Skip to content

Commit 624e0ae

Browse files
Bump to 4.1.1, add A30 input upgrade script
Add upgrade script to fix restored A30 RetroArch configs: - Set input_menu_toggle_btn to nul for Guide button path - Add joypad _btn fallback values for hotkeys
1 parent 83111e9 commit 624e0ae

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
3+
# Fix A30 RetroArch input mapping after restore
4+
# - Set input_menu_toggle_btn to nul so the Guide button path works
5+
# (old value "9" broke standalone menu button toggle)
6+
# - Add joypad _btn fallback values for hotkeys
7+
# (old configs only had keyboard bindings, no btn fallbacks)
8+
9+
TARGET_VERSION="4.1.1"
10+
11+
HELPER_FUNCTIONS="/mnt/SDCARD/spruce/scripts/helperFunctions.sh"
12+
if [ -f "$HELPER_FUNCTIONS" ]; then
13+
. "$HELPER_FUNCTIONS"
14+
else
15+
echo "Error: helperFunctions.sh not found"
16+
exit 1
17+
fi
18+
19+
RA_A30_CFG="/mnt/SDCARD/RetroArch/platform/retroarch-A30.cfg"
20+
21+
if [ ! -f "$RA_A30_CFG" ]; then
22+
log_message "No retroarch-A30.cfg found, skipping A30 input fix"
23+
exit 0
24+
fi
25+
26+
log_message "Starting upgrade to version $TARGET_VERSION"
27+
log_message "Patching A30 RetroArch hotkey config"
28+
29+
# Fix menu toggle btn: must be nul for Guide button autoconfig path
30+
sed 's|^input_menu_toggle_btn = .*|input_menu_toggle_btn = "nul"|' \
31+
"$RA_A30_CFG" > "$RA_A30_CFG.tmp" && mv "$RA_A30_CFG.tmp" "$RA_A30_CFG"
32+
33+
# Add joypad btn fallbacks for hotkeys (only replace nul values)
34+
for pair in \
35+
"input_enable_hotkey_btn:6" \
36+
"input_exit_emulator_btn:0" \
37+
"input_fps_toggle_btn:2" \
38+
"input_load_state_btn:4" \
39+
"input_save_state_btn:5" \
40+
"input_screenshot_btn:1"
41+
do
42+
key="${pair%%:*}"
43+
val="${pair##*:}"
44+
sed "s|^${key} = \"nul\"|${key} = \"${val}\"|" \
45+
"$RA_A30_CFG" > "$RA_A30_CFG.tmp" && mv "$RA_A30_CFG.tmp" "$RA_A30_CFG"
46+
done
47+
48+
log_message "Upgrade to version $TARGET_VERSION completed successfully"
49+
exit 0

spruce/spruce

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
4.1.1

0 commit comments

Comments
 (0)