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
e8c51b16b4
commit
59e61c31ea
1
CHANGES
1
CHANGES
|
@ -16,6 +16,7 @@ Bugfixes:
|
||||||
- Core: Fix importing save games as read-only
|
- Core: Fix importing save games as read-only
|
||||||
- Util: Fix PNG identification on files too small to be a PNG
|
- Util: Fix PNG identification on files too small to be a PNG
|
||||||
- GB: Fix invalid STOP behavior on Game Boy Color
|
- GB: Fix invalid STOP behavior on Game Boy Color
|
||||||
|
- GB, GBA: Fix emulator hardlocking when halting with IRQs off
|
||||||
Misc:
|
Misc:
|
||||||
- All: Only update version info if needed
|
- All: Only update version info if needed
|
||||||
- FFmpeg: Encoding cleanup
|
- FFmpeg: Encoding cleanup
|
||||||
|
|
|
@ -537,6 +537,9 @@ void GBProcessEvents(struct LR35902Core* cpu) {
|
||||||
|
|
||||||
if (cpu->halted) {
|
if (cpu->halted) {
|
||||||
cpu->cycles = cpu->nextEvent;
|
cpu->cycles = cpu->nextEvent;
|
||||||
|
if (!gb->memory.ie || !gb->memory.ime) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} while (cpu->cycles >= cpu->nextEvent);
|
} while (cpu->cycles >= cpu->nextEvent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,6 +287,9 @@ static void GBAProcessEvents(struct ARMCore* cpu) {
|
||||||
|
|
||||||
if (cpu->halted) {
|
if (cpu->halted) {
|
||||||
cpu->cycles = cpu->nextEvent;
|
cpu->cycles = cpu->nextEvent;
|
||||||
|
if (!gba->memory.io[REG_IME >> 1] || !gba->memory.io[REG_IE >> 1]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (nextEvent == 0) {
|
if (nextEvent == 0) {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue