cpu - Fix build errors

This commit is contained in:
madmaurice 2023-08-30 00:01:45 +02:00
parent c4a9a10e09
commit aec3c7b0e6
2 changed files with 7 additions and 7 deletions

View file

@ -54,11 +54,11 @@ Cpu::Cpu(Mem_device* bus)
void Cpu::step() void Cpu::step()
{ {
if(stopped) return; if(state.stopped) return;
if(!handleInterrupts()) // if no isr has been called, decode an instruction if(!handleInterrupts()) // if no isr has been called, decode an instruction
{ {
if (halted) if (state.halted)
processed_mcycles += 4; processed_mcycles += 4;
else else
executeInstruction(); executeInstruction();
@ -83,8 +83,8 @@ void Cpu::reset()
state.IE = 0; state.IE = 0;
state.IF = 0; state.IF = 0;
halted = false; state.halted = false;
stopped = false; state.stopped = false;
} }
u8 Cpu::readPC8() u8 Cpu::readPC8()
@ -235,7 +235,7 @@ bool Cpu::handleInterrupts()
// Once there's an interrupt we exit halt mode // Once there's an interrupt we exit halt mode
if (si) if (si)
halted = false; state.halted = false;
if (state.IME == IME_SCHEDULED) if (state.IME == IME_SCHEDULED)
state.IME = IME_ON; state.IME = IME_ON;

View file

@ -472,11 +472,11 @@ void Cpu::executeInstruction()
break; break;
case 0x76: // HALT case 0x76: // HALT
halted = true; state.halted = true;
break; break;
case 0x10: // STOP n8 case 0x10: // STOP n8
(void)readPC8(); (void)readPC8();
stopped = true; state.stopped = true;
break; break;
case 0xE8: // ADD SP, e8 case 0xE8: // ADD SP, e8