nitro2k01 wrote:
Can you give an example of an emulator (other than yours) which exhibits this behavior?
Looking at the code, from 5AF2 and forward there's some code that seems to be related to camera panning. It later writes to FFAB which in turn is I'm going to go out on a limb and say that your bug is related to how flags are affected by the rr, sra, add or adc instructions.
I saw a similar effect in
JavaBoy. It's an old emulator, but it used to be hosted on many web pages. Whatever it is doing wrong, I'm doing the same thing incorrectly.
I reviewed the flags in those instructions and I can't visually see an issue. However, I did notice what appears to be a repeated typo in the
Gameboy CPU (LR35902) instruction set table; the carry flag is marked as reset in all the SRA instructions. My emulator is setting the carry flag to the LSB.
If there is a particular test ROM that could vet the instruction flags, I'll gladly run it.
I noticed a similar issue with Street Fighter 2. Both of those are SGB roms. I'm not sure if there is a connection.