Exiting To Menu


thetooth

Still Fresh
Joined
Feb 1, 2010
Messages
11
I am currently writing an app for the wiz but for some reason its not exiting to the menu. i am using the exit script from the example file and can't seem to find whats stopping it...
I have tried clearing any more calls at the end of the file but no use... it appears to exit fine its just the signal to restart the menu never gos threw.
Code:
//at exit is set in main function
atexit(Terminate);

// Terminate contents Note: it is inside a header file so perhaps is unreachable?
void Terminate(void){
	SDL_Quit();
    #ifdef GP2X
		chdir("/usr/gp2x");
		execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
    #endif
    #ifdef WIN32
		fprintf (stdout, "\nExit to menu...\n");
    #endif
}

//Exit is triggerd by exiting the main loop. the only other code is return 0;
any ideas? i have tryed calling SDL_Quit() before return to no effect...
 
hmmm after looking at somethings i do beleave i have corrupted my firmware... no flash browser or built in games :p nor can i mount the nand for viewing over usb.
i'm going to reflash it and see if that helps... somethings just not right with the file system.

Edit: dot dot dot this is taking ages lol

Edit2:
P1020261.JPG


Uhhh well if anyone can make sense of this it would really help but what i am seeing is "Loadin'..." however this is printed when starting the app yet it appears after SDL has exited?
 
u9i said:
Here's another idea. Is GP2X actually defined anywhere?
I thought that also but yeah it is. i am using it to set some text in the gui and it works fine.

Its set in the compiler using -DGP2X
 
Last edited by a moderator:
I wouldn't execute the menu from within your program. For example if your executable segfaults, the menu would not be started.

IMO a wrapper script is a better idea:

Code:
#!/bin/sh

./your_executable
cd /usr/gp2x
exec ./gp2xmenu
 
In GLBasic I do this:
-name my program "gp2xwiz.prg"
-make a script called "thegame.gpe"
-in that script call the .prg file
-after the prg file call the menu

I think that's the most convenient way for all. Geeks can exchange that to GMenu2X, and noobs will get what they expect.
 
KungPhoo said:
In GLBasic I do this:
-name my program "gp2xwiz.prg"
-make a script called "thegame.gpe"
-in that script call the .prg file
-after the prg file call the menu

I think that's the most convenient way for all. Geeks can exchange that to GMenu2X, and noobs will get what they expect.

Tryed both ideas... when trying to run the .sh from termula its unable to find the file at all and is trying to look in /dev/arp for the binary >.>
With the shell script in the .gpe results in hang at loading screen. I've trying setting the path to the binary manually yet still the same results.

Edit: tryed running the app from termula directly again... runs fine only both apps are fighting over the display and input and the only exit message is "Profiling timer expired"... what?

Edit2: FFFFFUUUUUU was the damn IDE's profiling crap... the reason for that exit mesage... no idea why but it must be crashing or preventing SDL from exiting properly and therefore taking out the menu when it trys to attach to the display device.
 
Last edited by a moderator:
Back
Top