There's been many substantial changes under the hood to provide both Iyonix and IOMD 32bit support which have trippled the amount of testing I have to do, so a simply test run now takes three days. On top of that, when I find something that breaks on one platform I have to go back and retest all the others due to the interdependencies in the codebase.
Currently I have two show-stopping issues to resolve:
- Cache flushing - this is proving particularly tricky on the Iyonix where its corrupting the cache instead of cleaning it. Over the past two weeks, I've been rewriting the cache handling to reduce cache invalidation and instead clear only I and D entries as required, it's still in progress so I'm not sure it actually works yet. It's meant building up a large library of cache functions due to every ARM chip requiring a different method to clean the cache
- Branch walking - a new addition in the next release where the JIT walks code branches to reduce the number of JIT entries. This is closely tied in with the Cache flushing so is being developed in parallel. The first release will simply walk the first unconditional B/BL it hits and in a later update BL's will be queued for checking
ADFFS could let all page zero reads that it doesn't know how to handle succeed (I'll probably add an option for this for public release), but instead I've taken the route of fixing the bugs in the games themselves (ADFFS has the ability to dynamically change code when seen). I've fixed 14 bugs so far across 12 games and have 3 more bugs to resolve in Battle Chess, Caverns and Heimdall. I'm sure this is the tip of the iceberg considering I've only been testing around 20 games in the core testing.
In general illegal page zero reads can be classified into three categories. In order of prevalence, they are:
- Undefined pointers (value is 0) - fairly consistent across all C games, so I suspect it was a bug in the original compiler. A special case can be made for a read from 0 itself as it's unlikely a game would ever need the actual value there, so ADFFS can pass back the value it would have got on the OS environment it's currently providing. This may have a knock on effect if it's a memory pointer though, so as yet I've not added or tested this
- Sound handlers that don't initialise the Sound Channel Control Block (SCCB) during initialisation - fairly consistent across all games that have internal Voices. In the most part very few have initialisation routines and rely on RISCOS saving the values to the SCCB after the first call
- Programming errors - these are inevitable although thankfully low in number. These aren't so easy to fix as the previous two issues, as you have to understand what the code is trying to do and can't simply skip the instruction if it's reading from page zero
The blitter has had an overhaul to resolve some issues that came up with Gribbly's Day Out and Rockfall, it now correctly handles overlapping boarders and centres the screen where it can. There is one outstanding issue with Caverns to resolve where the blitter is dropping 2 pixels; I'll resolve this in a later release when I add hardware cursor support that Caverns requires.