Skip to content

Commit afe3341

Browse files
committed
add 1632mhz overclock CPU mode
true overclocking
1 parent 8307ba8 commit afe3341

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

static/Emus/.emu_setup/cpu_switch.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ case "$CPU_MODE" in
1414
NEW_DISPLAY="Perf"
1515
;;
1616
"performance")
17+
NEW_MODE="maximum"
18+
NEW_DISPLAY="Max"
19+
;;
20+
"maximum")
1721
NEW_MODE="overclock"
18-
NEW_DISPLAY="Overclock"
22+
NEW_DISPLAY="Overclock"
1923
;;
2024
"overclock")
2125
NEW_MODE="smart"
@@ -26,4 +30,8 @@ esac
2630
sed -i "s|\"CPU:.*\"|\"CPU: $NEW_DISPLAY\"|g" "$CONFIG"
2731
sed -i "s|CPU_MODE=.*|CPU_MODE=\"$NEW_MODE\"|g" "$OPT"
2832

29-
display -d 1000 -t "CPU mode for $EMU set to $NEW_MODE."
33+
if [ "$NEW_MODE" = "overclock" ]; then
34+
display -d 1000 -t "CPU mode for $EMU set to $NEW_MODE. Please be aware of potential instability that may occur."
35+
else
36+
display -d 1000 -t "CPU mode for $EMU set to $NEW_MODE."
37+
fi

static/System/scripts/helpers.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export THEME_PATH="$(awk -F'"' '/"theme":/ {print $4}' "/mnt/UDISK/system.json"
99
# Possible modes
1010
# - smart: modified conservative governor that responds better to usage spikes, balancing performance with battery life. Min/max frequencies can be specified by the user, defaults to 816-1344MHz
1111
# - performance: constant 1344mhz frequency, best for fast forwarding retro systems without too much heat
12-
# - overclock: constant 1536mhz frequency, best suited for harder to run games (i.e. SNES SuperFX or 3D PSX)
12+
# - maximum: constant 1536mhz frequency, best suited for harder to run games (i.e. SNES SuperFX or 3D PSX)
13+
# - overclock: constant 1632mhz frequency, best suited for the most demanding games. CAUTION: this may cause instability!
1314
set_cpuclock() {
1415
chmod a+w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
1516
chmod a+w /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
@@ -39,10 +40,14 @@ set_cpuclock() {
3940
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
4041
echo 1344000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
4142
;;
42-
"overclock")
43+
"maximum")
4344
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
4445
echo 1536000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
4546
;;
47+
"overclock")
48+
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
49+
devmem 0x01C20000 32 0x80001030 # direct PLL_CPUX register manipulation
50+
;;
4651
esac
4752

4853
chmod a-w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

0 commit comments

Comments
 (0)