Skip to content

Commit

Permalink
Merge pull request #3868 from cmitu/dolphin-pi5
Browse files Browse the repository at this point in the history
dolphin: updates to build and configuration
  • Loading branch information
joolswills authored Feb 25, 2024
2 parents b8cc361 + b59cb28 commit f807458
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 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,40 @@ 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/Config"
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
[Interface]
ConfirmStop = False
_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 f807458

Please sign in to comment.