Z80: Fix interrupts again
fixes #951 also made sure previous tricky IRQ games still work
This commit is contained in:
parent
cca2adfbe1
commit
2ff7ae06ea
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue