diff --git a/config/retrodeck/reference_lists/features.json b/config/retrodeck/reference_lists/features.json index 90014478..576fc38c 100644 --- a/config/retrodeck/reference_lists/features.json +++ b/config/retrodeck/reference_lists/features.json @@ -972,6 +972,12 @@ } ] }, + "ruffle": { + "description": "Flash Games emulator", + "name" : "Ruffle", + "system" : "flash", + "launch": "ruffle-rd-wrapper.sh" + }, "melonds": { "description": "MelonDS Nintendo DS Emulator", "name": "melonds", diff --git a/config/ruffle/ruffle-rdwrapper.sh b/config/ruffle/ruffle-rdwrapper.sh new file mode 100644 index 00000000..37ba0d89 --- /dev/null +++ b/config/ruffle/ruffle-rdwrapper.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +source /app/libexec/global.sh + +create_dir "$saves_folder/ruffle" + +static_invoke="--config /var/data/ruffle \ + --save-directory "$saves_folder/ruffle" \ + --fullscreen" + +#Check if Steam Deck in Desktop Mode +if [[ $(check_desktop_mode) == "true" ]]; then + ruffle --graphics vulkan $static_invoke "$@" +else + ruffle --graphics gl --no-gui $static_invoke "$@" +fi \ No newline at end of file diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index 137a5bbe..ac3e47b9 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -857,6 +857,24 @@ prepare_component() { sed -i 's#RETRODECKSAVESDIR#'$saves_folder'#g' "/var/config/gzdoom/gzdoom.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON fi + if [[ "$component" =~ ^(ruffle|all)$ ]]; then + component_found="true" + log i "----------------------" + log i "Prepearing Ruffle" + log i "----------------------" + + rm -rf "/var/config/ruffle" + + # Ruffle creates a directory with the full rom paths in it, so this is necessary + # TODO: be aware of this when multi user support will be integrated for this component + dir_prep "$saves_folder/flash" "/var/data/ruffle/SharedObjects/localhost/$roms_folder/flash" + + if [[ "$action" == "postmove" ]]; then # Run only post-move commands + dir_prep "$saves_folder/flash" "/var/data/ruffle/SharedObjects/localhost/$roms_folder/flash" + fi + + fi + if [[ $component_found == "false" ]]; then log e "Supplied component $component not found, not resetting" fi diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index b095d7e1..acda1f52 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -549,6 +549,20 @@ modules: url: https://github.com/RetroDECK/RetroDECK-theme commit: 975c41cac99d150b6ae86a1dfd19988058c69aad + # RUFFLE - START + # https://github.com/ruffle-rs/ruffle/releases + - name: ruffle + buildsystem: simple + build-commands: + - | + cp -p ruffle "${FLATPAK_DEST}/bin/" + chmod +x "${FLATPAK_DEST}/bin/ruffle" + sources: + - type: archive + strip-components: 0 + url: https://github.com/ruffle-rs/ruffle/releases/download/nightly-2024-08-09/ruffle-nightly-2024_08_09-linux-x86_64.tar.gz + sha256: d2c4c77d8426da6df8dc8b2a57565c151146464a8eec605d5faa68a297d8cad6 + - name: fetch-missing-libs buildsystem: simple build-commands: @@ -644,6 +658,10 @@ modules: - cp config/gzdoom/gzdoom.sh ${FLATPAK_DEST}/bin/gzdoom.sh - chmod +x ${FLATPAK_DEST}/bin/gzdoom.sh + # RUFFLE wrapper + - cp config/ruffle/ruffle-rdwrapper.sh "${FLATPAK_DEST}/bin/ruffle-rdwrapper.sh" + - chmod +x "${FLATPAK_DEST}/bin/ruffle-rdwrapper.sh" + sources: - type: git url: THISREPO diff --git a/tools/configurator/data_list.json b/tools/configurator/data_list.json index a671ea71..9f8a400d 100644 --- a/tools/configurator/data_list.json +++ b/tools/configurator/data_list.json @@ -405,4 +405,4 @@ ] } } -} \ No newline at end of file +}