GB: Fix boundary condition at end of scanline rendering
Jeffrey Pfau jeffrey@endrift.com
Tue, 30 Aug 2016 00:44:34 -0700
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
src/gb/renderers/software.c
→
src/gb/renderers/software.c
@@ -133,7 +133,7 @@ }
} color_t* row = &softwareRenderer->outputBuffer[softwareRenderer->outputBufferStride * y]; int x; - for (x = startX; x < (endX & ~7); x += 8) { + for (x = startX; x + 7 < (endX & ~7); x += 8) { row[x] = softwareRenderer->palette[softwareRenderer->row[x] & 0x7F]; row[x + 1] = softwareRenderer->palette[softwareRenderer->row[x + 1] & 0x7F]; row[x + 2] = softwareRenderer->palette[softwareRenderer->row[x + 2] & 0x7F];