spjewkes / jrnz

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

Debugger gets first instruction wrong if we're immediately handling something like a interrupt #54

Open spjewkes opened 2 months ago

spjewkes commented 2 months ago

I saw this whilst trying to debug Inca Curse (the z80 snapshot). It seems to have interrupts enabled for IM2. If you break on the first memory location (0x6888) (i.e. the PC in the z80). It prints the instruction at that location. However, we've injected a PUSH instruction due to the interrupt. The debugger needs to be able to sort this out properly.