mirror of https://github.com/mgba-emu/mgba.git
GB Video: Fix underflow
This commit is contained in:
parent
d456d6ff3c
commit
fc0109282b
|
@ -212,6 +212,9 @@ static void GBVideoSoftwareRendererDrawBackground(struct GBVideoSoftwareRenderer
|
||||||
}
|
}
|
||||||
int topY = (((y + sy) >> 3) & 0x1F) * 0x20;
|
int topY = (((y + sy) >> 3) & 0x1F) * 0x20;
|
||||||
int bottomY = (y + sy) & 7;
|
int bottomY = (y + sy) & 7;
|
||||||
|
if (x < 0) {
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
for (; x < GB_VIDEO_HORIZONTAL_PIXELS; ++x) {
|
for (; x < GB_VIDEO_HORIZONTAL_PIXELS; ++x) {
|
||||||
int topX = ((x + sx) >> 3) & 0x1F;
|
int topX = ((x + sx) >> 3) & 0x1F;
|
||||||
int bottomX = 7 - ((x + sx) & 7);
|
int bottomX = 7 - ((x + sx) & 7);
|
||||||
|
|
Loading…
Reference in New Issue