diff --git a/emu-configs/PCSX2/PCSX2.ini b/emu-configs/PCSX2/PCSX2.ini index a83b5c7b..69653491 100644 --- a/emu-configs/PCSX2/PCSX2.ini +++ b/emu-configs/PCSX2/PCSX2.ini @@ -18,7 +18,7 @@ EnableWideScreenPatches = false EnableNoInterlacingPatches = false EnableRecordingTools = true EnableGameFixes = true -SaveStateOnShutdown = true +SaveStateOnShutdown = false ConsoleToStdio = false HostFs = false PatchBios = false diff --git a/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg b/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg index 51a4c215..d25d2deb 100644 --- a/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg @@ -4,5 +4,6 @@ defaults_file^$emuconfigs/duckstation/settings.ini change^cheevos^Enabled^true^Cheevos change^cheevos^Username^$cheevos_username^Cheevos change^cheevos^Token^$cheevos_token^Cheevos -change^cheevos^LoginTimestamp^$cheevos_login_timestamp -change^cheevos_hardcore^ChallengeMode^true +change^cheevos^LoginTimestamp^$cheevos_login_timestamp^Cheevos +change^cheevos_hardcore^ChallengeMode^true^Cheevos +change^savestate_auto_save^SaveStateOnExit^true^Main diff --git a/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg b/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg index 9dcbe525..829c66d2 100644 --- a/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg @@ -4,5 +4,6 @@ defaults_file^$emuconfigs/PCSX2/PCSX2.ini change^cheevos^Enabled^true^Achievements change^cheevos^Username^$cheevos_username^Achievements change^cheevos^Token^$cheevos_token^Achievements -change^cheevos^LoginTimestamp^$cheevos_login_timestamp -change^cheevos_hardcore^ChallengeMode^true +change^cheevos^LoginTimestamp^$cheevos_login_timestamp^Achievements +change^cheevos_hardcore^ChallengeMode^true^Achievements +change^savestate_auto_save^SaveStateOnShutdown^true^EmuCore diff --git a/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg b/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg index 946db0b9..7a65546a 100644 --- a/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg @@ -5,3 +5,5 @@ change^cheevos^cheevos_enable^true change^cheevos^cheevos_token^$cheevos_token change^cheevos^cheevos_username^$cheevos_username change^cheevos_hardcore^cheevos_hardcore_mode_enable^true +change^savestate_auto_load^savestate_auto_load^true +change^savestate_auto_save^savestate_auto_save^true diff --git a/emu-configs/defaults/retrodeck/retrodeck.cfg b/emu-configs/defaults/retrodeck/retrodeck.cfg index 97233497..68536de5 100644 --- a/emu-configs/defaults/retrodeck/retrodeck.cfg +++ b/emu-configs/defaults/retrodeck/retrodeck.cfg @@ -60,3 +60,11 @@ gba=false gbc=false n64=false snes=false + +[savestate_auto_load] +retroarch=true + +[savestate_auto_save] +duckstation=true +pcsx2=true +retroarch=true diff --git a/emu-configs/duckstation/settings.ini b/emu-configs/duckstation/settings.ini index 98bf3bef..75136809 100644 --- a/emu-configs/duckstation/settings.ini +++ b/emu-configs/duckstation/settings.ini @@ -10,7 +10,7 @@ StartPaused = false StartFullscreen = false PauseOnFocusLoss = true PauseOnMenu = true -SaveStateOnExit = true +SaveStateOnExit = false ConfirmPowerOff = true LoadDevicesFromSaveStates = true ApplyGameSettings = true diff --git a/emu-configs/retroarch/retroarch.cfg b/emu-configs/retroarch/retroarch.cfg index a94d4984..0d0dd255 100644 --- a/emu-configs/retroarch/retroarch.cfg +++ b/emu-configs/retroarch/retroarch.cfg @@ -3090,8 +3090,8 @@ save_file_compression = "false" savefile_directory = "RETRODECKHOMEDIR/saves" savefiles_in_content_dir = "false" savestate_auto_index = "false" -savestate_auto_load = "true" -savestate_auto_save = "true" +savestate_auto_load = "false" +savestate_auto_save = "false" savestate_directory = "RETRODECKHOMEDIR/states" savestate_file_compression = "true" savestate_max_keep = "0" diff --git a/functions/dialogs.sh b/functions/dialogs.sh index bde4dda6..985f5458 100644 --- a/functions/dialogs.sh +++ b/functions/dialogs.sh @@ -160,7 +160,7 @@ changelog_dialog() { # USAGE: changelog_dialog "version" if [[ "$1" == "all" ]]; then - xmlstarlet sel -t -m "//release" -v "concat('RetroDECK version: ', @version)" -n -v "description" -n $rd_appdata | awk '{$1=$1;print}' | sed -e '/./b' -e :n -e 'N;s/\n$//;tn' > "/var/config/retrodeck/changelog.txt" + xml sel -t -m "//release" -v "concat('RetroDECK version: ', @version)" -n -v "description" -n $rd_appdata | awk '{$1=$1;print}' | sed -e '/./b' -e :n -e 'N;s/\n$//;tn' > "/var/config/retrodeck/changelog.txt" zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ diff --git a/functions/global.sh b/functions/global.sh index 53989bc9..1bb7740b 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -49,7 +49,6 @@ pretty_system_names_reference_list="$emuconfigs/defaults/retrodeck/reference_lis # Config files for emulators with single config files -cemuconf="/var/config/Cemu/settings.xml" citraconf="/var/config/citra-emu/qt-config.ini" duckstationconf="/var/config/duckstation/settings.ini" melondsconf="/var/config/melonDS/melonDS.ini" @@ -67,6 +66,11 @@ es_settings="/var/config/emulationstation/.emulationstation/es_settings.xml" raconf="/var/config/retroarch/retroarch.cfg" ra_core_conf="/var/config/retroarch/retroarch-core-options.cfg" +# CEMU config files + +cemuconf="/var/config/Cemu/settings.xml" +cemucontrollerconf="/var/config/Cemu/controllerProfiles/controller0.xml" + # Dolphin config files dolphinconf="/var/config/dolphin-emu/Dolphin.ini" diff --git a/functions/patching.sh b/functions/patching.sh index b6f296fa..928728c5 100644 --- a/functions/patching.sh +++ b/functions/patching.sh @@ -45,6 +45,14 @@ set_setting_value() { fi ;; + "cemu" ) + if [[ -z "$current_section_name" ]]; then + xml ed -L -u "//$setting_name_to_change" -v "$setting_value_to_change" "$1" + else + xml ed -L -u "//$current_section_name/$setting_name_to_change" -v "$setting_value_to_change" "$1" + fi + ;; + "es_settings" ) sed -i 's^'"$setting_name_to_change"'" value=".*"^'"$setting_name_to_change"'" value="'"$setting_value_to_change"'"^' $1 ;; @@ -116,6 +124,14 @@ get_setting_value() { fi ;; + "cemu" ) + if [[ -z "$current_section_name" ]]; then + echo $(xml sel -t -v "//$current_setting_name" $1) + else + echo $(xml sel -t -v "//$current_section_name/$current_setting_name" $1) + fi + ;; + "es_settings" ) echo $(grep -o -P "(?<=$current_setting_name\" value=\").*(?=\")" $1) ;; diff --git a/functions/post_update.sh b/functions/post_update.sh index 6da8f1e9..618d84b9 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -82,6 +82,8 @@ post_update() { # - Move Dolphin and Primehack save folder names # - Move PPSSPP saves/states to appropriate folders # - Set ESDE user themes folder directly + # - Disable auto-save/load in RA / PCSX2 / Duckstation for proper preset functionality + # - Init Cemu as it is a new emulator update_rd_conf # Expand retrodeck.cfg to latest template set_setting_value $rd_conf "screenshots_folder" "$rdhome/screenshots" @@ -184,6 +186,13 @@ post_update() { unlink "/var/config/emulationstation/ROMs" unlink "/var/config/emulationstation/.emulationstation/downloaded_media" unlink "/var/config/emulationstation/.emulationstation/themes" + + set_setting_value "$raconf" "savestate_auto_load" "false" "retroarch" + set_setting_value "$raconf" "savestate_auto_save" "false" "retroarch" + set_setting_value "$pcsx2conf" "SaveStateOnShutdown" "false" "pcsx2" "EmuCore" + set_setting_value "$duckstationconf" "SaveStateOnExit" "false" "duckstation" "Main" + + prepare_emulator "reset" "cemu" fi # The following commands are run every time. diff --git a/functions/prepare_emulator.sh b/functions/prepare_emulator.sh index 480f4be2..5eb651d2 100644 --- a/functions/prepare_emulator.sh +++ b/functions/prepare_emulator.sh @@ -136,21 +136,28 @@ prepare_emulator() { echo "----------------------" echo "Initializing CEMU" echo "----------------------" - rm -rf /var/config/Cemu - mkdir -pv /var/config/Cemu/ - cp -fr "$emuconfigs/cemu/"* /var/config/Cemu/ - #TODO : set_setting_value for Cemu and multi_user - sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/Cemu/settings.xml - dir_prep "$rdhome/saves/wiiu/cemu" "$rdhome/bios/cemu/usr/save" + if [[ $multi_user_mode == "true" ]]; then # Multi-user actions + rm -rf "$multi_user_data_folder/$SteamAppUser/config/Cemu" + mkdir -p "$multi_user_data_folder/$SteamAppUser/config/Cemu" + cp -fr "$emuconfigs/cemu/"* "$multi_user_data_folder/$SteamAppUser/config/Cemu/" + set_setting_value "$multi_user_data_folder/$SteamAppUser/config/Cemu/settings.ini" "mlc_path" "$bios_folder/cemu" "cemu" + set_setting_value "$multi_user_data_folder/$SteamAppUser/config/Cemu/settings.ini" "Entry" "$roms_folder/wiiu" "cemu" "GamePaths" + dir_prep "$multi_user_data_folder/$SteamAppUser/config/Cemu" "/var/config/Cemu" + else + rm -rf /var/config/Cemu + mkdir -pv /var/config/Cemu/ + cp -fr "$emuconfigs/cemu/"* /var/config/Cemu/ + set_setting_value "$multi_user_data_folder/$SteamAppUser/config/Cemu/settings.ini" "mlc_path" "$bios_folder/cemu" "cemu" + set_setting_value "$multi_user_data_folder/$SteamAppUser/config/Cemu/settings.ini" "Entry" "$roms_folder/wiiu" "cemu" "GamePaths" + fi + # Shared actions + dir_prep "$saves_folder/wiiu/cemu" "$bios_folder/cemu/usr/save" fi - if [[ "$action" == "reset" ]] || [[ "$action" == "postmove" ]]; then # Run commands that apply to both resets and moves - #TODO : set_setting_value for Cemu and multi_user - sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' /var/config/Cemu/settings.xml - dir_prep "$rdhome/saves/wiiu/cemu" "$rdhome/bios/cemu/usr/save" + if [[ "$action" == "postmove" ]]; then # Run commands that apply to both resets and moves + set_setting_value "$cemuconf" "mlc_path" "$bios_folder/cemu" "cemu" + set_setting_value "$cemuconf" "Entry" "$roms_folder/wiiu" "cemu" "GamePaths" + dir_prep "$saves_folder/wiiu/cemu" "$bios_folder/cemu/usr/save" fi - # if [[ "$action" == "postmove" ]]; then # Run only post-move commands - - # fi fi if [[ "$emulator" =~ ^(citra|citra-emu|Citra|all)$ ]]; then diff --git a/tools/configurator.sh b/tools/configurator.sh index f0fe8ada..5c77d71c 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -1045,7 +1045,7 @@ configurator_about_retrodeck_dialog() { } configurator_version_history_dialog() { - local version_array=($(xmlstarlet sel -t -v '//component/releases/release/@version' -n $rd_appdata)) + local version_array=($(xml sel -t -v '//component/releases/release/@version' -n $rd_appdata)) local all_versions_list=() for rd_version in ${version_array[*]}; do