Posts for Maxim

Joined: 10/5/2014
Posts: 2
The BIOS really doesn't do much, it's about detecting a cartridge and enforcing region detection. Some emulators bypass the checks in order to avoid having to emulate the multi-slot nature of the system, and that would account for a lot of the time difference you see. The r register is a bit odd, you can't set it in code. It's a counter that increments on every cycle, which provides a useful pattern for certain old memory chips, to help refresh their values and avoid data loss. The Z80 chip did this because it was useful at the time. Games use it as a random seed because its value is not deterministic, as the CPU clock runs for a while before the power stabilisation components allow it to start executing code. You could make a replacement BIOS, or a watchdog circuit on the expansion port using a CPLD or something, to watch the value and try to get the game start code to have a consistent value by halting the CPU or, in the BIOS case, executing code chunks that waste the right amount of time. Some games may not use the r register for their RNG. There's no way way to be sure, except for reading the code.
Joined: 10/5/2014
Posts: 2
Hi, I was summoned here from SMS Power. Post there to get the world's greatest SMS minds to see... I may not be the greatest but I can offer some advice and/or problems... 1. Dega is woefully inaccurate, I'd not bother with it. 2. SMS games generally read the inputs during the VBlank. That might be before or after the actual blanking signal, so ideally you'd need to try to sync to somewhere around the last line of the active display. 3. Most RNGs mix in entropy from user inputs and the r register. The latter is where you find trouble, what you get in there is going to be a bit dependent on some analogue characteristics of the initial console power on. 4. You could detect controller polling with a little hardware effort to monitor the CPU bus. This could be done over the expansion slot on an original model system. You might even attempt to control the r register that way, but that's getting very tricky.