GB Video: Fix underflow

This commit is contained in:
Jeffrey Pfau 2016-01-26 23:55:48 -08:00
parent d456d6ff3c
commit fc0109282b
1 changed files with 3 additions and 0 deletions

View File

@ -212,6 +212,9 @@ static void GBVideoSoftwareRendererDrawBackground(struct GBVideoSoftwareRenderer
}
int topY = (((y + sy) >> 3) & 0x1F) * 0x20;
int bottomY = (y + sy) & 7;
if (x < 0) {
x = 0;
}
for (; x < GB_VIDEO_HORIZONTAL_PIXELS; ++x) {
int topX = ((x + sx) >> 3) & 0x1F;
int bottomX = 7 - ((x + sx) & 7);