From 3a313a6133a25e82821f8bb256c2f94443df6a0f Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 3 Mar 2019 17:56:33 -0800 Subject: [PATCH] GB I/O: Filter IE top bits properly (fixes #1329) --- CHANGES | 1 + src/gb/io.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 521c109e4..f157b549c 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ Bugfixes: - Qt: More app metadata fixes - Qt: Fix load recent from archive (fixes mgba.io/i/1325) - GB Video: Delay LYC STAT check (fixes mgba.io/i/1331) + - GB Video: Fix window being enabled mid-scanline (fixes mgba.io/i/1328) Misc: - Qt: Add missing HEVC NVENC option (fixes mgba.io/i/1323) diff --git a/src/gb/io.c b/src/gb/io.c index 84b3a35bc..c5f138b60 100644 --- a/src/gb/io.c +++ b/src/gb/io.c @@ -465,7 +465,7 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) { } break; case REG_IE: - gb->memory.ie = value; + gb->memory.ie = value & 0x1F; 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; + return gb->memory.ie | 0xE0; case REG_WAVE_0: case REG_WAVE_1: case REG_WAVE_2: