JonAbbott wrote: Fri Jan 30, 2026
I've correct several other issues I've noticed and will probably go though the whole code.
Delving into the code turned up a can of worms, there's several bugs that cause it to break under certain conditions and I've ended up replacing large chunks, shrinking it by nearly 2KB in the process and making it ROMable.
The machine detection was being done by checking the RAM speed - so breaks on overclocked machines. I've rewritten that to determine the machine type from the chipset - it needs to know if its on an A4000/A5000 as their clocks are controlled by the OS, everything else (pre A4000) needs a VIDC Enhancer.
The clock detection was begin done by counting how many SoundDMA's occur over 30ms (so ~130ms for all four clock checks). That was problematic as it made making it ROMable difficult and was not particularly accurate. I've completely rewritten it to take over device 9 (Sound System Buffer Change) and to handle the MEMC DMA registers itself, taking the OS out of the loop. It now determines the playback speed by seeing how many T1 ticks occur over a fixed DMA length, which is an order of magnitude more accurate. I want to see how short I can make the DMA buffer before accuracy becomes an issue, to speed up the four clock checks and hopefully reduce or avoid the screen blanking.
After its worked out the clock frequencies, it currently raises a malformed Service_ModeChange to reset the VIDC clock back for the current MODE. As it can now work out the clock accurately, I might alter it to figure out which clock is active when it loads and reset it back once it's finished, avoiding the need for the Service_ModeChange.
Finally, there's some issues with its service handler, which supports RISC OS 2 and RISC OS 3.1x, but doesn't cover RISC OS 3.00 - I've yet to figure out the best way to resolve that.