GB Video: Fix window underflow

This commit is contained in:
Jeffrey Pfau 2016-02-14 11:26:45 -08:00
parent 2a7b268728
commit 52152a3a12
1 changed files with 6 additions and 0 deletions

View File

@ -175,6 +175,9 @@ static void GBVideoSoftwareRendererDrawBackground(struct GBVideoSoftwareRenderer
}
int topY = (((y + sy) >> 3) & 0x1F) * 0x20;
int bottomY = (y + sy) & 7;
if (startX < 0) {
startX = 0;
}
int x;
for (x = startX; x < endX; ++x) {
int topX = ((x + sx) >> 3) & 0x1F;
@ -204,6 +207,9 @@ static void GBVideoSoftwareRendererDrawObj(struct GBVideoSoftwareRenderer* rende
if (obj->x - 8 > startX) {
startX = obj->x - 8;
}
if (startX < 0) {
startX = 0;
}
uint8_t* data = renderer->d.vram;
int tileOffset = 0;
int bottomY;