raxoft / z80test

Set of programs to test the implementation of the Zilog Z80 instruction set.
MIT License
98 stars 11 forks source link

Finishing on interrupt mode 0 ? #6

Open fawtytoo opened 6 months ago

fawtytoo commented 6 months ago

Once the tests are finished, my emulator was not re-enabling interrupts, or so I thought. After much head scratching, I realised I wasn't handling IM 0 at all, but then the Spectrum doesn't use it anyway. If I handle IM 0 the same as IM 1, interrupts are working correctly again once the tests are finished. Is it possible your tests are finishing on IM 0 instead of IM 1? If so (or either way), which one of us is wrong?

raxoft commented 6 months ago

Yeah, I guess you are right, it ends in IM 0. This is an oversight. In practice it doesn't matter much, as in the end they behave the same (as long as the bus reads 0xFF at interrupt time, which is the case of real Sinclair machines and thus also the emulators). I will remember to fix it if I ever do a newer release, but at the moment it doesn't bother me much.