Skip to content

Commit b59cb28

Browse files
committed
dolphin: updates to build and configuration
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
1 parent 3c59970 commit b59cb28

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

scriptmodules/emulators/dolphin.sh

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ function depends_dolphin() {
4848
else
4949
depends+=(qtbase5-private-dev)
5050
fi
51+
# on KMS use x11 to start the emulator
52+
isPlatform "kms" && depends+=(xorg matchbox-window-manager)
53+
54+
# if using the latest version, add SDL2 as dependency, since it's mandatory
55+
[[ "$(_get_commit_dolphin)" == "" ]] && depends+=(libsdl2-dev)
56+
5157
getDepends "${depends[@]}"
5258
}
5359

@@ -58,8 +64,8 @@ function sources_dolphin() {
5864
function build_dolphin() {
5965
mkdir build
6066
cd build
61-
# use the bundled 'speexdsp' libs, distro versions before 1.2.1 produce a 'cmake' error
62-
cmake .. -DBUNDLE_SPEEX=ON -DCMAKE_INSTALL_PREFIX="$md_inst"
67+
# use the bundled 'speexdsp' libs, distro versions before 1.2.1 trigger a 'cmake' error
68+
cmake .. -DBUNDLE_SPEEX=ON -DENABLE_AUTOUPDATE=OFF -DENABLE_ANALYTICS=OFF -DUSE_DISCORD_PRESENCE=OFF -DCMAKE_INSTALL_PREFIX="$md_inst"
6369
make clean
6470
make
6571
md_ret_require="$md_build/build/Binaries/dolphin-emu"
@@ -74,23 +80,40 @@ function configure_dolphin() {
7480
mkRomDir "gc"
7581
mkRomDir "wii"
7682

77-
moveConfigDir "$home/.dolphin-emu" "$md_conf_root/gc"
83+
local launch_prefix
84+
isPlatform "kms" && launch_prefix="XINIT-WM:"
85+
86+
addEmulator 0 "$md_id" "gc" "$launch_prefix$md_inst/bin/dolphin-emu-nogui -e %ROM%"
87+
addEmulator 1 "$md_id-gui" "gc" "$launch_prefix$md_inst/bin/dolphin-emu -b -e %ROM%"
88+
addEmulator 0 "$md_id" "wii" "$launch_prefix$md_inst/bin/dolphin-emu-nogui -e %ROM%"
89+
addEmulator 1 "$md_id-gui" "wii" "$launch_prefix$md_inst/bin/dolphin-emu -b -e %ROM%"
90+
91+
addSystem "gc"
92+
addSystem "wii"
7893

94+
[[ "$md_mode" == "remove" ]] && return
95+
96+
moveConfigDir "$home/.config/dolphin-emu" "$md_conf_root/gc/Config"
97+
mkUserDir "$md_conf_root/gc/Config"
98+
# preset a few options on a first installation
7999
if [[ ! -f "$md_conf_root/gc/Config/Dolphin.ini" ]]; then
80-
mkdir -p "$md_conf_root/gc/Config"
81100
cat >"$md_conf_root/gc/Config/Dolphin.ini" <<_EOF_
82101
[Display]
83-
FullscreenResolution = Auto
102+
FullscreenDisplayRes = Auto
84103
Fullscreen = True
104+
RenderToMain = True
105+
KeepWindowOnTop = True
106+
[Interface]
107+
ConfirmStop = False
85108
_EOF_
86-
chown -R $user:$user "$md_conf_root/gc/Config"
109+
fi
110+
# use the GLES(3) render path on platforms where it's available
111+
if [[ ! -f "$md_conf_root/gc/Config/GFX.ini" ]] && isPlatform "gles3"; then
112+
cat >"$md_conf_root/gc/Config/GFX.ini" <<_EOF2_
113+
[Settings]
114+
PreferGLES = True
115+
_EOF2_
87116
fi
88117

89-
addEmulator 1 "$md_id" "gc" "$md_inst/bin/dolphin-emu-nogui -e %ROM%"
90-
addEmulator 0 "$md_id-gui" "gc" "$md_inst/bin/dolphin-emu -b -e %ROM%"
91-
addEmulator 1 "$md_id" "wii" "$md_inst/bin/dolphin-emu-nogui -e %ROM%"
92-
addEmulator 0 "$md_id-gui" "wii" "$md_inst/bin/dolphin-emu -b -e %ROM%"
93-
94-
addSystem "gc"
95-
addSystem "wii"
118+
chown -R $user:$user "$md_conf_root/gc/Config"
96119
}

0 commit comments

Comments
 (0)