GBA Video: Fix wrapped sprite mosaic clamping (fixes #1432)

This commit is contained in:
Vicki Pfau 2019-05-30 11:59:07 -07:00
parent 9ce234daac
commit 0cace151e1
11 changed files with 4 additions and 3 deletions

View File

@ -18,6 +18,7 @@ Emulation fixes:
- GB Video: Delay LYC STAT check (fixes mgba.io/i/1331) - 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 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) - GB I/O: Filter IE top bits properly (fixes mgba.io/i/1329)
- GBA Video: Fix wrapped sprite mosaic clamping (fixes mgba.io/i/1432)
Other fixes: Other fixes:
- Qt: Fix some Qt display driver race conditions - Qt: Fix some Qt display driver race conditions
- Core: Improved lockstep driver reliability (Le Hoang Quyen) - Core: Improved lockstep driver reliability (Le Hoang Quyen)

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

View File

@ -808,12 +808,12 @@ static void _drawScanline(struct GBAVideoSoftwareRenderer* renderer, int y) {
if ((y < sprite->y && (sprite->endY - 256 < 0 || y >= sprite->endY - 256)) || y >= sprite->endY) { if ((y < sprite->y && (sprite->endY - 256 < 0 || y >= sprite->endY - 256)) || y >= sprite->endY) {
continue; continue;
} }
if (GBAObjAttributesAIsMosaic(sprite->obj.a)) { if (GBAObjAttributesAIsMosaic(sprite->obj.a) && mosaicV > 1) {
localY = mosaicY; localY = mosaicY;
if (localY < sprite->y) { if (localY < sprite->y && sprite->y < GBA_VIDEO_VERTICAL_PIXELS) {
localY = sprite->y; localY = sprite->y;
} }
if (localY >= sprite->endY) { if (localY >= (sprite->endY & 0xFF)) {
localY = sprite->endY - 1; localY = sprite->endY - 1;
} }
} }