diff --git a/CHANGES b/CHANGES index 0287f3d6b..369634b11 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,7 @@ Bugfixes: - GB Video: Fix SCX timing - GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1126) - GB, GBA Savedata: Fix savestate loading overwriting saves on reset + - GBA Video: Make layer disabling work consistently Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722) diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index c0387ccb4..2b80ac998 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -722,7 +722,7 @@ static void GBAVideoSoftwareRendererPutPixels(struct GBAVideoRenderer* renderer, } static void _enableBg(struct GBAVideoSoftwareRenderer* renderer, int bg, bool active) { - if (renderer->d.disableBG[bg] || !active) { + if (!active) { renderer->bg[bg].enabled = 0; } else if (!renderer->bg[bg].enabled && active) { if (renderer->nextY == 0) { @@ -799,6 +799,7 @@ static void GBAVideoSoftwareRendererWriteBLDCNT(struct GBAVideoSoftwareRenderer* } #define TEST_LAYER_ENABLED(X) \ + !renderer->d.disableBG[X] && \ (renderer->bg[X].enabled == 4 && \ (GBAWindowControlIsBg ## X ## Enable(renderer->currentWindow.packed) || \ (GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt) && GBAWindowControlIsBg ## X ## Enable (renderer->objwin.packed))) && \