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 :)
Setting 333MHz question
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.
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.
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:
btw, I thought sceKernelLoadExec() reboots the kernel so would the CPU change stay in effect?
heres my code:
Code: Select all
#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.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: Select all
#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; }
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);