mirror of https://github.com/mgba-emu/mgba.git
GB I/O: Alternate fix for #1329 that doesn't break tests
This commit is contained in:
parent
3a313a6133
commit
3c9c3c01c0
|
@ -630,7 +630,7 @@ void GBDetectModel(struct GB* gb) {
|
|||
}
|
||||
|
||||
void GBUpdateIRQs(struct GB* gb) {
|
||||
int irqs = gb->memory.ie & gb->memory.io[REG_IF];
|
||||
int irqs = gb->memory.ie & gb->memory.io[REG_IF] & 0x1F;
|
||||
if (!irqs) {
|
||||
gb->cpu->irqPending = false;
|
||||
return;
|
||||
|
|
|
@ -465,7 +465,7 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
|
|||
}
|
||||
break;
|
||||
case REG_IE:
|
||||
gb->memory.ie = value & 0x1F;
|
||||
gb->memory.ie = value;
|
||||
GBUpdateIRQs(gb);
|
||||
return;
|
||||
default:
|
||||
|
@ -578,7 +578,7 @@ uint8_t GBIORead(struct GB* gb, unsigned address) {
|
|||
case REG_JOYP:
|
||||
return _readKeysFiltered(gb);
|
||||
case REG_IE:
|
||||
return gb->memory.ie | 0xE0;
|
||||
return gb->memory.ie;
|
||||
case REG_WAVE_0:
|
||||
case REG_WAVE_1:
|
||||
case REG_WAVE_2:
|
||||
|
|
Loading…
Reference in New Issue