 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
zshadow
Joined: 26 Dec 2005 Posts: 42
|
Posted: Thu Mar 30, 2006 8:43 am Post subject: Setting 333MHz question |
|
|
Theres a program that I would like to run @ 333MHz
would it be possible to start up an eboot from vsh, have it set the cpu speed, then load the desired program?
if someone could give me sample code that I could build off of or compile itd be greatly appreicated :) |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Thu Mar 30, 2006 3:09 pm Post subject: |
|
|
what you need is inside psppower.h
you change the cpu speed in the first lines of your code |
|
| Back to top |
|
 |
Gary13579
Joined: 15 Aug 2005 Posts: 93
|
Posted: Sat Apr 01, 2006 6:20 am Post subject: |
|
|
The function you want is scePowerSetCpuClockFrequency. Something like scePowerSetCpuClockFrequency(333);
You may even want to use scePowerSetClockFrequency (scePowerSetClockFrequency(333, 333, 166);). That will change everything so it can run as fast as it can.
You then want to do
sceKernelLoadExec("ms0:/PSP/GAME/FOLDER/EBOOT.PBP", struct SceKernelLoadExecParam *param);
I'm not sure what you need to set the SceKernelLoadExecParam to, I am not at my home PC and cannot find the struct definition online right now. It should be stored in pspkernel.h. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Sat Apr 01, 2006 10:06 am Post subject: |
|
|
| Gary13579 wrote: |
You then want to do
sceKernelLoadExec("ms0:/PSP/GAME/FOLDER/EBOOT.PBP", struct SceKernelLoadExecParam *param);
|
sceKernelLoadExec("ms0:/PSP/GAME/FOLDER/EBOOT.PBP", 0); _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
zshadow
Joined: 26 Dec 2005 Posts: 42
|
Posted: Mon Apr 03, 2006 11:40 am Post subject: |
|
|
I tried it.. but the EBOOT won't load, gives me "The game could not be started" error 80010002. :/
btw, I thought sceKernelLoadExec() reboots the kernel so would the CPU change stay in effect?
heres my code:
| Code: | #include <pspkernel.h>
#include <pspdebug.h>
#include <psppower.h>
#define printf pspDebugScreenPrintf
/* Define the module info section */
PSP_MODULE_INFO("CPU", 0, 1, 1);
int main(int argc, char *argv[])
{
scePowerSetClockFrequency(333, 333, 166);
pspDebugScreenInit();
pspDebugScreenPrintf("Loading RunUMD..\n");
sceKernelLoadExec("ms0:/PSP/GAME/RunUMD/EBOOT.PBP", 0);
return 0;
}
|
|
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Apr 03, 2006 3:31 pm Post subject: |
|
|
| zshadow wrote: | I tried it.. but the EBOOT won't load, gives me "The game could not be started" error 80010002. :/
btw, I thought sceKernelLoadExec() reboots the kernel so would the CPU change stay in effect?
heres my code:
| Code: | #include <pspkernel.h>
#include <pspdebug.h>
#include <psppower.h>
#define printf pspDebugScreenPrintf
/* Define the module info section */
PSP_MODULE_INFO("CPU", 0, 1, 1);
int main(int argc, char *argv[])
{
scePowerSetClockFrequency(333, 333, 166);
pspDebugScreenInit();
pspDebugScreenPrintf("Loading RunUMD..\n");
sceKernelLoadExec("ms0:/PSP/GAME/RunUMD/EBOOT.PBP", 0);
return 0;
}
|
|
Your app is running in user mode, user mode apps only can start programs from discs, not from memory sticks. You need to run in kernel mode.
To run in kernel mode, change this line
PSP_MODULE_INFO("CPU", 0, 1, 1); to
PSP_MODULE_INFO("CPU", 0x1000, 1, 1); and add this one:
PSP_MAIN_THREAD_ATTR(0); |
|
| Back to top |
|
 |
|
|
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
|