GBA Video: Fix mode 3-5 overflow with mosaic (fixes #1691)

This commit is contained in:
Vicki Pfau 2021-03-31 23:16:01 -07:00
parent 7744332b64
commit be8b95f803
2 changed files with 9 additions and 9 deletions

View File

@ -4,6 +4,7 @@ Emulation fixes:
- GB Serialize: Fix switching speed modes when loading a state (fixes mgba.io/i/2097)
- GBA Memory: Fix loading Thumb savestates when in ARM mode
- GBA Video: Fix window start on modes 3-5 with mosaic (fixes mgba.io/i/1690)
- GBA Video: Fix mode 3-5 overflow with mosaic (fixes mgba.io/i/1691)
Other fixes:
- GBA: Fix non-USA 1.0 FireRed misdetecting as a ROM hack (fixes mgba.io/i/2100)
- GBA: Fix crash when ROM loading fails

View File

@ -55,15 +55,14 @@
UNUSED(palette); \
PREPARE_OBJWIN;
#define BACKGROUND_BITMAP_ITERATE(W, H) \
x += background->dx; \
y += background->dy; \
\
if (x < 0 || y < 0 || (x >> 8) >= W || (y >> 8) >= H) { \
continue; \
} \
localX = x; \
localY = y; \
#define BACKGROUND_BITMAP_ITERATE(W, H) \
x += background->dx; \
y += background->dy; \
if ((x < 0 || y < 0 || (x >> 8) >= W || (y >> 8) >= H) && !mosaicWait) { \
continue; \
} \
localX = x; \
localY = y;
#define MODE_2_COORD_OVERFLOW \
localX = x & (sizeAdjusted - 1); \