From ca3b63d64c6d3d5e4670d3d93b2479029b07ed18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ed=C3=AAnis=20Freindorfer=20Azevedo?= Date: Fri, 31 Jan 2020 22:40:20 -0300 Subject: [PATCH] Enable layers in non-tile modes. The current code is very messy as far as GFX goes. There are more elegant ways of tackling this issue, but they are very difficult with our current code. The idea behind this issue is that the backgrounds are not switching properly for the lcd. So we enable the layers accordingly to `layerSettings & DISPCNT` on every `CPUUpdateRenderBuffers`. The bits of `layerSettings` enconde each layer and objs. We actually only need 2 of these, but I can't do much more here unsupervised. - Fix #376. --- src/gba/GBA.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gba/GBA.cpp b/src/gba/GBA.cpp index 27f991b1..6ff9dc44 100644 --- a/src/gba/GBA.cpp +++ b/src/gba/GBA.cpp @@ -577,6 +577,7 @@ extern uint32_t line3[240]; void CPUUpdateRenderBuffers(bool force) { + layerEnable = layerSettings & DISPCNT; if (!(layerEnable & 0x0100) || force) { CLEAR_ARRAY(line0); }