GB Video: Fix underflow
Jeffrey Pfau jeffrey@endrift.com
Tue, 26 Jan 2016 23:55:48 -0800
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
src/gb/renderers/software.c
→
src/gb/renderers/software.c
@@ -212,6 +212,9 @@ data += 0x1000;
} 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);