#576 - XyzZyx - Wed Jan 08, 2003 9:41 pm
I just managed to load graphics onto the screen! But something seems to be wrong with the palette. I have all the RGB values with each color in range 0-255 and am trying to do a real-time conversion into the 15-bit format the gameboy uses. Here is the formula I came up with:
u16 rgb = (r >> 3) | (g >> 3) << 5 | (b >> 3) << 10;
I don't know, have I mixed the bit positions or something? Thanks.
u16 rgb = (r >> 3) | (g >> 3) << 5 | (b >> 3) << 10;
I don't know, have I mixed the bit positions or something? Thanks.