GBA Video: Fix scanline cache with scale factor change edge cases

This commit is contained in:
Vicki Pfau 2019-03-09 11:27:52 -08:00
parent 0425fa805c
commit c655626095
2 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,7 @@ Emulation fixes:
- GB Video: Delay LYC STAT check (fixes mgba.io/i/1331)
- GB Video: Fix window being enabled mid-scanline (fixes mgba.io/i/1328)
- GB I/O: Filter IE top bits properly (fixes mgba.io/i/1329)
- GBA Video: Fix scanline cache with scale factor change edge cases
Other fixes:
- Qt: More app metadata fixes
- Qt: Fix load recent from archive (fixes mgba.io/i/1325)

View File

@ -539,6 +539,14 @@ static void GBAVideoSoftwareRendererDrawScanline(struct GBAVideoRenderer* render
dirty = true;
}
if (GBARegisterDISPCNTGetMode(softwareRenderer->dispcnt) != 0) {
if (softwareRenderer->cache[y].scale[0][0] != softwareRenderer->bg[2].sx ||
softwareRenderer->cache[y].scale[0][1] != softwareRenderer->bg[2].sy ||
softwareRenderer->cache[y].scale[1][0] != softwareRenderer->bg[3].sx ||
softwareRenderer->cache[y].scale[1][1] != softwareRenderer->bg[3].sy) {
dirty = true;
}
}
softwareRenderer->cache[y].scale[0][0] = softwareRenderer->bg[2].sx;
softwareRenderer->cache[y].scale[0][1] = softwareRenderer->bg[2].sy;
softwareRenderer->cache[y].scale[1][0] = softwareRenderer->bg[3].sx;