GBA: Fix IRQs firing after already being cleared

This commit is contained in:
Jeffrey Pfau 2016-11-06 22:22:01 -08:00
parent 60974cf61b
commit c92add2a5c
3 changed files with 3 additions and 1 deletions

View File

@ -28,6 +28,7 @@ Bugfixes:
- Qt: Only reset window dimensions when first shown
- GB Memory: Fix starting HDMAs during mode 0
- Qt: Fix Qt Multimedia audio driver on big endian
- GBA: Fix IRQs firing after already being cleared
Misc:
- SDL: Remove scancode key input
- GBA Video: Clean up unused timers

View File

@ -674,7 +674,7 @@ void GBARaiseIRQ(struct GBA* gba, enum GBAIRQ irq) {
void GBATestIRQ(struct ARMCore* cpu) {
struct GBA* gba = (struct GBA*) cpu->master;
if (gba->memory.io[REG_IME >> 1] && gba->memory.io[REG_IE >> 1] & gba->memory.io[REG_IF >> 1]) {
gba->springIRQ = 1;
gba->springIRQ = gba->memory.io[REG_IE >> 1] & gba->memory.io[REG_IF >> 1];
gba->cpu->nextEvent = gba->cpu->cycles;
}
}

View File

@ -541,6 +541,7 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
GBAWriteIE(gba, value);
break;
case REG_IF:
gba->springIRQ &= ~value;
value = gba->memory.io[REG_IF >> 1] & ~value;
break;
case REG_IME: