mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Fix sprite boundary conditions with mosaic
This commit is contained in:
parent
bbfd7d8e2c
commit
85c3ed4178
1
CHANGES
1
CHANGES
|
@ -35,6 +35,7 @@ Bugfixes:
|
|||
- Debugger: Fix watchpoints triggering too late
|
||||
- GBA Video: Fix sprite mis-ordering behavior in some cases (fixes #168)
|
||||
- GBA Video: Fix window interactions with 16-color mode 0 mosaic
|
||||
- GBA Video: Fix sprite boundary conditions with mosaic
|
||||
Misc:
|
||||
- Qt: Disable sync to video by default
|
||||
- GBA: Exit cleanly on FATAL if the port supports it
|
||||
|
|
|
@ -1578,14 +1578,22 @@ static void _drawBackgroundMode5(struct GBAVideoSoftwareRenderer* renderer, stru
|
|||
SPRITE_YBASE_ ## DEPTH(inY); \
|
||||
unsigned tileData; \
|
||||
if (outX % mosaicH) { \
|
||||
inX += (mosaicH - (outX % mosaicH)) * xOffset; \
|
||||
if (!inX && xOffset > 0) { \
|
||||
inX = mosaicH - (outX % mosaicH); \
|
||||
outX += mosaicH - (outX % mosaicH); \
|
||||
} else if (inX == width - xOffset) { \
|
||||
inX = mosaicH + (outX % mosaicH); \
|
||||
outX += mosaicH - (outX % mosaicH); \
|
||||
} \
|
||||
} \
|
||||
for (; outX < condition; ++outX, inX += xOffset) { \
|
||||
if (!(renderer->row[outX] & FLAG_UNWRITTEN)) { \
|
||||
continue; \
|
||||
} \
|
||||
int localX = inX - xOffset * (outX % mosaicH); \
|
||||
if (localX < 0 || localX > width - 1) { \
|
||||
continue; \
|
||||
} \
|
||||
SPRITE_XBASE_ ## DEPTH(localX); \
|
||||
SPRITE_DRAW_PIXEL_ ## DEPTH ## _ ## TYPE(localX); \
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue