mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
Setup more backend, move functions should be ready
This commit is contained in:
parent
ececa7cbec
commit
0c1bfe962d
|
@ -43,13 +43,13 @@ Enabled = False
|
||||||
[DSP]
|
[DSP]
|
||||||
EnableJIT = False
|
EnableJIT = False
|
||||||
[GBA]
|
[GBA]
|
||||||
BIOS = /home/deck/.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/GBA/gba_bios.bin
|
BIOS =
|
||||||
Rom1 =
|
Rom1 =
|
||||||
Rom2 =
|
Rom2 =
|
||||||
Rom3 =
|
Rom3 =
|
||||||
Rom4 =
|
Rom4 =
|
||||||
SavesInRomPath = False
|
SavesInRomPath = False
|
||||||
SavesPath = /home/deck/.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/GBA/Saves/
|
SavesPath =
|
||||||
Threads = True
|
Threads = True
|
||||||
[Input]
|
[Input]
|
||||||
BackgroundInput = False
|
BackgroundInput = False
|
||||||
|
|
18
emu-configs/defaults/dolphin/GBA.ini
Normal file
18
emu-configs/defaults/dolphin/GBA.ini
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
[GBA1]
|
||||||
|
Device = XInput2/0/Virtual core pointer
|
||||||
|
Buttons/B = `Z`
|
||||||
|
Buttons/A = `X`
|
||||||
|
Buttons/L = `Q`
|
||||||
|
Buttons/R = `W`
|
||||||
|
Buttons/SELECT = `Backspace`
|
||||||
|
Buttons/START = `Return`
|
||||||
|
D-Pad/Up = `T`
|
||||||
|
D-Pad/Down = `G`
|
||||||
|
D-Pad/Left = `F`
|
||||||
|
D-Pad/Right = `H`
|
||||||
|
[GBA2]
|
||||||
|
Device = XInput2/0/Virtual core pointer
|
||||||
|
[GBA3]
|
||||||
|
Device = XInput2/0/Virtual core pointer
|
||||||
|
[GBA4]
|
||||||
|
Device = XInput2/0/Virtual core pointer
|
|
@ -207,6 +207,10 @@ Shaders = shaders
|
||||||
Textures = textures
|
Textures = textures
|
||||||
|
|
||||||
|
|
||||||
|
[UI]
|
||||||
|
MainWindowGeometry = AdnQywADAAAAAAGWAAAAeQAABLUAAAM0AAABlgAAAHkAAAS1AAADNAAAAAAAAAAABk0AAAGWAAAAeQAABLUAAAM0
|
||||||
|
|
||||||
|
|
||||||
[InputSources]
|
[InputSources]
|
||||||
SDL = true
|
SDL = true
|
||||||
SDLControllerEnhancedMode = false
|
SDLControllerEnhancedMode = false
|
||||||
|
|
173
functions.sh
173
functions.sh
|
@ -43,7 +43,7 @@ verify_space() {
|
||||||
# USAGE: verify_space $source_dir $dest_dir
|
# USAGE: verify_space $source_dir $dest_dir
|
||||||
# Function returns "true" if there is enough space, "false" if there is not
|
# Function returns "true" if there is enough space, "false" if there is not
|
||||||
|
|
||||||
source_size=$(du -sk /home/deck/retrodeck | awk '{print $1}')
|
source_size=$(du -sk $1 | awk '{print $1}')
|
||||||
source_size=$((source_size+(source_size/10))) # Add 10% to source size for safety
|
source_size=$((source_size+(source_size/10))) # Add 10% to source size for safety
|
||||||
dest_avail=$(df -k --output=avail $2 | tail -1)
|
dest_avail=$(df -k --output=avail $2 | tail -1)
|
||||||
|
|
||||||
|
@ -143,6 +143,59 @@ get_setting_name() {
|
||||||
# Function for getting the setting name from a full setting line from a config file
|
# Function for getting the setting name from a full setting line from a config file
|
||||||
# USAGE: get_setting_name $setting_line $system (needed as different systems use different config file syntax)
|
# USAGE: get_setting_name $setting_line $system (needed as different systems use different config file syntax)
|
||||||
|
|
||||||
|
case $2 in
|
||||||
|
|
||||||
|
"retrodeck" )
|
||||||
|
echo "$1" | grep -o -P ".*(?=\=)"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"retroarch" )
|
||||||
|
echo "$1" | grep -o -P ".*(?= \= )"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"dolphin" ) # Use quotes when passing setting_name, as this config file contains special characters
|
||||||
|
echo "$1" | grep -o -P ".*(?= \= )"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"duckstation" )
|
||||||
|
echo "$1" | grep -o -P ".*(?= \= )"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"pcsx2" )
|
||||||
|
echo "$1" | grep -o -P ".*(?= \= )"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"ppsspp" ) # Use quotes when passing setting_name, as this config file contains spaces
|
||||||
|
echo "$1" | grep -o -P ".*(?= \= )"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"rpcs3" ) # Use quotes when passing setting_name, as this config file contains special characters and spaces
|
||||||
|
echo "$1" | grep -o -P ".*(?=:)"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"yuzu" ) # Use quotes when passing setting_name, as this config file contains special characters
|
||||||
|
yuzu_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Accomodate for backslashes in setting names
|
||||||
|
echo '$yuzu_setting' | grep -o -P ".*(?=\=)" | sed -e 's%\\\\%\\%g'
|
||||||
|
;;
|
||||||
|
|
||||||
|
"citra" ) # Use quotes when passing setting_name, as this config file contains special characters
|
||||||
|
citra_setting=$(sed -e 's%\\%\\\\%g' <<< "$1") # Accomodate for backslashes in setting names
|
||||||
|
echo '$citra_setting' | grep -o -P ".*(?=\=)" | sed -e 's%\\\\%\\%g'
|
||||||
|
;;
|
||||||
|
|
||||||
|
"melonds" )
|
||||||
|
echo "$1" | grep -o -P ".*(?=\=)"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"xemu" )
|
||||||
|
echo "$1" | grep -o -P ".*(?= \= )"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"emulationstation" )
|
||||||
|
echo '$1' | grep -o -P "(?<=name\=\").*(?=\" value)"
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
get_setting_value() {
|
get_setting_value() {
|
||||||
|
@ -205,11 +258,129 @@ esac
|
||||||
}
|
}
|
||||||
|
|
||||||
disable_setting() {
|
disable_setting() {
|
||||||
|
# This function will add a '#' to the beginning of a defined setting line, disabling it.
|
||||||
|
# USAGE: disable_setting $setting_file $setting_name $system
|
||||||
|
|
||||||
|
case $3 in
|
||||||
|
|
||||||
|
"retrodeck" )
|
||||||
|
sed -i "s%^$2=%#$2=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"retroarch" )
|
||||||
|
sed -i "s%^$2 = %#$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"dolphin" )
|
||||||
|
sed -i "s%^$2 = %#$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"duckstation" )
|
||||||
|
sed -i "s%^$2 = %#$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"pcsx2" )
|
||||||
|
sed -i "s%^$2 = %#$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"ppsspp" )
|
||||||
|
sed -i "s%^$2 = %#$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"rpcs3" ) # This does not currently work for settings with a $ in them
|
||||||
|
sed -i "s%^$2: %#$2: %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"yuzu" )
|
||||||
|
yuzu_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name
|
||||||
|
sed -i "s%^$yuzu_setting=%#$yuzu_setting=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"citra" )
|
||||||
|
citra_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name
|
||||||
|
sed -i "s%^$citra_setting=%#$citra_setting=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"melonds" )
|
||||||
|
sed -i "s%^$2=%#$2=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"xemu" )
|
||||||
|
sed -i "s%^$2 = %#$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_setting() {
|
enable_setting() {
|
||||||
|
# This function will remove a '#' to the beginning of a defined setting line, enabling it.
|
||||||
|
# USAGE: enable_setting $setting_file $setting_name $system
|
||||||
|
|
||||||
|
case $3 in
|
||||||
|
|
||||||
|
"retrodeck" )
|
||||||
|
sed -i "s%^#$2=%$2=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"retroarch" )
|
||||||
|
sed -i "s%^#$2 = %$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"dolphin" )
|
||||||
|
sed -i "s%^#$2 = %$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"duckstation" )
|
||||||
|
sed -i "s%^#$2 = %$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"pcsx2" )
|
||||||
|
sed -i "s%^#$2 = %$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"ppsspp" )
|
||||||
|
sed -i "s%^#$2 = %$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"rpcs3" ) # This does not currently work for settings with a $ in them
|
||||||
|
sed -i "s%^#$2: %$2: %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"yuzu" )
|
||||||
|
yuzu_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name
|
||||||
|
sed -i "s%^#$yuzu_setting=%$yuzu_setting=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"citra" )
|
||||||
|
citra_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name
|
||||||
|
sed -i "s%^#$citra_setting=%$citra_setting=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"melonds" )
|
||||||
|
sed -i "s%^#$2=%$2=%" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
"xemu" )
|
||||||
|
sed -i "s%^#$2 = %$2 = %" $1
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_file() {
|
||||||
|
# This function adds the suffix ".disabled" to the end of a file to prevent it from being used entirely.
|
||||||
|
# USAGE: disable_file $file_name
|
||||||
|
# NOTE: $filename can be a defined variable from global.sh or must have the full path to the file
|
||||||
|
|
||||||
|
mv $(realpath $1) $(realpath $1).disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_file() {
|
||||||
|
# This function removes the suffix ".disabled" to the end of a file to allow it to be used.
|
||||||
|
# USAGE: enable_file $file_name
|
||||||
|
# NOTE: $filename can be a defined variable from global.sh or must have the full path to the file and should not have ".disabled" as a suffix
|
||||||
|
|
||||||
|
mv $(realpath $1.disabled) $(realpath $(echo $1 | sed -e 's/\.disabled//'))
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_write() {
|
conf_write() {
|
||||||
|
|
30
global.sh
30
global.sh
|
@ -11,6 +11,36 @@ lockfile="/var/config/retrodeck/.lock" # where the lockfile
|
||||||
default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path
|
default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path
|
||||||
hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem)
|
hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem)
|
||||||
|
|
||||||
|
# Config files for emulators with single config files
|
||||||
|
|
||||||
|
citraconf="/var/config/citra-emu/qt-config.ini"
|
||||||
|
melondsconf="/var/config/melonDS/melonDS.ini"
|
||||||
|
rpcs3conf="/var/config/rpcs3/config.yml"
|
||||||
|
yuzuconf="/var/config/yuzu/qt-config.ini"
|
||||||
|
|
||||||
|
# ES-DE config files
|
||||||
|
|
||||||
|
es_settings="/var/config/emulationstation/.emulationstation/es_settings.xml"
|
||||||
|
|
||||||
|
# RetroArch config files
|
||||||
|
|
||||||
|
raconf="/var/config/retroarch/retroarch.cfg"
|
||||||
|
ra_core_conf="/var/config/retroarch/retroarch-core-options.cfg"
|
||||||
|
|
||||||
|
# Dolphin config files
|
||||||
|
|
||||||
|
dolphinconf="/var/config/dolphin-emu/Dolphin.ini"
|
||||||
|
dolphingcpadconf="/var/config/dolphin-emu/GCPadNew.ini"
|
||||||
|
dolphingfxconf="/var/config/dolphin-emu/GFX.ini"
|
||||||
|
dolphinhkconf="/var/config/dolphin-emu/Hotkeys.ini"
|
||||||
|
dolphinqtconf="/var/config/dolphin-emu/Qt.ini"
|
||||||
|
|
||||||
|
# PCSX2 config files
|
||||||
|
|
||||||
|
pcsx2conf="/var/config/PCSX2/inis/GS.ini"
|
||||||
|
pcsx2uiconf="/var/config/PCSX2/inis/PCSX2_ui.ini"
|
||||||
|
pcsx2vmconf="/var/config/PCSX2/inis/PCSX2_vm.ini"
|
||||||
|
|
||||||
# If there is no config file I initalize the file with the the default values
|
# If there is no config file I initalize the file with the the default values
|
||||||
if [ ! -f "$rd_conf" ]
|
if [ ! -f "$rd_conf" ]
|
||||||
then
|
then
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue