Support narrow windows
Jeffrey Pfau jeffrey@endrift.com
Sun, 10 Nov 2013 22:43:57 -0800
1 files changed,
7 insertions(+),
3 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -763,6 +763,10 @@ int mod8 = inX & 0x7;
BACKGROUND_TEXT_SELECT_CHARACTER; int end = outX + 0x8 - mod8; + if (end > renderer->end) { + // TODO: ensure tiles are properly aligned from this + end = renderer->end; + } if (!background->multipalette) { paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 4; palette = &mainPalette[paletteData];@@ -817,9 +821,9 @@ paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 4;
palette = &mainPalette[paletteData]; if (!GBA_TEXT_MAP_HFLIP(mapData)) { outX = renderer->end - mod8; - if (outX < 0) { - tileData >>= 4 * -outX; - outX = 0; + if (outX < renderer->start) { + tileData >>= 4 * (renderer->start - outX); + outX = renderer->start; } for (; outX < renderer->end; ++outX) { uint32_t* pixel = &renderer->row[outX];