From c63b1f27047fb178f15fa043fbf43b8915d09714 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 23 Dec 2016 15:41:11 -0800 Subject: [PATCH] GBA I/O: Mask off WAITCNT bits that cannot be written (fixes #457) --- CHANGES | 1 + src/gba/io.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 30ef721a7..decc39c70 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,7 @@ Bugfixes: - GB: Properly initialize sramRealVf variable - Qt: Fix Apply button for key and controller configurations - GB Video: Initialize LCDC in renderer + - GBA I/O: Mask off WAITCNT bits that cannot be written Misc: - PSP2: Improved controller rumble - GB, GBA: Prevent loading null ROMs diff --git a/src/gba/io.c b/src/gba/io.c index 75e8689bf..2a7fdc5b1 100644 --- a/src/gba/io.c +++ b/src/gba/io.c @@ -530,6 +530,7 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) { // Interrupts and misc case REG_WAITCNT: + value &= 0x5FFF; GBAAdjustWaitstates(gba, value); break; case REG_IE: