GP2X Startup / Quit Code


GernotFrisch

Member
Joined
Jan 2, 2007
Messages
445
Someone sais, that he must start another game before he starts mine. Strange. What are "others" (I'll get the game in detail later, hopefully) do when starting the program? Do I have to clean/set some registers?

Also, when I quit i do:
Code:
void QuitMe()
{
   delete gMyAllocatedStuff();
   SetCurrentDir("/usr/gp2x");
   system("./gp2xmenu &");
   exit(0);
}

It works about 10% of the time. Am I missing something? I use mmu_hack and blitter code.
 
You should:

Clean up blitter (ie. if the blitter was disabled when your program started, you should disable it before leaving).
Unmap any memory mapped
Close any open file descriptors
Run gp2xmenu as follows:

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

(do not put anything after the 'execl', it is not required)
 
I prefer not having the application automatically open gp2xmenu, naming it i.e. 'executable' then having a small script 'executable.gpe' that just runs:
Code:
./executable
exec /usr/gp2x/gp2xmenu

It makes me feel better or something...
 
Mudi posted on Feb 8 2007 at 05:25 PM said:
I prefer not having the application automatically open gp2xmenu, naming it i.e. 'executable' then having a small script 'executable.gpe' that just runs:
Code:
./executable
exec /usr/gp2x/gp2xmenu

It makes me feel better or something...

it makes it compatible with gmenu2x also if u do it using a script. Another way would be to add a command line paramter to disable the loading of the default menu so that the wrapper in gmenu2x can be used :)
 
Last edited by a moderator:
Back
Top