Setup more backend, move functions should be ready

This commit is contained in:
icenine451 2022-10-26 12:51:46 -04:00
parent ececa7cbec
commit 0c1bfe962d
7 changed files with 751 additions and 502 deletions

View file

@ -43,13 +43,13 @@ Enabled = False
[DSP]
EnableJIT = False
[GBA]
BIOS = /home/deck/.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/GBA/gba_bios.bin
BIOS =
Rom1 =
Rom2 =
Rom3 =
Rom4 =
SavesInRomPath = False
SavesPath = /home/deck/.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/GBA/Saves/
SavesPath =
Threads = True
[Input]
BackgroundInput = False

View 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

View file

@ -44,7 +44,7 @@ FastmemMode = MMap
[GPU]
Renderer = OpenGL
Adapter =
Adapter =
ResolutionScale = 1
Multisamples = 1
UseDebugDevice = false
@ -114,7 +114,7 @@ SeekSpeedup = 1
[Audio]
Backend = Cubeb
Driver =
Driver =
StretchMode = TimeStretch
BufferMS = 50
OutputLatencyMS = 20
@ -166,7 +166,7 @@ PrimedIndicators = true
[Logging]
LogLevel = Info
LogFilter =
LogFilter =
LogToConsole = true
LogToDebug = false
LogToWindow = false
@ -207,6 +207,10 @@ Shaders = shaders
Textures = textures
[UI]
MainWindowGeometry = AdnQywADAAAAAAGWAAAAeQAABLUAAAM0AAABlgAAAHkAAAS1AAADNAAAAAAAAAAABk0AAAGWAAAAeQAABLUAAAM0
[InputSources]
SDL = true
SDLControllerEnhancedMode = false
@ -280,4 +284,4 @@ OpenPauseMenu = Keyboard/Escape
LoadSelectedSaveState = Keyboard/F1
SaveSelectedSaveState = Keyboard/F2
SelectPreviousSaveStateSlot = Keyboard/F3
SelectNextSaveStateSlot = Keyboard/F4
SelectNextSaveStateSlot = Keyboard/F4

View file

@ -25,10 +25,10 @@ Fullscreen = True
DisableScreenSaver = True
[GBA]
BIOS = ~/retrodeck/bios
Rom1 =
Rom2 =
Rom3 =
Rom4 =
Rom1 =
Rom2 =
Rom3 =
Rom4 =
SavesInRomPath = False
SavesPath = ~/retrodeck/saves/gba
Threads = True

View file

@ -43,7 +43,7 @@ verify_space() {
# USAGE: verify_space $source_dir $dest_dir
# 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
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
# 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() {
@ -205,11 +258,129 @@ esac
}
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() {
# 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() {

View file

@ -11,6 +11,36 @@ lockfile="/var/config/retrodeck/.lock" # where the lockfile
default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path
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 [ ! -f "$rd_conf" ]
then

File diff suppressed because it is too large Load diff