From ddc38a74518b77a74203b0d3176f33853aea3e8d Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 19 Mar 2023 09:33:11 +0100 Subject: [PATCH] mupen64plus.sh: final fix for GlideN64 config version We already extract GlideN64 config version. Use it to finally set right config version in mupen64plus package script. Mupen64plus startup script should do this as well, but it is not wrong to do it here. -set right GlideN64 config version in "$config.rp-dist" -set right GlideN64 config version in "$config" because GlideN64 overwrites user settings if config version is wrong fixes: https://github.com/RetroPie/RetroPie-Setup/issues/3654 --- scriptmodules/emulators/mupen64plus.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scriptmodules/emulators/mupen64plus.sh b/scriptmodules/emulators/mupen64plus.sh index a05930239f..298a841bf7 100644 --- a/scriptmodules/emulators/mupen64plus.sh +++ b/scriptmodules/emulators/mupen64plus.sh @@ -316,6 +316,16 @@ function configure_mupen64plus() { local config="$md_conf_root/n64/mupen64plus.cfg" local cmd="$md_inst/bin/mupen64plus --configdir $md_conf_root/n64 --datadir $md_conf_root/n64" + # patch existing mupen64plus config because Gliden64 overwrites user settings if config + # version is wrong + iniConfig " = " "" "$config" + # Create GlideN64 section in .cfg + if ! grep -q "\[Video-GLideN64\]" "$config"; then + echo "[Video-GLideN64]" >> "$config" + fi + # Settings version. Don't touch it. + iniSet "configVersion" "$(cat $md_inst/share/mupen64plus/GLideN64_config_version.ini)" + # if the user has an existing mupen64plus config we back it up, generate a new configuration # copy that to rp-dist and put the original config back again. We then make any ini changes # on the rp-dist file. This preserves any user configs from modification and allows us to have @@ -345,7 +355,7 @@ function configure_mupen64plus() { echo "[Video-GLideN64]" >> "$config" fi # Settings version. Don't touch it. - iniSet "configVersion" "29" + iniSet "configVersion" "$(cat $md_inst/share/mupen64plus/GLideN64_config_version.ini)" # Bilinear filtering mode (0=N64 3point, 1=standard) iniSet "bilinearMode" "1" iniSet "EnableFBEmulation" "True"