[Windows Mobile Apps and Games] jpc073@gmail.com:
Dynamic Overclocking Working!!! . . . may need more testing

Ok so I was having some problems getting the great script by cls_ to work on my sprint TP2 running EnergyRom. After analyzing the script a little closer and looking into the registry, I made a few modifications to the script and I think I finally have it working perfectly. I am posting it here so if anyone wants to try it out for themselves they can. I do not take credit for the main portion of the script as it was provided by cls_, I just made a few minor modifications.

This is the first script that should be run at startup: Note: You must be sure that the script points to "DispOn" on your device. If not, it will not work.

;**********************************************************************
;Set your speed settings. Default Settings are boost=39 safe=31

;41=787
;40=768
;39=748
;38=729
;37=710
;36=691
;35=672
;34=652
;33=633
;32=614
;31=604
;30=576
;29=556
;28=537

Boost=RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "BoostSpeed")
Safe=RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "SafeSpeed")

If (Boost<>0)
boost_speed=Boost
Else
boost_speed=39
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "BoostSpeed", boost_speed)
EndIf

If (Safe<>0)
safe_speed=Safe
Else
safe_speed=31
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "SafeSpeed", safe_speed)
EndIf

;**********************************************************************
; Variables
RunWait("\Program Files\Msm7kCpuSpeed\Msm7KAutoCpuSpeed.exe", boost_speed)
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "OverClocked", 0)
reg_root = "HKCU"

; supposed to be 0 when screen is off... does not work.
;reg_key_bkl = "System\CurrentControlSet\Control\Power\State\BacklightOff"
;reg_val_bkl = "bkl1:"

; will be 2 when locked
;reg_key_bkl = "System\State"
;reg_val_bkl = "Lock"

; will be 0 when screen is off, 1 when on - This may be device or Rom Specific
reg_key_bkl = "ControlPanel\BackLight"
reg_val_bkl = "DispOn"

; Check existence of reg key
If ( NOT RegValueExists(reg_root, reg_key_bkl, reg_val_bkl) )
BigMessage(reg_root \ reg_key_bkl \ reg_val_bkl & " was not found!^NL^^NL^Exiting...", "OverClocking ERROR")
Exit
EndIf

;**********************************************************************
; Set the clock to the desired clock speed
While (1)
; Read registry key
bkl_value = RegRead(reg_root, reg_key_bkl, reg_val_bkl)
cpu_overclocked = RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "OverClocked")

; Check if screen is off, if so, throttle to Safe Speed
If ((bkl_value = 0) AND (cpu_overclocked))
RunWait("\Program Files\Msm7kCpuSpeed\Msm7KAutoCpuSpeed.exe", safe_speed)
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "OverClocked", 0)

; Screen is on, overclock CPU to Boost Speed :)
ElseIf ((bkl_value <> 0) AND (NOT cpu_overclocked))
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "OverClocked", 1)
RunWait("\Program Files\Msm7kCpuSpeed\Msm7KAutoCpuSpeed.exe", boost_speed)
Else
Sleep(5000)
EndIf
EndWhile
Exit

This is the second script that should be assigned to your power button on top of your device:

;**********************************************************************
;Set your speed settings Default Settings are boost=39 safe=31

;41=787
;40=768
;39=748
;38=729
;37=710
;36=691
;35=672
;34=652
;33=633
;32=614
;31=604
;30=576
;29=556
;28=537

Boost=RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "BoostSpeed")
Safe=RegRead("HKLM", "SOFTWARE\Msm7kCpuSpeed", "SafeSpeed")

If (Boost<>0)
boost_speed=Boost
Else
boost_speed=39
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "BoostSpeed", boost_speed)
EndIf

If (Safe<>0)
safe_speed=Safe
Else
safe_speed=31
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "SafeSpeed", safe_speed)
EndIf

RunWait("\Program Files\Msm7kCpuSpeed\Msm7KAutoCpuSpeed.exe", safe_speed)
RegWriteDWord("HKLM", "SOFTWARE\Msm7kCpuSpeed\", "OverClocked", 0)
Exit

This should be all that is needed!!! :)

This creates 3 new registry keys. These default settings work on MY device.

HKLM\SOFTWARE\Msm7kCpuSpeed\SafeSpeed = Set this to non SOD setting 31(default for 604)

HKLM\SOFTWARE\Msm7kCpuSpeed\BoostSpeed = Set this Max Stable setting 39(default for 748)

HKLM\SOFTWARE\Msm7kCpuSpeed\OverClocked = Tells script whether currently overclocked or not