all repos — mgba @ 48cf8448c161b51f49d7ee0aa87303c329487d57

mGBA Game Boy Advance Emulator

GBA Video: Finish mColor cleanup
Vicki Pfau vi@endrift.com
Wed, 02 Aug 2017 23:42:38 -0700
commit

48cf8448c161b51f49d7ee0aa87303c329487d57

parent

05c2fc3e0d4cec701af25581cbb6b807b16b66a9

1 files changed, 1 insertions(+), 29 deletions(-)

jump to
M src/gba/renderers/software-bg.csrc/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;