Hi,
I searched docs, couldn't find the answer so posting question here...
In the function call:
void pgBitBlt(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d);
what is the pixel format for the byte array referenced by last parameter *d ?
Is is 32bpp rgb or 16bpp rgb or something else?
Thanks for the help.
Thanks,
Tony
Pixel format for pgBitBlt call's byte array parameter
Yeah, that's the format as far as I can tell. I use this snippet to convert 24bpp RGB to the format the PSP VRAM uses:
I got the code from somewhere on this forum, and it's helped me to write a function for loading BMPs for game graphics from the mem card, which is nice.
Code: Select all
unsigned short gfxRGB(unsigned char r,unsigned char g,unsigned char b)
{
return ((b&0xf8)<<7)+((g&0xf8)<<2)+((r&0xf8)>>3)+0x8000;
}
Re: Pixel format for pgBitBlt call's byte array parameter
For a start it's BGR (Blue, Green, Red) rather than the standard sequence of RGB. Secondly the mode is changeable, nem's defauls to 16 bits, there is also appear to be other modes which might well be 32 bit, but I am not sure if anyone has posted the information.biermana wrote:
Is is 32bpp rgb or 16bpp rgb or something else?