Sadistictoaster
Still Fresh
- Joined
- Sep 12, 2006
- Messages
- 22
Hey
Been trying to figure out how to change the clock speed for the GP2X , but even when I directly copy and paste the code from online tutorials / Squidges' function in 'PocketSnes' ( thanks , by the way , I'm still very new at this , but there's some very interesting looking code in there I'm lookig forward to taking apart ) , I still get the same problem : when the program is run , all I get is a black screen.
I'm clearly missing something : any ideas?
#define SYS_CLK_FREQ 7372800
void gp_setCpuspeed(unsigned int cpuspeed);
gp_setCpuspeed(100);
void gp_setCpuspeed(unsigned int MHZ)
{
unsigned v;
unsigned mdiv,pdiv=3,scale=0;
volatile unsigned short *gp2x_memregs;
MHZ*=1000000;
mdiv=(MHZ*pdiv)/SYS_CLK_FREQ;
mdiv=((mdiv-8)<<8) & 0xff00;
pdiv=((pdiv-2)<<2) & 0xfc;
scale&=3;
v=mdiv | pdiv | scale;
gp2x_memregs[0x910>>1]=v;
}
Many Thanks
Been trying to figure out how to change the clock speed for the GP2X , but even when I directly copy and paste the code from online tutorials / Squidges' function in 'PocketSnes' ( thanks , by the way , I'm still very new at this , but there's some very interesting looking code in there I'm lookig forward to taking apart ) , I still get the same problem : when the program is run , all I get is a black screen.
I'm clearly missing something : any ideas?
#define SYS_CLK_FREQ 7372800
void gp_setCpuspeed(unsigned int cpuspeed);
gp_setCpuspeed(100);
void gp_setCpuspeed(unsigned int MHZ)
{
unsigned v;
unsigned mdiv,pdiv=3,scale=0;
volatile unsigned short *gp2x_memregs;
MHZ*=1000000;
mdiv=(MHZ*pdiv)/SYS_CLK_FREQ;
mdiv=((mdiv-8)<<8) & 0xff00;
pdiv=((pdiv-2)<<2) & 0xfc;
scale&=3;
v=mdiv | pdiv | scale;
gp2x_memregs[0x910>>1]=v;
}
Many Thanks