I've uploaded some preliminary patches against Allegro 4.2.0, to make it build for the GP2X. It's not yet complete - see the end of the post for a list of what's working and what isn't. You can download the patches at http://gfoot.homeip.net/~gfoot/gp2x/gp2xallegro-0.1.diff.gz
Initially I was using the SDK from gp32spain, but it doesn't seem to work properly either for my joystick reading in Allegro or for rlyeh's minimal library examples. Open2x works fine though, and I'd highly recommend upgrading to it.
What works:
Initially I was using the SDK from gp32spain, but it doesn't seem to work properly either for my joystick reading in Allegro or for rlyeh's minimal library examples. Open2x works fine though, and I'd highly recommend upgrading to it.
- Unpack Allegro: tar -xzf allegro-4.2.0.tar.gz
- cd allegro-4.2.0
- Apply patches: gunzip -c gp2xallegro-0.1.diff.gz | patch -p1
- Configure - see below.
- Build: make && make install
- To link into your own programs, use `/opt/gp2xallegro/bin/allegro-config --static ...` with --cflags and/or --libs as appropriate. I might rename allegro-config to gp2x-allegro-config, so you could path the directory and not conflict with a native Allegro installation.
Code:
LDFLAGS=-static ./configure --host arm-open2x-linux --without-x --enable-lgp2x --enable-static --disable-shared --disable-modules --prefix=/opt/gp2xallegro --enable-dbglib --enable-dbgprog
What works:
- GFX_FBCON graphics driver at 320x240 16bpp
- Joystick support via custom GP2X joystick driver
- Sound seems to work, I haven't tested it much though, it's just standard Linux stuff
- Non-hardware stuff, obviously - datafiles, fixed point math routines, etc
- Timers - I'm not convinced they're working properly
- FLI player - probably due to the timer issues
- MIDI player - again probably due to timer issues
- Keyboard - I might hook up the buttons to generate key events, for best compatibility, but that might also get in the way, and in any case the buttons don't generate interrupts so you'd need to poll the keyboard, which most games don't bother doing. For now, recode to use joystick only.
- Page flipping / triple buffering / video bitmaps - I wonder how necessary these are. Maybe you can just write GPIO registers to map the framebuffer from your own address space or something.
- The demo game - it currently crashes just as the game is about to start, needs more debugging.