mirror of https://github.com/mgba-emu/mgba.git
GB, GBA: Fix emulator hardlocking when halting with IRQs off
This commit is contained in:
parent
e7c3b02897
commit
6f9a0d9758
1
CHANGES
1
CHANGES
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue