GP2X Allegro Patches V0.2


gfoot

Member
Joined
Nov 15, 2005
Messages
218
Get gp2xallegro-0.2.diff.gz and see the last thread for setup instructions. Pay attention to the configure line I posted before.

You can also get the compiled demo game if you like - unzip and copy to SD card as usual.

The FLI player still doesn't work, and I'm not sure why. So the splash screen doesn't come on properly. There's also a bit of a pause while it loads the 8Mb of MIDI patches before the title screen, but after that things work pretty much ok.

The graphics driver currently only supports 8bpp and 16bpp, doesn't support large virtual screens (scrolling, page flipping, triple buffering). These things are pretty easy to fix. It also doesn't support hardware blitting yet - I'm not sure how to do this yet, need more info from those who have researched it.

Other than that, most things seem to "just work" - if anything is broken let me know or maybe fix it yourself. :)
 
Last edited by a moderator:
gfoot posted on Dec 23 2005 at 12:39 AM said:
Get gp2xallegro-0.2.diff.gz and see the last thread for setup instructions. Pay attention to the configure line I posted before.

You can also get the compiled demo game if you like - unzip and copy to SD card as usual.

The FLI player still doesn't work, and I'm not sure why. So the splash screen doesn't come on properly. There's also a bit of a pause while it loads the 8Mb of MIDI patches before the title screen, but after that things work pretty much ok.

The graphics driver currently only supports 8bpp and 16bpp, doesn't support large virtual screens (scrolling, page flipping, triple buffering). These things are pretty easy to fix. It also doesn't support hardware blitting yet - I'm not sure how to do this yet, need more info from those who have researched it.

Other than that, most things seem to "just work" - if anything is broken let me know or maybe fix it yourself. :)

Oh yes! I have been waiting for these. Sword Of Fargoal.. here I come! ;-)


David
 
Last edited by a moderator:
I don't know anything about cross-compiling Unix Allegro from Windows, I guess it would work but you'd probably need a pretty hefty cygwin environment to support running the configure script.

If I get some motivation I might do it, but now that it's basically working I'd kind of like to make a game instead. :)

If someone does sort it out, they could provide a precompiled version which doesn't require cygwin, to make it easier for other people.
 
gfoot posted on Dec 26 2005 at 03:46 AM said:
OK, I've had a look at this now. I couldn't be bothered to install cygwin, but the libraries built by the Unix Open2x toolchain seem to work fine.

http://www.glost.eclipse.co.uk/gfoot/gp2x/...o-prebuilt.html

Let me know if you have any problems with it.


works perfectly with devkitgp2x under win32 :)

but, how to use Joystick function with Allegro for gp2x ?
 
Last edited by a moderator:
The joystick works exactly like a normal Allegro joystick. The best reference for that is probably exjoy.c. If you apply my patch (v0.2), it'll work properly on the gp2x too, so you can see it responding and hack it about if you like. Without the patch it'll get stuck waiting for keypresses.

Code:
    install_joystick(JOY_TYPE_AUTODETECT);
    ...
    poll_joystick();
    if (joy[0].stick[0].axis[0].d1) x--;
    if (joy[0].stick[0].axis[0].d2) x++;
    if (joy[0].stick[0].axis[1].d1) y--;
    if (joy[0].stick[0].axis[1].d2) y++;
    if (joy[0].stick[0].button[0].b) fire();    // B button
    if (joy[0].stick[0].button[1].b) fire2();  // X button

If you prefer, you can treat it as an analog stick:

Code:
    poll_joystick();
    x += joy[0].stick[0].axis[0].pos;
    y += joy[0].stick[0].axis[1].pos;

There are 7 buttons mapped - B, X, A, Y, L, R, Click. joy[0].stick[0].button[n].desc is a string giving the button's name, if you get confused. The other buttons aren't mapped - I was going to hardcode the volume control, and perhaps make start and select put characters in the keyboard buffer, but I'm not sure about that.
 
Back
Top