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 dd3c09e7a7
commit fd9645fde7
11 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,6 @@
0.7.3: (Future)
Emulation fixes:
- GBA Video: Fix wrapped sprite mosaic clamping (fixes mgba.io/i/1432)
Other fixes:
- Switch: Fix threading-related crash on second launch
- Qt: Fix FPS target maxing out at 59.727 (fixes mgba.io/i/1421)

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

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