Precompute some parameters in mode 0
Jeffrey Pfau jeffrey@endrift.com
Sun, 27 Oct 2013 22:18:24 -0700
1 files changed,
5 insertions(+),
5 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -727,12 +727,11 @@ xBase = localX & 0xF8; \
if (background->size & 1) { \ xBase += (localX & 0x100) << 5; \ } \ - screenBase = (background->screenBase >> 1) + (xBase >> 3) + (yBase << 2); \ + screenBase = yBase + (xBase >> 3); \ mapData = renderer->d.vram[screenBase]; \ - if (!GBA_TEXT_MAP_VFLIP(mapData)) { \ - localY = inY & 0x7; \ - } else { \ - localY = 7 - (inY & 0x7); \ + localY = inY & 0x7; \ + if (GBA_TEXT_MAP_VFLIP(mapData)) { \ + localY = 7 - localY; \ } #define PREPARE_OBJWIN \@@ -781,6 +780,7 @@ yBase += inY & 0x100;
} else if (background->size == 3) { yBase += (inY & 0x100) << 1; } + yBase = (background->screenBase >> 1) + (yBase << 2); int localX; int localY;