all repos — mgba @ 52152a3a12f36f91ace52b31ab9f0c129b8cd19e

mGBA Game Boy Advance Emulator

GB Video: Fix window underflow
Jeffrey Pfau jeffrey@endrift.com
Sun, 14 Feb 2016 11:26:45 -0800
commit

52152a3a12f36f91ace52b31ab9f0c129b8cd19e

parent

2a7b26872886a51111e043451d4b79d53547b5cf

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

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