GBA Video: Fix mosaic objects drawing past the end (fixes #1702)

This commit is contained in:
Vicki Pfau 2020-05-13 23:31:44 -07:00
parent ba11b8aa0c
commit e582e98b62
2 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@
- GBA SIO: Fix Multiplayer busy bit
- GBA SIO: Fix double-unloading active driver
- GBA Timers: Fix deserializing count-up timers
- GBA Video: Fix mosaic objects drawing past the end (fixes mgba.io/i/1702)
Other fixes:
- Core: Fix ELF loading regression (fixes mgba.io/i/1669)
- Core: Fix crash modifying hash table entry (fixes mgba.io/i/1673)

View File

@ -224,7 +224,7 @@ int GBAVideoSoftwareRendererPreprocessSprite(struct GBAVideoSoftwareRenderer* re
int mosaicH = 1;
if (GBAObjAttributesAIsMosaic(sprite->a)) {
mosaicH = GBAMosaicControlGetObjH(renderer->mosaic) + 1;
if (condition % mosaicH) {
if (condition != end && condition % mosaicH) {
condition += mosaicH - (condition % mosaicH);
}
}