From a159e377932c8def76c2d77495b94f70083defcd Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 21 Apr 2017 03:15:39 -0700 Subject: [PATCH] GBA Video: Don't update background scanline params in mode 0 (fixes #377) --- CHANGES | 1 + src/gba/renderers/video-software.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 66c37278a..a8a1106c3 100644 --- a/CHANGES +++ b/CHANGES @@ -40,6 +40,7 @@ Bugfixes: - Qt: Fix crash when changing audio settings after a game is closed - GBA BIOS: Fix ArcTan sign in HLE BIOS - GBA BIOS: Fix ArcTan2 sign in HLE BIOS (fixes mgba.io/i/689) + - GBA Video: Don't update background scanline params in mode 0 (fixes mgba.io/i/377) Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 2c20a475a..70dac8811 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -807,10 +807,12 @@ static void _drawScanline(struct GBAVideoSoftwareRenderer* renderer, int y) { } } } - renderer->bg[2].sx += renderer->bg[2].dmx; - renderer->bg[2].sy += renderer->bg[2].dmy; - renderer->bg[3].sx += renderer->bg[3].dmx; - renderer->bg[3].sy += renderer->bg[3].dmy; + if (GBARegisterDISPCNTGetMode(renderer->dispcnt) != 0) { + renderer->bg[2].sx += renderer->bg[2].dmx; + renderer->bg[2].sy += renderer->bg[2].dmy; + renderer->bg[3].sx += renderer->bg[3].dmx; + renderer->bg[3].sy += renderer->bg[3].dmy; + } } static void _updatePalettes(struct GBAVideoSoftwareRenderer* renderer) {