From f9ebe36faccf4267bde327f3b607a3054ca7f862 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 1 Oct 2014 23:19:26 -0700 Subject: [PATCH] Fix regression caused by converting DISPSTAT into a bitfield --- src/gba/gba-video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gba/gba-video.c b/src/gba/gba-video.c index 9d97ebaa9..d2b6e275f 100644 --- a/src/gba/gba-video.c +++ b/src/gba/gba-video.c @@ -157,7 +157,8 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) { } void GBAVideoWriteDISPSTAT(struct GBAVideo* video, uint16_t value) { - video->dispstat = value; + video->dispstat &= 0x7; + video->dispstat |= value & 0xFFF8; if (GBARegisterDISPSTATIsVcounterIRQ(video->dispstat)) { // FIXME: this can be too late if we're in the middle of an Hblank