all repos — mgba @ 6f9a0d9758537b80df5291bd05dff26a626113ff

mGBA Game Boy Advance Emulator

GB, GBA: Fix emulator hardlocking when halting with IRQs off
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Sep 2016 16:48:41 -0700
commit

6f9a0d9758537b80df5291bd05dff26a626113ff

parent

e7c3b028977f1771cfdeaf089bd8c739d666d4df

3 files changed, 7 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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.csrc/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;