GP2X Fceu-0.3 Optimization For Gp2x.


zzhu8192

Still Fresh
Joined
May 10, 2006
Messages
50
Location
Austin, TX
Website
www.unicorn-jockey.com
I've been doing some optimization on the fceu-0.3 source. I've gotten it to run at pretty much full speed without frame-skipping. Video, sound, and input work, but the problem is that the sprites seem to be screwed up. Since compiling the exact same source for x86 target seems to work perfectly, I have to assume that the cross compiler gcc I built is messed up. The thing is, I'm using the script to build the gcc cross env that everyone else is using (i.e. I didn't change flags to configure in the script) . I've tried building gcc 4.0.2, 4.0.3, and 4.1.0 as arm-cross compilers, and all have the sprite problem. Actually 4.1.0 is even worse. I lose sound for some reason. :huh:
I've tried this with -O, -O2, -O3, and no -O (which produces pretty slow binaries)

I'm running on slackware 10.2 . Has anyone else run into similar issues? Thanks!
 
I had some problems with sprites in C-Dogs. It used it's own graphics file format which had the palette as an array of structures with 3 byte fields. On my x86 PC, it worked fine but on the arm it packed the structures to 4 bytes.
using __attribute__((__packed__)) fixed it, i.e.

Code:
struct RGB {
		unsigned char red, green, blue;
} __attribute__((__packed__));

Could your problem by related?
 
Parkydr posted on May 12 2006 at 05:20 PM said:
I had some problems with sprites in C-Dogs. It used it's own graphics file format which had the palette as an array of structures with 3 byte fields. On my x86 PC, it worked fine but on the arm it packed the structures to 4 bytes.
using __attribute__((__packed__)) fixed it, i.e.

Code:
struct RGB {
		unsigned char red, green, blue;
} __attribute__((__packed__));

Could your problem by related?
It's a good idea, but I already did
#pragma pack(1)
on pretty much every file that matters. No help.
 
Last edited by a moderator:
GCC seems to ignore #pragma pack most of the time, you should try the attribute method instead.
 
Back
Top