GBA Video: Improve mode 2 speed

This commit is contained in:
Vicki Pfau 2019-11-11 00:32:19 -08:00
parent 0675991538
commit 24c603b62d
1 changed files with 5 additions and 3 deletions

View File

@ -36,14 +36,16 @@
pixelData = charBase[(mapData << 6) + ((localY & 0x700) >> 5) + ((localX & 0x700) >> 8)]; pixelData = charBase[(mapData << 6) + ((localY & 0x700) >> 5) + ((localX & 0x700) >> 8)];
#define MODE_2_LOOP(MOSAIC, COORD, BLEND, OBJWIN) \ #define MODE_2_LOOP(MOSAIC, COORD, BLEND, OBJWIN) \
for (outX = renderer->start, pixel = &renderer->row[outX]; outX < renderer->end; ++outX, ++pixel) { \ int condition = renderer->end - renderer->start; \
pixel = &renderer->row[renderer->start]; \
for (outX = 0; outX < condition; ++outX) { \
x += background->dx; \ x += background->dx; \
y += background->dy; \ y += background->dy; \
\ \
uint32_t current = *pixel; \
MOSAIC(COORD) \ MOSAIC(COORD) \
if (pixelData) { \ if (pixelData) { \
COMPOSITE_256_ ## OBJWIN (BLEND, 0); \ uint32_t current = pixel[outX]; \
COMPOSITE_256_ ## OBJWIN (BLEND, outX); \
} \ } \
} }