all repos — mgba @ 0421228a77fdf228551584fbcb300c6e27f2583e

mGBA Game Boy Advance Emulator

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
commit

0421228a77fdf228551584fbcb300c6e27f2583e

parent

ce2732823985041f17107a4178d43ac3234ea1f7

2 files changed, 3 insertions(+), 3 deletions(-)

jump to
M src/gb/gb.csrc/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.csrc/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: