Setting 333MHz question

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
zshadow
Posts: 42
Joined: Mon Dec 26, 2005 5:36 am

Setting 333MHz question

Post by zshadow »

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 :)
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

what you need is inside psppower.h
you change the cpu speed in the first lines of your code
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

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.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

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
zshadow
Posts: 42
Joined: Mon Dec 26, 2005 5:36 am

Post by zshadow »

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&#40;"CPU", 0, 1, 1&#41;;

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	scePowerSetClockFrequency&#40;333, 333, 166&#41;;

	pspDebugScreenInit&#40;&#41;;
	pspDebugScreenPrintf&#40;"Loading RunUMD..\n"&#41;;
	sceKernelLoadExec&#40;"ms0&#58;/PSP/GAME/RunUMD/EBOOT.PBP", 0&#41;;

	return 0;
&#125;
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

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&#40;"CPU", 0, 1, 1&#41;;

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	scePowerSetClockFrequency&#40;333, 333, 166&#41;;

	pspDebugScreenInit&#40;&#41;;
	pspDebugScreenPrintf&#40;"Loading RunUMD..\n"&#41;;
	sceKernelLoadExec&#40;"ms0&#58;/PSP/GAME/RunUMD/EBOOT.PBP", 0&#41;;

	return 0;
&#125;
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);
Post Reply