Add default light profile for PortMaster

This commit is contained in:
Alexander Sellite 2026-08-14 22:12:02 -04:00
parent a62cce6404
commit a3e0830bd1
16 changed files with 454 additions and 42 deletions

View file

@ -140,7 +140,10 @@ The package requires an ARM64 device, two analog sticks, GLIBC 2.28 or newer,
and the \`weston_pkg_0.2\` runtime.
Save data and device-local configuration remain under \`netfishing/conf/\`.
See \`netfishing/licenses/\` for bundled credits and license information.
PortMaster launches use the light performance profile by default. Put the word
\`normal\` in \`netfishing/conf/performance_profile\` to opt a capable device
into the normal rendering profile. See \`netfishing/licenses/\` for bundled
credits and license information.
EOF
(
@ -162,6 +165,10 @@ grep -q '"version": 4' "${STAGE_ROOT}/port.json"
grep -q '"name": "netfishing.zip"' "${STAGE_ROOT}/port.json"
grep -q '^# PORTMASTER: netfishing.zip, NETfishing.sh$' \
"${STAGE_ROOT}/NETfishing.sh"
grep -Fq 'PROFILE_PATH="$CONFDIR/performance_profile"' \
"${STAGE_ROOT}/NETfishing.sh"
grep -Fq 'NETFISHING_PERFORMANCE_PROFILE=light' \
"${STAGE_ROOT}/NETfishing.sh"
if grep -q 'GPTOKEYB' "${STAGE_ROOT}/NETfishing.sh"; then
echo "GPTOKEYB must not be enabled for NETfishing." >&2
exit 1

View file

@ -78,17 +78,36 @@ fi
NETFISHING_GODOT_OPTIONS=()
NETFISHING_GAME_ENVIRONMENT=()
DEVICE_COMPATIBILITY=""
if [[ -r /proc/device-tree/compatible ]]; then
DEVICE_COMPATIBILITY="$(tr '\0' ' ' </proc/device-tree/compatible)"
elif [[ -r /sys/firmware/devicetree/base/compatible ]]; then
DEVICE_COMPATIBILITY="$(
tr '\0' ' ' </sys/firmware/devicetree/base/compatible
)"
PERFORMANCE_PROFILE="${NETFISHING_PERFORMANCE_PROFILE:-}"
PROFILE_PATH="$CONFDIR/performance_profile"
if [[ -z "$PERFORMANCE_PROFILE" && -r "$PROFILE_PATH" ]]; then
IFS= read -r PERFORMANCE_PROFILE < "$PROFILE_PATH" || true
PERFORMANCE_PROFILE="${PERFORMANCE_PROFILE%$'\r'}"
fi
case "$DEVICE_COMPATIBILITY" in
*allwinner,h616*|*sun50iw9p1*|*allwinner,sun50i-h700*)
NETFISHING_GAME_ENVIRONMENT+=("NETFISHING_LOW_END=1")
case "$PERFORMANCE_PROFILE" in
normal)
NETFISHING_GAME_ENVIRONMENT+=(
"NETFISHING_PERFORMANCE_PROFILE=normal"
)
;;
light|"")
NETFISHING_GAME_ENVIRONMENT+=(
"NETFISHING_PERFORMANCE_PROFILE=light"
"NETFISHING_LOW_END=1"
)
NETFISHING_GODOT_OPTIONS+=(
--single-window
--disable-vsync
--max-fps 30
--audio-output-latency 40
)
;;
*)
echo "Unknown performance profile '$PERFORMANCE_PROFILE'; using light." >&2
NETFISHING_GAME_ENVIRONMENT+=(
"NETFISHING_PERFORMANCE_PROFILE=light"
"NETFISHING_LOW_END=1"
)
NETFISHING_GODOT_OPTIONS+=(
--single-window
--disable-vsync

View file

@ -30,6 +30,7 @@ readonly -a QUICK_TESTS=(
readonly -a RUNTIME_TESTS=(
"tests/inventory_notepad_art_validation.gd"
"tests/light_performance_profile_validation.gd"
"tests/logbook_runtime_validation.gd"
"tests/player_experience_ui_validation.gd"
"tests/title_credits_validation.gd"