Merge branch 'cooker-0.8.0b' into feat/portmaster

This commit is contained in:
XargonWan 2024-04-12 08:57:21 +09:00
commit c5c27ce93b
16 changed files with 470 additions and 185 deletions

View file

@ -7,7 +7,7 @@ PauseOnFocusLoss = true
StartFullscreen = true StartFullscreen = true
StartPaused = false StartPaused = false
ConfirmShutdown = false ConfirmShutdown = false
HideMouseCursor = false HideMouseCursor = true
RenderToSeparateWindow = false RenderToSeparateWindow = false
HideMainWindowWhenRunning = false HideMainWindowWhenRunning = false
DisableWindowResize = false DisableWindowResize = false

View file

@ -86,16 +86,16 @@
"grid_size": 2, "grid_size": 2,
"application_sort": 0, "application_sort": 0,
"is_ascending_order": true, "is_ascending_order": true,
"start_fullscreen": false, "start_fullscreen": true,
"show_console": true, "show_console": true,
"enable_keyboard": false, "enable_keyboard": false,
"enable_mouse": false, "enable_mouse": false,
"hotkeys": { "hotkeys": {
"toggle_vsync": "", "toggle_vsync": "Tab",
"screenshot": "", "screenshot": "F8",
"show_ui": "ESC", "show_ui": "F4",
"pause": "", "pause": "F5",
"toggle_mute": "", "toggle_mute": "F2",
"res_scale_up": "Unbound", "res_scale_up": "Unbound",
"res_scale_down": "Unbound", "res_scale_down": "Unbound",
"volume_up": "Unbound", "volume_up": "Unbound",
@ -119,11 +119,11 @@
"rotate90_cw": false, "rotate90_cw": false,
"stick_button": "RightStick" "stick_button": "RightStick"
}, },
"deadzone_left": 0, "deadzone_left": 0.1,
"deadzone_right": 0, "deadzone_right": 0.1,
"range_left": 1.2, "range_left": 1,
"range_right": 1, "range_right": 1,
"trigger_threshold": 0, "trigger_threshold": 0.5,
"motion": { "motion": {
"slot": 0, "slot": 0,
"alt_slot": 0, "alt_slot": 0,
@ -136,12 +136,12 @@
"enable_motion": true "enable_motion": true
}, },
"rumble": { "rumble": {
"strong_rumble": 2.1, "strong_rumble": 1,
"weak_rumble": 1, "weak_rumble": 1,
"enable_rumble": true "enable_rumble": true
}, },
"left_joycon": { "left_joycon": {
"button_minus": "Minus", "button_minus": "Back",
"button_l": "LeftShoulder", "button_l": "LeftShoulder",
"button_zl": "LeftTrigger", "button_zl": "LeftTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
@ -152,20 +152,20 @@
"dpad_right": "DpadRight" "dpad_right": "DpadRight"
}, },
"right_joycon": { "right_joycon": {
"button_plus": "Plus", "button_plus": "Start",
"button_r": "RightShoulder", "button_r": "RightShoulder",
"button_zr": "RightTrigger", "button_zr": "RightTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
"button_sr": "Unbound", "button_sr": "Unbound",
"button_x": "X", "button_x": "Y",
"button_b": "B", "button_b": "A",
"button_y": "Y", "button_y": "X",
"button_a": "A" "button_a": "B"
}, },
"version": 1, "version": 1,
"backend": "GamepadSDL2", "backend": "GamepadSDL2",
"id": "0-00000003-28de-0000-ff11-000001000000", "id": "0-36b80003-28de-0000-ff11-000001000000",
"controller_type": "JoyconPair", "controller_type": "ProController",
"player_index": "Player1" "player_index": "Player1"
}, },
{ {
@ -183,11 +183,11 @@
"rotate90_cw": false, "rotate90_cw": false,
"stick_button": "RightStick" "stick_button": "RightStick"
}, },
"deadzone_left": 0, "deadzone_left": 0.1,
"deadzone_right": 0, "deadzone_right": 0.1,
"range_left": 1.2, "range_left": 1,
"range_right": 1, "range_right": 1,
"trigger_threshold": 0, "trigger_threshold": 0.5,
"motion": { "motion": {
"motion_backend": "GamepadDriver", "motion_backend": "GamepadDriver",
"sensitivity": 100, "sensitivity": 100,
@ -200,7 +200,7 @@
"enable_rumble": true "enable_rumble": true
}, },
"left_joycon": { "left_joycon": {
"button_minus": "Minus", "button_minus": "Back",
"button_l": "LeftShoulder", "button_l": "LeftShoulder",
"button_zl": "LeftTrigger", "button_zl": "LeftTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
@ -211,19 +211,19 @@
"dpad_right": "DpadRight" "dpad_right": "DpadRight"
}, },
"right_joycon": { "right_joycon": {
"button_plus": "Plus", "button_plus": "Start",
"button_r": "RightShoulder", "button_r": "RightShoulder",
"button_zr": "RightTrigger", "button_zr": "RightTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
"button_sr": "Unbound", "button_sr": "Unbound",
"button_x": "X", "button_x": "Y",
"button_b": "B", "button_b": "A",
"button_y": "Y", "button_y": "X",
"button_a": "A" "button_a": "B"
}, },
"version": 1, "version": 1,
"backend": "GamepadSDL2", "backend": "GamepadSDL2",
"id": "1-00000003-28de-0000-ff11-000001000000", "id": "1-36b80003-28de-0000-ff11-000001000000",
"controller_type": "ProController", "controller_type": "ProController",
"player_index": "Player2" "player_index": "Player2"
}, },
@ -242,11 +242,11 @@
"rotate90_cw": false, "rotate90_cw": false,
"stick_button": "RightStick" "stick_button": "RightStick"
}, },
"deadzone_left": 0, "deadzone_left": 0.1,
"deadzone_right": 0, "deadzone_right": 0.1,
"range_left": 1.2, "range_left": 1,
"range_right": 1, "range_right": 1,
"trigger_threshold": 0, "trigger_threshold": 0.5,
"motion": { "motion": {
"motion_backend": "GamepadDriver", "motion_backend": "GamepadDriver",
"sensitivity": 100, "sensitivity": 100,
@ -259,7 +259,7 @@
"enable_rumble": true "enable_rumble": true
}, },
"left_joycon": { "left_joycon": {
"button_minus": "Minus", "button_minus": "Back",
"button_l": "LeftShoulder", "button_l": "LeftShoulder",
"button_zl": "LeftTrigger", "button_zl": "LeftTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
@ -270,19 +270,19 @@
"dpad_right": "DpadRight" "dpad_right": "DpadRight"
}, },
"right_joycon": { "right_joycon": {
"button_plus": "Plus", "button_plus": "Start",
"button_r": "RightShoulder", "button_r": "RightShoulder",
"button_zr": "RightTrigger", "button_zr": "RightTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
"button_sr": "Unbound", "button_sr": "Unbound",
"button_x": "X", "button_x": "Y",
"button_b": "B", "button_b": "A",
"button_y": "Y", "button_y": "X",
"button_a": "A" "button_a": "B"
}, },
"version": 1, "version": 1,
"backend": "GamepadSDL2", "backend": "GamepadSDL2",
"id": "2-00000003-28de-0000-ff11-000001000000", "id": "2-36b80003-28de-0000-ff11-000001000000",
"controller_type": "ProController", "controller_type": "ProController",
"player_index": "Player3" "player_index": "Player3"
}, },
@ -301,11 +301,11 @@
"rotate90_cw": false, "rotate90_cw": false,
"stick_button": "RightStick" "stick_button": "RightStick"
}, },
"deadzone_left": 0, "deadzone_left": 0.1,
"deadzone_right": 0, "deadzone_right": 0.1,
"range_left": 1.2, "range_left": 1,
"range_right": 1, "range_right": 1,
"trigger_threshold": 0, "trigger_threshold": 0.5,
"motion": { "motion": {
"motion_backend": "GamepadDriver", "motion_backend": "GamepadDriver",
"sensitivity": 100, "sensitivity": 100,
@ -318,7 +318,7 @@
"enable_rumble": true "enable_rumble": true
}, },
"left_joycon": { "left_joycon": {
"button_minus": "Minus", "button_minus": "Back",
"button_l": "LeftShoulder", "button_l": "LeftShoulder",
"button_zl": "LeftTrigger", "button_zl": "LeftTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
@ -329,19 +329,19 @@
"dpad_right": "DpadRight" "dpad_right": "DpadRight"
}, },
"right_joycon": { "right_joycon": {
"button_plus": "Plus", "button_plus": "Start",
"button_r": "RightShoulder", "button_r": "RightShoulder",
"button_zr": "RightTrigger", "button_zr": "RightTrigger",
"button_sl": "Unbound", "button_sl": "Unbound",
"button_sr": "Unbound", "button_sr": "Unbound",
"button_x": "X", "button_x": "Y",
"button_b": "B", "button_b": "A",
"button_y": "Y", "button_y": "X",
"button_a": "A" "button_a": "B"
}, },
"version": 1, "version": 1,
"backend": "GamepadSDL2", "backend": "GamepadSDL2",
"id": "3-00000003-28de-0000-ff11-000001000000", "id": "3-36b80003-28de-0000-ff11-000001000000",
"controller_type": "ProController", "controller_type": "ProController",
"player_index": "Player4" "player_index": "Player4"
} }

View file

@ -0,0 +1,64 @@
{
"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.1,
"deadzone_right": 0.1,
"range_left": 1,
"range_right": 1,
"trigger_threshold": 0.5,
"motion": {
"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": 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": "0-f7390003-28de-0000-ff11-000001000000",
"controller_type": "ProController",
"player_index": "Player1"
}

View file

@ -0,0 +1,59 @@
{
"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.1,
"deadzone_right": 0.1,
"range_left": 1,
"range_right": 1,
"trigger_threshold": 0.5,
"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-f7390003-28de-0000-ff11-000001000000",
"controller_type": "ProController",
"player_index": "Player2"
}

View file

@ -0,0 +1,59 @@
{
"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.1,
"deadzone_right": 0.1,
"range_left": 1,
"range_right": 1,
"trigger_threshold": 0.5,
"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-f7390003-28de-0000-ff11-000001000000",
"controller_type": "ProController",
"player_index": "Player3"
}

View file

@ -0,0 +1,59 @@
{
"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.1,
"deadzone_right": 0.1,
"range_left": 1,
"range_right": 1,
"trigger_threshold": 0.5,
"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-f7390003-28de-0000-ff11-000001000000",
"controller_type": "ProController",
"player_index": "Player4"
}

View file

@ -0,0 +1,64 @@
{
"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.1,
"deadzone_right": 0.1,
"range_left": 1,
"range_right": 1,
"trigger_threshold": 0.5,
"motion": {
"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,
"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": "0-f6790003-28de-0000-ff11-000001000000",
"controller_type": "ProController",
"player_index": "Player1"
}

View file

@ -1,9 +0,0 @@
#!/bin/bash
source /app/libexec/global.sh
log i "Ryujinx RetroDECK wrapper: starting"
command="$1"
manage_ryujinx_keys
log d "Ryujinx RetroDECK wrapper: launching \"Ryujinx.sh $command\""
Ryujinx.sh "$command"

View file

@ -55,36 +55,35 @@ validate_for_chd() {
local file="$1" local file="$1"
local normalized_filename=$(echo "$file" | tr '[:upper:]' '[:lower:]') local normalized_filename=$(echo "$file" | tr '[:upper:]' '[:lower:]')
local file_validated="false" local file_validated="false"
chd_validation_log_file="compression_$(basename "$file").log" log i "Validating file: $file"
echo "Validating file:" "$file" > "$logs_folder/$chd_validation_log_file"
if echo "$normalized_filename" | grep -qE '\.iso|\.cue|\.gdi'; then if echo "$normalized_filename" | grep -qE '\.iso|\.cue|\.gdi'; then
echo ".cue/.iso/.gdi file detected" >> "$logs_folder/$chd_validation_log_file" log i ".cue/.iso/.gdi file detected"
local file_path=$(dirname "$(realpath "$file")") local file_path=$(dirname "$(realpath "$file")")
local file_base_name=$(basename "$file") local file_base_name=$(basename "$file")
local file_name=${file_base_name%.*} local file_name=${file_base_name%.*}
if [[ "$normalized_filename" == *".cue" ]]; then # Validate .cue file if [[ "$normalized_filename" == *".cue" ]]; then # Validate .cue file
if [[ ! "$file_path" == *"dreamcast"* ]]; then # .bin/.cue compression may not work for Dreamcast, only GDI or ISO # TODO: verify if [[ ! "$file_path" == *"dreamcast"* ]]; then # .bin/.cue compression may not work for Dreamcast, only GDI or ISO # TODO: verify
echo "Validating .cue associated .bin files" >> "$logs_folder/$chd_validation_log_file" log i "Validating .cue associated .bin files"
local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")
echo "Associated bin files read:" >> "$logs_folder/$chd_validation_log_file" log i "Associated bin files read:"
printf '%s\n' "$cue_bin_files" >> "$logs_folder/$chd_validation_log_file" log i $(printf '%s\n' "$cue_bin_files")
if [[ ! -z "$cue_bin_files" ]]; then if [[ ! -z "$cue_bin_files" ]]; then
while IFS= read -r line while IFS= read -r line
do do
echo "looking for $file_path/$line" >> "$logs_folder/$chd_validation_log_file" log i "Looking for $file_path/$line"
if [[ -f "$file_path/$line" ]]; then if [[ -f "$file_path/$line" ]]; then
echo ".bin file found at $file_path/$line" >> "$logs_folder/$chd_validation_log_file" log i ".bin file found at $file_path/$line"
file_validated="true" file_validated="true"
else else
echo ".bin file NOT found at $file_path/$line" >> "$logs_folder/$chd_validation_log_file" log e ".bin file NOT found at $file_path/$line"
echo ".cue file could not be validated. Please verify your .cue file contains the correct corresponding .bin file information and retry." >> "$logs_folder/$chd_validation_log_file" log e ".cue file could not be validated. Please verify your .cue file contains the correct corresponding .bin file information and retry."
file_validated="false" file_validated="false"
break break
fi fi
done < <(printf '%s\n' "$cue_bin_files") done < <(printf '%s\n' "$cue_bin_files")
fi fi
else else
echo ".cue files not compatible with Dreamcast CHD compression" >> "$logs_folder/$chd_validation_log_file" log w ".cue files not compatible with CHD compression"
fi fi
echo $file_validated echo $file_validated
else # If file is a .iso or .gdi else # If file is a .iso or .gdi
@ -92,7 +91,7 @@ validate_for_chd() {
echo $file_validated echo $file_validated
fi fi
else else
echo "File type not recognized. Supported file types are .cue, .gdi and .iso" >> "$logs_folder/$chd_validation_log_file" log w "File type not recognized. Supported file types are .cue, .gdi and .iso"
echo $file_validated echo $file_validated
fi fi
} }
@ -108,32 +107,36 @@ cli_compress_single_game() {
local system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") local system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$")
local compatible_compression_format=$(find_compatible_compression_format "$file") local compatible_compression_format=$(find_compatible_compression_format "$file")
if [[ ! $compatible_compression_format == "none" ]]; then if [[ ! $compatible_compression_format == "none" ]]; then
echo "$(basename "$file") can be compressed to $compatible_compression_format" log i "$(basename "$file") can be compressed to $compatible_compression_format"
compress_game "$compatible_compression_format" "$file" "$system" compress_game "$compatible_compression_format" "$file" "$system"
if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested
if [[ $(basename "$file") == *".cue" ]]; then if [[ -f "${file%.*}.$compatible_compression_format" ]]; then
local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") if [[ $(basename "$file") == *".cue" ]]; then
local file_path=$(dirname "$(realpath "$file")") local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")
while IFS= read -r line local file_path=$(dirname "$(realpath "$file")")
do # Remove associated .bin files while IFS= read -r line
echo "Removing original file "$file_path/$line"" do # Remove associated .bin files
rm -f "$file_path/$line" log i "Removing original file "$file_path/$line""
done < <(printf '%s\n' "$cue_bin_files") # Remove original .cue file rm -f "$file_path/$line"
echo "Removing original file $(basename "$file")" done < <(printf '%s\n' "$cue_bin_files") # Remove original .cue file
rm -f "$file" log i "Removing original file $(basename "$file")"
rm -f "$file"
else
log i "Removing original file $(basename "$file")"
rm -f "$file"
fi
else else
echo "Removing original file $(basename "$file")" log w "Compressed version of $(basename "$file") not found, skipping deletion."
rm -f "$file"
fi fi
fi fi
else else
echo "$(basename "$file") does not have any compatible compression formats." log w "$(basename "$file") does not have any compatible compression formats."
fi fi
else else
echo "File not found, please specify the full path to the file to be compressed." log w "File not found, please specify the full path to the file to be compressed."
fi fi
else else
echo "Please use this command format \"--compress-one <path to file to compress>\"" log i "Please use this command format \"--compress-one <path to file to compress>\""
fi fi
} }
@ -161,35 +164,39 @@ cli_compress_all_games() {
do do
local compression_candidates=$(find "$roms_folder/$system" -type f -not -iname "*.txt") local compression_candidates=$(find "$roms_folder/$system" -type f -not -iname "*.txt")
if [[ ! -z "$compression_candidates" ]]; then if [[ ! -z "$compression_candidates" ]]; then
echo "Checking files for $system" log i "Checking files for $system"
while IFS= read -r file while IFS= read -r file
do do
local compatible_compression_format=$(find_compatible_compression_format "$file") local compatible_compression_format=$(find_compatible_compression_format "$file")
if [[ ! "$compatible_compression_format" == "none" ]]; then if [[ ! "$compatible_compression_format" == "none" ]]; then
echo "$(basename "$file") can be compressed to $compatible_compression_format" log i "$(basename "$file") can be compressed to $compatible_compression_format"
compress_game "$compatible_compression_format" "$file" "$system" compress_game "$compatible_compression_format" "$file" "$system"
if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested
if [[ "$file" == *".cue" ]]; then if [[ -f "${file%.*}.$compatible_compression_format" ]]; then
local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") if [[ "$file" == *".cue" ]]; then
local file_path=$(dirname "$(realpath "$file")") local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")
while IFS= read -r line local file_path=$(dirname "$(realpath "$file")")
do # Remove associated .bin files while IFS= read -r line
echo "Removing original file "$file_path/$line"" do # Remove associated .bin files
rm -f "$file_path/$line" log i "Removing original file "$file_path/$line""
done < <(printf '%s\n' "$cue_bin_files") # Remove original .cue file rm -f "$file_path/$line"
echo "Removing original file "$file"" done < <(printf '%s\n' "$cue_bin_files") # Remove original .cue file
rm -f $(realpath "$file") log i "Removing original file "$file""
rm -f $(realpath "$file")
else
log i "Removing original file "$file""
rm -f $(realpath "$file")
fi
else else
echo "Removing original file "$file"" log w "Compressed version of $(basename "$file") not found, skipping deletion."
rm -f $(realpath "$file")
fi fi
fi fi
else else
echo "No compatible compression format found for $(basename "$file")" log w "No compatible compression format found for $(basename "$file")"
fi fi
done < <(printf '%s\n' "$compression_candidates") done < <(printf '%s\n' "$compression_candidates")
else else
echo "No compatible files found for compression in $system" log w "No compatible files found for compression in $system"
fi fi
done < <(printf '%s\n' "$compressable_systems_list") done < <(printf '%s\n' "$compressable_systems_list")
} }

View file

@ -236,8 +236,8 @@ dir_prep() {
# Call me with: # Call me with:
# dir prep "real dir" "symlink location" # dir prep "real dir" "symlink location"
real="$1" real="$(realpath -s $1)"
symlink="$2" symlink="$(realpath -s $2)"
log d "Preparing directory $symlink in $real" log d "Preparing directory $symlink in $real"
@ -620,43 +620,6 @@ easter_eggs() {
cp -f "$new_splash_file" "$current_splash_file" # Deploy assigned splash screen 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
log i "Checking Ryujinx Switch keys."
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
log i "Found \"$symlink\" and it's a valid symlink."
continue # Skip if the symlink is already valid
fi
# Remove broken symlink or non-symlink file
log w "Found \"$symlink\" but it's not a valid symlink. Repairing it"
[ -e "$symlink" ] && rm "$symlink"
# Create symlink
ln -s "$file" "$symlink"
log i "Created symlink: \"$symlink\""
done
else
log w "No files found in $bios_folder/switch/keys. Continuing..."
fi
else
log e "Directory $bios_folder/switch/keys does not exist. Something is wrong with your RetroDECK installation. Continuing but Ryujinx will not be able to run any game."
fi
}
ponzu() { ponzu() {
# This function is used to extract some specific appimages # This function is used to extract some specific appimages
# Check if any of the specified files exist # Check if any of the specified files exist

View file

@ -283,17 +283,16 @@ post_update() {
# The save folder of rpcs3 was inverted so we're moving the saves into the real one # The save folder of rpcs3 was inverted so we're moving the saves into the real one
log i "RPCS3 saves needs to be migrated, executing." log i "RPCS3 saves needs to be migrated, executing."
mv "$saves_folder/ps3/rpcs3" "$saves_folder/ps3/rpcs3.bak" if [[ "$(ls -A $bios_folder/rpcs3/dev_hdd0/home/00000001/savedata)" ]]; then
mkdir -p "$saves_folder/ps3/rpcs3" log i "Existing RPCS3 savedata found, backing up..."
mv -v "$saves_folder/ps3/rpcs3.bak"/* "$saves_folder/ps3/rpcs3" create_dir "$backups_folder"
mv -v "$bios_folder/rpcs3/dev_hdd0/home/00000001/savedata"/* "$saves_folder/ps3/rpcs3" zip -rq9 "$backups_folder/$(date +"%0m%0d")_rpcs3_save_data.zip" "$bios_folder/rpcs3/dev_hdd0/home/00000001/savedata"
mv -v "$saves_folder/ps3/rpcs3.bak" "$rdhome/backups/saves/ps3/rpcs3" fi
log i "RPCS3 saves migration completed, a backup was made here: \"$rdhome/backups/saves/ps3/rpcs3\"."
source /app/libexec/functions.sh
dir_prep "$saves_folder/ps3/rpcs3" "$bios_folder/rpcs3/dev_hdd0/home/00000001/savedata" dir_prep "$saves_folder/ps3/rpcs3" "$bios_folder/rpcs3/dev_hdd0/home/00000001/savedata"
log i "RPCS3 saves migration completed, a backup was made here: \"$backups_folder/$(date +"%0m%0d")_rpcs3_save_data.zip\"."
log i "Switch firmware folder should be moved in \"$bios_folder/switch/firmware\" from \"$bios_folder/switch/registered\"" log i "Switch firmware folder should be moved in \"$bios_folder/switch/firmware\" from \"$bios_folder/switch/registered\""
dir_prep "$bios_folder/switch/firmware" "$bios_folder/switch/registered" mv "$bios_folder/switch/registered" "$bios_folder/switch/firmware"
log i "New systems were added in this version, regenerating system folders." log i "New systems were added in this version, regenerating system folders."
#es-de --home "/var/config/" --create-system-dirs #es-de --home "/var/config/" --create-system-dirs

View file

@ -571,7 +571,7 @@ prepare_component() {
fi fi
fi fi
if [[ "$component" =~ ^(ryujunx|Ryujinx|all)$ ]]; then if [[ "$component" =~ ^(ryujinx|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 # 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. # 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 if [[ "$action" == "reset" ]]; then # Run reset-only commands
@ -594,6 +594,7 @@ prepare_component() {
rm -rf /var/config/Ryujinx rm -rf /var/config/Ryujinx
create_dir /var/config/Ryujinx/system create_dir /var/config/Ryujinx/system
cp -fv $emuconfigs/ryujinx/Config.json $ryujinxconf cp -fv $emuconfigs/ryujinx/Config.json $ryujinxconf
cp -fvr $emuconfigs/ryujinx/profiles /var/config/Ryujinx/
log d "Replacing placeholders in \"$ryujinxconf\"" log d "Replacing placeholders in \"$ryujinxconf\""
sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "$ryujinxconf" sed -i 's#RETRODECKHOMEDIR#'$rdhome'#g' "$ryujinxconf"
log i "Linking switch nand/saves folder" log i "Linking switch nand/saves folder"
@ -602,6 +603,7 @@ prepare_component() {
dir_prep "$saves_folder/switch/ryujinx/nand" "/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 "$saves_folder/switch/ryujinx/sdcard" "/var/config/Ryujinx/sdcard"
dir_prep "$bios_folder/switch/firmware" "/var/config/Ryujinx/bis/system/Contents/registered" dir_prep "$bios_folder/switch/firmware" "/var/config/Ryujinx/bis/system/Contents/registered"
dir_prep "$bios_folder/switch/keys" "/var/config/Ryujinx/system"
fi fi
fi fi
# if [[ "$action" == "reset" ]] || [[ "$action" == "postmove" ]]; then # Run commands that apply to both resets and moves # if [[ "$action" == "reset" ]] || [[ "$action" == "postmove" ]]; then # Run commands that apply to both resets and moves
@ -826,7 +828,10 @@ prepare_component() {
create_dir "/var/config/boilr" create_dir "/var/config/boilr"
cp -fvr "/app/libexec/steam-sync/config.toml" "/var/config/boilr" cp -fvr "/app/libexec/steam-sync/config.toml" "/var/config/boilr"
fi
if [[ ! "$component" =~ ^(retrodeck|es-de|ES-DE|retroarch|RetroArch|citra|citra-emu|Citra|cemu|Cemu|dolphin|dolphin-emu|Dolphin|duckstation|Duckstation|melonds|melonDS|MelonDS|pcsx2|PCSX2|pico8|pico-8|ppsspp|PPSSPP|primehack|Primehack|rpcs3|RPCS3|ryujinx|Ryujinx|yuzu|Yuzu|xemu|XEMU|vita3k|Vita3K|mame|MAME|gzdoom|GZDOOM|boilr|BOILR|)$ ]]; then
log e "Supplied component $component not found, not resetting"
fi fi
# Update presets for all components after any reset or move # Update presets for all components after any reset or move

View file

@ -913,7 +913,7 @@ modules:
sources: sources:
- type: git - type: git
url: https://github.com/RPCS3/rpcs3.git url: https://github.com/RPCS3/rpcs3.git
commit: efbf044ea08a0cee103acaf664f55e8eaa452c63 commit: 4ecf8ecd06c15f0557e1d9243f31e4c2d7baebe2
# RPCS3 - END # RPCS3 - END
@ -1327,10 +1327,6 @@ modules:
- cp emu-configs/gzdoom/gzdoom.sh ${FLATPAK_DEST}/bin/gzdoom.sh - cp emu-configs/gzdoom/gzdoom.sh ${FLATPAK_DEST}/bin/gzdoom.sh
- chmod +x ${FLATPAK_DEST}/bin/gzdoom.sh - chmod +x ${FLATPAK_DEST}/bin/gzdoom.sh
# Ryujinx wrapper
- cp emu-configs/ryujinx/ryujinx-rdwrapper.sh ${FLATPAK_DEST}/bin/ryujinx-rdwrapper.sh
- chmod +x ${FLATPAK_DEST}/bin/ryujinx-rdwrapper.sh
sources: sources:
- type: git - type: git
url: https://github.com/XargonWan/RetroDECK.git url: https://github.com/XargonWan/RetroDECK.git

View file

@ -56,7 +56,7 @@ https://retrodeck.net
;; ;;
--reset-component*) --reset-component*)
echo "You are about to reset one or more RetroDECK components or emulators." echo "You are about to reset one or more RetroDECK components or emulators."
echo "Available options are: es-de, retroarch, cemu, dolphin, duckstation, gzdoom, melonds, pcsx3, pico8, ppsspp, primehack, ryujinx, rpcs3, ryujinx, xemu, vita3k, mame, boilr, all" echo "Available options are: es-de, retroarch, cemu, dolphin, duckstation, gzdoom, melonds, pcsx3, pico8, ppsspp, primehack, rpcs3, ryujinx, xemu, vita3k, mame, boilr, all"
read -p "Please enter the component you would like to reset: " component read -p "Please enter the component you would like to reset: " component
if [[ "$component" =~ ^(es-de|retroarch|cemu|dolphin|duckstation|gzdoom|mame|melonds|pcsx2|ppsspp|primehack|ryujinx|rpcs3|xemu|all)$ ]]; then if [[ "$component" =~ ^(es-de|retroarch|cemu|dolphin|duckstation|gzdoom|mame|melonds|pcsx2|ppsspp|primehack|ryujinx|rpcs3|xemu|all)$ ]]; then
read -p "You are about to reset $component to default settings. Enter 'y' to continue, 'n' to stop: " response read -p "You are about to reset $component to default settings. Enter 'y' to continue, 'n' to stop: " response

View file

@ -119,8 +119,7 @@ configurator_welcome_dialog() {
"Open Emulator" "Launch and configure each emulators settings (for advanced users)" \ "Open Emulator" "Launch and configure each emulators settings (for advanced users)" \
"RetroDECK: Tools" "Compress games, move RetroDECK and install optional features" \ "RetroDECK: Tools" "Compress games, move RetroDECK and install optional features" \
"RetroDECK: Troubleshooting" "Backup data, perform BIOS / multi-disc file checks checks and emulator resets" \ "RetroDECK: Troubleshooting" "Backup data, perform BIOS / multi-disc file checks checks and emulator resets" \
"RetroDECK: About" "Show additional information about RetroDECK" \ "RetroDECK: About" "Show additional information about RetroDECK")
"Sync with Steam" "Sync with Steam all the favorites games")
fi fi
choice=$(zenity --list --title="RetroDECK Configurator Utility" --cancel-label="Quit" \ choice=$(zenity --list --title="RetroDECK Configurator Utility" --cancel-label="Quit" \
@ -528,7 +527,7 @@ configurator_open_emulator_dialog() {
"Ryujinx" ) "Ryujinx" )
log i "Configurator: \"$emulator\"" log i "Configurator: \"$emulator\""
ryujinx-rdwrapper.sh Ryujinx.sh
;; ;;
"Vita3K" ) "Vita3K" )
@ -791,26 +790,36 @@ configurator_compress_single_game_dialog() {
if [[ ! $compatible_compression_format == "none" ]]; then if [[ ! $compatible_compression_format == "none" ]]; then
local post_compression_cleanup=$(configurator_compression_cleanup_dialog) local post_compression_cleanup=$(configurator_compression_cleanup_dialog)
( (
echo "# Compressing $(basename "$file") to $compatible_compression_format format" echo "# Compressing $(basename "$file") to $compatible_compression_format format" # This updates the Zenity dialog
log i "Compressing $(basename "$file") to $compatible_compression_format format"
compress_game "$compatible_compression_format" "$file" "$system" compress_game "$compatible_compression_format" "$file" "$system"
if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested
if [[ "$file" == *".cue" ]]; then if [[ -f "${file%.*}.$compatible_compression_format" ]]; then
local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") log i "Performing post-compression file cleanup"
local file_path=$(dirname "$(realpath "$file")") if [[ "$file" == *".cue" ]]; then
while IFS= read -r line local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")
do local file_path=$(dirname "$(realpath "$file")")
rm -f "$file_path/$line" while IFS= read -r line
done < <(printf '%s\n' "$cue_bin_files") do
rm -f $(realpath "$file") log i "Removing file $file_path/$line"
rm -f "$file_path/$line"
done < <(printf '%s\n' "$cue_bin_files")
log i "Removing file $(realpath $file)"
rm -f $(realpath "$file")
else
log i "Removing file $(realpath $file)"
rm -f "$(realpath "$file")"
fi
else else
rm -f "$(realpath "$file")" log i "Compressed file ${file%.*}.$compatible_compression_format not found, skipping original file deletion"
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "A compressed version of the file was not found, skipping deletion."
fi fi
fi fi
) | ) |
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - Compression in Progress" --title "RetroDECK Configurator Utility - Compression in Progress"
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "The compression process is complete!" configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "The compression process is complete."
configurator_compression_tool_dialog configurator_compression_tool_dialog
else else
@ -906,21 +915,31 @@ configurator_compress_multiple_games_dialog() {
local system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") local system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$")
local compression_format=$(find_compatible_compression_format "$file") local compression_format=$(find_compatible_compression_format "$file")
echo "# Compressing $(basename "$file") into $compression_format format" # Update Zenity dialog text echo "# Compressing $(basename "$file") into $compression_format format" # Update Zenity dialog text
log i "Compressing $(basename "$file") into $compression_format format"
progress=$(( 100 - (( 100 / "$total_games_to_compress" ) * "$games_left_to_compress" ))) progress=$(( 100 - (( 100 / "$total_games_to_compress" ) * "$games_left_to_compress" )))
echo $progress echo $progress
games_left_to_compress=$((games_left_to_compress-1)) games_left_to_compress=$((games_left_to_compress-1))
log i "Games left to compress: $games_left_to_compress"
compress_game "$compression_format" "$file" "$system" compress_game "$compression_format" "$file" "$system"
if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested
if [[ "$file" == *".cue" ]]; then if [[ -f "${file%.*}.$compatible_compression_format" ]]; then
local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") if [[ "$file" == *".cue" ]]; then
local file_path=$(dirname "$(realpath "$file")") local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")
while IFS= read -r line local file_path=$(dirname "$(realpath "$file")")
do while IFS= read -r line
rm -f "$file_path/$line" do
done < <(printf '%s\n' "$cue_bin_files") log i "Removing file $file_path/$line"
rm -f $(realpath "$file") rm -f "$file_path/$line"
done < <(printf '%s\n' "$cue_bin_files")
log i "Removing file $(realpath $file)"
rm -f $(realpath "$file")
else
log i "Removing file $(realpath $file)"
rm -f "$(realpath "$file")"
fi
else else
rm -f "$(realpath "$file")" log i "Compressed file ${file%.*}.$compatible_compression_format not found, skipping original file deletion"
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "Compression of $(basename $file) failed, skipping deletion."
fi fi
fi fi
done done
@ -939,7 +958,7 @@ configurator_compression_cleanup_dialog() {
zenity --icon-name=net.retrodeck.retrodeck --question --no-wrap --cancel-label="No" --ok-label="Yes" \ zenity --icon-name=net.retrodeck.retrodeck --question --no-wrap --cancel-label="No" --ok-label="Yes" \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK: Compression Tool" \ --title "RetroDECK Configurator - RetroDECK: Compression Tool" \
--text="Do you want to remove old files after they are compressed?\n\nClicking \"No\" will leave all files behind which will need to be cleaned up manually and may result in game duplicates showing in the RetroDECK library." --text="Do you want to remove old files after they are compressed?\n\nClicking \"No\" will leave all files behind which will need to be cleaned up manually and may result in game duplicates showing in the RetroDECK library.\n\nPlease make sure you have a backup of your ROMs before using automatic cleanup!"
local rc=$? # Capture return code, as "Yes" button has no text value local rc=$? # Capture return code, as "Yes" button has no text value
if [[ $rc == "0" ]]; then # If user clicked "Yes" if [[ $rc == "0" ]]; then # If user clicked "Yes"
echo "true" echo "true"