forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

atexit does not work

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Tue Nov 25, 2008 3:58 am    Post subject: atexit does not work Reply with quote

I tried to use the stdlib function at exit so that it would save settings when yes on the homescreen is pressed and i couldnt get it to work i even added exit(EXIT_SUCCESS) in to the exit callback then it just crashes how can i get this to work so far my program calls osl_quit = 1; and sceKernelExitGame() in the exit_callback but if i try to call the function directly the psp crashes if i call exit() it crashes so what am i to do and if i have it save in the main after osl_quit = 1 then it doesnt even get called cause it doesnt reach it
Back to top
View user's profile Send private message MSN Messenger
Badboy_



Joined: 09 Aug 2008
Posts: 4

PostPosted: Tue Nov 25, 2008 5:41 am    Post subject: Reply with quote

put your save_settings call in the exit callback...
Back to top
View user's profile Send private message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Tue Nov 25, 2008 8:24 am    Post subject: Reply with quote

tried that it crashes the psp when i do so
Back to top
View user's profile Send private message MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Nov 25, 2008 1:20 pm    Post subject: Reply with quote

Sounds more like one of the exit functions is crashing. You might try putting debug prints in them and see how far it gets.
Back to top
View user's profile Send private message AIM Address
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Sat Nov 29, 2008 3:58 am    Post subject: Reply with quote

i got it to work my main has to return 0 for it to work
Back to top
View user's profile Send private message MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Nov 29, 2008 6:21 am    Post subject: Reply with quote

coolkehon wrote:
i got it to work my main has to return 0 for it to work


Ah... a lot of people think that because the PSP has its own exit function, they don't need to return something from main()... I do it anyway to suppress the warning, but I guess it really is needed. :)
Back to top
View user's profile Send private message AIM Address
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Sat Nov 29, 2008 7:29 am    Post subject: Reply with quote

no i had it return one before but it was never reached because sceKernelExitGame was called before return 0;


Code:
int main(whatever)
{
sceKernelExitGame();
return 0;
}
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group