GBA Video: Fix more merge regressions

This commit is contained in:
Vicki Pfau 2020-07-16 23:42:49 -07:00
parent 9fd6a5bf7b
commit c7f85f7b7e
1 changed files with 67 additions and 61 deletions

View File

@ -21,15 +21,17 @@
palette = &mainPalette[paletteData]; \
charBase = (background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 5)) + (localY << 2); \
vram = renderer->d.vramBG[charBase >> VRAM_BLOCK_OFFSET]; \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
tileData >>= 4 * mod8; \
for (; outX < end; ++outX) { \
BACKGROUND_DRAW_PIXEL_16(BLEND, OBJWIN, 0); \
} \
} else { \
for (outX = end - 1; outX >= renderer->start; --outX) { \
BACKGROUND_DRAW_PIXEL_16(BLEND, OBJWIN, 0); \
if (LIKELY(vram)) { \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
tileData >>= 4 * mod8; \
for (; outX < end; ++outX) { \
BACKGROUND_DRAW_PIXEL_16(BLEND, OBJWIN, 0); \
} \
} else { \
for (outX = end - 1; outX >= renderer->start; --outX) { \
BACKGROUND_DRAW_PIXEL_16(BLEND, OBJWIN, 0); \
} \
} \
}
@ -189,37 +191,39 @@
#define DRAW_BACKGROUND_MODE_0_TILE_SUFFIX_256(BLEND, OBJWIN) \
charBase = (background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 6)) + (localY << 3); \
vram = renderer->d.vramBG[charBase >> VRAM_BLOCK_OFFSET]; \
int end2 = end - 4; \
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
int shift = inX & 0x3; \
if (end2 > outX) { \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
if (LIKELY(vram)) { \
int end2 = end - 4; \
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
int shift = inX & 0x3; \
if (end2 > outX) { \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
tileData >>= 8 * shift; \
shift = 0; \
for (; outX < end2; ++outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
} \
\
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
tileData >>= 8 * shift; \
shift = 0; \
for (; outX < end2; ++outX) { \
for (; outX < end; ++outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
} \
\
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
tileData >>= 8 * shift; \
for (; outX < end; ++outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
} else { \
int start = outX; \
outX = end - 1; \
if (end2 > start) { \
} else { \
int start = outX; \
outX = end - 1; \
if (end2 > start) { \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
for (; outX >= end2; --outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
charBase += 4; \
} \
\
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
for (; outX >= end2; --outX) { \
for (; outX >= renderer->start; --outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
charBase += 4; \
} \
\
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
for (; outX >= renderer->start; --outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
}
@ -412,39 +416,41 @@
#define DRAW_BACKGROUND_MODE_0_TILE_SUFFIX_256EXT(BLEND, OBJWIN) \
charBase = (background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 6)) + (localY << 3); \
vram = renderer->d.vramBG[charBase >> VRAM_BLOCK_OFFSET]; \
int end2 = end - 4; \
paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 8; \
palette = &mainPalette[paletteData]; \
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
int shift = inX & 0x3; \
if (end2 > outX) { \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
if (LIKELY(vram)) { \
int end2 = end - 4; \
paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 8; \
palette = &mainPalette[paletteData]; \
if (!GBA_TEXT_MAP_HFLIP(mapData)) { \
int shift = inX & 0x3; \
if (end2 > outX) { \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
tileData >>= 8 * shift; \
shift = 0; \
for (; outX < end2; ++outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
} \
\
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
tileData >>= 8 * shift; \
shift = 0; \
for (; outX < end2; ++outX) { \
for (; outX < end; ++outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
} \
\
LOAD_32(tileData, (charBase + 4) & VRAM_BLOCK_MASK, vram); \
tileData >>= 8 * shift; \
for (; outX < end; ++outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
} else { \
int start = outX; \
outX = end - 1; \
if (end2 > start) { \
} else { \
int start = outX; \
outX = end - 1; \
if (end2 > start) { \
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
for (; outX >= end2; --outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
charBase += 4; \
} \
\
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
for (; outX >= end2; --outX) { \
for (; outX >= renderer->start; --outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
charBase += 4; \
} \
\
LOAD_32(tileData, charBase & VRAM_BLOCK_MASK, vram); \
for (; outX >= renderer->start; --outX) { \
BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \
} \
}