GBA: Fix IRQs firing after already being cleared

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

View File

@ -18,6 +18,7 @@ Bugfixes:
- Qt: Only reset window dimensions when first shown - Qt: Only reset window dimensions when first shown
- GB Memory: Fix starting HDMAs during mode 0 - GB Memory: Fix starting HDMAs during mode 0
- Qt: Fix Qt Multimedia audio driver on big endian - Qt: Fix Qt Multimedia audio driver on big endian
- GBA: Fix IRQs firing after already being cleared
Misc: Misc:
- PSP2: Improved controller rumble - PSP2: Improved controller rumble
- GB, GBA: Prevent loading null ROMs - GB, GBA: Prevent loading null ROMs

View File

@ -666,7 +666,7 @@ void GBARaiseIRQ(struct GBA* gba, enum GBAIRQ irq) {
void GBATestIRQ(struct ARMCore* cpu) { void GBATestIRQ(struct ARMCore* cpu) {
struct GBA* gba = (struct GBA*) cpu->master; 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]) { 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; gba->cpu->nextEvent = gba->cpu->cycles;
} }
} }

View File

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