all repos — mgba @ 85367c37135577de88ed18cf1fe19b226c178b7b

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:39:14 -0800
commit

85367c37135577de88ed18cf1fe19b226c178b7b

parent

3415484d9db5528bfbeb71a5bf0bb30d0eeef410

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

jump to
M CHANGESCHANGES

@@ -33,7 +33,7 @@ - All: Fix fullscreen config option being ignored

- GBA BIOS: Implement BitUnPack - GBA: Add savegame override for Crash Bandicoot 2 - ARM7: PSR mode bits should not get sign extended - - GBA: Only unhalt CPU if an IRQ actually fires + - GBA: Only unhalt CPU if appropriate bit is set in IE - GBA Video: Fix out of bounds sprite transforms Misc: - SDL: Remove scancode key input
M src/arm/arm.csrc/arm/arm.c

@@ -147,7 +147,6 @@ cpu->irqh.reset(cpu);

} void ARMRaiseIRQ(struct ARMCore* cpu) { - cpu->halted = 0; if (cpu->cpsr.i) { return; }
M src/gba/gba.csrc/gba/gba.c

@@ -665,8 +665,11 @@

void GBARaiseIRQ(struct GBA* gba, enum GBAIRQ irq) { gba->memory.io[REG_IF >> 1] |= 1 << irq; - 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); + } } }