From e5161b766d6b8bdd21a174724b435c68185462e0 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 23 Feb 2019 00:13:22 -0800 Subject: [PATCH] GBA Video: Fix enabling layers in non-tile modes (fixes #1317) --- CHANGES | 1 + src/gba/renderers/video-software.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 72bdd0dd5..db72bf169 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,7 @@ Bugfixes: - GBA DMA: Fix DMA start/end timing - Qt: Fix window icon on X11 - GB, GBA Serialize: Fix loading two states in a row + - GBA Video: Fix enabling layers in non-tile modes (fixes mgba.io/i/1317) Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 614f9087f..f31239d09 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -727,7 +727,8 @@ static void _enableBg(struct GBAVideoSoftwareRenderer* renderer, int bg, bool ac if (!active) { renderer->bg[bg].enabled = 0; } else if (!wasActive && active) { - if (renderer->nextY == 0) { + if (renderer->nextY == 0 || GBARegisterDISPCNTGetMode(renderer->dispcnt) > 2) { + // TODO: Investigate in more depth how switching background works in different modes renderer->bg[bg].enabled = 4; } else { renderer->bg[bg].enabled = 1;