Is there a way to set the cpu clock frequency on 1.5 and when you exit that program, the clock still remains at the frequency set.
Thanks
scePower Question
Ok, I've read that only via a loadmodule will the cpu be able to stick at the rate I've set so I came up with the following code but I'm unable to load the module. I get a 80020001 error code.
Any help? Thanks.
Code: Select all
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <pspmoduleinfo.h>
/* Define the module info section */
//PSP_MODULE_INFO("CPU Test", 0, 0, 71);
PSP_MODULE_INFO("CPU TEST", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
/* Define printf, just to make typing easier */
#define printf pspDebugScreenPrintf
/**
* Function that is called from _init in kernelmode before the
* main thread is started in usermode.
*/
__attribute__ ((constructor))
void loaderInit()
{
pspKernelSetKernelPC();
pspSdkInstallNoDeviceCheckPatch();
pspSdkInstallNoPlainModuleCheckPatch();
pspDebugInstallKprintfHandler(NULL);
}
int LoadThread() {
SceUID moduid;
int start;
char *eboot = "flash0:/vsh/module/vshmain.prx";
if ((moduid = sceKernelLoadModule(eboot, 0, NULL)) & 0x80000000)
{
printf("Error %08X loading module.\n", moduid);
}
if ((start = sceKernelStartModule(moduid, 0, NULL, NULL, NULL)) & 0x80000000)
{
printf("Error %08X starting module.\n", start);
}
return 0;
}
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
/* main routine */
int main(int argc, char *argv[])
{
int thid = 0;
//init screen and callbacks
pspDebugScreenInit();
pspDebugScreenClear();
SetupCallbacks();
thid = sceKernelCreateThread("load_thread", LoadThread, 0x10, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
sceKernelSleepThread();
sceKernelExitGame();
return 0;
}
Any help? Thanks.