all repos — mgba @ 59e61c31ea4f7daef3692a890f8702b7494df683

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

59e61c31ea4f7daef3692a890f8702b7494df683

parent

e8c51b16b430bdcd0faaef50aa12c1d5937d7900

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;