GP32 Gpclockspeedchange


mATkEUpON

Certified Guru
Joined
Sep 30, 2003
Messages
276
I've got trouble finding the good GpClockSpeedChange values, and there are 2 problems:

1st, the sound pitch can change depending on which values you use

2nd, glitches appear on the right of the screen when using certain freq settings

I think it would be a good idea to share some values. So I'll start here:

GpClockSpeedChange(67500000, 0x25002, 1) => sound ok, no glitches
framelength = 38

GpClockSpeedChange(99000000, 0x3a002, 2) => sound pitch modified, glitches
framelength = 56

GpClockSpeedChange(110000000, 0x2f011, 2) => sound ok, glitches
framelength = 62

GpClockSpeedChange(132000000, 0x3a011, 2) => sound ok, no glitches
framelength = 76

GpClockSpeedChange(156000000, 0x2c001, 2) => sound ok, no glitches
framelength = 89

The framelenght values are in Ticks, and kinda show how much processing power you get.
 
78000000, 0x2c002, 2 => Sounf ok, glitches

105000000, 0x1b001, 2 => pitch modified, glitches

123000000, 0x21001, 2 => pitch ok, glitches

135000000, 0x25001, 2 => pitch ok, glitches

144000000, 0x28001, 2 => pitch ok, glitches
 
mATkEUpON posted on Feb 15 2004 at 08:36 PM said:
I've got trouble finding the good GpClockSpeedChange values, and there are 2 problems:

1st, the sound pitch can change depending on which values you use

2nd, glitches appear on the right of the screen when using certain freq settings

I think it would be a good idea to share some values. So I'll start here:

....
I assume you did reinit sound stuff after changing the clock speed.. If not that might be one cause for pitch changes. Also as the sound output depends on the PCLK, the accuracy of the sound output varies on the final PCLK value after clockspeed change. There is a source code to calculate the final sound output speed depending on the PCLK:
http://www.cs.helsinki.fi/u/jikorhon/conde...32/dl/srate.zip
 
Last edited by a moderator:
Well thanks for the advice, but it won't be very helpful as I can't change the mixing freq or prescaler values of the sound (using the SDK). So what I really need are values for GpClockSpeedChange that would keep the clocks synced. Also, the screen problem is noticeable, and I'm sure correct values can be found.
 
As far as I remember after clock speed change you just need to do PCMInit again (or whatever the SDK call was).. It does about the same stuff the code I posted for prescalers etc.
 
mATkEUpON posted on Feb 15 2004 at 08:36 PM said:
The framelenght values are in Ticks, and kinda show how much processing power you get.
Um..... You can't really compare the values, since there are more ticks per second on higher clockspeeds :) Or do I not get something? :huh:
 
Last edited by a moderator:
Well rcx21000, that's exactly it !!! What I posted means that when the gp32 runs at 66 and you wait 38 ticks, then you should wait 76 ticks when the gp32 runs at 133. It also correspond to one frame refresh time.
 
Back
Top