all repos — mgba @ 1e0f4000918ab61f637fbce626178225d640c693

mGBA Game Boy Advance Emulator

Precompute some parameters in mode 0
Jeffrey Pfau jeffrey@endrift.com
Sun, 27 Oct 2013 22:18:24 -0700
commit

1e0f4000918ab61f637fbce626178225d640c693

parent

7132c873e33d848f523a8a024c2959b451f4ead8

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

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