Make EI enable interrupts next cycle, not this cycle
taylus opened this issue · 0 comments
taylus commented
Per https://github.com/AntonioND/giibiiadvance/blob/master/docs/TCAGBD.pdf,
Note that EI doesn't enable the interrupts the same cycle it is executed, but the next cycle:
di
ld a, IEF_TIMER
ld [rIE], a
ld [rIF], a
ei
inc a ; This is still executed before jumping to the interrupt vector.
inc a ; This is executed after returning.
ld [hl+],a