Skip to content

Commit c6722ec

Browse files
committed
add more OC profiles
1728MHz and 1824MHz
1 parent afe3341 commit c6722ec

2 files changed

Lines changed: 32 additions & 11 deletions

File tree

static/Emus/.emu_setup/cpu_switch.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,31 @@ case "$CPU_MODE" in
1818
NEW_DISPLAY="Max"
1919
;;
2020
"maximum")
21-
NEW_MODE="overclock"
22-
NEW_DISPLAY="Overclock"
21+
NEW_MODE="turbo"
22+
NEW_DISPLAY="Turbo"
2323
;;
24-
"overclock")
24+
"turbo")
25+
NEW_MODE="overdrive"
26+
NEW_DISPLAY="Overdrive"
27+
;;
28+
"overdrive")
29+
NEW_MODE="unstable"
30+
NEW_DISPLAY="Unstable"
31+
;;
32+
"unstable")
2533
NEW_MODE="smart"
26-
NEW_DISPLAY="Smart"
34+
NEW_DISPLAY="Smart"
2735
;;
2836
esac
2937

3038
sed -i "s|\"CPU:.*\"|\"CPU: $NEW_DISPLAY\"|g" "$CONFIG"
3139
sed -i "s|CPU_MODE=.*|CPU_MODE=\"$NEW_MODE\"|g" "$OPT"
3240

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
41+
case "$NEW_MODE" in
42+
turbo|overdrive|unstable)
43+
display -d 1000 -t "CPU mode for $EMU set to $NEW_MODE. This is potentially unstable and will result in reduced battery life."
44+
;;
45+
*)
46+
display -d 1000 -t "CPU mode for $EMU set to $NEW_MODE."
47+
;;
48+
esac

static/System/scripts/helpers.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export THEME_PATH="$(awk -F'"' '/"theme":/ {print $4}' "/mnt/UDISK/system.json"
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
1212
# - 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!
13+
# - turbo: constant 1632mhz frequency, best suited for the most demanding games. CAUTION: this may cause instability!
14+
# - overdrive: constant 1728mhz frequency, best suited for the most demanding games. CAUTION: this may cause instability!
15+
# - unstable: constant 1824mhz frequency, best suited for the most demanding games. CAUTION: this may cause instability!
1416
set_cpuclock() {
1517
chmod a+w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
1618
chmod a+w /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
@@ -44,10 +46,18 @@ set_cpuclock() {
4446
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
4547
echo 1536000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
4648
;;
47-
"overclock")
49+
"turbo")
4850
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
4951
devmem 0x01C20000 32 0x80001030 # direct PLL_CPUX register manipulation
5052
;;
53+
"overdrive")
54+
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
55+
devmem 0x01C20000 32 0x80001130 # ditto (1728MHz)
56+
;;
57+
"unstable")
58+
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
59+
devmem 0x01C20000 32 0x80001230 # ditto (1824MHz)
60+
;;
5161
esac
5262

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

0 commit comments

Comments
 (0)