GB Video: Fix window underflow
Jeffrey Pfau jeffrey@endrift.com
Sun, 14 Feb 2016 11:26:45 -0800
1 files changed,
6 insertions(+),
0 deletions(-)
jump to
M
src/gb/renderers/software.c
→
src/gb/renderers/software.c
@@ -175,6 +175,9 @@ data += 0x1000;
} 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;@@ -203,6 +206,9 @@ endX = obj->x;
} if (obj->x - 8 > startX) { startX = obj->x - 8; + } + if (startX < 0) { + startX = 0; } uint8_t* data = renderer->d.vram; int tileOffset = 0;