Lay out the action prompt's face buttons as the pad layout has them.

The action prompt at the top right of the HUD draws the four face buttons as a diamond in the console's places: A right, B bottom, X top, Y left. Under pad_layout = xbox, playstation or auto the A action is the bottom button, yet the diamond kept A on the right, so the prompt pointed at the wrong button. At start the runtime now edits the prompt's layout in the shared interface archive for such a layout (the buttons, the dots and the lit crosses move, and the bubbles of X and Y flip) and serves the result from the profile folder; with nintendo, the default, nothing is changed. Every field is found and checked before anything is written, so a layout a mod changed is left as it is, and the archive is packed again with the game's own dictionary at the same unpacked size. One SARC reader and dictionary lookup now serve this, the camera pack and the menu's assets. When the layout changes, the menu's Restart counts the diamond.

tests/action_prompt_check.py passes without game files and on the game's own archive (4 copies, 208 fields, 13 ms at start).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 23:10:04 -05:00
parent 4eea3d1c2f
commit b1d08b06a8
13 changed files with 1279 additions and 68 deletions

View File

@@ -348,6 +348,21 @@ A change to the button prompts (`tools/make_romfs_patches.py --prompts`, `tools/
`.venv-py314\Scripts\python tests\romfs_prompts_test.py`, which runs the tool on a RomFS it makes itself (no game
files); a change to the settings passes `nx2navi.exe --probe-cfg`.
A change to the action prompt's diamond of face buttons (`runtime/action_prompt.c`) or to the SARC and zstd dictionary
helpers (`runtime/sarc.c`) passes `python tests\action_prompt_check.py`. It builds them alone, with the
undefined-behaviour sanitizer, on a layout file, archives and dictionaries it makes from the format `action_prompt.c`'s
header comment describes, and checks that:
- by label every place, cross, flip and bubble moves and no other byte, in every copy of the layout in the archive;
- a second run changes nothing, and by label then by position gives the game's file back;
- a file that is not the expected one is refused and left as it was: one value off, half laid out, one copy of four,
damaged offsets, a pane record laid over the records that lead to another field, more than 16 copies, copies that
share some of their bytes;
- the packed file names the dictionary the original named, found by its id in the pack of dictionaries.
No game files. `--romfs <folder with romfs.bin and index.json>` also runs it on the game's own archive: four copies laid
out, 208 fields, the same dictionary and unpacked size, and no byte changed outside the layout's copies.
A change to what the library warm logs when the driver's cache of stage libraries is cold (`runtime/vk_warm_hint.h`,
`runtime/vk_pipeline.c` `lw_main`) passes `python tests\warm_hint_check.py`, which builds the header alone and checks
the added text by GPU vendor and by why the cache was cold. No game files.

View File

@@ -21,6 +21,22 @@ The log names the layout in effect (`input: gamepad layout ...`) and each gamepa
(`input: gamepad "...": first press`); the menu shows the layout under *Automatic*. The game's prompts show the Switch
letters unless *Button prompts* says otherwise (below).
The action prompt (top right) shows the four face buttons as a diamond. The game draws it in the Switch places (A right,
B bottom, X top, Y left), which `nintendo` keeps. Under `xbox`, `playstation` and `auto` the diamond follows such a
pad instead (A bottom, B right, X left, Y top), whatever *Button prompts* is.
The game reads the diamond once at start, before a gamepad is open:
- `auto` gets the Xbox diamond, so a Switch Pro Controller under `auto` sees A at the bottom although its A is on the
right. Pick `nintendo` for that pad.
- A change of layout shows after a restart; until then *Button prompts* says *prompts change after restart*.
- A RomFS mod that changes the action prompt keeps its own diamond. A mod that replaces the same archive for other
reasons gets the diamond moved on top of its changes.
The log says what happened in a line that starts with `action prompt:`. How the layout is changed:
`runtime/action_prompt.c` (`DoCommand_00` in `UI/Layout2Archive/Common.Product.100.Nin_Ounce_NVN2.blarc.zs`, served
from `<profile>/action-prompt/`).
## Button prompts
`NX2NAVI_PROMPTS` (`prompts`, the *Button prompts* row on the Controls tab) picks the buttons the game's prompts show: `nintendo` (default, the game's own), `xbox`, `playstation`, `steamdeck` or `pc` (*Keyboard and mouse*). It changes three things the game draws: