spjewkes / jrnz

A work-in-progress ZX Spectrum emulator
MIT License
1 stars 0 forks source link

ZX Spectrum rom - divergence at address 0x12da #29

Closed spjewkes closed 6 months ago

spjewkes commented 5 years ago

Simple test: type '10 run' fails with an error on this program. Initial debug shows a divergence at 0x12da (when compared to another emulator). It looks like a number of registers aren't correct at this point so the code would've diverged earlier (possibly due to a flag issue). Need to dig further...

spjewkes commented 5 years ago

Looking further back, it looks like there may be something going wrong in the call to "LINE_SCAN" at 0x12b4. Returning from this call seems to show a difference in register DE. Stepping through both side by side should hopefully highlight the issue.

spjewkes commented 5 years ago

Issue was due to incorrectly implemented djnz instruction. It was jumping on zero rather than if NOT zero. Pretty embarrassing considering the name of the project...

spjewkes commented 6 months ago

I think this was resolved and can be closed for now.