Lunar Porter takes any controller, not the first one

A controller does not always arrive on pad nought. The front end hands out
the numbers the host gave it, so a game that reads only the first one
works on the machine it was written on and silently does nothing on the
next - which is the shape of "the pad is detected, Pad shows it, and the
game ignores it".

Four reads and three ORs. One person flies this and which socket they
plugged into is not a thing they should have to know. Presence is any of
the four bits rather than the low one, for the same reason.

The manifest's pad column takes several fixtures now, comma separated, and
they fill the pads in turn. So cosmosLanderPadOne holds nothing on pad
nought and flies the whole landing on pad one - a test that fails on the
version of this program that shipped an hour ago.

Also confirmed while looking: raylib 6 does refresh which gamepads are
ready every frame in PollInputEvents, so a hot-plugged pad should be seen.
Whatever is stopping that is above us and worth a separate look.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-09-02 23:36:05 -04:00
co-authored by Claude Opus 5
parent 6def343e97
commit f7be843ed9
16 changed files with 73 additions and 21 deletions
+15 -3
View File
@@ -255,12 +255,24 @@ while IFS='|' read -r name src mode stdin limit disk keys pad; do
# what makes a device that only a person could otherwise exercise into one the
# recordings cover - the same argument as the keyboard fixture above.
if [ "$pad" != "-" ]; then
if [ ! -f "$INPUT/$pad" ]; then
# ---- Commas for more than one ----
#
# --pad fills the pads in turn, so naming two puts the second on pad one.
# That is worth being able to say: a game that reads only the first pad works
# on the machine it was written on and silently does nothing on one where the
# host handed out a different number.
padMissing=""
IFS=',' read -r -a padList <<< "$pad"
for one in "${padList[@]}"; do
one="$(trim "$one")"
if [ ! -f "$INPUT/$one" ]; then padMissing="$one"; break; fi
EMUARGS+=(--pad "$INPUT/$one")
done
if [ -n "$padMissing" ]; then
FAIL=$((FAIL + 1)); FAILED_NAMES+=("$name")
report "FAIL" "$name" "missing pad fixture $pad"
report "FAIL" "$name" "missing pad fixture $padMissing"
continue
fi
EMUARGS+=(--pad "$INPUT/$pad")
fi
[ "$limit" != "-" ] && EMUARGS+=(--cycles "$limit")
# A disk starts fresh for every test, so a test cannot pass because of what a