all repos — mgba @ c06edae71d8a236124f3068700db1204b8473af1

mGBA Game Boy Advance Emulator

GB: Fix boundary condition at end of scanline rendering
Jeffrey Pfau jeffrey@endrift.com
Tue, 30 Aug 2016 00:44:34 -0700
commit

c06edae71d8a236124f3068700db1204b8473af1

parent

bdf647db42a1f02a0e110d40251f1ad36622beea

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/gb/renderers/software.csrc/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];