Skip to content

Commit

Permalink
dolphin: updates to build and configuration
Browse files Browse the repository at this point in the history
Modified the module to update the dependencies and improve the initial configuration

* Build changes:
   -  build dependencies modified to include SDL2. Latest version (as of Jan 2024) enable SDL2 by default on Linux and use it for input auto-configuration.
      Gamepads detected using SDL's GameController API are automatically configred based on their mappings.
   - disable analytics and update support durign the build. Updates are handled by RetroPie-Setup and - unfortunately - analytics require a keyboard/mouse to get over the initial agreement pop-up that is presented to the user on the 1st run.

* Configuration updates:
   - on KMS systems, start Dolphin via X11 by using the `XINIT-WM` launc prefix, which instructs `runcommand` to start a minimal desktop env.
   - change the location of the configuration folder, since now Dolphin follows the XDG specs and uses `$XDG_CONFIG_HOME` to store its settings.
     It will not affect existing installations, since we symlink-it to the configuration folder anyway and Dolphin will look in the previous location first.
   - pre-set a few initial configuration options in the main `Dolphin.ini` configuration file, upating existing options
   - add a new pre-set for the graphics backend configuration file in `GFX.ini` to switch to GLES3 on platforms where it is available.
     It should help the Pi5 but also other SBCs we support (i.e. OrangePi5 / RK3399) to startw the correct rendering backend.
   - set the '-gui' variant as default. Since the 'nogui' doesn't seem to read the configuration files correctly (i.e. no Fullscreen or Hotkeys are working), use the main program started with '--batch' to run a game
  • Loading branch information
cmitu committed Feb 16, 2024
1 parent 3c59970 commit 6242f40
Showing 1 changed file with 34 additions and 13 deletions.
47 changes: 34 additions & 13 deletions scriptmodules/emulators/dolphin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ function depends_dolphin() {
else
depends+=(qtbase5-private-dev)
fi
# on KMS use x11 to start the emulator
isPlatform "kms" && depends+=(xorg matchbox-window-manager)

# if using the latest version, add SDL2 as dependency, since it's mandatory
[[ "$(_get_commit_dolphin)" == "" ]] && depends+=(libsdl2-dev)

getDepends "${depends[@]}"
}

Expand All @@ -58,8 +64,8 @@ function sources_dolphin() {
function build_dolphin() {
mkdir build
cd build
# use the bundled 'speexdsp' libs, distro versions before 1.2.1 produce a 'cmake' error
cmake .. -DBUNDLE_SPEEX=ON -DCMAKE_INSTALL_PREFIX="$md_inst"
# use the bundled 'speexdsp' libs, distro versions before 1.2.1 trigger a 'cmake' error
cmake .. -DBUNDLE_SPEEX=ON -DENABLE_AUTOUPDATE=OFF -DENABLE_ANALYTICS=OFF -DUSE_DISCORD_PRESENCE=OFF -DCMAKE_INSTALL_PREFIX="$md_inst"
make clean
make
md_ret_require="$md_build/build/Binaries/dolphin-emu"
Expand All @@ -74,23 +80,38 @@ function configure_dolphin() {
mkRomDir "gc"
mkRomDir "wii"

moveConfigDir "$home/.dolphin-emu" "$md_conf_root/gc"
local launch_prefix
isPlatform "kms" && launch_prefix="XINIT-WM:"

addEmulator 0 "$md_id" "gc" "$launch_prefix$md_inst/bin/dolphin-emu-nogui -e %ROM%"
addEmulator 1 "$md_id-gui" "gc" "$launch_prefix$md_inst/bin/dolphin-emu -b -e %ROM%"
addEmulator 0 "$md_id" "wii" "$launch_prefix$md_inst/bin/dolphin-emu-nogui -e %ROM%"
addEmulator 1 "$md_id-gui" "wii" "$launch_prefix$md_inst/bin/dolphin-emu -b -e %ROM%"

addSystem "gc"
addSystem "wii"

[[ "$md_mode" == "remove" ]] && return

moveConfigDir "$home/.config/dolphin-emu" "$md_conf_root/gc"
mkUserDir "$md_conf_root/gc/Config"
# preset a few options on a first installation
if [[ ! -f "$md_conf_root/gc/Config/Dolphin.ini" ]]; then
mkdir -p "$md_conf_root/gc/Config"
cat >"$md_conf_root/gc/Config/Dolphin.ini" <<_EOF_
[Display]
FullscreenResolution = Auto
FullscreenDisplayRes = Auto
Fullscreen = True
RenderToMain = True
KeepWindowOnTop = True
_EOF_
chown -R $user:$user "$md_conf_root/gc/Config"
fi
# use the GLES(3) render path on platforms where it's available
if [[ ! -f "$md_conf_root/gc/Config/GFX.ini" ]] && isPlatform "gles3"; then
cat >"$md_conf_root/gc/Config/GFX.ini" <<_EOF2_
[Settings]
PreferGLES = True
_EOF2_
fi

addEmulator 1 "$md_id" "gc" "$md_inst/bin/dolphin-emu-nogui -e %ROM%"
addEmulator 0 "$md_id-gui" "gc" "$md_inst/bin/dolphin-emu -b -e %ROM%"
addEmulator 1 "$md_id" "wii" "$md_inst/bin/dolphin-emu-nogui -e %ROM%"
addEmulator 0 "$md_id-gui" "wii" "$md_inst/bin/dolphin-emu -b -e %ROM%"

addSystem "gc"
addSystem "wii"
chown -R $user:$user "$md_conf_root/gc/Config"
}

0 comments on commit 6242f40

Please sign in to comment.