all repos — mgba @ a8dae9b9d5546a2fdfdea3674e813a7883d913df

mGBA Game Boy Advance Emulator

GBA Video: Fix modes 3 and 5 with RGB565 pixel format
Jeffrey Pfau jeffrey@endrift.com
Mon, 16 Mar 2015 20:32:02 -0700
commit

a8dae9b9d5546a2fdfdea3674e813a7883d913df

parent

20aae1202a22ecda2313f77c141f3a288c23500f

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -1526,6 +1526,12 @@ color32 |= (color << 3) & 0xF8;

color32 |= (color << 6) & 0xF800; color32 |= (color << 9) & 0xF80000; 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 {

@@ -1609,6 +1615,12 @@ color32 |= (color << 9) & 0xF80000;

color32 |= (color << 3) & 0xF8; color32 |= (color << 6) & 0xF800; 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 {