Fix mosaic drawing of 256-color mirrored background tiles
Jeffrey Pfau jeffrey@endrift.com
Wed, 09 Jul 2014 22:49:05 -0700
1 files changed,
9 insertions(+),
7 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -1066,18 +1066,20 @@ charBase = ((background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 6)) >> 2) + (localY << 1); \
tileData = carryData; \ for (x = 0; x < 8; ++x) { \ if (!mosaicWait) { \ - if (x >= 4) { \ - tileData = ((uint32_t*)renderer->d.vram)[charBase + 1]; \ - if (!GBA_TEXT_MAP_HFLIP(mapData)) { \ + if (!GBA_TEXT_MAP_HFLIP(mapData)) { \ + if (x >= 4) { \ + tileData = ((uint32_t*)renderer->d.vram)[charBase + 1]; \ tileData >>= (x - 4) * 8; \ } else { \ - tileData >>= (7 - x) * 8; \ + tileData = ((uint32_t*)renderer->d.vram)[charBase]; \ + tileData >>= x * 8; \ } \ } else { \ - tileData = ((uint32_t*)renderer->d.vram)[charBase]; \ - if (!GBA_TEXT_MAP_HFLIP(mapData)) { \ - tileData >>= x * 8; \ + if (x >= 4) { \ + tileData = ((uint32_t*)renderer->d.vram)[charBase]; \ + tileData >>= (7 - x) * 8; \ } else { \ + tileData = ((uint32_t*)renderer->d.vram)[charBase + 1]; \ tileData >>= (3 - x) * 8; \ } \ } \