GB I/O: Alternate fix for #1329 that doesn't break tests
Vicki Pfau vi@endrift.com
Sun, 03 Mar 2019 18:07:10 -0800
2 files changed,
3 insertions(+),
3 deletions(-)
M
src/gb/gb.c
→
src/gb/gb.c
@@ -630,7 +630,7 @@ }
} 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;
M
src/gb/io.c
→
src/gb/io.c
@@ -465,7 +465,7 @@ GBVideoDisableCGB(&gb->video);
} break; case REG_IE: - gb->memory.ie = value & 0x1F; + gb->memory.ie = value; GBUpdateIRQs(gb); return; default:@@ -578,7 +578,7 @@ switch (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: