GBA Video: Delay enabling backgrounds in bitmap modes (fixes #1668)

This commit is contained in:
Vicki Pfau 2021-09-22 15:52:48 -07:00
parent 2d4294e417
commit ca91489e00
2 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@ Emulation fixes:
- GBA SIO: Fix SI value for unattached MULTI mode
- GBA Video: Fix backdrop color if DISPCNT is first set to 0 (fixes mgba.io/i/2260)
- GBA Video: Don't iterate affine backgrounds when disabled
- GBA Video: Delay enabling backgrounds in bitmap modes (fixes mgba.io/i/1668)
Other fixes:
- Core: Don't attempt to restore rewind diffs past start of rewind
- FFmpeg: Don't attempt to use YUV 4:2:0 for lossless videos (fixes mgba.io/i/2084)

View File

@ -727,9 +727,11 @@ 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 || GBARegisterDISPCNTGetMode(renderer->dispcnt) > 2) {
if (renderer->nextY == 0) {
// TODO: Investigate in more depth how switching background works in different modes
renderer->bg[bg].enabled = 4;
} else if (GBARegisterDISPCNTGetMode(renderer->dispcnt) > 2) {
renderer->bg[bg].enabled = 2;
} else {
renderer->bg[bg].enabled = 1;
}