cpu/cpu - Fix build errors

This commit is contained in:
madmaurice 2023-08-30 22:13:58 +02:00
parent 5d5f1803b2
commit 3f1a23b7e5

View file

@ -251,16 +251,16 @@ bool Cpu::handleInterrupts()
if (state.IME == IME_SCHEDULED)
state.IME = IME_ON;
else if (state.IME == IME_ON && si != 0)
else if (state.IME == IME_ON && state.SI() != 0)
{
u16 isr;
InterruptType it;
if (si & INT_VBlank) { it = INT_VBlank; isr = 0x40; }
else if (si & INT_LCDSTAT) { it = INT_LCDSTAT; isr = 0x48; }
else if (si & INT_Timer) { it = INT_Timer; isr = 0x50; }
else if (si & INT_Serial) { it = INT_Serial; isr = 0x58; }
else if (si & INT_Joypad) { it = INT_Joypad; isr = 0x60; }
if (state.SI() & INT_VBlank) { it = INT_VBlank; isr = 0x40; }
else if (state.SI() & INT_LCDSTAT) { it = INT_LCDSTAT; isr = 0x48; }
else if (state.SI() & INT_Timer) { it = INT_Timer; isr = 0x50; }
else if (state.SI() & INT_Serial) { it = INT_Serial; isr = 0x58; }
else if (state.SI() & INT_Joypad) { it = INT_Joypad; isr = 0x60; }
else panic("Can't find pending interrupt IE=%02x IF=%02x\n", state.IE, state.IF);
state.IME = IME_OFF; // Disable IME