GP2X Can't Start Gp2xmenu 2nd Time


GernotFrisch

Member
Joined
Jan 2, 2007
Messages
445
Very strange here.

After quitting SDL, I do this:
CODE
chdir("/usr/gp2x");
execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);


While this works for the first time, after playing the game a 2nd time, some process freezes.
I mean, the printf before that code gets executed, the one after it does not. However, the menu is not popping up.
When I press Ctrl+C (devboard) and type gp2xmenu, it starts normally.

Please help :(
 
Don't know. Are you using the Wiz launcher (for gpe) or the Wiz game (for ini) menu?

Also, this is what I usually use:

chdir("/usr/gp2x");
execl("gp2xmenu","gp2xmenu",NULL);

Maybe your app is trashing some memory? I wouldn't have thought so though being that linux is normally pretty quick about seg faulting you, but if your trashing your own memory space, it's possible.
 
Use a wrapper script anyway; this way if your app crashes, the script can invoke the launcher anyway. (Furthermore, it gives an easy place for the user to stick in cpufreak and other mods, or post-run logging or whatever.) I hate when people put exec(launcher) in the tail of their app or atexit() :)

jeff
 
I hate GPH for not doing the loader correctly in the first place, so that it handles this for you >_> I should migrate to a wrapper script too, though, you're right about it being a better solution.

I've actually had problems with execl on Wiz not working with anything but current directory binaries, hence the need for the chdir. So Squidge's suggestion to remove the absolute path from the execl might help.
 
Last edited by a moderator:
Well, I know that the problem is with GLBasic.
The Compiler is hardcoding the return to the System menu,
I'd very much prefer, as stated above, that this not happen.
The application should end as the author of the code wants it to.
So that the author calls the main system menu or NOT.
With the project I am working on,
I definitely do not want GLBasic to call the main system menu on exit.
And since removing this code would likely solve the problem.
Cant we try it?
-DEJ
 
GLBasic first tries to open a gp2xmenu.pge and a gp2xmenu.gpu form the binaries directory. You can adjust this script. It was the reccommended way for the GP2X, so I guess that makes sense.

I had the ralative path, too but it was the same result.
How can I check what process is actually freezing?
I mean, in the console, I see that the execl is executed, but not returning and nothing else gets printed. I must Ctrl+C to get a console window. I'd like to see which process acually freezes, so I can see if it's the menu or my program.

I'm starting the programs with then ini-SD-Game menu, yes. But with the launcher the same happens.
 
Back
Top