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 

Running "sleep-program" in background...

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



Joined: 11 Jan 2008
Posts: 3

PostPosted: Sat Jan 19, 2008 11:16 pm    Post subject: Running "sleep-program" in background... Reply with quote

Is it possible to run a program in the background that shuts the psp down after a specific time. Kind of like the sleep function in the origional FW, but the original sleep function doesn't shuts the psp down until all mp3's have stopped playing for example.

I want my program to shut the psp down completly after the time i set up.
Any tutorial or example i can look at?

Great forum by the way!!!
Back to top
View user's profile Send private message
Hellcat



Joined: 24 Jan 2007
Posts: 84

PostPosted: Sun Jan 20, 2008 2:18 am    Post subject: Reply with quote

Simple idea:

Grab the current system time and calculate when it's time to shutdown (or however you wanna do that part....)

Then make a loop that spends its most time with sceKernelDelayThread() so it doesn't pull 100% CPU load and drains the battery.
When this loop "detects" that it's bedtime, call scePowerRequestStandby(), and OFF you go - literaly :)

Simply, but should do it....
Back to top
View user's profile Send private message
manflesh



Joined: 11 Jan 2008
Posts: 3

PostPosted: Sun Jan 20, 2008 4:37 am    Post subject: Reply with quote

Ok, can I just "return to the XMB" after the program has been started, and the program will continue to run in the background?

I have only made programs with graphics etc. so far where I exit my program to return to XMB.
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Sun Jan 20, 2008 5:23 am    Post subject: Reply with quote

Hi! :)
manflesh wrote:
Ok, can I just "return to the XMB" after the program has been started, and the program will continue to run in the background?

You have to code a module (a prx that you have to put in your ms0:/seplugin directory and activate through recovery).
Here there's a tutorial:
http://ps2dev.org/psp/Tutorials/PSP_Modules,_Exports,_Imports_and_Patches.download

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
manflesh



Joined: 11 Jan 2008
Posts: 3

PostPosted: Sun Jan 20, 2008 7:10 am    Post subject: Reply with quote

Aha, great, thanks!!!
Back to top
View user's profile Send private message
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