GB, GBA: Fix emulator hardlocking when halting with IRQs off

This commit is contained in:
Jeffrey Pfau 2016-09-25 16:48:41 -07:00
parent e7c3b02897
commit 6f9a0d9758
3 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ Bugfixes:
- Core: Fix importing save games as read-only
- Util: Fix PNG identification on files too small to be a PNG
- GB: Fix invalid STOP behavior on Game Boy Color
- GB, GBA: Fix emulator hardlocking when halting with IRQs off
Misc:
- All: Only update version info if needed
- FFmpeg: Encoding cleanup

View File

@ -537,6 +537,9 @@ void GBProcessEvents(struct LR35902Core* cpu) {
if (cpu->halted) {
cpu->cycles = cpu->nextEvent;
if (!gb->memory.ie || !gb->memory.ime) {
break;
}
}
} while (cpu->cycles >= cpu->nextEvent);
}

View File

@ -287,6 +287,9 @@ static void GBAProcessEvents(struct ARMCore* cpu) {
if (cpu->halted) {
cpu->cycles = cpu->nextEvent;
if (!gba->memory.io[REG_IME >> 1] || !gba->memory.io[REG_IE >> 1]) {
break;
}
}
if (nextEvent == 0) {
break;