GP2X Gp2x Rgb Format


craigix

Mega GP Mania
Joined
Feb 3, 2003
Messages
11,008
Location
England
Website
twitter.com
I don't suppose anyone can recommend a program for windows which converts say a BMP to the raw GP2X RGB format?

How are you guys who are not using SDL handling this?

I am using a program from the GP32 days but the GP32 hi-colour format is slightly different meaning I have to convert it on the GP2X on the fly.

Just wondering if there is a nicer solution?
 
im saving as 24bit raw using irfenview and then im using this little code from robster
CODE
for (i=0; i<(720*288); i++)
{
//printf(" %X;",i);
r = (unsigned short)(foo[IMG_OFFSET + (i*3) + 0]);
g = (unsigned short)(foo[IMG_OFFSET + (i*3) + 1]);
b = (unsigned short)(foo[IMG_OFFSET + (i*3) + 2]);
r >>= 3;
g >>= 2;
b >>= 3;
c565 = (r << 11) + (g<<5) + b;
new_fb = c565;
}

Adjust the resolution and change the new_fb = c565; into a printf, compile the code and let it output into a header file to #include on the gp.
 
My code is virtually identical, apart from the fact I use division rather than shifts, leaving the compiler to do the optimisation for me. I also do it at runtime.
 
Back
Top