Multiple fixes/additions

- Enabled using variable names directly in patches
- Updated multi-user mode to latest code
  THIS FEATURE IS STILL IN TESTING
- Changed semi-hard-coded paths to source from $rd_conf instead
This commit is contained in:
icenine451 2023-03-24 11:24:28 -04:00
parent bfd7e83c6b
commit 8f8d9c2bb6
5 changed files with 369 additions and 244 deletions

View file

@ -1,5 +1,6 @@
uuddlrlrstart^set_setting_value /var/config/retrodeck/retrodeck.cfg developer_options true retrodeck uuddlrlrstart^set_setting_value $rd_conf developer_options true retrodeck
uuddlrlrstart^echo Visit the Configurator to behold your new-found powers. uuddlrlrstart^echo Visit the Configurator to behold your new-found powers.
uuddlrlrstart^echo But beware, with great power comes great responsibility... uuddlrlrstart^echo But beware, with great power comes great responsibility...
gameovermangameover^set_setting_value /var/config/retrodeck/retrodeck.cfg developer_options false retrodeck gameovermangameover^set_setting_value $rd_conf developer_options false retrodeck
gameovermangameover^echo You have relinquished your powers in the name of saftey. gameovermangameover^echo You have relinquished your powers in the name of saftey.
gameovermangameover^echo This was a wise choice.

View file

@ -7,6 +7,7 @@ bios_folder=/home/deck/retrodeck/bios
media_folder=/home/deck/retrodeck/downloaded_media media_folder=/home/deck/retrodeck/downloaded_media
themes_folder=/home/deck/retrodeck/themes themes_folder=/home/deck/retrodeck/themes
logs_folder=/home/deck/retrodeck/.logs logs_folder=/home/deck/retrodeck/.logs
screenshots_folder=/home/deck/retrodeck/screenshots
mods_folder=/home/deck/retrodeck/mods mods_folder=/home/deck/retrodeck/mods
texture_packs_folder=/home/deck/retrodeck/texture_packs texture_packs_folder=/home/deck/retrodeck/texture_packs
sdcard=/run/media/mmcblk0p1 sdcard=/run/media/mmcblk0p1

View file

@ -380,7 +380,7 @@ disable_setting() {
# This function will add a '#' to the beginning of a defined setting line, disabling it. # This function will add a '#' to the beginning of a defined setting line, disabling it.
# USAGE: disable_setting $setting_file $setting_line $system $section (optional) # USAGE: disable_setting $setting_file $setting_line $system $section (optional)
local current_setting_line"$2" local current_setting_line="$2"
local current_section_name="$4" local current_section_name="$4"
case $3 in case $3 in
@ -400,7 +400,7 @@ enable_setting() {
# This function will remove a '#' to the beginning of a defined setting line, enabling it. # This function will remove a '#' to the beginning of a defined setting line, enabling it.
# USAGE: enable_setting $setting_file $setting_line $system $section (optional) # USAGE: enable_setting $setting_file $setting_line $system $section (optional)
local current_setting_line"$2" local current_setting_line="$2"
local current_section_name="$4" local current_section_name="$4"
case $3 in case $3 in
@ -545,27 +545,27 @@ do
case $action in case $action in
"disable_file" ) "disable_file" )
disable_file $setting_name eval disable_file "$setting_name"
;; ;;
"enable_file" ) "enable_file" )
enable_file $setting_name eval enable_file "$setting_name"
;; ;;
"add_setting" ) "add_setting" )
add_setting $3 "$setting_name" $system_name $current_section eval add_setting $3 "$setting_name" $system_name $current_section
;; ;;
"disable_setting" ) "disable_setting" )
disable_setting $3 "$setting_name" $system_name $current_section eval disable_setting $3 "$setting_name" $system_name $current_section
;; ;;
"enable_setting" ) "enable_setting" )
enable_setting $3 "$setting_name" $system_name $current_section eval enable_setting $3 "$setting_name" $system_name $current_section
;; ;;
"change" ) "change" )
set_setting_value $3 "$setting_name" "$setting_value" $system_name $current_section eval set_setting_value $3 "$setting_name" "$setting_value" $system_name $current_section
;; ;;
* ) * )
@ -588,27 +588,27 @@ do
case $action in case $action in
"disable_file" ) "disable_file" )
disable_file $config_file eval disable_file "$config_file"
;; ;;
"enable_file" ) "enable_file" )
enable_file $config_file eval enable_file "$config_file"
;; ;;
"add_setting" ) "add_setting" )
add_setting $config_file "$setting_name" $system_name $current_section eval add_setting "$config_file" "$setting_name" $system_name $current_section
;; ;;
"disable_setting" ) "disable_setting" )
disable_setting $config_file "$setting_name" $system_name $current_section eval disable_setting "$config_file" "$setting_name" $system_name $current_section
;; ;;
"enable_setting" ) "enable_setting" )
enable_setting $config_file "$setting_name" $system_name $current_section eval enable_setting "$config_file" "$setting_name" $system_name $current_section
;; ;;
"change" ) "change" )
set_setting_value $config_file "$setting_name" "$setting_value" $system_name $current_section eval set_setting_value "$config_file" "$setting_name" "$setting_value" $system_name $current_section
;; ;;
* ) * )
@ -636,8 +636,7 @@ validate_input() {
while IFS="^" read -r input action while IFS="^" read -r input action
do do
if [[ "$input" == "$1" ]]; then if [[ "$input" == "$1" ]]; then
# $action line must be completely literal in the $input_validation file. No shell expansion or extra characters. eval "$action"
$action
input_validated="true" input_validated="true"
fi fi
done < $input_validation done < $input_validation
@ -694,99 +693,132 @@ multi_user_set_default_dialog() {
fi fi
} }
load_current_user_saves_and_states() { multi_user_choose_current_user_dialog() {
if [[ $(get_setting_value $rd_conf "multi_user" retrodeck) == "true" ]]; then # If multi-user environment is enabled in rd_conf full_userlist=()
if [[ -f "$rd_userlist" ]]; then # If userlist already exists while IFS= read -r user
do
full_userlist=("${full_userlist[@]}" "$user")
done < <(ls -1 "$multi_user_data_folder")
chosen_user=$(zenity \
--list --width=1200 --height=720 \
--ok-label="Select User" \
--text="Choose the current user:" \
--column "Steam Username" --print-column=1 \
"${full_userlist[@]}")
if [[ ! -z $chosen_user && -z $default_user && $ask_default_user == "true" ]]; then
multi_user_set_default_dialog "$chosen_user"
fi
echo "$chosen_user"
}
multi_user_enable_multi_user_mode() {
if [[ -z "$SteamAppUser" ]]; then
configurator_generic_dialog "The Steam username of the current user could not be determined from the system.\n\nThis can happen when running in Desktop mode.\n\nYou will be asked to specify the Steam username (not profile name) of the current user in the next dialog."
fi
if [[ -d "$multi_user_data_folder" && $(ls -1 "$multi_user_data_folder" | wc -l) -gt 0 ]]; then # If multi-user data folder exists from prior use and is not empty
if [[ -d "$multi_user_data_folder/$SteamAppUser" ]]; then # Current user has an existing save folder
configurator_generic_dialog "The current user $SteamAppUser has an existing folder in the multi-user data folder.\n\nThe saves here are likely older than the ones currently used by RetroDECK.\n\nThe old saves will be backed up to $backups_folder and the current saves will be loaded into the multi-user data folder."
mkdir -p "$backups_folder"
tar -C "$multi_user_data_folder" -cahf "$backups_folder/multi-user-backup_$SteamAppUser_$(date +"%Y_%m_%d").zip" "$SteamAppUser"
rm -rf "$multi_user_data_folder/$SteamAppUser" # Remove stale data after backup
fi
fi
set_setting_value $rd_conf "multi_user_mode" "true" retrodeck
multi_user_determine_current_user
if [[ -d "$multi_user_data_folder/$SteamAppUser" ]]; then
configurator_process_complete_dialog "enabling multi-user support"
else
configurator_generic_dialog "It looks like something went wrong while enabling multi-user mode."
fi
}
multi_user_disable_multi_user_mode() {
if [[ $(ls -1 "$multi_user_data_folder" | wc -l) -gt 1 ]]; then
full_userlist=()
while IFS= read -r user
do
full_userlist=("${full_userlist[@]}" "$user")
done < <(ls -1 "$multi_user_data_folder")
single_user=$(zenity \
--list --width=1200 --height=720 \
--ok-label="Select User" \
--text="Choose the current user:" \
--column "Steam Username" --print-column=1 \
"${full_userlist[@]}")
if [[ ! -z "$single_user" ]]; then # Single user was selected
multi_user_return_to_single_user "$single_user"
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
configurator_process_complete_dialog "disabling multi-user support"
else
configurator_generic_dialog "No single user was selected, please try the process again."
configurator_retrodeck_multiuser_dialog
fi
else # There is only one multi-user-data folder
single_user=$(ls -1 "$multi_user_data_folder")
multi_user_return_to_single_user "$single_user"
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
configurator_process_complete_dialog "disabling multi-user support"
fi
}
multi_user_determine_current_user() {
if [[ $(get_setting_value $rd_conf "multi_user_mode" retrodeck) == "true" ]]; then # If multi-user environment is enabled in rd_conf
if [[ -d "$multi_user_data_folder" ]]; then # If current user already has a multi-user-data folder
if [[ ! -z $SteamAppUser ]]; then # If running in Game Mode and this variable exists if [[ ! -z $SteamAppUser ]]; then # If running in Game Mode and this variable exists
if [[ -z $(grep "$SteamAppUser" "$rd_userlist") ]]; then # If the user was not found in a list of known users if [[ -z $(ls -1 "$multi_user_data_folder" | grep "$SteamAppUser") ]]; then
add_setting $rd_userlist $SteamAppUser retrodeck # Add the user to the list echo "Didn't find user data folder, adding."
unlink "$saves_folder" multi_user_setup_new_user
unlink "$states_folder" else # User data folder was found
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder" echo "Found existing user data, linking files"
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder" multi_user_link_current_user_files
else # User was found on the list
if [[ -L "$saves_folder" ]]; then # and saves folder was already a symlink
ln -sfT "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
fi
if [[ -L "$states_folder" ]]; then # and saves folder was already a symlink
ln -sfT "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
fi
fi fi
else # Unable to find Steam user ID else # Unable to find Steam user ID
if [[ $(cat "$rd_userlist" | sed '/^\s*$/d' | wc -l) -gt 1 ]]; then # If there is more than one user on the list... if [[ $(ls -1 "$multi_user_data_folder" | wc -l) -gt 1 ]]; then # If there is more than one user data folder...
if [[ -z $default_user ]]; then # And a default user is not set if [[ -z $default_user ]]; then # And a default user is not set
configurator_generic_dialog "The current user could not be determined from the system, and there are multiple users registered.\n\nPlease select which user is currently playing in the next dialog." configurator_generic_dialog "The current user could not be determined from the system, and there are multiple users registered.\n\nPlease select which user is currently playing in the next dialog."
SteamAppUser=$(multi_user_choose_current_user_dialog) SteamAppUser=$(multi_user_choose_current_user_dialog)
if [[ ! -z $SteamAppUser ]]; then # User was chosen from dialog if [[ ! -z $SteamAppUser ]]; then # User was chosen from dialog
if [[ -L "$saves_folder" ]]; then # and saves folder was already a symlink multi_user_link_current_user_files
ln -sfT "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
fi
if [[ -L "$states_folder" ]]; then # and saves folder was already a symlink
ln -sfT "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
fi
else else
configurator_generic_dialog "No user was chosen, RetroDECK will launch with the files from the user who played most recently." configurator_generic_dialog "No user was chosen, RetroDECK will launch with the files from the user who played most recently."
fi fi
else # The default user is set else # The default user is set
if [[ ! -z $(ls -1 $multi_user_data_folder | grep "$default_user") ]]; then # Confirm user data folder exists if [[ ! -z $(ls -1 $multi_user_data_folder | grep "$default_user") ]]; then # Confirm user data folder exists
SteamAppUser=$default_user SteamAppUser=$default_user
if [[ -L "$saves_folder" ]]; then # and saves folder was already a symlink multi_user_link_current_user_files
ln -sfT "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
fi
if [[ -L "$states_folder" ]]; then # and saves folder was already a symlink
ln -sfT "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
fi
else else
echo "Default user $default_user has no data folder, something has gone horribly wrong." echo "Default user $default_user has no data folder, something may have gone horribly wrong. Setting up as a new user."
multi_user_setup_new_user
fi fi
fi fi
else # If there is only 1 user in the userlist, default to that user else # If there is only 1 user data folder, default to that user
SteamAppUser=$(cat "$rd_userlist" | sed '/^\s*$/d') SteamAppUser=$(ls -1 $multi_user_data_folder)
if [[ -L "$saves_folder" ]]; then # and saves folder was already a symlink multi_user_link_current_user_files
ln -sfT "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
fi
if [[ -L "$states_folder" ]]; then # and saves folder was already a symlink
ln -sfT "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
else # If saves folder was not a symlink (user may have disabled multi_user before and is renabling it now)
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
fi
fi fi
fi fi
else # If the userlist file doesn't exist yet, create it and add the current user else # If the multi-user-data folder doesn't exist yet, create it and add the current user
if [[ ! -z $SteamAppUser ]]; then if [[ ! -z "$SteamAppUser" ]]; then
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder" multi_user_setup_new_user
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
else # If running in Desktop mode for the first time else # If running in Desktop mode for the first time
configurator_generic_dialog "The current user could not be determined from the system and there is no existing userlist.\n\nPlease enter the Steam account username (not profile name) into the next dialog, or run RetroDECK in game mode." configurator_generic_dialog "The current user could not be determined from the system and there is no existing userlist.\n\nPlease enter the Steam account username (not profile name) into the next dialog, or run RetroDECK in game mode."
if zenity --entry \ if zenity --entry \
--title="Specify Steam username" \ --title="Specify Steam username" \
--text="Enter Steam username:" --text="Enter Steam username:"
then # User clicked "OK" then # User clicked "OK"
SteamAppUser=$? SteamAppUser="$?"
if [[ ! -z $SteamAppUser ]]; then if [[ ! -z "$SteamAppUser" ]]; then
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder" multi_user_setup_new_user
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
else # But dialog box was blank else # But dialog box was blank
configurator_generic_dialog "No username was entered, so multi-user data folder cannot be created.\n\nDisabling multi-user mode, please try the process again." configurator_generic_dialog "No username was entered, so multi-user data folder cannot be created.\n\nDisabling multi-user mode, please try the process again."
set_setting_value $rd_conf "multi_user" "false" retrodeck set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
fi fi
else # User clicked "Cancel" else # User clicked "Cancel"
configurator_generic_dialog "Cancelling multi-user mode activation." configurator_generic_dialog "Cancelling multi-user mode activation."
set_setting_value $rd_conf "multi_user" "false" retrodeck set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
fi fi
fi fi
fi fi
@ -795,6 +827,129 @@ load_current_user_saves_and_states() {
fi fi
} }
multi_user_return_to_single_user() {
single_user="$1"
echo "Returning to single-user mode for $single_user"
unlink "$saves_folder"
unlink "$states_folder"
unlink "$rd_conf"
mv -f "$multi_user_data_folder/$SteamAppUser/config/retrodeck/retrodeck.cfg" "$rd_conf"
mkdir -p "$saves_folder"
mkdir -p "$states_folder"
mv -f "$multi_user_data_folder/$single_user/saves"/{.[!.],}* "$saves_folder"
mv -f "$multi_user_data_folder/$single_user/states"/{.[!.],}* "$states_folder"
for emu_conf in $(find "$multi_user_data_folder/$single_user/config" -mindepth 1 -maxdepth 1 -type d -printf '%f\n')
do
if [[ ! -z $(grep "^$emu_conf$" "$multi_user_emulator_config_dirs") ]]; then
unlink "/var/config/$emu_conf"
mkdir -p "/var/config/$emu_conf"
mv -f "$multi_user_data_folder/$single_user/config/$emu_conf"/{.[!.],}* "/var/config/$emu_conf"
fi
done
rm -r "$multi_user_data_folder/$single_user" # Should be empty, omitting -f for safety
}
multi_user_setup_new_user() {
unlink "$saves_folder"
unlink "$states_folder"
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
dir_prep "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
dir_prep "$multi_user_data_folder/$SteamAppUser/screenshots" "$screenshots_folder"
mkdir -p "$multi_user_data_folder/$SteamAppUser/config/retrodeck"
cp "$multi_user_data_folder/$SteamAppUser/config/retrodeck/retrodeck.cfg" "$rd_conf" # Copy existing $rd_conf so new user can have their own presets
for emu_conf in $(find "/var/config" -mindepth 1 -maxdepth 1 -type l -printf '%f\n') # For all the config folders already linked to a different user
do
if [[ ! -z $(grep "^$emu_conf$" "$multi_user_emulator_config_dirs") ]]; then
multi_user_selective_emu_init "$emu_conf"
dir_prep "$multi_user_data_folder/$SteamAppUser/config/$emu_conf" "/var/config/$emu_conf"
fi
done
for emu_conf in $(find "/var/config" -mindepth 1 -maxdepth 1 -type d -printf '%f\n') # For all the currently non-linked config folders, like from a newly-added emulator
do
if [[ ! -z $(grep "^$emu_conf$" "$multi_user_emulator_config_dirs") ]]; then
dir_prep "$multi_user_data_folder/$SteamAppUser/config/$emu_conf" "/var/config/$emu_conf"
fi
done
}
multi_user_link_current_user_files() {
ln -sfT "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
ln -sfT "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
ln -sfT "$multi_user_data_folder/$SteamAppUser/screenshots" "$screenshots_folder"
ln -sfT "$multi_user_data_folder/$SteamAppUser/config/retrodeck/retrodeck.cfg" "$rd_conf" # Linking personal $rd_conf for per-user settings
for emu_conf in $(find "/var/config" -mindepth 1 -maxdepth 1 -type d -printf '%f\n') # Find any new emulator config folders from last time this user played
do
if [[ ! -z $(grep "^$emu_conf$" "$multi_user_emulator_config_dirs") ]]; then
dir_prep "$multi_user_data_folder/$SteamAppUser/config/$emu_conf" "/var/config/$emu_conf"
fi
done
for emu_conf in $(find "/var/config" -mindepth 1 -maxdepth 1 -type l -printf '%f\n')
do
if [[ ! -z $(grep "^$emu_conf$" "$multi_user_emulator_config_dirs") ]]; then
if [[ -d "$multi_user_data_folder/$SteamAppUser/config/$emu_conf" ]]; then # If the current user already has a config folder for this emulator
ln -sfT "$multi_user_data_folder/$SteamAppUser/config/$emu_conf" "retrodeck/config/$emu_conf"
else # If the current user doesn't have a config folder for this emulator, init it and then link it
multi_user_selective_emu_init "$emu_conf"
dir_prep "$multi_user_data_folder/$SteamAppUser/config/$emu_conf" "/var/config/$emu_conf"
fi
fi
done
}
multi_user_selective_emu_init() {
case "$1" in
"citra-emu")
citra_init
;;
"dolphin-emu")
dolphin_init
;;
"duckstation")
duckstation_init
;;
"melonDS")
melonds_init
;;
"PCSX2")
pcsx2_init
;;
"ppsspp")
ppssppsdl_init
;;
"primehack")
primehack_init
;;
"retroarch")
ra_init
;;
"rpcs3")
rpcs3_init
;;
"Ryujinx")
ryujinx_init
;;
"xemu")
xemu_init
;;
"yuzu")
yuzu_init
;;
esac
}
conf_write() { conf_write() {
# writes the variables in the retrodeck config file # writes the variables in the retrodeck config file
@ -919,25 +1074,24 @@ yuzu_init() {
echo "Initializing YUZU" echo "Initializing YUZU"
echo "----------------------" echo "----------------------"
# removing dead symlinks as they were present in a past version # removing dead symlinks as they were present in a past version
if [ -d $rdhome/bios/switch ]; then if [ -d $bios_folder/switch ]; then
find $rdhome/bios/switch -xtype l -exec rm {} \; find $bios_folder/switch -xtype l -exec rm {} \;
fi fi
# initializing the keys folder # initializing the keys folder
dir_prep "$rdhome/bios/switch/keys" "/var/data/yuzu/keys" dir_prep "$bios_folder/switch/keys" "/var/data/yuzu/keys"
# initializing the firmware folder # initializing the firmware folder
dir_prep "$rdhome/bios/switch/registered" "/var/data/yuzu/nand/system/Contents/registered" dir_prep "$bios_folder/switch/registered" "/var/data/yuzu/nand/system/Contents/registered"
# initializing the save folders # initializing the save folders
dir_prep "$rdhome/saves/switch/yuzu/nand" "/var/data/yuzu/nand" dir_prep "$saves_folder/switch/yuzu/nand" "/var/data/yuzu/nand"
dir_prep "$rdhome/saves/switch/yuzu/sdmc" "/var/data/yuzu/sdmc" dir_prep "$saves_folder/switch/yuzu/sdmc" "/var/data/yuzu/sdmc"
# configuring Yuzu # configuring Yuzu
dir_prep "$rdhome/.logs/yuzu" "/var/data/yuzu/log" dir_prep "$logs_folder/yuzu" "/var/data/yuzu/log"
# removing config directory to wipe legacy files # removing config directory to wipe legacy files
rm -rf /var/config/yuzu rm -rf /var/config/yuzu
mkdir -pv /var/config/yuzu/ mkdir -pv /var/config/yuzu/
cp -fvr $emuconfigs/yuzu/* /var/config/yuzu/ cp -fvr $emuconfigs/yuzu/* /var/config/yuzu/
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/yuzu/qt-config.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/yuzu/qt-config.ini
dir_prep "$rdhome/screenshots" "/var/data/yuzu/screenshots" dir_prep "$screenshots_folder" "/var/data/yuzu/screenshots"
dir_prep "$mods_folder/Yuzu" "/var/data/yuzu/load"
} }
dolphin_init() { dolphin_init() {
@ -949,15 +1103,13 @@ dolphin_init() {
mkdir -pv /var/config/dolphin-emu/ mkdir -pv /var/config/dolphin-emu/
cp -fvr "$emuconfigs/dolphin/"* /var/config/dolphin-emu/ cp -fvr "$emuconfigs/dolphin/"* /var/config/dolphin-emu/
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/dolphin-emu/Dolphin.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/dolphin-emu/Dolphin.ini
dir_prep "$rdhome/saves/gc/dolphin/EUR" "/var/data/dolphin-emu/GC/EUR" dir_prep "$saves_folder/gc/dolphin/EUR" "/var/data/dolphin-emu/GC/EUR"
dir_prep "$rdhome/saves/gc/dolphin/USA" "/var/data/dolphin-emu/GC/USA" dir_prep "$saves_folder/gc/dolphin/USA" "/var/data/dolphin-emu/GC/USA"
dir_prep "$rdhome/saves/gc/dolphin/JAP" "/var/data/dolphin-emu/GC/JAP" dir_prep "$saves_folder/gc/dolphin/JAP" "/var/data/dolphin-emu/GC/JAP"
dir_prep "$rdhome/screenshots" "/var/data/dolphin-emu/ScreenShots" dir_prep "$screenshots_folder" "/var/data/dolphin-emu/ScreenShots"
dir_prep "$rdhome/states/dolphin" "/var/data/dolphin-emu/StateSaves" dir_prep "$states_folder/dolphin" "/var/data/dolphin-emu/StateSaves"
mkdir -pv /var/data/dolphin-emu/Wii/ mkdir -pv /var/data/dolphin-emu/Wii/
dir_prep "$rdhome/saves/wii/dolphin" "/var/data/dolphin-emu/Wii" dir_prep "$saves_folder/wii/dolphin" "/var/data/dolphin-emu/Wii"
dir_prep "$mods_folder/Dolphin" "/var/data/dolphin-emu/Load/GraphicMods/"
dir_prep "$texture_packs_folder/Dolphin" "/var/data/dolphin-emu/Load/Textures/"
} }
primehack_init() { primehack_init() {
@ -969,15 +1121,13 @@ primehack_init() {
mkdir -pv /var/config/primehack/ mkdir -pv /var/config/primehack/
cp -fvr "$emuconfigs/primehack/"* /var/config/primehack/ cp -fvr "$emuconfigs/primehack/"* /var/config/primehack/
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/primehack/Dolphin.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/primehack/Dolphin.ini
dir_prep "$rdhome/saves/gc/primehack/EUR" "/var/data/primehack/GC/EUR" dir_prep "$saves_folder/gc/primehack/EUR" "/var/data/primehack/GC/EUR"
dir_prep "$rdhome/saves/gc/primehack/USA" "/var/data/primehack/GC/USA" dir_prep "$saves_folder/gc/primehack/USA" "/var/data/primehack/GC/USA"
dir_prep "$rdhome/saves/gc/primehack/JAP" "/var/data/primehack/GC/JAP" dir_prep "$saves_folder/gc/primehack/JAP" "/var/data/primehack/GC/JAP"
dir_prep "$rdhome/screenshots" "/var/data/primehack/ScreenShots" dir_prep "$screenshots_folder" "/var/data/primehack/ScreenShots"
dir_prep "$rdhome/states/primehack" "/var/data/primehack/StateSaves" dir_prep "$states_folder/primehack" "/var/data/primehack/StateSaves"
mkdir -pv /var/data/primehack/Wii/ mkdir -pv /var/data/primehack/Wii/
dir_prep "$rdhome/saves/wii/primehack" "/var/data/primehack/Wii" dir_prep "$saves_folder/wii/primehack" "/var/data/primehack/Wii"
dir_prep "$mods_folder/Primehack" "/var/data/primehack/Load/GraphicMods/"
dir_prep "$texture_packs_folder/Primehack" "/var/data/primehack/Load/Textures/"
} }
pcsx2_init() { pcsx2_init() {
@ -987,8 +1137,8 @@ pcsx2_init() {
# removing config directory to wipe legacy files # removing config directory to wipe legacy files
rm -rf /var/config/PCSX2 rm -rf /var/config/PCSX2
mkdir -pv "/var/config/PCSX2/inis" mkdir -pv "/var/config/PCSX2/inis"
mkdir -pv "$rdhome/saves/ps2/pcsx2/memcards" mkdir -pv "$saves_folder/ps2/pcsx2/memcards"
mkdir -pv "$rdhome/states/ps2/pcsx2" mkdir -pv "$states_folder/ps2/pcsx2"
cp -fvr $emuconfigs/PCSX2/* /var/config/PCSX2/inis/ cp -fvr $emuconfigs/PCSX2/* /var/config/PCSX2/inis/
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2_ui.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2_ui.ini
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2.ini
@ -1005,9 +1155,9 @@ melonds_init() {
# removing config directory to wipe legacy files # removing config directory to wipe legacy files
rm -rf /var/config/melonDS rm -rf /var/config/melonDS
mkdir -pv /var/config/melonDS/ mkdir -pv /var/config/melonDS/
mkdir -pv "$rdhome/saves/nds/melonds" mkdir -pv "$saves_folder/nds/melonds"
mkdir -pv "$rdhome/states/nds/melonds" mkdir -pv "$states_folder/nds/melonds"
dir_prep "$rdhome/bios" "/var/config/melonDS/bios" dir_prep "$bios_folder" "/var/config/melonDS/bios"
cp -fvr $emuconfigs/melonDS.ini /var/config/melonDS/ cp -fvr $emuconfigs/melonDS.ini /var/config/melonDS/
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/melonDS/melonDS.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/melonDS/melonDS.ini
} }
@ -1019,14 +1169,12 @@ citra_init() {
# removing config directory to wipe legacy files # removing config directory to wipe legacy files
rm -rf /var/config/citra-emu rm -rf /var/config/citra-emu
mkdir -pv /var/config/citra-emu/ mkdir -pv /var/config/citra-emu/
mkdir -pv "$rdhome/saves/n3ds/citra/nand/" mkdir -pv "$saves_folder/n3ds/citra/nand/"
mkdir -pv "$rdhome/saves/n3ds/citra/sdmc/" mkdir -pv "$saves_folder/n3ds/citra/sdmc/"
dir_prep "$rdhome/bios/citra/sysdata" "/var/data/citra-emu/sysdata" dir_prep "$bios_folder/citra/sysdata" "/var/data/citra-emu/sysdata"
dir_prep "$rdhome/.logs/citra" "/var/data/citra-emu/log" dir_prep "$logs_folder/citra" "/var/data/citra-emu/log"
cp -fv $emuconfigs/citra/qt-config.ini /var/config/citra-emu/qt-config.ini cp -fv $emuconfigs/citra/qt-config.ini /var/config/citra-emu/qt-config.ini
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/citra-emu/qt-config.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/citra-emu/qt-config.ini
dir_prep "$mods_folder/Citra" "/var/data/citra-emu/load/mods/"
dir_prep "$texture_packs_folder/Citra" "/var/data/citra-emu/load/textures/"
} }
rpcs3_init() { rpcs3_init() {
@ -1044,7 +1192,7 @@ xemu_init() {
echo "------------------------" echo "------------------------"
echo "Initializing XEMU" echo "Initializing XEMU"
echo "------------------------" echo "------------------------"
mkdir -pv $rdhome/saves/xbox/xemu/ mkdir -pv $saves_folder/xbox/xemu/
# removing config directory to wipe legacy files # removing config directory to wipe legacy files
rm -rf /var/config/xemu rm -rf /var/config/xemu
rm -rf /var/data/xemu rm -rf /var/data/xemu
@ -1052,11 +1200,11 @@ xemu_init() {
cp -fv $emuconfigs/xemu.toml /var/config/xemu/xemu.toml cp -fv $emuconfigs/xemu.toml /var/config/xemu/xemu.toml
sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/xemu/xemu.toml sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/xemu/xemu.toml
# Preparing HD dummy Image if the image is not found # Preparing HD dummy Image if the image is not found
if [ ! -f $rdhome/bios/xbox_hdd.qcow2 ] if [ ! -f $bios_folder/xbox_hdd.qcow2 ]
then then
wget "https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip" -P $rdhome/bios/ wget "https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip" -P $bios_folder/
unzip -q $rdhome/bios/xbox_hdd.qcow2.zip -d $rdhome/bios/ unzip -q $bios_folder/xbox_hdd.qcow2.zip -d $bios_folder/
rm -rfv $rdhome/bios/xbox_hdd.qcow2.zip rm -rfv $bios_folder/xbox_hdd.qcow2.zip
fi fi
} }
@ -1075,13 +1223,13 @@ duckstation_init() {
echo "------------------------" echo "------------------------"
echo "Initializing DUCKSTATION" echo "Initializing DUCKSTATION"
echo "------------------------" echo "------------------------"
dir_prep "$rdhome/saves/duckstation" "/var/data/duckstation/memcards" # This was not previously included, so performing first for save data safety. dir_prep "$saves_folder/duckstation" "/var/data/duckstation/memcards" # This was not previously included, so performing first for save data safety.
dir_prep "$rdhome/states/duckstation" "/var/data/duckstation/savestates" # This was not previously included, so performing first for state data safety. dir_prep "$states_folder/duckstation" "/var/data/duckstation/savestates" # This was not previously included, so performing first for state data safety.
# removing config directory to wipe legacy files # removing config directory to wipe legacy files
rm -rf /var/config/duckstation rm -rf /var/config/duckstation
mkdir -p /var/data/duckstation/ mkdir -p /var/data/duckstation/
cp -fv $emuconfigs/duckstation/* /var/data/duckstation cp -fv $emuconfigs/duckstation/* /var/data/duckstation
sed -i 's#/home/deck/retrodeck/bios#'$rdhome/bios'#g' /var/data/duckstation/settings.ini sed -i 's#/home/deck/retrodeck/bios#'$bios_folder'#g' /var/data/duckstation/settings.ini
} }
ryujinx_init() { ryujinx_init() {
@ -1093,7 +1241,7 @@ ryujinx_init() {
mkdir -p /var/config/Ryujinx/system mkdir -p /var/config/Ryujinx/system
cp -fv $emuconfigs/ryujinx/* /var/config/Ryujinx cp -fv $emuconfigs/ryujinx/* /var/config/Ryujinx
sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/Ryujinx/Config.json sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/Ryujinx/Config.json
dir_prep "$rdhome/bios/switch/keys" "/var/config/Ryujinx/system" dir_prep "$bios_folder/switch/keys" "/var/config/Ryujinx/system"
} }
standalones_init() { standalones_init() {
@ -1116,54 +1264,58 @@ standalones_init() {
} }
ra_init() { ra_init() {
# removing config directory to wipe legacy files if [[ $multi_user_mode == "true" ]]; then
rm -rf /var/config/retroarch # TODO: Put multi-user specific init here
mkdir -p /var/config/retroarch else # TODO: Put single-user specific init here
dir_prep "$rdhome/bios" "/var/config/retroarch/system" # removing config directory to wipe legacy files
dir_prep "$rdhome/.logs/retroarch" "/var/config/retroarch/logs" rm -rf /var/config/retroarch
mkdir -pv /var/config/retroarch/shaders/ mkdir -p /var/config/retroarch
cp -rf /app/share/libretro/shaders /var/config/retroarch/ dir_prep "$bios_folder" "/var/config/retroarch/system"
dir_prep "$rdhome/shaders/retroarch" "/var/config/retroarch/shaders" dir_prep "$logs_folder/retroarch" "/var/config/retroarch/logs"
mkdir -pv /var/config/retroarch/cores/ mkdir -pv /var/config/retroarch/shaders/
cp -f /app/share/libretro/cores/* /var/config/retroarch/cores/ cp -rf /app/share/libretro/shaders /var/config/retroarch/
cp -fv $emuconfigs/retroarch/retroarch.cfg /var/config/retroarch/ dir_prep "$rdhome/shaders/retroarch" "/var/config/retroarch/shaders"
cp -fv $emuconfigs/retroarch/retroarch-core-options.cfg /var/config/retroarch/ mkdir -pv /var/config/retroarch/cores/
mkdir -pv /var/config/retroarch/config/ cp -f /app/share/libretro/cores/* /var/config/retroarch/cores/
cp -rf $emuconfigs/retroarch/core-overrides/* /var/config/retroarch/config cp -fv $emuconfigs/retroarch/retroarch.cfg /var/config/retroarch/
#rm -rf $rdhome/bios/bios # in some situations a double bios symlink is created cp -fv $emuconfigs/retroarch/retroarch-core-options.cfg /var/config/retroarch/
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/retroarch/retroarch.cfg mkdir -pv /var/config/retroarch/config/
cp -rf $emuconfigs/retroarch/core-overrides/* /var/config/retroarch/config
#rm -rf $rdhome/bios/bios # in some situations a double bios symlink is created
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/retroarch/retroarch.cfg
# PPSSPP # PPSSPP
echo "--------------------------------" echo "--------------------------------"
echo "Initializing PPSSPP_LIBRETRO" echo "Initializing PPSSPP_LIBRETRO"
echo "--------------------------------" echo "--------------------------------"
if [ -d $rdhome/bios/PPSSPP/flash0/font ] if [ -d $bios_folder/PPSSPP/flash0/font ]
then then
mv -fv $rdhome/bios/PPSSPP/flash0/font $rdhome/bios/PPSSPP/flash0/font.bak mv -fv $bios_folder/PPSSPP/flash0/font $bios_folder/PPSSPP/flash0/font.bak
fi fi
mkdir -p $rdhome/bios/PPSSPP mkdir -p $bios_folder/PPSSPP
#if [ ! -f "$rdhome/bios/PPSSPP/ppge_atlas.zim" ] #if [ ! -f "$rdhome/bios/PPSSPP/ppge_atlas.zim" ]
#then #then
wget "https://github.com/hrydgard/ppsspp/archive/refs/heads/master.zip" -P $rdhome/bios/PPSSPP wget "https://github.com/hrydgard/ppsspp/archive/refs/heads/master.zip" -P $bios_folder/PPSSPP
unzip -q "$rdhome/bios/PPSSPP/master.zip" -d $rdhome/bios/PPSSPP/ unzip -q "$bios_folder/PPSSPP/master.zip" -d $bios_folder/PPSSPP/
mv -f "$rdhome/bios/PPSSPP/ppsspp-master/assets/"* "$rdhome/bios/PPSSPP/" mv -f "$bios_folder/PPSSPP/ppsspp-master/assets/"* "$bios_folder/PPSSPP/"
rm -rfv "$rdhome/bios/PPSSPP/master.zip" rm -rfv "$bios_folder/PPSSPP/master.zip"
rm -rfv "$rdhome/bios/PPSSPP/ppsspp-master" rm -rfv "$bios_folder/PPSSPP/ppsspp-master"
#fi #fi
if [ -d $rdhome/bios/PPSSPP/flash0/font.bak ] if [ -d $bios_folder/PPSSPP/flash0/font.bak ]
then then
mv -fv $rdhome/bios/PPSSPP/flash0/font.bak $rdhome/bios/PPSSPP/flash0/font mv -fv $bios_folder/PPSSPP/flash0/font.bak $bios_folder/PPSSPP/flash0/font
fi fi
# MSX / SVI / ColecoVision / SG-1000 # MSX / SVI / ColecoVision / SG-1000
echo "-----------------------------------------------------------" echo "-----------------------------------------------------------"
echo "Initializing MSX / SVI / ColecoVision / SG-1000 LIBRETRO" echo "Initializing MSX / SVI / ColecoVision / SG-1000 LIBRETRO"
echo "-----------------------------------------------------------" echo "-----------------------------------------------------------"
wget "http://bluemsx.msxblue.com/rel_download/blueMSXv282full.zip" -P $rdhome/bios/MSX wget "http://bluemsx.msxblue.com/rel_download/blueMSXv282full.zip" -P $bios_folder/MSX
unzip -q "$rdhome/bios/MSX/blueMSXv282full.zip" -d $rdhome/bios/MSX unzip -q "$bios_folder/MSX/blueMSXv282full.zip" -d $bios_folder/MSX
mv -f $rdhome/bios/MSX/Databases $rdhome/bios/Databases mv -f $bios_folder/MSX/Databases $bios_folder/Databases
mv -f $rdhome/bios/MSX/Machines $rdhome/bios/Machines mv -f $bios_folder/MSX/Machines $bios_folder/Machines
rm -rfv $rdhome/bios/MSX rm -rfv $bios_folder/MSX
fi
} }
cli_emulator_reset() { cli_emulator_reset() {
@ -1241,49 +1393,49 @@ emulators_post_move() {
dir_prep $roms_folder "/var/config/emulationstation/ROMs" dir_prep $roms_folder "/var/config/emulationstation/ROMs"
# RA section # RA section
dir_prep "$rdhome/bios" "/var/config/retroarch/system" dir_prep "$bios_folder" "/var/config/retroarch/system"
dir_prep "$rdhome/.logs/retroarch" "/var/config/retroarch/logs" dir_prep "$logs_folder/retroarch" "/var/config/retroarch/logs"
dir_prep "$rdhome/shaders/retroarch" "/var/config/retroarch/shaders" dir_prep "$rdhome/shaders/retroarch" "/var/config/retroarch/shaders"
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/retroarch/retroarch.cfg sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/retroarch/retroarch.cfg
# Yuzu section # Yuzu section
dir_prep "$rdhome/bios/switch/keys" "/var/data/yuzu/keys" dir_prep "$bios_folder/switch/keys" "/var/data/yuzu/keys"
dir_prep "$rdhome/bios/switch/registered" "/var/data/yuzu/nand/system/Contents/registered" dir_prep "$bios_folder/switch/registered" "/var/data/yuzu/nand/system/Contents/registered"
dir_prep "$rdhome/saves/switch/yuzu/nand" "/var/data/yuzu/nand" dir_prep "$saves_folder/switch/yuzu/nand" "/var/data/yuzu/nand"
dir_prep "$rdhome/saves/switch/yuzu/sdmc" "/var/data/yuzu/sdmc" dir_prep "$saves_folder/switch/yuzu/sdmc" "/var/data/yuzu/sdmc"
dir_prep "$rdhome/.logs/yuzu" "/var/data/yuzu/log" dir_prep "$logs_folder/yuzu" "/var/data/yuzu/log"
dir_prep "$rdhome/screenshots" "/var/data/yuzu/screenshots" dir_prep "$screenshots_folder" "/var/data/yuzu/screenshots"
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/yuzu/qt-config.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/yuzu/qt-config.ini
# Dolphin section # Dolphin section
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/dolphin-emu/Dolphin.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/dolphin-emu/Dolphin.ini
dir_prep "$rdhome/saves/gc/dolphin/EUR" "/var/data/dolphin-emu/GC/EUR" dir_prep "$saves_folder/gc/dolphin/EUR" "/var/data/dolphin-emu/GC/EUR"
dir_prep "$rdhome/saves/gc/dolphin/USA" "/var/data/dolphin-emu/GC/USA" dir_prep "$saves_folder/gc/dolphin/USA" "/var/data/dolphin-emu/GC/USA"
dir_prep "$rdhome/saves/gc/dolphin/JAP" "/var/data/dolphin-emu/GC/JAP" dir_prep "$saves_folder/gc/dolphin/JAP" "/var/data/dolphin-emu/GC/JAP"
dir_prep "$rdhome/screenshots" "/var/data/dolphin-emu/ScreenShots" dir_prep "$screenshots_folder" "/var/data/dolphin-emu/ScreenShots"
dir_prep "$rdhome/states/dolphin" "/var/data/dolphin-emu/StateSaves" dir_prep "$states_folder/dolphin" "/var/data/dolphin-emu/StateSaves"
dir_prep "$rdhome/saves/wii/dolphin" "/var/data/dolphin-emu/Wii/" dir_prep "$saves_folder/wii/dolphin" "/var/data/dolphin-emu/Wii/"
# Primehack section # Primehack section
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/primehack/Dolphin.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/primehack/Dolphin.ini
dir_prep "$rdhome/saves/gc/primehack/EUR" "/var/data/primehack/GC/EUR" dir_prep "$saves_folder/gc/primehack/EUR" "/var/data/primehack/GC/EUR"
dir_prep "$rdhome/saves/gc/primehack/USA" "/var/data/primehack/GC/USA" dir_prep "$saves_folder/gc/primehack/USA" "/var/data/primehack/GC/USA"
dir_prep "$rdhome/saves/gc/primehack/JAP" "/var/data/primehack/GC/JAP" dir_prep "$saves_folder/gc/primehack/JAP" "/var/data/primehack/GC/JAP"
dir_prep "$rdhome/screenshots" "/var/data/primehack/ScreenShots" dir_prep "$screenshots_folder" "/var/data/primehack/ScreenShots"
dir_prep "$rdhome/states/primehack" "/var/data/primehack/StateSaves" dir_prep "$states_folder/primehack" "/var/data/primehack/StateSaves"
dir_prep "$rdhome/saves/wii/primehack" "/var/data/primehack/Wii/" dir_prep "$saves_folder/wii/primehack" "/var/data/primehack/Wii/"
# PCSX2 section # PCSX2 section
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2_ui.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2_ui.ini
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2.ini
# MelonDS section # MelonDS section
dir_prep "$rdhome/bios" "/var/config/melonDS/bios" dir_prep "$bios_folder" "/var/config/melonDS/bios"
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/melonDS/melonDS.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/melonDS/melonDS.ini
# Citra section # Citra section
dir_prep "$rdhome/bios/citra/sysdata" "/var/data/citra-emu/sysdata" dir_prep "$bios_folder/citra/sysdata" "/var/data/citra-emu/sysdata"
dir_prep "$rdhome/.logs/citra" "/var/data/citra-emu/log" dir_prep "$logs_folder/citra" "/var/data/citra-emu/log"
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/citra-emu/qt-config.ini sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/citra-emu/qt-config.ini
# RPCS3 section # RPCS3 section
@ -1296,11 +1448,11 @@ emulators_post_move() {
sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/ppsspp/PSP/SYSTEM/ppsspp.ini sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/ppsspp/PSP/SYSTEM/ppsspp.ini
# Duckstation section # Duckstation section
sed -i 's#/home/deck/retrodeck/bios#'$rdhome/bios'#g' /var/data/duckstation/settings.ini sed -i 's#/home/deck/retrodeck/bios#'$bios_folder'#g' /var/data/duckstation/settings.ini
# Ryujinx section # Ryujinx section
sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/Ryujinx/Config.json sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/Ryujinx/Config.json
dir_prep "$rdhome/bios/switch/keys" "/var/config/Ryujinx/system" dir_prep "$bios_folder/switch/keys" "/var/config/Ryujinx/system"
} }
create_lock() { create_lock() {
@ -1345,8 +1497,8 @@ path_selected=false
while [ $path_selected == false ] while [ $path_selected == false ]
do do
local target="$(zenity --file-selection --title="Choose RetroDECK data directory location" --directory)" local target="$(zenity --file-selection --title="Choose RetroDECK data directory location" --directory)"
if [[ ! -z $target ]]; then if [[ ! -z "$target" ]]; then
if [[ -w $target ]]; then if [[ -w "$target" ]]; then
zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \ zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \
--cancel-label="No" \ --cancel-label="No" \
--ok-label "Yes" \ --ok-label "Yes" \
@ -1492,7 +1644,7 @@ finit() {
mkdir -pv $saves_folder mkdir -pv $saves_folder
mkdir -pv $states_folder mkdir -pv $states_folder
mkdir -pv $rdhome/screenshots mkdir -pv $screenshots_folder
mkdir -pv $logs_folder mkdir -pv $logs_folder
mkdir -pv $mods_folder mkdir -pv $mods_folder
mkdir -pv $texture_packs_folder mkdir -pv $texture_packs_folder

@ -1 +1 @@
Subproject commit 717b78093797270877ec416e58082f1c71d435d8 Subproject commit 0b1cfb79e591e10488a3262d6b38db843c39a409

View file

@ -10,7 +10,6 @@ source /app/libexec/functions.sh
# Configurator Option Tree # Configurator Option Tree
# Welcome # Welcome
# - Move RetroDECK
# - RetroArch Presets # - RetroArch Presets
# - Change Rewind Setting # - Change Rewind Setting
# - Enable/Disable Rewind # - Enable/Disable Rewind
@ -29,6 +28,7 @@ source /app/libexec/functions.sh
# - Launch XEMU # - Launch XEMU
# - Launch Yuzu # - Launch Yuzu
# - Tools and Troubleshooting # - Tools and Troubleshooting
# - Move RetroDECK
# - Multi-file game check # - Multi-file game check
# - Basic BIOS file check # - Basic BIOS file check
# - Advanced BIOS file check # - Advanced BIOS file check
@ -46,14 +46,11 @@ source /app/libexec/functions.sh
# - Reset PPSSPP # - Reset PPSSPP
# - Reset Primehack # - Reset Primehack
# - Reset RPCS3 # - Reset RPCS3
# - Reset Ryujinx
# - Reset XEMU # - Reset XEMU
# - Reset Yuzu # - Reset Yuzu
# - Reset All Emulators # - Reset All Emulators
# - Reset RetroDECK # - Reset RetroDECK
# Code for the menus should be put in reverse order, so functions for sub-menus exists before it is called by the parent menu
# DIALOG TREE FUNCTIONS # DIALOG TREE FUNCTIONS
configurator_reset_dialog() { configurator_reset_dialog() {
@ -878,41 +875,16 @@ configurator_move_dialog() {
} }
configurator_retrodeck_multiuser_dialog() { configurator_retrodeck_multiuser_dialog() {
if [[ $(get_setting_value $rd_conf "multi_user" retrodeck) == "true" ]]; then if [[ $(get_setting_value $rd_conf "multi_user_mode" retrodeck) == "true" ]]; then
zenity --question \ zenity --question \
--no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Multi-user Support" \ --title "RetroDECK Configurator - RetroDECK Multi-user Support" \
--text="Multi-user support is current enabled. Do you want to disable it?\n\nIf there are more than one user configured,\nyou will be given a choice of which to use as the single RetroDECK user.\n\nAll existing saves will be retained in the \"retrodeck/multi-user-data\" folder." --text="Multi-user support is current enabled. Do you want to disable it?\n\nIf there are more than one user configured,\nyou will be given a choice of which to use as the single RetroDECK user.\n\nThis users files will be moved to the default locations.\n\nOther users files will remain in the mutli-user-data folder.\n"
if [ $? == 0 ] # User clicked "Yes" if [ $? == 0 ] # User clicked "Yes"
then # Load full userlist for selection then
full_userlist=() multi_user_disable_multi_user_mode
while IFS= read -r user else # User clicked "Cancel"
do
full_userlist=("${full_userlist[@]}" "$user")
done < <(cat "$rd_userlist")
single_user=$(zenity \
--list --width=1200 --height=720 \
--ok-label="Select User" \
--text="Choose the current user:" \
--column "Steam Username" --print-column=1 \
"${full_userlist[@]}")
if [[ ! -z $single_user ]]; then # Single user was selected
unlink "$saves_folder"
unlink "$states_folder"
mkdir "$saves_folder"
mkdir "$states_folder"
cp -r "$multi_user_data_folder/$single_user/saves/." "$saves_folder"
cp -r "$multi_user_data_folder/$single_user/states/." "$states_folder"
set_setting_value $rd_conf "multi_user" "false" retrodeck
configurator_process_complete_dialog "disabling multi-user support"
else
configurator_generic_dialog "No single user was selected, please try the process again."
configurator_retrodeck_multiuser_dialog
fi
else
configurator_developer_dialog configurator_developer_dialog
fi fi
else else
@ -921,13 +893,11 @@ configurator_retrodeck_multiuser_dialog() {
--title "RetroDECK Configurator - RetroDECK Multi-user support" \ --title "RetroDECK Configurator - RetroDECK Multi-user support" \
--text="Multi-user support is current disabled. Do you want to enable it?\n\nThe current users saves and states will be backed up and then moved to the \"retrodeck/multi-user-data\" folder.\nAdditional users will automatically be stored in their own folder here as they are added." --text="Multi-user support is current disabled. Do you want to enable it?\n\nThe current users saves and states will be backed up and then moved to the \"retrodeck/multi-user-data\" folder.\nAdditional users will automatically be stored in their own folder here as they are added."
if [ $? == 0 ] if [ $? == 0 ] # User clicked "Yes"
then then
set_setting_value $rd_conf "multi_user" "true" retrodeck multi_user_enable_multi_user_mode
load_current_user_saves_and_states else # User clicked "Cancel"
configurator_process_complete_dialog "enabling multi-user support" configurator_developer_dialog
else
configurator_retroarch_options_dialog
fi fi
fi fi
} }
@ -936,7 +906,7 @@ configurator_developer_dialog() {
choice=$(zenity --list --title="RetroDECK Configurator Utility - Change Options" --cancel-label="Back" \ choice=$(zenity --list --title="RetroDECK Configurator Utility - Change Options" --cancel-label="Back" \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \
--column="Choice" --column="Action" \ --column="Choice" --column="Action" \
"Change Multi-user mode" "Enable or disable multi-user save/states support" ) "Change Multi-user mode" "Enable or disable multi-user support" )
case $choice in case $choice in
@ -988,6 +958,7 @@ configurator_welcome_dialog() {
;; ;;
"Developer Options" ) "Developer Options" )
configurator_generic_dialog "The following features and options are potentially VERY DANGEROUS for your RetroDECK install!\n\nThey should be considered the bleeding-edge of upcoming RetroDECK features, and never used when you have important saves/states/roms that are not backed up!\n\nYOU HAVE BEEN WARNED!"
configurator_developer_dialog configurator_developer_dialog
;; ;;