From 3f1a23b7e573f7fe649f9ae2885a7fdc06dd998c Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Wed, 30 Aug 2023 22:13:58 +0200 Subject: [PATCH] cpu/cpu - Fix build errors --- cpu/cpu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 8021826..dfa88e5 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -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