My Allegro Adventures


deps

Still Fresh
Joined
Jul 23, 2007
Messages
31
Age
43
Location
Sweden
Website
Visit site
Hi all,

While I'm waiting for my GP2X to arrive I figured I could just as well get a toolchain up and running.
I think I have Allegro up and running. I can compile it using devkitGP2X and I don't get any compile or linker errors, but does it work? I have to wait some more days to find out. But there is some questions.
  • I might have done something wrong, but the result have .exe at the end. (even when I use the devkit gcc) Can i just rename it to make it appear in the GP2X menu?
  • Do I have to upload something else to the GP2X to make Allegro powered games to work? I link it with -static, does that mean that I don't have to worry about any Allegro files?
  • I haven't used Allegro in a couple of years, and never on a GP2X is there something regular Allegro can do that the GP2X can't?
Thank you.
 
You should be generating a .gpe file for the gp2x..

If you do - 'file output.exe' - does it say 'something' like:
"ELF 32bit LSB executable ARM version 1 for Linux 2.4.3 statically linked"..

If so then that file is the .gpe (gp2x executable) that will/should run on the gp2x.
It _has_ to be .gpe for the gp2x menu to find it (utilities are .gpu).

I'm using allegro at the moment and it works fine.. (using open2x toolchain) :)

Also make sure you've added the patch to gfoot's allegro to get access to all gp2x buttons.
There are other issues with allegro (like the black screen at start) you may come across (easy to sort out - uninitialised blitter); but cross that bridge when you come to it.
 
Thanks for the quick reply! :)

I did not have the "file" command, I'm using Dev-Cpp on WinXP. But I have a hex editing app and the beginning of the exe file did have ELF, so I guess it will work then. Right? :)

The filesize is 1.38MB, I get the feeling that Allegro is therefore statically linked. Correct? The Win32 one was about 20Kb and doesn't link with -static.


Edit: I have not added any patches. Guess I should look into it then. I just unzipped gfoots GP2X version into the devkitGP2X dir.
Thanks.

Edit2: Also, I see that some examples uses a shellscript to start the game and restore the GP2X menu, why is that? The SDL examples doesn't do it like that.
 
deps said:
Thanks for the quick reply! :)
No problem.

deps said:
I did not have the "file" command, I'm using Dev-Cpp on WinXP. But I have a hex editing app and the beginning of the exe file did have ELF, so I guess it will work then. Right? :)
Not necessarily - all ELF files (an executable format) have this at the start whatever binary image they are.
Use a hex editor and 'near the end' there will be a load of strings - search for "r_ARM_PC24" - if htat's there you should be okay - I'm sure there's probably a windows/dos version of the unix command 'file' though.

deps said:
The filesize is 1.38MB, I get the feeling that Allegro is therefore statically linked. Correct? The Win32 one was about 20Kb and doesn't link with -static.
Sounds like it.

deps said:
Edit: I have not added any patches. Guess I should look into it then. I just unzipped gfoots GP2X version into the devkitGP2X dir.
There are a couple of issues with the downloadable gp2x allegro - I have a version that ensures there is no blackscreen problem (easy to fix in a number of ways) and also I think the vsync code was wrong (hence parallax.gpe flickered) - again wait until you have the gp2x before worrying about this stuff.

deps said:
Edit2: Also, I see that some examples uses a shellscript to start the game and restore the GP2X menu, why is that? The SDL examples doesn't do it like that.
Don't know - I think if you look through posts on this forum, most things seem to restart gmenu2x after the program has run - SDL apps should be no different.
 
Last edited by a moderator:
deps said:
Edit2: Also, I see that some examples uses a shellscript to start the game and restore the GP2X menu, why is that? The SDL examples doesn't do it like that.
The script is used so that after the game has finished the menu is loaded (as you said). Some games load the menu in their main executable, as they quit.
 
Last edited by a moderator:
r_ARM_PC24 was found near the end. :)

An SDL example used this at the end
CODE
chdir("/usr/gp2x");
execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);

I guess it would work in Allegro too, but since some examples used a shellscript I got a bit confused. But if there is no problems doing it like this then it's what I'm going to do. :)

Thank you for answering my questions!
 
I prefer to restart the menu in the shell script:

1) If the game crashes, you'll still get back to the menu
2) if you're debugging over telnet, it's a pain in the arse if the menu keeps coming back.
3) If you wanted to run anything else after the game exits, you can't
 
Parkydr said:
I prefer to restart the menu in the shell script:
It was the way I was going to go before I saw this.
Parkydr said:
1) If the game crashes, you'll still get back to the menu
Mmm.. software.. crashing - sorry don't understand :)
Parkydr said:
2) if you're debugging over telnet, it's a pain in the arse if the menu keeps coming back.
3) If you wanted to run anything else after the game exits, you can't
Yeah, during dev, fair enough - I always run via telnet.. but when it's released I (now) reckon it's the tidiest thing to do.
 
Last edited by a moderator:
Back
Top