GB, GBA: Fix emulator hardlocking when halting with IRQs off
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Sep 2016 16:48:41 -0700
3 files changed,
7 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -16,6 +16,7 @@ - GBA Savedata: Fix loading savestates with 512Mb Flash saves
- 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
M
src/gb/gb.c
→
src/gb/gb.c
@@ -537,6 +537,9 @@ cpu->nextEvent = nextEvent;
if (cpu->halted) { cpu->cycles = cpu->nextEvent; + if (!gb->memory.ie || !gb->memory.ime) { + break; + } } } while (cpu->cycles >= cpu->nextEvent); }
M
src/gba/gba.c
→
src/gba/gba.c
@@ -287,6 +287,9 @@ cpu->nextEvent = nextEvent;
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;