mirror of https://github.com/mgba-emu/mgba.git
GBA Video: I can't believe I broke so this so much
This commit is contained in:
parent
dd67bf9797
commit
d9ecac8cca
|
@ -42,6 +42,9 @@
|
||||||
#define DRAW_BACKGROUND_MODE_0_TILE_PREFIX_16(BLEND, OBJWIN) \
|
#define DRAW_BACKGROUND_MODE_0_TILE_PREFIX_16(BLEND, OBJWIN) \
|
||||||
charBase = (background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 5)) + (localY << 2); \
|
charBase = (background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 5)) + (localY << 2); \
|
||||||
vram = renderer->d.vramBG[charBase >> VRAM_BLOCK_OFFSET]; \
|
vram = renderer->d.vramBG[charBase >> VRAM_BLOCK_OFFSET]; \
|
||||||
|
if (UNLIKELY(!vram)) { \
|
||||||
|
return; \
|
||||||
|
} \
|
||||||
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
||||||
paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 4; \
|
paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 4; \
|
||||||
palette = &mainPalette[paletteData]; \
|
palette = &mainPalette[paletteData]; \
|
||||||
|
@ -389,25 +392,29 @@
|
||||||
tileData = carryData; \
|
tileData = carryData; \
|
||||||
for (x = 0; x < 8; ++x) { \
|
for (x = 0; x < 8; ++x) { \
|
||||||
if (!mosaicWait) { \
|
if (!mosaicWait) { \
|
||||||
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
|
if (UNLIKELY(!vram)) { \
|
||||||
if (x >= 4) { \
|
carryData = 0; \
|
||||||
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
|
||||||
tileData >>= (x - 4) * 8; \
|
|
||||||
} else { \
|
|
||||||
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
|
||||||
tileData >>= x * 8; \
|
|
||||||
} \
|
|
||||||
} else { \
|
} else { \
|
||||||
if (x >= 4) { \
|
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
|
||||||
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
if (x >= 4) { \
|
||||||
tileData >>= (7 - x) * 8; \
|
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= (x - 4) * 8; \
|
||||||
|
} else { \
|
||||||
|
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= x * 8; \
|
||||||
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
if (x >= 4) { \
|
||||||
tileData >>= (3 - x) * 8; \
|
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= (7 - x) * 8; \
|
||||||
|
} else { \
|
||||||
|
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= (3 - x) * 8; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
tileData &= 0xFF; \
|
||||||
|
carryData = tileData; \
|
||||||
} \
|
} \
|
||||||
tileData &= 0xFF; \
|
|
||||||
carryData = tileData; \
|
|
||||||
mosaicWait = mosaicH; \
|
mosaicWait = mosaicH; \
|
||||||
} \
|
} \
|
||||||
tileData |= tileData << 8; \
|
tileData |= tileData << 8; \
|
||||||
|
@ -622,25 +629,29 @@
|
||||||
if (!mosaicWait) { \
|
if (!mosaicWait) { \
|
||||||
paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 8; \
|
paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 8; \
|
||||||
palette = &mainPalette[paletteData]; \
|
palette = &mainPalette[paletteData]; \
|
||||||
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
|
if (UNLIKELY(!vram)) { \
|
||||||
if (x >= 4) { \
|
carryData = 0; \
|
||||||
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
|
||||||
tileData >>= (x - 4) * 8; \
|
|
||||||
} else { \
|
|
||||||
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
|
||||||
tileData >>= x * 8; \
|
|
||||||
} \
|
|
||||||
} else { \
|
} else { \
|
||||||
if (x >= 4) { \
|
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
|
||||||
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
if (x >= 4) { \
|
||||||
tileData >>= (7 - x) * 8; \
|
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= (x - 4) * 8; \
|
||||||
|
} else { \
|
||||||
|
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= x * 8; \
|
||||||
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
if (x >= 4) { \
|
||||||
tileData >>= (3 - x) * 8; \
|
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= (7 - x) * 8; \
|
||||||
|
} else { \
|
||||||
|
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
|
||||||
|
tileData >>= (3 - x) * 8; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
|
tileData &= 0xFF; \
|
||||||
|
carryData = tileData; \
|
||||||
} \
|
} \
|
||||||
tileData &= 0xFF; \
|
|
||||||
carryData = tileData; \
|
|
||||||
mosaicWait = mosaicH; \
|
mosaicWait = mosaicH; \
|
||||||
} \
|
} \
|
||||||
tileData |= tileData << 8; \
|
tileData |= tileData << 8; \
|
||||||
|
|
Loading…
Reference in New Issue