forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Setting 333MHz question

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
zshadow



Joined: 26 Dec 2005
Posts: 42

PostPosted: Thu Mar 30, 2006 8:43 am    Post subject: Setting 333MHz question Reply with quote

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
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Thu Mar 30, 2006 3:09 pm    Post subject: Reply with quote

what you need is inside psppower.h
you change the cpu speed in the first lines of your code
Back to top
View user's profile Send private message Visit poster's website
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Sat Apr 01, 2006 6:20 am    Post subject: Reply with quote

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
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Sat Apr 01, 2006 10:06 am    Post subject: Reply with quote

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
View user's profile Send private message
zshadow



Joined: 26 Dec 2005
Posts: 42

PostPosted: Mon Apr 03, 2006 11:40 am    Post subject: Reply with quote

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
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Apr 03, 2006 3:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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