ADFFS 2.71 beta

Discuss ADFFS development and download test releases
JonAbbott
Posts: 2245
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: ADFFS 2.71 beta

Post by JonAbbott » Sat Feb 23, 2019 5:14 pm

richw wrote:
Fri Feb 22, 2019 9:27 pm
BigBang. OK, but CTRL-ESC to quit is a bit odd. Mouse pointer appears but game screen is still there, frozen. If I press F12 then ENTER, I see the desktop as normal!

Crystal Maze. OK until you start a game, then I get instruction not implemented
I've updated both packages, so remove and reinstall them. BigBang was not exiting correctly (ie via OS_Exit) and The Crystal Maze was down to the box based protection being removed. For the time being, I've completely removed the intro sequence as having spent 5+ hours trying, I couldn't get the intro to remain and remove the box based protection, without it breaking the game itself.

richw
Posts: 137
Joined: Sat Sep 14, 2013 9:05 pm

Re: ADFFS 2.71 beta

Post by richw » Sun Feb 24, 2019 9:51 pm

OK, so with 2.72g, 2067BC, BigBang and Crystal Maze are better.

Chocks Away, Break 147 and Superpool still lock on the loading screen. CTRL-BREAK to the rescue!

JonAbbott
Posts: 2245
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: ADFFS 2.71 beta

Post by JonAbbott » Sun Feb 24, 2019 10:51 pm

richw wrote:
Sun Feb 24, 2019 9:51 pm
Chocks Away, Break 147 and Superpool still lock on the loading screen. CTRL-BREAK to the rescue!
I've tested Chock Away, Chock Away Compendium [SA version], Break 147 and Superpool and can't get any of them to lock. Could you try them without USBJoystick loaded, just to rule it out. It's also worth removing and reinstalling the packages, having cleared your PackMan cache, as I know I've changed Break 147 & Superpool recently to fix an issue with it.

JonAbbott
Posts: 2245
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: ADFFS 2.71 beta

Post by JonAbbott » Mon Feb 25, 2019 1:52 pm

2.72h package available. I've also updated the following packages, so please remove and reinstall them:
  • Carnage Inc
  • Interdictor II
  • Flashback
  • OddBall
The OddBall update fixes the hang when quitting and the others were updated to match a change in ADFFS, which allows the environment to be set when using *GO.

richw
Posts: 137
Joined: Sat Sep 14, 2013 9:05 pm

Re: ADFFS 2.71 beta

Post by richw » Tue Feb 26, 2019 9:31 pm

I have tried upgrading my RISC OS ROM (was only a week or two old anyway) and with killing USBJoystick. No difference. Also tried re installing.

Then I removed StrongEd from my boot sequence. Break 147 starts! One time I tried CTRL-ESC i got a lock-up and an AODT error (but now I cannot reproduce, and CTRL-SHIFT-F12 is exiting nicely).

Do these crash for anyone else with StrongEd loaded?

JonAbbott
Posts: 2245
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: ADFFS 2.71 beta

Post by JonAbbott » Wed Feb 27, 2019 10:46 am

richw wrote:
Tue Feb 26, 2019 9:31 pm
Do these crash for anyone else with StrongEd loaded?
Loading StrongEd before ADFFS does appear to cause an issue. It appears to be interfering with the OS_File decryption routine in The Fourth Dimension titles. Most of them hook into FileV and decrypt files as they're loaded and with StrongEd loaded they're not performing the decryption, so either aren't seeing the vector call or the parameters have somehow changed so it doesn't recognise them.

This is going to cause all sorts of random crashes, as undecrypted code is either called directly, loaded into BASIC or inserted via OS_Module.

The crash in Superpool for example, is occurring when the 32bit Module shim is being created. I'll add some checks so it bails early if the Module is rubbish, which doesn't fix the issue but should prevent ADFFS from causing a crash.

I'll have to do some debugging to figure out why StrongEd is breaking things, my guess is its hooking into FileV although why that causes an issue when loaded before ADFFS I'm not sure. Before/After ADFFS should make no difference, although ADFFS does preserve SPSR around OS_File specifically for FileV reentry, which this particular protection relies on. It's possible StrongEd is corrupting SPSR and then passing FileV onto the protection, which then fails.

JonAbbott
Posts: 2245
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: ADFFS 2.71 beta

Post by JonAbbott » Wed Feb 27, 2019 1:59 pm

JonAbbott wrote:
Wed Feb 27, 2019 10:46 am
I'll have to do some debugging to figure out why StrongEd is breaking things, my guess is its hooking into FileV
The issue is FileV vector related and is caused by ADFFS being unable to RMLoad BASIC26.

The reason it can't load BASIC26 is because it can't reset the FileV vector to point back to RISC OS - it's pointing at one of StrongEd Modules. The consequence of this is the OS_File to load the Module gets passed down the Module chain and ends up in the protection module, which decrypts it - obviously BASIC26 isn't encrypted as it's an ADFFS Module.

Once BASIC26 fails to load, the error gets passed up the Error handler chain until it hits ADFFS which then attempts to shutdown the JIT. The protection Module then locks the machine as it fails a protection check to ensure it was called from BASIC.

I can fix the hang in each game by modifying the protection Module finalise code, but I don't think there's anything I can do about the underlying issue of not being able to reset the filesystem vectors, before loading files.

Long story short, ADFFS needs to be loaded with CLIV, ByteV, WordV, FileV, ArgsV, BGetV, BPutV, GBPBV and FindV pointing to the OS so it can reset them around internal file handling.

Games affected by this issue:

F1005601 Break 147 & Superpool (1991) (The Fourth Dimension)
F1007801 Chocks Away (1990) (The Fourth Dimension)
F1024501 Grievous Bodily 'ARM (1991) (The Fourth Dimension)
F1018701 Haunted House (1993) (The Fourth Dimension)
F1026801 Olympics, The (1990) (The Fourth Dimension)
F1027401 Pandora's Box (1991) (The Fourth Dimension)
F1028601 PowerBand (1990) (The Fourth Dimension) (v1.00) (no package for this version)
F1031801 Saloon Cars (1991) (The Fourth Dimension)
F1031901 Saloon Cars Deluxe (1992) (The Fourth Dimension)
F1035101 Stunt Racer 2000 (1993) (The Fourth Dimension)
F1000501 Virtual Golf (1993) (The Fourth Dimension)
F1039701 X-Fire (1992) (The Fourth Dimension)

JonAbbott
Posts: 2245
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: ADFFS 2.71 beta

Post by JonAbbott » Wed Feb 27, 2019 6:35 pm

JonAbbott wrote:
Wed Feb 27, 2019 10:46 am
Loading StrongEd before ADFFS does appear to cause an issue. It appears to be interfering with the OS_File decryption routine in The Fourth Dimension titles.
2.72i package now available, which doesn't resolve the underlying issue, but does allow it to fail gracefully with a suitable error. I've updated boot scripts for the following games, which won't require a package update to take effect:

F1007801 Chocks Away (1990) (The Fourth Dimension)
F1027401 Pandora's Box (1991) (The Fourth Dimension)
F1031801 Saloon Cars (1991) (The Fourth Dimension)
F1039701 X-Fire (1992) (The Fourth Dimension)


I've modified the following packages, so please remove and reinstall them:

F1005601 Break 147 & Superpool (1991) (The Fourth Dimension)
F1024501 Grievous Bodily 'ARM (1991) (The Fourth Dimension)
F1018701 Haunted House (1993) (The Fourth Dimension)
F1026801 Olympics, The (1990) (The Fourth Dimension)
F1031901 Saloon Cars Deluxe (1992) (The Fourth Dimension)
F1035101 Stunt Racer 2000 (1993) (The Fourth Dimension)
F1000501 Virtual Golf (1993) (The Fourth Dimension)

richw
Posts: 137
Joined: Sat Sep 14, 2013 9:05 pm

Re: ADFFS 2.71 beta

Post by richw » Wed Feb 27, 2019 9:24 pm

Magic!

There is the step I didn't make... It was the order that was critical! We have had some of the StrongEd discussion before, but it didn't make sense. Now it does.

I can confirm that it works as expected. If ADFFS is started first, then its all good. If StrongEd is/was started first, I get 'ADFFS failed to load 26-bit BASIC'. For Break147 the error box fonts are all messed up so it is hard to read, but you get the idea.

Note the 'was' above. Even if I quit StrongEd, then load ADFFS, it doesn't work. ADFFS must be loaded first.

JonAbbott
Posts: 2245
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: ADFFS 2.71 beta

Post by JonAbbott » Wed Feb 27, 2019 10:05 pm

richw wrote:
Wed Feb 27, 2019 9:24 pm
Even if I quit StrongEd, then load ADFFS, it doesn't work. ADFFS must be loaded first.
I didn't look at StrongEd to see what it's doing, but suspect it's either re-raising calls or passing them directly on to the next claimant.

There's another issue when quitting StrongED after loading ADFFS. ADFFS takes a copy of the vectors when it loads and resets them when it accesses files. If you quit StrongEd, ADFFS just points it back to the StrongEd code, so its eventually going to crash when it gets overwritten by another RMA allocation.

I haven't figured out a good solution to that issue yet. One possibility is to watch OS_Release and regrab the vector if the cached one get removed.
richw wrote:
Wed Feb 27, 2019 9:24 pm
For Break147 the error box fonts are all messed up so it is hard to read
You've got to love Wimp error boxes in low resolution modes...totally illegible :shock:

Post Reply