Closed simonowen closed 3 years ago
1057b95 tries to support it. I gave it 5 ticks to read the opcode as my sources say, e.g., at https://rk.nvg.ntnu.no/sinclair/faq/tech_z80.html:
When an NMI occurs, it takes 11 T states to get to #0066: a 5 T state M1 cycle to do an opcode read and decrement SP, a 3 T state M2 cycle to write the high byte of PC to the stack and decrement SP and finally a 3 T state M3 cycle to write the low byte of PC and jump to #0066.
The Sean's paper seems to agree with that saying that NMI takes 11 ticks.
Thanks! I've tested it and it's working as expected. It's hard to measure timings from NMI as it's usually an asynchronous button press, but good to have it matching known sources.
Could I request the core support an
initiate_nmi
for NMI? Here's what I'm using at the moment, which seems to work for me:It's mostly a stripped down version of
initiate_int
but it doesn't clear iff2 has a different fixed handler address, and reduced timing. It's probably worth checking the details!