richw wrote:For what it is worth, I enjoy any sort of update on here, even if I don't follow it all. However it seems unreasonable to sound demanding when someone is dedicating their own time.
Fire away, I'll accommodate requests where I can, be it more detail or requests for additions etc. Additions may not happen immediately, but I do add them all to the wish list and review on a regular basis to see what I can easily include.
I get so little feedback, it's hard to tell if people actually find what I'm doing is of any use - I don't even know if it works beyond my own kit if I'm honest, from memory only two people to date have confirmed any success or issues. That's a royal pain for me as it means I have to spend most of my time testing beta's when the idea of a beta is to let other people test on your behalf. Admittedly, I try not to put out broken betas however, as the supported list of games growing I can no longer test them all.
- - -
I spent a few hours debugging yesterday and believe I've find a source for a lot of the issues. After analysing which games were failing and at what point, I categorized the issues into the following:
- Games that load files and crash during the loading sequence
- Games that crash with invalid addresses
- Games that hang randomly
On investigating (1) further, I realised I'd made a noddy error when coding the paravirtualized** OS_GBPB and forgot to add the final step of cleaning / invalidating the caches. This also got me wondering if I'd missed any other SWI's or CLib functions that need to clean the caches, so I need to double check them over the next few days.
Look into issue (2) I found I wasn't correctly disabling Alignment faults and enabling rotated loads - my Pi ordinarily shouldn't need this as the CPU Configuration is set to ARMv5 by default, however I've updated recently to a Pi2 ROM daily build and wonder if the behaviour has now inadvertently changed. With this fixed a few games got a bit further before crashing on other issues.
(3) I've yet to look into, although its probably not a major issue. I left a few games soak testing during the day, Ballarena and 2067BC ran fine for hours, Conqueror hung within minutes as did Fire & Ice. Zarch is soak testing as I'm typing this. Battle Chess isn't quite working to soak test, its working under emulation so my guess is something isn't cleaning the cache correctly, this is also confirmed by the fact the debug build of ADFFS behaves differently to the non-debug.
Both Fire & Ice and Gribbly's Day out were previously hanging after several cycles of demo mode - but at the same place, implying either an instruction isn't being encoded correctly or something's been missed. I still need to look into this once I've resolved the random hangs.
Branch Prediction, although simple to implement (it's about 20 instructions) is proving very good a highlighting any minor flaws. For it to work correctly, all writes to App space must be mirrored in JIT App space so that any incorrect Branch code is cleaned and recoded if it's overwritten by any file loads, memory writes, self-modifying code etc. It's particularly susceptible to this, one missed instruction and the code in JIT App space won't match the original code in actual App space and result in a crash, hang or odd behaviour.
Games are running as User code*, so any writes done by them are trapped and handled. Anything OS related however needs paravirtualizing so that after RISCOS has done it's thing, ADFFS performs the necessary post actions to ensure the cache's are cleaned of any instructions and that code in JIT App space matches actual App space.
* At the minute this is relying on the main game code not switching into SVC, in a later ADFFS build the CPU mode will be paravirtualized so that all code runs as USR and registers/TLB/L2PT are switched as the code switches virtual CPU modes. Interrupt / vector code that's virualized is all run as User mode, so anything that generates Sound or relies on T1 / VSync IRQ's isn't an issue.
** paravirtualizing - essentially modifying host OS/hardware behaviour to allow code to run at a lower privilage level. In ADFFS's case, this means managing various RISCOS SWI's to allow changes both pre and post of the SWI performing its usual action.