GBA Video: Finish mColor cleanup
Vicki Pfau vi@endrift.com
Wed, 02 Aug 2017 23:42:38 -0700
1 files changed,
1 insertions(+),
29 deletions(-)
jump to
M
src/gba/renderers/software-bg.c
→
src/gba/renderers/software-bg.c
@@ -103,21 +103,6 @@
if (!mosaicWait) { LOAD_16(color, ((localX >> 8) + (localY >> 8) * VIDEO_HORIZONTAL_PIXELS) << 1, renderer->d.vram); color = mColorFrom555(color); -#ifndef COLOR_16_BIT - unsigned color32; - color32 = 0; - color32 |= (color << 3) & 0xF8; - color32 |= (color << 6) & 0xF800; - color32 |= (color << 9) & 0xF80000; - color32 |= (color32 >> 5) & 0x070707; - color = color32; -#elif COLOR_5_6_5 - uint16_t color16 = 0; - color16 |= (color & 0x001F) << 11; - color16 |= (color & 0x03E0) << 1; - color16 |= (color & 0x7C00) >> 10; - color = color16; -#endif mosaicWait = mosaicH; } else { --mosaicWait;@@ -194,20 +179,7 @@ BACKGROUND_BITMAP_ITERATE(160, 128);
if (!mosaicWait) { LOAD_16(color, offset + (localX >> 8) * 2 + (localY >> 8) * 320, renderer->d.vram); -#ifndef COLOR_16_BIT - unsigned color32 = 0; - color32 |= (color << 9) & 0xF80000; - color32 |= (color << 3) & 0xF8; - color32 |= (color << 6) & 0xF800; - color32 |= (color32 >> 5) & 0x070707; - color = color32; -#elif COLOR_5_6_5 - uint16_t color16 = 0; - color16 |= (color & 0x001F) << 11; - color16 |= (color & 0x03E0) << 1; - color16 |= (color & 0x7C00) >> 10; - color = color16; -#endif + color = mColorFrom555(color); mosaicWait = mosaicH; } else { --mosaicWait;