GBA Video: Make layer disabling work consistently

This commit is contained in:
Vicki Pfau 2018-08-04 10:16:31 -07:00
parent 6c5d30e250
commit 8f7a0e6858
2 changed files with 3 additions and 1 deletions

View File

@ -44,6 +44,7 @@ Bugfixes:
- GB Video: Fix SCX timing - GB Video: Fix SCX timing
- GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1126) - GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1126)
- GB, GBA Savedata: Fix savestate loading overwriting saves on reset - GB, GBA Savedata: Fix savestate loading overwriting saves on reset
- GBA Video: Make layer disabling work consistently
Misc: Misc:
- GBA Timer: Use global cycles for timers - GBA Timer: Use global cycles for timers
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722) - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)

View File

@ -722,7 +722,7 @@ static void GBAVideoSoftwareRendererPutPixels(struct GBAVideoRenderer* renderer,
} }
static void _enableBg(struct GBAVideoSoftwareRenderer* renderer, int bg, bool active) { static void _enableBg(struct GBAVideoSoftwareRenderer* renderer, int bg, bool active) {
if (renderer->d.disableBG[bg] || !active) { if (!active) {
renderer->bg[bg].enabled = 0; renderer->bg[bg].enabled = 0;
} else if (!renderer->bg[bg].enabled && active) { } else if (!renderer->bg[bg].enabled && active) {
if (renderer->nextY == 0) { if (renderer->nextY == 0) {
@ -799,6 +799,7 @@ static void GBAVideoSoftwareRendererWriteBLDCNT(struct GBAVideoSoftwareRenderer*
} }
#define TEST_LAYER_ENABLED(X) \ #define TEST_LAYER_ENABLED(X) \
!renderer->d.disableBG[X] && \
(renderer->bg[X].enabled == 4 && \ (renderer->bg[X].enabled == 4 && \
(GBAWindowControlIsBg ## X ## Enable(renderer->currentWindow.packed) || \ (GBAWindowControlIsBg ## X ## Enable(renderer->currentWindow.packed) || \
(GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt) && GBAWindowControlIsBg ## X ## Enable (renderer->objwin.packed))) && \ (GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt) && GBAWindowControlIsBg ## X ## Enable (renderer->objwin.packed))) && \