More setting retention fixes

This commit is contained in:
icenine451 2022-10-14 10:51:45 -04:00
parent 9fa49ff904
commit 9e50cdf4a8

View file

@ -95,8 +95,10 @@ standalones_init() {
# configuring Yuzu
dir_prep "$rdhome/.logs/yuzu" "/var/data/yuzu/log"
mkdir -pv /var/config/yuzu/
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fvr $emuconfigs/yuzu/* /var/config/yuzu/
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/yuzu/qt-config.ini
fi
dir_prep "$rdhome/screenshots" "/var/data/yuzu/screenshots"
# Dolphin
@ -104,8 +106,10 @@ standalones_init() {
echo "Initializing DOLPHIN"
echo "----------------------"
mkdir -pv /var/config/dolphin-emu/
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fvr "$emuconfigs/dolphin/"* /var/config/dolphin-emu/
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/dolphin-emu/Dolphin.ini
fi
dir_prep "$rdhome/saves/gc/dolphin/EUR" "/var/data/dolphin-emu/GC/EUR"
dir_prep "$rdhome/saves/gc/dolphin/USA" "/var/data/dolphin-emu/GC/USA"
dir_prep "$rdhome/saves/gc/dolphin/JAP" "/var/data/dolphin-emu/GC/JAP"
@ -120,9 +124,11 @@ standalones_init() {
mkdir -pv "/var/config/PCSX2/inis"
mkdir -pv "$rdhome/saves/ps2/pcsx2/memcards"
mkdir -pv "$rdhome/states/ps2/pcsx2"
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fvr $emuconfigs/PCSX2/* /var/config/PCSX2/inis/
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2_ui.ini
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/PCSX2/inis/PCSX2.ini
fi
#dir_prep "$rdhome/states/ps2/pcsx2" "/var/config/PCSX2/sstates"
#dir_prep "$rdhome/screenshots" "/var/config/PCSX2/snaps"
#dir_prep "$rdhome/.logs" "/var/config/PCSX2/logs"
@ -136,9 +142,11 @@ standalones_init() {
mkdir -pv "$rdhome/saves/nds/melonds"
mkdir -pv "$rdhome/states/nds/melonds"
dir_prep "$rdhome/bios" "/var/config/melonDS/bios"
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fvr $emuconfigs/melonDS.ini /var/config/melonDS/
# Replace ~/retrodeck with $rdhome as ~ cannot be understood by MelonDS
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/melonDS/melonDS.ini
fi
# CITRA
echo "------------------------"
@ -149,8 +157,10 @@ standalones_init() {
mkdir -pv "$rdhome/saves/n3ds/citra/sdmc/"
dir_prep "$rdhome/bios/citra/sysdata" "/var/data/citra-emu/sysdata"
dir_prep "$rdhome/.logs/citra" "/var/data/citra-emu/log"
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fv $emuconfigs/citra-qt-config.ini /var/config/citra-emu/qt-config.ini
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/citra-emu/qt-config.ini
fi
#TODO: do the same with roms folders after new variables is pushed (check even the others qt-emu)
#But actually everything is always symlinked to retrodeck/roms so it might be not needed
#sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/citra-emu/qt-config.ini
@ -160,16 +170,20 @@ standalones_init() {
echo "Initializing RPCS3"
echo "------------------------"
mkdir -pv /var/config/rpcs3/
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fvr $emuconfigs/rpcs3/* /var/config/rpcs3/
sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/rpcs3/vfs.yml
fi
# XEMU
echo "------------------------"
echo "Initializing XEMU"
echo "------------------------"
mkdir -pv $rdhome/saves/xbox/xemu/
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fv $emuconfigs/xemu.toml /var/data/xemu/xemu.toml
sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/data/xemu/xemu.toml
fi
# Preparing HD dummy Image if the image is not found
if [ ! -f $rdhome/bios/xbox_hdd.qcow2 ]
then
@ -183,16 +197,20 @@ standalones_init() {
echo "Initializing PPSSPPSDL"
echo "------------------------"
mkdir -p /var/config/ppsspp/PSP/SYSTEM/
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fv $emuconfigs/ppssppsdl/* /var/config/ppsspp/PSP/SYSTEM/
sed -i 's#/home/deck/retrodeck#'$rdhome'#g' /var/config/ppsspp/PSP/SYSTEM/ppsspp.ini
fi
# DUCKSTATION
echo "------------------------"
echo "Initializing DUCKSTATION"
echo "------------------------"
mkdir -p /var/config/duckstation/
if [ $overwrite_configs = true ]; then # Initializing config after major version update
cp -fv $emuconfigs/duckstation/* /var/config/duckstation
sed -i 's#/home/deck/retrodeck/bios#'$rdhome/bios'#g' /var/config/ppsspp/PSP/SYSTEM/settings.ini
if [ $overwrite_configs = true ]; then # Initializing config after major version update
# PICO-8
@ -204,9 +222,9 @@ ra_init() {
dir_prep "$rdhome/bios" "/var/config/retroarch/system"
dir_prep "$rdhome/.logs/retroarch" "/var/config/retroarch/logs"
mkdir -pv /var/config/retroarch/cores/
cp /app/share/libretro/cores/* /var/config/retroarch/cores/
cp -fv $emuconfigs/retroarch.cfg /var/config/retroarch/
cp -fv /app/share/libretro/cores/* /var/config/retroarch/cores/
if [ $overwrite_configs = true ]; then
cp -fv $emuconfigs/retroarch.cfg /var/config/retroarch/
cp -fv $emuconfigs/retroarch-core-options.cfg /var/config/retroarch/
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/retroarch/retroarch.cfg
fi
@ -607,11 +625,15 @@ finit() {
# PICO-8
dir_prep "$roms_folder/pico8" "$rdhome/bios/pico8/bbs/carts" #this is the folder where pico-8 is saving the carts
overwrite_configs=true
ra_init
standalones_init
tools_init
create_lock
overwrite_configs=false
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
@ -658,11 +680,15 @@ https://retrodeck.net
exit
;;
--reset-ra*)
overwrite_configs=true
ra_init
overwrite_configs=false
shift # past argument with no value
;;
--reset-sa*)
overwrite_configs=true
standalones_init
overwrite_configs=false
shift # past argument with no value
;;
--reset-tools*)