GBA I/O: Fix IRQ register write checks (fixes #1335)

This commit is contained in:
Vicki Pfau 2019-03-03 14:14:21 -08:00
parent f9ff88302f
commit f9b12a8612
1 changed files with 3 additions and 3 deletions

View File

@ -548,16 +548,16 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
break;
case REG_IE:
gba->memory.io[REG_IE >> 1] = value;
GBATestIRQ(gba->cpu, 1);
GBATestIRQ(gba, 1);
return;
case REG_IF:
value = gba->memory.io[REG_IF >> 1] & ~value;
gba->memory.io[REG_IF >> 1] = value;
GBATestIRQ(gba->cpu, 1);
GBATestIRQ(gba, 1);
return;
case REG_IME:
gba->memory.io[REG_IME >> 1] = value;
GBATestIRQ(gba->cpu, 1);
GBATestIRQ(gba, 1);
return;
case REG_MAX:
// Some bad interrupt libraries will write to this