| View previous topic :: View next topic |
| Author |
Message |
manflesh
Joined: 11 Jan 2008 Posts: 3
|
Posted: Sat Jan 19, 2008 11:16 pm Post subject: Running "sleep-program" in background... |
|
|
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 |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Sun Jan 20, 2008 2:18 am Post subject: |
|
|
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 |
|
 |
manflesh
Joined: 11 Jan 2008 Posts: 3
|
Posted: Sun Jan 20, 2008 4:37 am Post subject: |
|
|
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 |
|
 |
sakya
Joined: 28 Apr 2006 Posts: 190
|
Posted: Sun Jan 20, 2008 5:23 am Post subject: |
|
|
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 |
|
 |
manflesh
Joined: 11 Jan 2008 Posts: 3
|
Posted: Sun Jan 20, 2008 7:10 am Post subject: |
|
|
| Aha, great, thanks!!! |
|
| Back to top |
|
 |
|