From 6588901e9a4d81e655f20d8dbb2a558d929b8a65 Mon Sep 17 00:00:00 2001 From: mleo2003 Date: Mon, 17 Aug 2026 21:36:49 -0700 Subject: [PATCH] rg34xxsp launcher: also resolve GAMEDIR on split-tree firmwares The generated launcher resolves the game folder as "$SHDIR/gen1recomp" -- the sibling of the script. That is right on Anbernic stock, and the comment above it explains why PortMaster's \$directory was not used there (casing and mount points differ). Firmwares that keep launcher scripts and port data in SEPARATE trees -- muOS puts scripts in roms/ports and data in ports, as does PortMaster on several devices -- have no game beside the script, so the launcher exits without starting anything. Try the sibling first, unchanged, and fall back to the split layouts only when the sibling holds no game. Probe for bin/love.aarch64, not for the directory: on a split layout the script has usually already created "$SHDIR/gen1recomp/conf" and log.txt on an earlier failed run (its own mkdir and tee), so a directory test matches a decoy of the script's own making. Verified on a muOS RG35XXSP, where exactly that decoy exists and holds only conf/ and log.txt. Stock is unaffected: its sibling holds the real binary and wins the first test, including when a populated path exists elsewhere. With no game anywhere the value is unchanged, so the failure mode stays what it was. --- build-rg34xxsp.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build-rg34xxsp.sh b/build-rg34xxsp.sh index 01a62b53..041afcfc 100755 --- a/build-rg34xxsp.sh +++ b/build-rg34xxsp.sh @@ -193,6 +193,26 @@ get_controls [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" GAMEDIR="$SHDIR/gen1recomp" +# Anbernic stock keeps the launcher and the game folder side by side, so the +# SHDIR-relative path above is correct there and is tried first. +# +# Other firmwares (muOS, and PortMaster's layout on several devices) keep +# launcher scripts and port data in SEPARATE trees -- scripts under roms/ports, +# data under ports -- so the sibling folder holds no game. +# +# Probe for the BINARY, not the directory: on a split layout this script has +# usually already created "$SHDIR/gen1recomp/conf" and log.txt on an earlier +# failed run (see mkdir/tee below), so an existence test matches a decoy of our +# own making. Stock is unaffected -- its sibling holds the real binary and wins +# on the first test. +if [ ! -f "$GAMEDIR/bin/love.aarch64" ]; then + for candidate in "/$directory/ports/gen1recomp" \ + "/mnt/sdcard/ports/gen1recomp" \ + "/mnt/mmc/ports/gen1recomp" \ + "/roms/ports/gen1recomp"; do + if [ -f "$candidate/bin/love.aarch64" ]; then GAMEDIR="$candidate"; break; fi + done +fi CONFDIR="$GAMEDIR/conf" mkdir -p "$CONFDIR"