From 3f4aecc7867c9d34d06bce1718e5f9eb82b33397 Mon Sep 17 00:00:00 2001 From: monkeyx-net Date: Wed, 3 Jul 2024 01:00:45 +0100 Subject: [PATCH] More wiki updates. More to follow soon. On branch ruffle Changes to be committed: modified: wiki-rtd/docs/wiki_development/general/add-system.md --- .../wiki_development/general/add-system.md | 96 ++++++++++++++++--- 1 file changed, 83 insertions(+), 13 deletions(-) diff --git a/wiki-rtd/docs/wiki_development/general/add-system.md b/wiki-rtd/docs/wiki_development/general/add-system.md index e6de4a7..962a574 100644 --- a/wiki-rtd/docs/wiki_development/general/add-system.md +++ b/wiki-rtd/docs/wiki_development/general/add-system.md @@ -34,33 +34,34 @@ How well do you know the emulator you are looking to add to RetroDECK. ### Editing the manifest file ```bash linenums="1" -# Ruffle - START + # Ruffle - START - name: ruffle buildsystem: simple build-commands: + - mkdir -p "${FLATPAK_DEST}/share/ruffle" + - mv -f ruffle "${FLATPAK_DEST}/share/ruffle/" - chmod +x "${FLATPAK_DEST}/share/ruffle/ruffle" - - ln -s ${FLATPAK_DEST}/share/ruffle/ruffle ${FLATPAK_DEST}/bin/ruffle sources: - type: archive url: https://github.com/ruffle-rs/ruffle/releases/download/nightly-2024-07-02/ruffle-nightly-2024_07_02-linux-x86_64.tar.gz sha256: a410ce8956723a0043d1744ef9b519debc978faa2b5868953acc548e44586d15 -# Ruffle - END + # Ruffle - END ``` - - Please note lines 1 and 15 as remarks/labels having these help with logging and fund the emulator within the file. + - Please note lines 1 and 14 as remarks/labels having these help with logging and fund the emulator within the file. - Line 3 is a label - Lines 4 indicates a simple build type, the simple build type is just executing the given `build-commands`, ie downloading and copying files rather than compiling and building the project. The preference is to compile and build emulators to support the Flatpak process in producing increased compatibly and customisation. Ruffle is a rust project and under constant development. It is hoped to make this a compiled project in the future. - A simple project is also a good starting point to Flatpak builds. - - Lines 5 to 9 shows the build process kinked to the downloaded ruffle file. - - Lines 11-13 are defining the sources: + - Lines 5 to 8 shows the build process kinked to the downloaded ruffle file. + - Lines 10-12 are defining the sources: - type: `archive`, this means that the archive is download and extracted without any explicit manifest action, `file` type source instead would just download the file without extracting it. - url: obviously the url to download - sha256: the sha256sum of the file, this is mandatory -> **NOTE:** In some rare caes we might don't know the sha (or even the url) in advance, for example when an emulator is having only one release on GitHub that is being kept updated without a release history. -[This guide](wiki-rtd/docs/wiki_development/general/automate-emulator-with-placeholders.md) is explaining how to use the placeholders instead of urls or sha in case the this data cannot be forseen. +> **NOTE:** In some rare cases we might don't know the sha (or even the url) in advance, for example when an emulator is having only one release on GitHub that is being kept updated without a release history. +[This guide](wiki-rtd/docs/wiki_development/general/automate-emulator-with-placeholders.md) is explaining how to use the placeholders instead of urls or sha in case the this data cannot be foreseen. Fort his purpose we have implemented an automation to get that data from the repository itself to being used only as a final resource as we prefer to control the version of each module for proper troubleshooting and version control. ### Build the RetroDECK Flatpak @@ -78,8 +79,7 @@ Other than human error with the code the most frequent issue is with sha256 issu If the build completes without errors it should produce an artifact that you can download and test - -## Backup your key data and configs +### Backup your key data and configs Make a copy of `~/.var/app/net.retrodeck.retrodeck/` folder and name it `old.net.retrodeck.retrodeck` Make a full back up or partial backups of the retrodeck folder normally under `~/retrodeck` or sdcard/other drive. @@ -87,7 +87,7 @@ On retrodeck folder backups: Generally, very few things would target the roms folder, but the other folders could be targeted for various scripts. Our recommendation would be to back up the full ~/retrodeck folder, but as a tester you can decide how much you want to risk. -## Install and Test the built Flatpak +### Install and Test the built Flatpak Remove all the installed versions of RetroDECK, to be sure uninstall both in the system and userland: @@ -101,9 +101,79 @@ Download and unzip the artifact to a folder of your choice and then run this com On first run it will ask you to upgrade -If it then asks to upgrade the cooker as well. Then say no +If it then asks to upgrade the cooker as well. Then say no. +### Add emulator/system to ES-DE -## Add emulator/system to ES-DE +In order for your new system to show in ES-DE it need to be added to ES-DE, which has been forked by the project. Fork and clone the RetroDECK ES-DE [Repo](https://github.com/XargonWan/RetroDECK-ES-DE/fork) + +Once cloned cd into your cloned directory and create a new branch and then + +```bash +cd retrodeck-main/resources/systems/linux +``` + +There are two files in that folder and the relevant ruffle sections are shown below. There is a good chance that the emulator or system you are adding is already there and just needs to have the remarks removed. If not you can use this as an example of what needs adding. + +`es_system.xml` +```xml + + flash + Adobe Flash + %ROMPATH%/flash + .swf .SWF + %EMULATOR_RUFFLE% %ROM% + + flash + flash + +``` + +In the rules file I added an entry for the ruffle-wrapper.sh and added the remark to make it easier to compare for differences when merges are made from ES-De source project. A wrapper script was required as ruffle has most options set from cli switches. The wrapper script is documented [below.](emu-configs) + +`es_find_rules.xml` +```xml + + + + ruffle + + + /app/bin/ruffle-wrapper.sh + ~/Applications/ruffle/ruffle + ~/.local/share/applications/ruffle/ruffle + ~/.local/bin/ruffle/ruffle + ~/bin/ruffle/ruffle + + +``` + +### Emu-configs + +Ruffle wrapper script sources the /app/libexec/global.sh to reference the $saves_folder variable. it also allows the use if check_desktop_mode function so that a different graphics preference can be set for Steam Deck in game mode. + + +```bash +#!/bin/bash + +source /app/libexec/global.sh + +#Check if Steam Deck in Desktop Mode +if [[ $(check_desktop_mode) == "true" ]]; then + /app/share/ruffle/ruffle --graphics vulkan --config /var/data/ruffle --save-directory $saves_folder/ruffle --fullscreen "$@" +else + /app/share/ruffle/ruffle --graphics gl --config /var/data/ruffle --save-directory $saves_folder/ruffle --fullscreen "$@" +fi +``` +Other important variables referenced in the global.sh are:- + +```bash +RETRODECKHOMEDIR is $rdhome (aka retrodeck folder) +RETRODECKSAVESDIR is $saves_folder (aka retrodeck/saves) +RETRODECKROMSDIR is $roms_dir (aka retrodeck/roms) +``` + +These are used by the configurator tool to move key folders and reset them. More on that tool soon. +