diff --git a/emu-configs/ryujinx/Config.json b/emu-configs/ryujinx/Config.json index e58b6ead..630011ad 100644 --- a/emu-configs/ryujinx/Config.json +++ b/emu-configs/ryujinx/Config.json @@ -1,5 +1,5 @@ { - "version": 48, + "version": 49, "enable_file_log": true, "backend_threading": "Auto", "res_scale": 1, @@ -12,7 +12,7 @@ "graphics_shaders_dump_path": "", "logging_enable_debug": false, "logging_enable_stub": false, - "logging_enable_info": true, + "logging_enable_info": false, "logging_enable_warn": true, "logging_enable_error": true, "logging_enable_trace": false, @@ -91,13 +91,13 @@ "enable_keyboard": false, "enable_mouse": false, "hotkeys": { - "toggle_vsync": "F1", - "screenshot": "F8", - "show_ui": "F4", - "pause": "F5", - "toggle_mute": "F2", - "res_scale_up": "Unbound", - "res_scale_down": "Unbound", + "toggle_vsync": "Unknown", + "screenshot": "Unknown", + "show_ui": "F1", + "pause": "F4", + "toggle_mute": "Unknown", + "res_scale_up": "F7", + "res_scale_down": "F8", "volume_up": "Unbound", "volume_down": "Unbound" }, @@ -121,22 +121,27 @@ }, "deadzone_left": 0, "deadzone_right": 0, - "range_left": 1, + "range_left": 1.2, "range_right": 1, - "trigger_threshold": 0.5, + "trigger_threshold": 0, "motion": { - "motion_backend": "GamepadDriver", + "slot": 0, + "alt_slot": 0, + "mirror_input": false, + "dsu_server_host": "127.0.0.1", + "dsu_server_port": 26760, + "motion_backend": "CemuHook", "sensitivity": 100, "gyro_deadzone": 1, "enable_motion": true }, "rumble": { - "strong_rumble": 1, + "strong_rumble": 2.1, "weak_rumble": 1, "enable_rumble": true }, "left_joycon": { - "button_minus": "Minus", + "button_minus": "Back", "button_l": "LeftShoulder", "button_zl": "LeftTrigger", "button_sl": "Unbound", @@ -147,7 +152,7 @@ "dpad_right": "DpadRight" }, "right_joycon": { - "button_plus": "Plus", + "button_plus": "Start", "button_r": "RightShoulder", "button_zr": "RightTrigger", "button_sl": "Unbound", @@ -160,12 +165,190 @@ "version": 1, "backend": "GamepadSDL2", "id": "0-f6790003-28de-0000-ff11-000001000000", - "controller_type": "Handheld", - "player_index": "Handheld" + "controller_type": "ProController", + "player_index": "Player1" + }, + { + "left_joycon_stick": { + "joystick": "Left", + "invert_stick_x": false, + "invert_stick_y": false, + "rotate90_cw": false, + "stick_button": "LeftStick" + }, + "right_joycon_stick": { + "joystick": "Right", + "invert_stick_x": false, + "invert_stick_y": false, + "rotate90_cw": false, + "stick_button": "RightStick" + }, + "deadzone_left": 0, + "deadzone_right": 0, + "range_left": 1.2, + "range_right": 1, + "trigger_threshold": 0, + "motion": { + "motion_backend": "GamepadDriver", + "sensitivity": 100, + "gyro_deadzone": 1, + "enable_motion": false + }, + "rumble": { + "strong_rumble": 1, + "weak_rumble": 1, + "enable_rumble": true + }, + "left_joycon": { + "button_minus": "Back", + "button_l": "LeftShoulder", + "button_zl": "LeftTrigger", + "button_sl": "Unbound", + "button_sr": "Unbound", + "dpad_up": "DpadUp", + "dpad_down": "DpadDown", + "dpad_left": "DpadLeft", + "dpad_right": "DpadRight" + }, + "right_joycon": { + "button_plus": "Start", + "button_r": "RightShoulder", + "button_zr": "RightTrigger", + "button_sl": "Unbound", + "button_sr": "Unbound", + "button_x": "Y", + "button_b": "A", + "button_y": "X", + "button_a": "B" + }, + "version": 1, + "backend": "GamepadSDL2", + "id": "1-00000003-28de-0000-ff11-000001000000", + "controller_type": "ProController", + "player_index": "Player2" + }, + { + "left_joycon_stick": { + "joystick": "Left", + "invert_stick_x": false, + "invert_stick_y": false, + "rotate90_cw": false, + "stick_button": "LeftStick" + }, + "right_joycon_stick": { + "joystick": "Right", + "invert_stick_x": false, + "invert_stick_y": false, + "rotate90_cw": false, + "stick_button": "RightStick" + }, + "deadzone_left": 0, + "deadzone_right": 0, + "range_left": 1.2, + "range_right": 1, + "trigger_threshold": 0, + "motion": { + "motion_backend": "GamepadDriver", + "sensitivity": 100, + "gyro_deadzone": 1, + "enable_motion": false + }, + "rumble": { + "strong_rumble": 1, + "weak_rumble": 1, + "enable_rumble": true + }, + "left_joycon": { + "button_minus": "Back", + "button_l": "LeftShoulder", + "button_zl": "LeftTrigger", + "button_sl": "Unbound", + "button_sr": "Unbound", + "dpad_up": "DpadUp", + "dpad_down": "DpadDown", + "dpad_left": "DpadLeft", + "dpad_right": "DpadRight" + }, + "right_joycon": { + "button_plus": "Start", + "button_r": "RightShoulder", + "button_zr": "RightTrigger", + "button_sl": "Unbound", + "button_sr": "Unbound", + "button_x": "Y", + "button_b": "A", + "button_y": "X", + "button_a": "B" + }, + "version": 1, + "backend": "GamepadSDL2", + "id": "2-00000003-28de-0000-ff11-000001000000", + "controller_type": "ProController", + "player_index": "Player3" + }, + { + "left_joycon_stick": { + "joystick": "Left", + "invert_stick_x": false, + "invert_stick_y": false, + "rotate90_cw": false, + "stick_button": "LeftStick" + }, + "right_joycon_stick": { + "joystick": "Right", + "invert_stick_x": false, + "invert_stick_y": false, + "rotate90_cw": false, + "stick_button": "RightStick" + }, + "deadzone_left": 0, + "deadzone_right": 0, + "range_left": 1.2, + "range_right": 1, + "trigger_threshold": 0, + "motion": { + "motion_backend": "GamepadDriver", + "sensitivity": 100, + "gyro_deadzone": 1, + "enable_motion": false + }, + "rumble": { + "strong_rumble": 1, + "weak_rumble": 1, + "enable_rumble": true + }, + "left_joycon": { + "button_minus": "Back", + "button_l": "LeftShoulder", + "button_zl": "LeftTrigger", + "button_sl": "Unbound", + "button_sr": "Unbound", + "dpad_up": "DpadUp", + "dpad_down": "DpadDown", + "dpad_left": "DpadLeft", + "dpad_right": "DpadRight" + }, + "right_joycon": { + "button_plus": "Start", + "button_r": "RightShoulder", + "button_zr": "RightTrigger", + "button_sl": "Unbound", + "button_sr": "Unbound", + "button_x": "Y", + "button_b": "A", + "button_y": "X", + "button_a": "B" + }, + "version": 1, + "backend": "GamepadSDL2", + "id": "3-00000003-28de-0000-ff11-000001000000", + "controller_type": "ProController", + "player_index": "Player4" } ], "graphics_backend": "Vulkan", "preferred_gpu": "0x1002_0x163F", + "multiplayer_mode": 0, "multiplayer_lan_interface_id": "0", "use_hypervisor": true -} +} \ No newline at end of file diff --git a/emu-configs/yuzu/qt-config.ini b/emu-configs/yuzu/qt-config.ini index a1e63a4d..b4a4feff 100644 --- a/emu-configs/yuzu/qt-config.ini +++ b/emu-configs/yuzu/qt-config.ini @@ -815,9 +815,9 @@ gamecard_path= gamecard_path\default=true load_directory=/var/data/yuzu/load load_directory\default=true -nand_directory=RETRODECKHOMEDIR/saves/switch/yuzu/nand +nand_directory=RETRODECKHOMEDIR/saves/switch/nand nand_directory\default=true -sdmc_directory=RETRODECKHOMEDIR/saves/switch/yuzu/sdmc +sdmc_directory=RETRODECKHOMEDIR/saves/switch/sdmc sdmc_directory\default=true tas_directory=/var/data/yuzu/tas tas_directory\default=true diff --git a/functions/functions.sh b/functions/functions.sh index b5470eb0..7e740a84 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -578,6 +578,43 @@ easter_eggs() { cp -f "$new_splash_file" "$current_splash_file" # Deploy assigned splash screen } +manage_ryujinx_keys() { + # This function checks if Switch keys are existing and symlinks them inside the Ryujinx system folder + # If the symlinks are broken it recreates them + + echo "Checking Ryujinx Switch keys." #TODO logging + local ryujinx_system="/var/config/Ryujinx/system" # Set the path to the Ryujinx system folder + # Check if the keys folder exists + if [ -d "$bios_folder/switch/keys" ]; then + # Check if there are files in the keys folder + if [ -n "$(find "$bios_folder/switch/keys" -maxdepth 1 -type f)" ]; then + # Iterate over each file in the keys folder + for file in "$bios_folder/switch/keys"/*; do + local filename=$(basename "$file") + local symlink="$ryujinx_system/$filename" + + # Check if the symlink exists and is valid + if [ -L "$symlink" ] && [ "$(readlink -f "$symlink")" = "$file" ]; then + echo "Found \"$symlink\" and it's a valid symlink." #TODO logging + continue # Skip if the symlink is already valid + fi + + # Remove broken symlink or non-symlink file + echo "Found \"$symlink\" but it's not a valid symlink. Repairing it" #TODO logging + [ -e "$symlink" ] && rm "$symlink" + + # Create symlink + ln -s "$file" "$symlink" + echo "Created symlink: \"$symlink\"" + done + else + echo "No files found in $bios_folder/switch/keys. Continuing" #TODO logging + fi + else + echo "Directory $bios_folder/switch/keys does not exist. Maybe Ryujinx was never run. Continuing" #TODO logging + fi +} + # TODO: this function is not yet used branch_selector() { # Fetch branches from GitHub API excluding "main" diff --git a/functions/post_update.sh b/functions/post_update.sh index 104029e4..c75e1275 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -247,6 +247,7 @@ post_update() { prepare_component "reset" "mame" prepare_component "reset" "vita3k" prepare_component "reset" "gzdoom" + fi # if [[ $prev_version -le "090" ]]; then diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index ea55f3db..57cdc6a3 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -542,27 +542,38 @@ prepare_component() { fi if [[ "$component" =~ ^(ryujunx|Ryujinx|all)$ ]]; then + # NOTE: for techincal reasons the system folder of Ryujinx IS NOT a sumlink of the bios/switch/keys as not only the keys are located there + # When RetroDECK starts there is a "manage_ryujinx_keys" function that symlinks the keys only in Rryujinx/system. if [[ "$action" == "reset" ]]; then # Run reset-only commands echo "------------------------" echo "Initializing RYUJINX" echo "------------------------" if [[ $multi_user_mode == "true" ]]; then rm -rf "$multi_user_data_folder/$SteamAppUser/config/Ryujinx" - mkdir -p "$multi_user_data_folder/$SteamAppUser/config/Ryujinx/system" + #mkdir -p "$multi_user_data_folder/$SteamAppUser/config/Ryujinx/system" + # TODO: add /var/config/Ryujinx/system system folder management cp -fv $emuconfigs/ryujinx/* "$multi_user_data_folder/$SteamAppUser/config/Ryujinx" - sed -i 's#/home/deck/retrodeck#'$rdhome'#g' "$multi_user_data_folder/$SteamAppUser/config/Ryujinx/Config.json" + sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "$multi_user_data_folder/$SteamAppUser/config/Ryujinx/Config.json" dir_prep "$multi_user_data_folder/$SteamAppUser/config/Ryujinx" "/var/config/Ryujinx" + # TODO: add nand (saves) folder management + # TODO: add nand (saves) folder management + # TODO: add "registered" folder management else # removing config directory to wipe legacy files rm -rf /var/config/Ryujinx mkdir -p /var/config/Ryujinx/system cp -fv $emuconfigs/ryujinx/* /var/config/Ryujinx - sed -i 's#/home/deck/retrodeck#'$rdhome'#g' "$ryujinxconf" + sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "$ryujinxconf" + # Linking switch nand/saves folder + rm -rf /var/config/Ryujinx/bis + dir_prep "$saves_folder/switch/ryujinx/nand" "/var/config/Ryujinx/bis" + dir_prep "$saves_folder/switch/ryujinx/sdcard" "/var/config/Ryujinx/sdcard" + dir_prep "$bios_folder/switch/ryujinx/registered" "/var/config/Ryujinx/bis/system/Contents/registered" fi fi - if [[ "$action" == "reset" ]] || [[ "$action" == "postmove" ]]; then # Run commands that apply to both resets and moves - dir_prep "$bios_folder/switch/keys" "/var/config/Ryujinx/system" - fi + # if [[ "$action" == "reset" ]] || [[ "$action" == "postmove" ]]; then # Run commands that apply to both resets and moves + # dir_prep "$bios_folder/switch/keys" "/var/config/Ryujinx/system" + # fi if [[ "$action" == "postmove" ]]; then # Run only post-move commands sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "$ryujinxconf" # This is an unfortunate one-off because set_setting_value does not currently support JSON fi diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index d1efc458..4c9c0362 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -1292,6 +1292,23 @@ modules: # MAME - End + # Ryujinx Appimage - START + # https://ryujinx.org/download + + - name: Ryujinx + buildsystem: simple + build-commands: + - | + tar -zxvf *.tar.gz + mv -v publish ${FLATPAK_DEST}/ryujinx + ln -sv ${FLATPAK_DEST}/ryujinx/Ryujinx ${FLATPAK_DEST}/bin/Ryujinx.sh + sources: + - type: file + url: https://github.com/Ryujinx/release-channel-master/releases/download/1.1.1192/ryujinx-1.1.1192-linux_x64.tar.gz + sha256: 41716233f5745a7df1e411af6bac9d828f0b6b6feb63b5ef87445b81b01dee54 + + # Ryujinx Appimage - END + # External manifests end - name: retrodeck diff --git a/old/removed-modules.yml b/old/removed-modules.yml index 43d5cab3..04274441 100644 --- a/old/removed-modules.yml +++ b/old/removed-modules.yml @@ -112,24 +112,7 @@ # Duckstation-DontUpdate - END - # Ryujinx Appimage - START - # https://ryujinx.org/download - - # - name: Ryujinx - # buildsystem: simple - # build-commands: - # - | - # tar -zxvf ryujinx-1.1.685-linux_x64.tar.gz - # mv -v publish ${FLATPAK_DEST}/ryujinx - # ln -sv ${FLATPAK_DEST}/ryujinx/Ryujinx ${FLATPAK_DEST}/bin/Ryujinx - # sources: - # - type: file - # url: https://github.com/Ryujinx/release-channel-master/releases/download/1.1.685/ryujinx-1.1.685-linux_x64.tar.gz - # sha256: bc4d7076106d7aa59c3a3ea22b83c553e5fa1a897815831adcf18cc13d729e15 - - # Ryujinx Appimage - END - - # Ryujinx - START + # Ryujinx - START # https://github.com/flathub/org.ryujinx.Ryujinx - name: Ryujinx diff --git a/retrodeck.sh b/retrodeck.sh index f80c0ea5..745f03d4 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -56,9 +56,9 @@ https://retrodeck.net ;; --reset-component*) echo "You are about to reset one or more RetroDECK components or emulators." - echo "Available options are: es-de, retroarch, cemu, citra, dolphin, duckstation, melonds, pcsx3, pico8, ppsspp, primehack, rpcs3, xemu, yuzu, vita3k, mame, gzdoom, boilr, all" + echo "Available options are: es-de, retroarch, cemu, citra, dolphin, duckstation, melonds, pcsx3, pico8, ppsspp, primehack, ryujinx. rpcs3, ryujinx, xemu, yuzu, vita3k, mame, gzdoom, boilr, all" read -p "Please enter the component you would like to reset: " component - if [[ "$component" =~ ^(es-de|retroarch|cemu|citra|dolphin|duckstation|mame|melonds|pcsx2|ppsspp|primehack|rpcs3|xemu|yuzu|all)$ ]]; then + if [[ "$component" =~ ^(es-de|retroarch|cemu|citra|dolphin|duckstation|mame|melonds|pcsx2|ppsspp|primehack|ryujinx|rpcs3|xemu|yuzu|all)$ ]]; then read -p "You are about to reset $component to default settings. Enter 'y' to continue, 'n' to stop: " response if [[ $response == [yY] ]]; then prepare_component "reset" "$component" "cli" @@ -182,6 +182,9 @@ if [[ -f "$HOME/.steam/steam/controller_base/templates/RetroDECK_controller_conf fi # REMOVE BEFORE NEXT VERSION RELEASE +# Linking switch keys for Ryujinx +manage_ryujinx_keys + # Normal Startup if [[ $steam_sync == "true" ]]; then diff --git a/tools/configurator.sh b/tools/configurator.sh index aa4ffbb7..bad8f91a 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -1009,6 +1009,7 @@ configurator_reset_dialog() { "PPSSPP" "Reset the PSP emulator PPSSPP to default settings" \ "Primehack" "Reset the Metroid Prime emulator Primehack to default settings" \ "RPCS3" "Reset the PS3 emulator RPCS3 to default settings" \ + "Ryujinx" "Reset the Switch emulator Ryujinx to default settings" \ "Vita3k" "Reset the PS Vita emulator Vita3k to default settings" \ "XEMU" "Reset the XBOX emulator XEMU to default settings" \ "Yuzu" "Reset the Switch emulator Yuzu to default settings" )