 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
pegasus21
Joined: 18 Jun 2006 Posts: 8
|
Posted: Sun Jul 02, 2006 8:25 pm Post subject: scePower Question |
|
|
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 |
|
| Back to top |
|
 |
pegasus21
Joined: 18 Jun 2006 Posts: 8
|
Posted: Mon Jul 03, 2006 4:42 pm Post subject: |
|
|
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.
| Code: | #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. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Tue Jul 04, 2006 2:09 am Post subject: |
|
|
| Loading just vshmain wont get you very far as loading the vsh up requires a few more modules. And yes by default unless you use loadmodule the clock frequency wont stick, in fact even with hacks it wont stick (but you can reset it again once the psp has rebooted). |
|
| Back to top |
|
 |
pegasus21
Joined: 18 Jun 2006 Posts: 8
|
Posted: Tue Jul 04, 2006 4:06 am Post subject: |
|
|
I see. Thx for the reply.
Looks like loadexec of the vshmain.prx does load other prx along with it. Since it restarts the menu. |
|
| 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
|