Page 1 of 1

Incorrect RGB conversion

Posted: Mon May 19, 2014 4:50 pm
by Zenju
Hi,

for the Windows port the RGB565 to RGB32 is implemented as:

Code: Select all

#define CONVERT_16_TO_32(pixel) 
    (((((pixel) >> 11)        ) << /*RedShift+3*/  19) | 
     ((((pixel) >> 6)   & 0x1f) << /*GreenShift+3*/11) | 
     (((pixel)         & 0x1f) << /*BlueShift+3*/ 3))
The green pixel needlessly is stripped off its least significant bit, i.e. instad of 6 it is treated as a 5-bit color. Here's the fix:

Code: Select all

     ((((pixel) >> 5)   & 0x3f) << /*GreenShift+2*/10) | 
Regards, Zenju

Re: Incorrect RGB conversion

Posted: Tue Jun 03, 2014 10:47 pm
by adventure_of_link
Moved to Public Dev. :)

Re: Incorrect RGB conversion

Posted: Wed Jun 04, 2014 6:13 pm
by OV2
I've already applied it. Now I just need to find some time for xbrz...

Re: Incorrect RGB conversion

Posted: Wed Jun 11, 2014 6:12 am
by MELERIX
how this can be 16 bit to 32 bit RGB conversion ? if the SNES work with 15 bit BGR.

http://wiki.superfamicom.org/snes/show/Palettes