all repos — mgba @ 75f6155bdaab8d2446ee827d6afb28ca63a20c49

mGBA Game Boy Advance Emulator

DS Video: Fix extended mode 0 mirroring
Vicki Pfau vi@endrift.com
Fri, 17 Mar 2017 18:32:16 -0700
commit

75f6155bdaab8d2446ee827d6afb28ca63a20c49

parent

c9f4c9c89806762de5787718c0fc629466fe1575

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

jump to
M src/ds/renderers/software.csrc/ds/renderers/software.c

@@ -645,6 +645,12 @@ } \

LOAD_16(mapData, screenBase & (VRAM_BLOCK_MASK - 1), screenBlock); \ paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 8; \ palette = &mainPalette[paletteData]; \ + if (GBA_TEXT_MAP_VFLIP(mapData)) { \ + localY = 0x7FF - localY; \ + } \ + if (GBA_TEXT_MAP_HFLIP(mapData)) { \ + localX = 0x7FF - localX; \ + } \ uint32_t charBase = (background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 6)) + ((localY & 0x700) >> 5) + ((localX & 0x700) >> 8); \ uint16_t* vram = renderer->d.vramBG[charBase >> VRAM_BLOCK_OFFSET]; \ if (UNLIKELY(!vram)) { \