fix(portmaster): align launcher with upstream conventions

This commit is contained in:
Alexander Sellite 2026-08-20 23:48:00 -04:00
parent 9649cc8623
commit 876c243a8b
4 changed files with 33 additions and 39 deletions

View file

@ -28,18 +28,21 @@ directory. The templates in `scripts/portmaster/` are authoritative.
- `port.json` uses schema version 4, names `netfishing.zip`, and marks the - `port.json` uses schema version 4, names `netfishing.zip`, and marks the
self-contained package ready to run. self-contained package ready to run.
- `NETfishing.sh` starts with `# PORTMASTER: netfishing.zip, NETfishing.sh`. - `NETfishing.sh` does not contain a `# PORTMASTER:` signature in the source or
distributable archive. HarbourMaster adds that installation marker when it
installs the port.
- The executable is `netfishing/NETfishing.aarch64`. - The executable is `netfishing/NETfishing.aarch64`.
- The package declares AArch64, two analog sticks, GLIBC 2.28, and - The package declares AArch64, two analog sticks, GLIBC 2.28, and
`weston_pkg_0.2.squashfs`. `weston_pkg_0.2.squashfs`.
- The launcher starts GPTOKEYB with the explicit `netfishing.gptk` no-op map. - The launcher starts GPTOKEYB with the explicit `netfishing.gptk` no-op map.
Every keyboard and mouse binding is disabled, leaving only PortMaster's Every keyboard and mouse binding is disabled, leaving only GPTOKEYB's
device-specific force-quit chord while Godot and NETfishing's controller device-specific force-quit chord while Godot and NETfishing's controller
mapping manager handle gameplay input. mapping manager handle gameplay input. The explicit map also avoids the
anomalous controller behavior observed on ROCKNIX without a passthrough map.
- The launcher calls `pm_platform_helper` for the game executable after - The launcher calls `pm_platform_helper` for the game executable after
starting GPTOKEYB and calls `pm_finish` after the game exits. starting GPTOKEYB and calls `pm_finish` after the game exits.
- New installations automatically create player data under - NETfishing automatically creates player data for new installations under
`ports/saves/netfishing/` and do not present the in-game folder picker. `ports/saves/netfishing/` and does not present the in-game folder picker.
- Existing installations with a selected data root keep that location when - Existing installations with a selected data root keep that location when
upgraded. Device-local data, configuration, and cache remain under upgraded. Device-local data, configuration, and cache remain under
`netfishing/conf/data`, `netfishing/conf/config`, and `netfishing/conf/data`, `netfishing/conf/config`, and
@ -103,15 +106,15 @@ Before upgrading an existing installation, preserve
device. After installation: device. After installation:
1. Confirm the installed executable and PCK hashes match the staged release. 1. Confirm the installed executable and PCK hashes match the staged release.
2. Confirm the installed launcher contains the canonical PortMaster header, 2. Confirm HarbourMaster added its `# PORTMASTER:` installation signature to
starts GPTOKEYB with `netfishing.gptk`, and calls the installed launcher, then confirm the launcher starts GPTOKEYB with
`pm_platform_helper` for the game executable. `netfishing.gptk` and calls `pm_platform_helper` for the game executable.
3. Confirm `conf/` and the external save directory were not replaced or 3. Confirm `conf/` and the external save directory were not replaced or
removed. removed.
4. Launch the installed port through the normal muOS menu. 4. Launch the installed port through the normal muOS menu.
5. Verify the displayed game version and controller face-button mapping. 5. Verify the displayed game version and controller face-button mapping.
6. Verify PortMaster's force-quit chord exits the game. This is Start+Select on 6. Verify GPTOKEYB's device-specific force-quit chord exits the game. This is
most devices. Start+Select on most devices.
Installing the public PortMaster catalog entry can still install an older Installing the public PortMaster catalog entry can still install an older
catalog build until the upstream `netfishing.zip` is updated. A local release catalog build until the upstream `netfishing.zip` is updated. A local release
@ -173,12 +176,12 @@ the game process. This applies the mapping at the same point as the working
reconstruction. Do not move the mapping back to either side of reconstruction. Do not move the mapping back to either side of
`westonwrap.sh`. `westonwrap.sh`.
Legacy GPTOKEYB builds can load their compiled default keyboard map when no
`-c` file is supplied. That map translates face buttons, D-pad directions, and
sticks into keyboard or mouse events on top of Godot's native controller input.
Always pass `netfishing.gptk`, which explicitly unassigns every direct and Always pass `netfishing.gptk`, which explicitly unassigns every direct and
hotkey binding with GPTOKEYB's `\"` value. Do not add gameplay mappings to this hotkey binding with GPTOKEYB's `\"` value. This keeps GPTOKEYB from injecting
file. The Start+Select kill chord remains independent of the no-op bindings. keyboard or mouse events on top of Godot's native controller input and retains
the device-specific kill chord. Supplying the explicit passthrough map also
avoids the anomalous controller behavior observed on ROCKNIX when no map is
provided. Do not add gameplay mappings to this file.
Do not call `Input.add_joy_mapping(..., true)` for a recognized connected muOS Do not call `Input.add_joy_mapping(..., true)` for a recognized connected muOS
controller. Updating this virtual controller after connection can stop Godot controller. Updating this virtual controller after connection can stop Godot

View file

@ -223,7 +223,7 @@ music while omitting rain and shoreline ambience in both profiles. See
## Controls ## Controls
NETfishing reads the handheld controller directly. PortMaster's system NETfishing reads the handheld controller directly. GPTOKEYB's device-specific
force-quit chord remains available; this is Start+Select on most devices. force-quit chord remains available; this is Start+Select on most devices.
EOF EOF
@ -249,8 +249,11 @@ if unzip -Z1 "${ARCHIVE}" | grep -qx 'port.json'; then
echo "port.json must be inside netfishing/, not at the archive root." >&2 echo "port.json must be inside netfishing/, not at the archive root." >&2
exit 1 exit 1
fi fi
grep -q '^# PORTMASTER: netfishing.zip, NETfishing.sh$' \ if grep -Eq '^[[:space:]]*#[[:space:]]*PORTMASTER:' \
"${STAGE_ROOT}/NETfishing.sh" "${STAGE_ROOT}/NETfishing.sh"; then
echo "The distributable launcher contains an installed PortMaster signature." >&2
exit 1
fi
grep -Fq 'PROFILE_PATH="$CONFDIR/performance_profile"' \ grep -Fq 'PROFILE_PATH="$CONFDIR/performance_profile"' \
"${STAGE_ROOT}/NETfishing.sh" "${STAGE_ROOT}/NETfishing.sh"
grep -Fq 'NETFISHING_PERFORMANCE_PROFILE=light' \ grep -Fq 'NETFISHING_PERFORMANCE_PROFILE=light' \

View file

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
# PORTMASTER: netfishing.zip, NETfishing.sh
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
@ -13,19 +12,11 @@ else
controlfolder="/roms/ports/PortMaster" controlfolder="/roms/ports/PortMaster"
fi fi
if [ ! -f "$controlfolder/control.txt" ]; then
echo "PortMaster control.txt was not found at $controlfolder" >&2
exit 1
fi
source "$controlfolder/control.txt" source "$controlfolder/control.txt"
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" [ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
get_controls get_controls
GAMEDIR="/${directory}/ports/netfishing" GAMEDIR="/${directory}/ports/netfishing"
if [ ! -d "$GAMEDIR" ] && [ -d "/mnt/mmc/ports/netfishing" ]; then
GAMEDIR="/mnt/mmc/ports/netfishing"
fi
CONFDIR="$GAMEDIR/conf" CONFDIR="$GAMEDIR/conf"
PORTS_ROOT="${GAMEDIR%/netfishing}" PORTS_ROOT="${GAMEDIR%/netfishing}"
@ -38,16 +29,13 @@ CONTROLLER_MAPPING_FILE="$CONFDIR/cache/controller_mapping.txt"
WESTON_DIR="/tmp/netfishing-weston" WESTON_DIR="/tmp/netfishing-weston"
WESTON_RUNTIME="weston_pkg_0.2" WESTON_RUNTIME="weston_pkg_0.2"
HARBOURMASTER="$controlfolder/harbourmaster" HARBOURMASTER="$controlfolder/harbourmaster"
if [ ! -x "$HARBOURMASTER" ] && [ -x "/mnt/mmc/MUOS/PortMaster/harbourmaster" ]; then
HARBOURMASTER="/mnt/mmc/MUOS/PortMaster/harbourmaster"
fi
mkdir -p "$CONFDIR/data" "$CONFDIR/config" "$CONFDIR/cache" "$WESTON_DIR" mkdir -p "$CONFDIR/data" "$CONFDIR/config" "$CONFDIR/cache" "$WESTON_DIR"
chmod +x "$GAME_EXECUTABLE" chmod +x "$GAME_EXECUTABLE"
# New PortMaster installs use a predictable save directory beside the port # NETfishing uses a predictable save directory beside the port instead of
# instead of presenting a folder picker on a small screen. Preserve an # presenting a folder picker on a small screen. Preserve an established
# established data-root choice when upgrading an existing installation. # data-root choice when upgrading an existing installation.
NETFISHING_DATA_ENVIRONMENT=() NETFISHING_DATA_ENVIRONMENT=()
if [ -f "$SAVEDIR/netfishing_data.json" ] || { if [ -f "$SAVEDIR/netfishing_data.json" ] || {
[ ! -f "$DATA_BOOTSTRAP_DIR/data_root_bootstrap.json" ] && [ ! -f "$DATA_BOOTSTRAP_DIR/data_root_bootstrap.json" ] &&
@ -139,10 +127,9 @@ case "$PERFORMANCE_PROFILE" in
;; ;;
esac esac
# Keep NETfishing's native controller input separate from PortMaster's exit # NETfishing reads gameplay input natively. The explicit no-op map prevents
# handling. Legacy GPTOKEYB builds can load their default keyboard map when no # GPTOKEYB from injecting duplicate keyboard or mouse input while retaining
# config is supplied, so the explicit no-op map preserves only the # its device-specific force-quit chord, including on ROCKNIX.
# device-specific force-quit chord.
$GPTOKEYB "NETfishing.aarch64" -c "$GPTOKEYB_CONFIG" & $GPTOKEYB "NETfishing.aarch64" -c "$GPTOKEYB_CONFIG" &
pm_platform_helper "$GAME_EXECUTABLE" pm_platform_helper "$GAME_EXECUTABLE"

View file

@ -1,5 +1,6 @@
# NETfishing reads the controller directly. GPTOKEYB is retained only for the # NETfishing reads the controller directly. GPTOKEYB is retained only for its
# PortMaster force-quit chord, so every keyboard and mouse binding is disabled. # device-specific force-quit chord, so every keyboard and mouse binding is
# disabled to prevent duplicate input.
back = \" back = \"
guide = \" guide = \"