diff --git a/CHANGES b/CHANGES index e5b232c92..765990083 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ Bugfixes: - DS Video: Enable overflow bit on extended affine modes - DS Video: Fix extended mode 0 without extended palettes - DS Video: Fix caputre stride + - DS Video: Fix affine transformations in video capture Misc: - DS: Set boot complete bit in RAM on boot (fixes mgba.io/i/576, mgba.io/i/580, mgba.io/i/586) - DS Memory: Ensure DS9 I/O is 8-byte aligned diff --git a/src/ds/renderers/software.c b/src/ds/renderers/software.c index 80fa4f2d6..14e15527c 100644 --- a/src/ds/renderers/software.c +++ b/src/ds/renderers/software.c @@ -379,6 +379,11 @@ static void DSVideoSoftwareRendererDrawGBAScanline(struct GBAVideoRenderer* rend memset(softwareRenderer->alphaA, softwareRenderer->blda, sizeof(softwareRenderer->alphaA)); memset(softwareRenderer->alphaB, softwareRenderer->bldb, sizeof(softwareRenderer->alphaB)); + softwareRenderer->bg[2].sx = softwareRenderer->bg[2].dmx * y; + softwareRenderer->bg[2].sy = softwareRenderer->bg[2].dmy * y; + softwareRenderer->bg[3].sx = softwareRenderer->bg[3].dmx * y; + softwareRenderer->bg[3].sy = softwareRenderer->bg[3].dmy * y; + int w; unsigned priority; for (priority = 0; priority < 4; ++priority) { @@ -477,10 +482,6 @@ static void DSVideoSoftwareRendererDrawGBAScanline(struct GBAVideoRenderer* rend } } } - softwareRenderer->bg[2].sx += softwareRenderer->bg[2].dmx; - softwareRenderer->bg[2].sy += softwareRenderer->bg[2].dmy; - softwareRenderer->bg[3].sx += softwareRenderer->bg[3].dmx; - softwareRenderer->bg[3].sy += softwareRenderer->bg[3].dmy; GBAVideoSoftwareRendererPostprocessBuffer(softwareRenderer); }