I found this snippet which convers RGB colors down to the 4byte madness that is the psp's color space:
Code: Select all
unsigned short rgb2col(unsigned char r,unsigned char g,unsigned char b){return ((((b>>3) & 0x1F)<<10)+(((g>>3) & 0x1F)<<5)+(((r>>3) & 0x1F)<<0)+0x8000);}
Here is my pathetic contribution to the pg.c library ;)
Code: Select all
unsigned short pgGetPixel(int x, int y)
{
unsigned short *vptr0 = pgGetVramAddr(0,0);
return vptr0[y * LINESIZE + x];
}
sorry if this has been brought up before, a search didn't lead me to the answers I was looking for, but if its in here somewhere a link to a similar thread would be appreciated as much as a straight answer.
Thanks in advance,
-Harold