diff --git a/src/gb/core.c b/src/gb/core.c index 41290e84e..7ee5828dd 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -1082,9 +1082,9 @@ static void _GBVLPReset(struct mCore* core) { GBVideoProxyRendererShim(&gb->video, &gbcore->proxyRenderer); // Make sure CPU loop never spins - GBHalt(gb->cpu); gb->memory.ie = 0; gb->memory.ime = false; + GBHalt(gb->cpu); } static bool _GBVLPLoadROM(struct mCore* core, struct VFile* vf) { @@ -1115,9 +1115,9 @@ static bool _GBVLPLoadState(struct mCore* core, const void* buffer) { GBAudioReset(&gb->audio); // Make sure CPU loop never spins - GBHalt(gb->cpu); gb->memory.ie = 0; gb->memory.ime = false; + GBHalt(gb->cpu); return true; } diff --git a/src/gb/gb.c b/src/gb/gb.c index fda3f214a..ff73614eb 100644 --- a/src/gb/gb.c +++ b/src/gb/gb.c @@ -749,7 +749,7 @@ void GBHalt(struct SM83Core* cpu) { if (!(gb->memory.ie & gb->memory.io[REG_IF] & 0x1F)) { cpu->cycles = cpu->nextEvent; cpu->halted = true; - } else { + } else if (!gb->memory.ime) { mLOG(GB, GAME_ERROR, "HALT bug"); cpu->executionState = SM83_CORE_HALT_BUG; }