all repos — mgba @ 64d3f48cd81faa9a2b4cf8de94fe1fdf3b151c0b

mGBA Game Boy Advance Emulator

GBA: Only unhalt CPU if appropriate bit is set in IE
Jeffrey Pfau jeffrey@endrift.com
Sun, 11 Dec 2016 20:40:14 -0800
commit

64d3f48cd81faa9a2b4cf8de94fe1fdf3b151c0b

parent

881c10b40e2ee8c0f56709c4450718bf7bc11a4c

2 files changed, 6 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -22,6 +22,7 @@ - GBA: Fix IRQs firing after already being cleared

- All: Fix fullscreen config option being ignored - GBA: Add savegame override for Crash Bandicoot 2 - ARM7: PSR mode bits should not get sign extended + - GBA: Only unhalt CPU if appropriate bit is set in IE Misc: - PSP2: Improved controller rumble - GB, GBA: Prevent loading null ROMs
M src/gba/gba.csrc/gba/gba.c

@@ -656,10 +656,12 @@ }

void GBARaiseIRQ(struct GBA* gba, enum GBAIRQ irq) { gba->memory.io[REG_IF >> 1] |= 1 << irq; - gba->cpu->halted = 0; - if (gba->memory.io[REG_IME >> 1] && (gba->memory.io[REG_IE >> 1] & 1 << irq)) { - ARMRaiseIRQ(gba->cpu); + if (gba->memory.io[REG_IE >> 1] & 1 << irq) { + gba->cpu->halted = 0; + if (gba->memory.io[REG_IME >> 1]) { + ARMRaiseIRQ(gba->cpu); + } } }