all repos — mgba @ fc0109282b81c5fac6a108b4636192d8efe2b345

mGBA Game Boy Advance Emulator

GB Video: Fix underflow
Jeffrey Pfau jeffrey@endrift.com
Tue, 26 Jan 2016 23:55:48 -0800
commit

fc0109282b81c5fac6a108b4636192d8efe2b345

parent

d456d6ff3c858376933c3b2198132c6f7c2ed23d

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

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