fix(prompts): Auto picks the face by the pad's SDL type, not its name alone #1125

Open
gab9281 wants to merge 2 commits from gab9281/Longshot:fix/prompts-auto-pad-type into main
Member

Type: fix · Risk: low · Tested on: Linux, Radeon 680M (RADV); Windows build under Wine · Needs: Windows, any GPU, a PlayStation pad

Why

With Button prompts on Auto, the game shows the icons of the controller you play with. It picked them from the controller's name alone, so a PlayStation pad that the system names "Wireless Controller" (a DualShock 4 or a DualSense on some Linux drivers and over Bluetooth on Windows) got the Xbox's icons, and so did any pad whose name says nothing (Steam Input's "Steam Virtual Gamepad" in front of a PlayStation pad). SDL knows the kind of pad from its USB ids, or through Steam Input from the pad behind the stand-in: Auto now asks it.

See #413 (Auto choosing the face there).

How to reproduce

Seen on: any OS, a DualShock 4 or DualSense that SDL names "Wireless Controller" (or through Steam Input)
Settings and switches: Button prompts: Auto
Steps: start the game with that pad, look at prompts: auto: in longshot_log.txt and at any button icon
Expected: the PlayStation's icons
Actual: prompts: auto: controller "Wireless Controller": xbox, the Xbox's icons

What changed

Auto picks the face by the pad's name when it says the maker's buttons (Steam Deck, Steam Controller, DualSense, DualShock, PlayStation, Nintendo, Switch, Joy-Con), else by the type SDL gives it, else the Xbox's as before. The menu's hint for Auto says "from its type and name", in every language.

  • prompts: face_of_type (SDL3's and SDL2's numbers; the Switch's through hd_rumble_kind, host/hd_rumble.h), face_of_pad and auto_face in host/prompts.c; the log line now reads prompts: auto: controller "<name>" (SDL<n> type <t>): <face>
  • pads: host/pad_sdl.c keeps each pad's SDL type, read once when it opens (pads[i].type, also used for HD rumble), and hos_sdl_pad_first(name, cap, &type, &sdl) hands it with the SDL it came from (replaces hos_sdl_pad_first_name); the prompts no longer load SDL themselves
  • menu: hn_prompts' Auto line in gpu/vk/vk_menu.cpp and its 13 translations in gpu/vk/menu_i18n.h
  • guide: docs/images/guide/manifest.json: the Graphics image reviewed again and kept (the Auto help line is on the Gameplay tab, not in that view; gpu/vk/vk_internal.h changed on main with #1107's test_vram_bytes(), a declaration only, which already failed this check on main @ 71b1edd8): the reviewed hashes advance, scripts/check_guide_screenshots.py --review-sources passes
  • tests: tests/test_prompt_auto_face.py (31 names and types, SDL3 and SDL2, a brand name over another type, no SDL), tests/test_mods_size_table.py's stub, tests/test_menu_i18n.py

Measurements

Verdict: nothing to measure: the type is read once when a pad opens (before, the name was copied at each poll, as it still is).

Flags and settings

None: no row, ini key or switch is added or changed; button_prompts keeps its values, and only the Auto choice's help line under Button prompts reads differently.

Testing

Tested:

  • game-free: tests/test_prompt_auto_face.py, tests/test_menu_i18n.py; tests/run_all.py: 586 passed, 15 failed, 74 skipped; the 15 also fail on main @ 6c8d6e6a (17 there: test_bug_report and test_hardware_report besides), none reads the prompts
  • the game, Linux, Radeon 680M, a DualSense over USB (SDL3): prompts: auto: controller "DualSense Wireless Controller" (SDL3 type 6): ps5, then the PS5's icons
  • host/prompts.c and host/pad_sdl.c compile without warnings for Windows (llvm-mingw) and Linux

Not tested: a pad SDL names "Wireless Controller" (the one here is named by its model); SDL2 builds in the game; a live change and Auto on native Windows (under Wine, the chosen PS5 face loaded from a Chinese-named user folder with zh-Hans: see the comment)

Must be tested:

  • windows, a DualShock 4 or DualSense over Bluetooth, Button prompts on Auto: start, expecting prompts: auto: controller "…" (SDL3 type 5 or 6): ps4 or ps5 in longshot_log.txt and the PlayStation's icons (by hand: a tester with the pad)
  • linux, Steam running with a PlayStation pad behind Steam Input, Auto: expecting the PlayStation's icons, not the Xbox's (by hand)

Risks

What could break: a pad that SDL types as a PlayStation's or a Switch's but that has an Xbox layout, and whose name says nothing, now gets that face; the name still wins when it names a maker

Turning it off: pick the face in Button prompts instead of Auto, or revert the commit

Compatibility: Nothing changes (longshot_options.ini keeps its values)

Issues

See #413

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_015KgSKmCc7pkXGyByWtmErh

**Type:** fix · **Risk:** low · **Tested on:** Linux, Radeon 680M (RADV); Windows build under Wine · **Needs:** Windows, any GPU, a PlayStation pad ## Why With **Button prompts** on Auto, the game shows the icons of the controller you play with. It picked them from the controller's name alone, so a PlayStation pad that the system names "Wireless Controller" (a DualShock 4 or a DualSense on some Linux drivers and over Bluetooth on Windows) got the Xbox's icons, and so did any pad whose name says nothing (Steam Input's "Steam Virtual Gamepad" in front of a PlayStation pad). SDL knows the kind of pad from its USB ids, or through Steam Input from the pad behind the stand-in: Auto now asks it. See #413 (Auto choosing the face there). ## How to reproduce **Seen on:** any OS, a DualShock 4 or DualSense that SDL names "Wireless Controller" (or through Steam Input) **Settings and switches:** Button prompts: Auto **Steps:** start the game with that pad, look at `prompts: auto:` in longshot_log.txt and at any button icon **Expected:** the PlayStation's icons **Actual:** `prompts: auto: controller "Wireless Controller": xbox`, the Xbox's icons ## What changed Auto picks the face by the pad's name when it says the maker's buttons (Steam Deck, Steam Controller, DualSense, DualShock, PlayStation, Nintendo, Switch, Joy-Con), else by the type SDL gives it, else the Xbox's as before. The menu's hint for Auto says "from its type and name", in every language. - prompts: `face_of_type` (SDL3's and SDL2's numbers; the Switch's through `hd_rumble_kind`, `host/hd_rumble.h`), `face_of_pad` and `auto_face` in `host/prompts.c`; the log line now reads `prompts: auto: controller "<name>" (SDL<n> type <t>): <face>` - pads: `host/pad_sdl.c` keeps each pad's SDL type, read once when it opens (`pads[i].type`, also used for HD rumble), and `hos_sdl_pad_first(name, cap, &type, &sdl)` hands it with the SDL it came from (replaces `hos_sdl_pad_first_name`); the prompts no longer load SDL themselves - menu: `hn_prompts`' Auto line in `gpu/vk/vk_menu.cpp` and its 13 translations in `gpu/vk/menu_i18n.h` - guide: `docs/images/guide/manifest.json`: the Graphics image reviewed again and kept (the Auto help line is on the Gameplay tab, not in that view; `gpu/vk/vk_internal.h` changed on main with #1107's `test_vram_bytes()`, a declaration only, which already failed this check on main @ 71b1edd8): the reviewed hashes advance, `scripts/check_guide_screenshots.py --review-sources` passes - tests: `tests/test_prompt_auto_face.py` (31 names and types, SDL3 and SDL2, a brand name over another type, no SDL), `tests/test_mods_size_table.py`'s stub, `tests/test_menu_i18n.py` ## Measurements **Verdict:** nothing to measure: the type is read once when a pad opens (before, the name was copied at each poll, as it still is). ### Flags and settings None: no row, ini key or switch is added or changed; `button_prompts` keeps its values, and only the Auto choice's help line under Button prompts reads differently. ## Testing **Tested:** - game-free: `tests/test_prompt_auto_face.py`, `tests/test_menu_i18n.py`; `tests/run_all.py`: 586 passed, 15 failed, 74 skipped; the 15 also fail on main @ 6c8d6e6a (17 there: test_bug_report and test_hardware_report besides), none reads the prompts - the game, Linux, Radeon 680M, a DualSense over USB (SDL3): `prompts: auto: controller "DualSense Wireless Controller" (SDL3 type 6): ps5`, then the PS5's icons - `host/prompts.c` and `host/pad_sdl.c` compile without warnings for Windows (llvm-mingw) and Linux **Not tested:** a pad SDL names "Wireless Controller" (the one here is named by its model); SDL2 builds in the game; a live change and Auto on native Windows (under Wine, the chosen PS5 face loaded from a Chinese-named user folder with zh-Hans: see the comment) **Must be tested:** - windows, a DualShock 4 or DualSense over Bluetooth, Button prompts on Auto: start, expecting `prompts: auto: controller "…" (SDL3 type 5 or 6): ps4 or ps5` in longshot_log.txt and the PlayStation's icons (by hand: a tester with the pad) - linux, Steam running with a PlayStation pad behind Steam Input, Auto: expecting the PlayStation's icons, not the Xbox's (by hand) ## Risks **What could break:** a pad that SDL types as a PlayStation's or a Switch's but that has an Xbox layout, and whose name says nothing, now gets that face; the name still wins when it names a maker **Turning it off:** pick the face in Button prompts instead of Auto, or revert the commit **Compatibility:** Nothing changes (longshot_options.ini keeps its values) ## Issues See #413 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015KgSKmCc7pkXGyByWtmErh
fix(prompts): Auto picks the face by the pad's SDL type, not its name alone
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 18s
0a3408d4e1
Auto chose the face from the first pad's name, so a DualSense or DualShock 4
that SDL names "Wireless Controller" (some Linux drivers, Bluetooth on
Windows) got the Xbox's icons. pad_sdl.c now keeps each pad's SDL type, read
once when it opens, and hands it with the SDL it came from to the prompts. A
name that says the maker's buttons still wins (Steam Deck, Steam Controller,
DualSense, DualShock, Nintendo); else the type says (SDL3's and SDL2's
numbers, the Switch's through hd_rumble_kind); else the Xbox's. The menu's
hint for Auto says so, in every language.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015KgSKmCc7pkXGyByWtmErh
Author
Member

Tested in game: Linux (CachyOS, kernel 7.3.4), Radeon 680M on RADV (Mesa 26.2.6), a DualSense over USB, the kokiri-start save in Link's house: Button prompts on Auto picked the PS5's (log: prompts: auto: controller "DualSense Wireless Controller" (SDL3 type 6): ps5), then Xbox, Switch and Steam Deck set live through the control bridge each changed the icons. Windows under Wine: running now.

Tested in game: Linux (CachyOS, kernel 7.3.4), Radeon 680M on RADV (Mesa 26.2.6), a DualSense over USB, the kokiri-start save in Link's house: Button prompts on Auto picked the PS5's (log: prompts: auto: controller "DualSense Wireless Controller" (SDL3 type 6): ps5), then Xbox, Switch and Steam Deck set live through the control bridge each changed the icons. Windows under Wine: running now.
gab9281 force-pushed fix/prompts-auto-pad-type from 0a3408d4e1
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 18s
to d531947e7a
All checks were successful
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 10s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-16 12:14:06 +00:00
Compare
Author
Member

Windows build (llvm-mingw cross-build of this PR with #1125 and #1126 together, v3.0.0-rc.5-21-g67bf65fe) under Wine on Linux, Radeon 680M (RADV, Mesa 26.2.6): a user folder with a Chinese name, HOS_LANGUAGE=zh-Hans, button_prompts=4 (PlayStation 5) seeded, as in #413 and #897:

[hos host] options: the settings file is Z:\...\wine\ps5-zh\用户设置\longshot_options.ini
[hos sead::MainThread] oe: language zh-Hans (HOS_LANGUAGE)
[hos ARes Loading 0] prompts: ps5 icons, 16 buttons on these pad's controls
[hos ARes Loading 0] prompts: the Talk ring's A B X Y at places 1 0 3 2, the ocarina hint as is
[hos ARes Loading 1] prompts: ps5 textures, 1914 runs for this pad's controls
[hos ModuleSystemWorker1] prompts: the textures' pool at 0x7fc32d5000 (+0xe86c000): a new face or new controls show at once
[hos sead::MainThread] prompts: the layouts at 0x7fe1a41000: the Talk ring and the ocarina hint follow at once

The chosen face is read from the non-ASCII user folder (not Auto), and the layouts are found whole. Not covered under Wine: a live change (the control bridge's named pipe can't be reached from Linux) and Auto with a pad (Wine doesn't pass the DualSense through here); native Windows with a PlayStation pad is still in Must be tested.

Guide screenshots fails on main @ 71b1edd8 too (gpu/vk/vk_internal.h, from #1107); #1125's second commit records the review that clears it.

Windows build (llvm-mingw cross-build of this PR with #1125 and #1126 together, `v3.0.0-rc.5-21-g67bf65fe`) under Wine on Linux, Radeon 680M (RADV, Mesa 26.2.6): a user folder with a Chinese name, `HOS_LANGUAGE=zh-Hans`, `button_prompts=4` (PlayStation 5) seeded, as in #413 and #897: ``` [hos host] options: the settings file is Z:\...\wine\ps5-zh\用户设置\longshot_options.ini [hos sead::MainThread] oe: language zh-Hans (HOS_LANGUAGE) [hos ARes Loading 0] prompts: ps5 icons, 16 buttons on these pad's controls [hos ARes Loading 0] prompts: the Talk ring's A B X Y at places 1 0 3 2, the ocarina hint as is [hos ARes Loading 1] prompts: ps5 textures, 1914 runs for this pad's controls [hos ModuleSystemWorker1] prompts: the textures' pool at 0x7fc32d5000 (+0xe86c000): a new face or new controls show at once [hos sead::MainThread] prompts: the layouts at 0x7fe1a41000: the Talk ring and the ocarina hint follow at once ``` The chosen face is read from the non-ASCII user folder (not Auto), and the layouts are found whole. Not covered under Wine: a live change (the control bridge's named pipe can't be reached from Linux) and Auto with a pad (Wine doesn't pass the DualSense through here); native Windows with a PlayStation pad is still in **Must be tested**. `Guide screenshots` fails on main @ 71b1edd8 too (`gpu/vk/vk_internal.h`, from #1107); #1125's second commit records the review that clears it.
gab9281 changed title from WIP: fix(prompts): Auto picks the face by the pad's SDL type, not its name alone to fix(prompts): Auto picks the face by the pad's SDL type, not its name alone 2026-11-16 12:20:42 +00:00
Author
Member

Auto, checked with emulated controllers (uinput virtual pads with each pad's USB ids and name, on a clean build of this PR with #1126 and #1184; Linux, SDL3; Button prompts = Auto, restart for each):

Virtual pad (vid:pid, name) SDL sees Auto picks
054c:0ce6 "Wireless Controller" (DualSense) "PS5 Controller", type 6 ps5
054c:09cc "Wireless Controller" (DualShock 4) "PS4 Controller", type 5 ps4
057e:2009 "Pro Controller" "Nintendo Switch Pro Controller", type 7 switch
045e:0b13 "Xbox Wireless Controller" "Xbox Series X Controller", type 3 xbox
0f0d:00c1 "HORIPAD S" "HORIPAD S", type 7 switch
28de:1205 "Steam Deck" "Steam Deck", type 12 steamdeck

Each line is the run's own prompts: auto: controller … line, followed by prompts: <face> icons. Not covered: a real pad over Bluetooth, Steam Input's virtual pad, and Windows (the Test Farm run on #1184).

**Auto, checked with emulated controllers** (uinput virtual pads with each pad's USB ids and name, on a clean build of this PR with #1126 and #1184; Linux, SDL3; Button prompts = Auto, restart for each): | Virtual pad (vid:pid, name) | SDL sees | Auto picks | |---|---|---| | 054c:0ce6 "Wireless Controller" (DualSense) | "PS5 Controller", type 6 | ps5 | | 054c:09cc "Wireless Controller" (DualShock 4) | "PS4 Controller", type 5 | ps4 | | 057e:2009 "Pro Controller" | "Nintendo Switch Pro Controller", type 7 | switch | | 045e:0b13 "Xbox Wireless Controller" | "Xbox Series X Controller", type 3 | xbox | | 0f0d:00c1 "HORIPAD S" | "HORIPAD S", type 7 | switch | | 28de:1205 "Steam Deck" | "Steam Deck", type 12 | steamdeck | Each line is the run's own `prompts: auto: controller …` line, followed by `prompts: <face> icons`. Not covered: a real pad over Bluetooth, Steam Input's virtual pad, and Windows (the Test Farm run on #1184).
All checks were successful
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 10s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/prompts-auto-pad-type:gab9281-fix/prompts-auto-pad-type'
git switch 'gab9281-fix/prompts-auto-pad-type'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1125
No description provided.