GBA Video: Fix enabling layers in non-tile modes (fixes #1317)

This commit is contained in:
Vicki Pfau 2019-02-23 00:13:22 -08:00
parent fc33aec7bb
commit a8dcbd05cb
2 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,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 Video: Improve sprite cycle counting (fixes mgba.io/i/1274)

View File

@ -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;