Adjust ADFFS !Boot so that it loads when first seen?
Adjust ADFFS !Boot so that it loads when first seen?
Let's say that I have ADFFS on the root of my hard drive. What I want is for !ADFFS to load as soon as the root of the drive is seen by RISC OS (e.g. I click on the drive icon). I know this needs to be done in the ADFFS !Boot file, but what would be the best way to go about this? The reason I want to do this is so that hard drive installed games that use ADFBootFloppy in their !Run files do not require the user to first manually load ADFFS.
Re: Adjust ADFFS !Boot so that it loads when first seen?
Or, even better - is there perhaps a way to auto-load ADFFS when an ADFBootFloppy command is encountered, rather than loading ADFFS when the drive is first clicked?
- IanJeffray
- Posts: 6018
- Joined: Sat Jun 06, 2020 3:50 pm
- Contact:
Re: Adjust ADFFS !Boot so that it loads when first seen?
Just copy the !Run as !Boot
Re: Adjust ADFFS !Boot so that it loads when first seen?
Or, if you'd rather not do that, edit the !Boot file and add this line to the bottom:
Edit 1: Actually, on further expansion you'll *have* to do it this way rather than copying the !Run file as above, since ADFFS' !Boot file sets variables that the regular !Run file relies on - for example, it sets up ADFFS$Path which the !Run file then uses to refer to files within the app.
Edit 2: And if you don't want to alter !ADFFS at all (which is completely understandable), there's another method. Create your own app directory in the same location as !ADFFS, called !RunADFFS or something, then make an Obey file called "!Boot" in it with the following line:
This will cause !ADFFS to run when !RunADFFS is seen.
Edit 3: Oops, it turns out that first method of adding an *Obey wouldn't work either! It'd end up in an infinite loop, since the !Run file calls back to !Boot in its first line. So yeah, the !RunADFFS option (which wmd ended up choosing) is the easiest solution.
Code: Select all
Obey <Obey$Dir>.!Run
Edit 2: And if you don't want to alter !ADFFS at all (which is completely understandable), there's another method. Create your own app directory in the same location as !ADFFS, called !RunADFFS or something, then make an Obey file called "!Boot" in it with the following line:
Code: Select all
Filer_Run <Obey$Dir>.^.!ADFFS
Edit 3: Oops, it turns out that first method of adding an *Obey wouldn't work either! It'd end up in an infinite loop, since the !Run file calls back to !Boot in its first line. So yeah, the !RunADFFS option (which wmd ended up choosing) is the easiest solution.
Last edited by Sophira on Wed Nov 22, 2023 7:43 pm, edited 2 times in total.
- IanJeffray
- Posts: 6018
- Joined: Sat Jun 06, 2020 3:50 pm
- Contact:
Re: Adjust ADFFS !Boot so that it loads when first seen?
That's broken behaviour, then. ADFFS needs fixing. No application should require being seen by the filer before being run.
Re: Adjust ADFFS !Boot so that it loads when first seen?
Thanks for the suggestions. I will go with the !RunADFFS method. About ADFFS when it loads - I notice the screen momentarily goes black when loading. I don't recall this happening on older versions (I'm using the latest version). Any way to fix that?
Re: Adjust ADFFS !Boot so that it loads when first seen?
To be fair, the way it's done is such that it *doesn't* need to be seen by the Filer; the first line of the !Run file is an *Obey to execute the !Boot file. (Which is why, for example, the !RunADFFS method I outlined works.) But it does still mean that the !Boot file can't just be wholesale replaced.IanJeffray wrote: ↑Wed Nov 22, 2023 9:57 amThat's broken behaviour, then. ADFFS needs fixing. No application should require being seen by the filer before being run.
[edit: Although that does make me realise that the suggestion I made of calling !Run in !Boot won't work either! It'd trigger an infinite loop. Oops.]
ADFFS accesses the floppy drive on bootup, and if you're using an older machine, there's an issue if you're in a high-resolution, high-colour mode, RISC OS will blank the screen while accessing the floppy drive. Try accessing the floppy drive normally to see if that's the issue - if it is, then the workaround is to switch to a lower-bandwidth mode.
Re: Adjust ADFFS !Boot so that it loads when first seen?
I've not tried doing this but in theory you could use an alias:
Code: Select all
Set Alias$ADFBootFloppy Run ADFFS:!Run|MUnset Alias$ADFBootFloppy
Don't do that - it will probably lock or crash the machine!
Because ADFFS hooks into the filesystem, its intentionally split out into several files. !Run actually runs !Boot and to work around a "feature" of the OS, the core Modules have to be loaded via a separate !Loader. In the next release I've split it out into more files to solve another problem!
Essentially any settings that the end-user can alter are held in !Boot. !Run and the other files shouldn't be altered.
Suffice to say, its designed for the following scenarios:
- Be "seen" by the Wimp if the Boot sequence loads a recent CLib or it's RO5. It will then auto-load when a floppy image is launched
- Run manually or loaded via Boot.Tasks provided CLib is current
- Run via Boot.PreDesk if CLib is ancient
In the next release it checks where CLib is in memory. If it's out of date and in the RMA, ADFFS will refuse to load; if it's in ROM and out of date, ADFFS will auto-load the minimum supported CLib from its own folder.
That might AutoVIDC/LCDGameModes. Edit !ADFFS.!Boot and follow the instructions to disable LCDGameModes if they're not required.
ADFFS doesn't actually accessing the floppy. The floppy access is a side-effect of ADFS being restarted to allow ADFFS to sit on the DiscOp/MiscOp entry points.
Re: Adjust ADFFS !Boot so that it loads when first seen?
Thanks, that has fixed the screen blanking.
Re: Adjust ADFFS !Boot so that it loads when first seen?
I tried this, but when double clicking a hard drive installed game that uses ADFBootFloppy, ADFFS loads as expected, but nothing else happens - game doesn't load (tested with Fireball).sirbod wrote: ↑Thu Nov 23, 2023 1:56 pmI've not tried doing this but in theory you could use an alias:Code: Select all
Set Alias$ADFBootFloppy Run ADFFS:!Run|MUnset Alias$ADFBootFloppy
Re: Adjust ADFFS !Boot so that it loads when first seen?
And I wouldn't expect it work as its just an example of how you might go about using an alias to run something that goes on to provide itself as a * command. You'd have to extend it to execute the original command it was running for.wmd wrote: ↑Sat Nov 25, 2023 5:40 pmI tried this, but when double clicking a hard drive installed game that uses ADFBootFloppy, ADFFS loads as expected, but nothing else happens - game doesn't load (tested with Fireball).sirbod wrote: ↑Thu Nov 23, 2023 1:56 pmCode: Select all
Set Alias$ADFBootFloppy Run ADFFS:!Run|MUnset Alias$ADFBootFloppy