diff --git a/BizHawk.Emulation.Cores/CPUs/Z80/Execute.cs b/BizHawk.Emulation.Cores/CPUs/Z80/Execute.cs index c89d1a7aa4..ee77ddde91 100644 --- a/BizHawk.Emulation.Cores/CPUs/Z80/Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/Z80/Execute.cs @@ -12390,7 +12390,16 @@ namespace BizHawk.Emulation.Cores.Components.Z80 } } - bool int_triggered = false; + + //EI (enable interrupts) actually takes effect after the NEXT instruction + if (EI_pending > 0) + { + EI_pending--; + if (EI_pending == 0) + { + IFF1 = IFF2 = true; + } + } // Process interrupt requests. if (nonMaskableInterruptPending) @@ -12410,8 +12419,6 @@ namespace BizHawk.Emulation.Cores.Components.Z80 } else if (iff1 && interrupt && Interruptable) { - int_triggered = true; - Halted = false; iff1 = iff2 = false; @@ -12436,15 +12443,6 @@ namespace BizHawk.Emulation.Cores.Components.Z80 IRQCallback(); } - //EI (enable interrupts) actually takes effect after the NEXT instruction - if (EI_pending > 0) - { - EI_pending--; - if (EI_pending == 0 && !int_triggered) - { - IFF1 = IFF2 = true; - } - } } }