From c2f40b88ef4b7040429a205e31f0d74a2d5862ce Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 27 Jul 2021 19:14:53 -0700 Subject: [PATCH] GBA Video: Fix backdrop color if DISPCNT is first set to 0 (fixes #2260) --- CHANGES | 1 + src/gba/renderers/gl.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 592a474c8..a5a4fe9de 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ Emulation fixes: - GB Memory: Add cursory cartridge open bus emulation (fixes mgba.io/i/2032) - GBA: Improve timing when not booting from BIOS - GBA SIO: Fix SI value for unattached MULTI mode + - GBA Video: Fix backdrop color if DISPCNT is first set to 0 (fixes mgba.io/i/2260) Other fixes: - Core: Don't attempt to restore rewind diffs past start of rewind - GB Video: Fix memory leak when reseting SGB games diff --git a/src/gba/renderers/gl.c b/src/gba/renderers/gl.c index 49653a268..dff331fc4 100644 --- a/src/gba/renderers/gl.c +++ b/src/gba/renderers/gl.c @@ -933,6 +933,7 @@ void GBAVideoGLRendererReset(struct GBAVideoRenderer* renderer) { glRenderer->nextPalette = 0; glRenderer->paletteDirtyScanlines = GBA_VIDEO_VERTICAL_PIXELS; memset(glRenderer->shadowRegs, 0, sizeof(glRenderer->shadowRegs)); + glRenderer->shadowRegs[REG_DISPCNT >> 1] = glRenderer->dispcnt; glRenderer->regsDirty = 0xFFFFFFFFFFFEULL; int i;