From 54fba4c4611141b45c76471cad9981dadb03389c Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 20 Nov 2020 01:15:46 -0800 Subject: [PATCH] GBA I/O: Ignore high bits on IME --- CHANGES | 1 + src/gba/io.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index aba1aa345..39907c7f5 100644 --- a/CHANGES +++ b/CHANGES @@ -32,6 +32,7 @@ Emulation fixes: - GBA DMA: Linger last DMA on bus (fixes mgba.io/i/301 and mgba.io/i/1320) - GBA DMA: Fix ordering and timing of overlapping DMAs - GBA I/O: Green swap register should be readable + - GBA I/O: Ignore high bits on IME - GBA Memory: Improve gamepak prefetch timing - GBA Memory: Stall on VRAM access in mode 2 (fixes mgba.io/i/190) - GBA Memory: Improve robustness of Matrix memory support diff --git a/src/gba/io.c b/src/gba/io.c index 6a1037bf3..b544db166 100644 --- a/src/gba/io.c +++ b/src/gba/io.c @@ -557,7 +557,7 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) { GBATestIRQ(gba, 1); return; case REG_IME: - gba->memory.io[REG_IME >> 1] = value; + gba->memory.io[REG_IME >> 1] = value & 1; GBATestIRQ(gba, 1); return; case REG_MAX: