From 00b04df8b234da3e2197fb36fb732fe931000b17 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Wed, 18 Nov 2026 18:34:50 +0300 Subject: [PATCH] The game makes a missing layout or prompts folder in the background, at start and when a setting asks for it (#180, #378) When the game resolution, the HUD width, the button prompts or the pad layout need a folder the install lacks (an older setup, a failed setup step, a new display), totk.exe starts the setup's generator for it in the background with the tools build-cache/rebuild.txt names, once per folder and process: at start for the settings in effect (the resolution output_res asks for, also when the missing layout made this start 16:9), and from the settings menu once a changed choice has stayed for 1.5 seconds or the menu closes. A missing 16:9 prompts folder is made too, the PC prompts from totk.ini's bindings. The notes under Game resolution and Button prompts say the files are being made and are used at the next start; when the tools did not start they say so and Try again starts them again. The Prepare button is gone. Source builds without rebuild.txt and TOTK_ROMFS_PATCHES keep the old behaviour. romfs_shape_missing and romfs_shape_prepare become romfs_folders_missing (a mask of the missing folders) and romfs_folders_prepare; --probe-cfg and tests/romfs_shapes_check.py check the new decisions. Co-Authored-By: Claude Opus 5.5 --- docs/building.md | 4 +- docs/controls.md | 6 +- docs/installer.md | 10 ++- docs/settings.md | 2 +- runtime/cfg_probe.c | 32 ++++++-- runtime/fs.h | 19 +++-- runtime/host.h | 1 + runtime/resolution.c | 14 +++- runtime/romfs.c | 160 +++++++++++++++++++++--------------- runtime/ui/menu.cpp | 135 +++++++++++++++++++++--------- runtime/ui_text.c | 28 ++++--- runtime/ui_text.h | 5 +- tests/romfs_shapes_check.py | 77 ++++++++++++----- 13 files changed, 331 insertions(+), 162 deletions(-) diff --git a/docs/building.md b/docs/building.md index 39c59f3c..0baf5c95 100644 --- a/docs/building.md +++ b/docs/building.md @@ -241,7 +241,9 @@ HUD pane/animation and generator naming regressions run with Python 3.14+: `test Set `HUD_TEST_ROMFS` to a verified extracted RomFS directory to include a real-archive comparison against the pre-port layout generator; all game-derived temporary data stays under `build/`. `python tests/romfs_shapes_check.py --cc ` compiles the production folder-selection and preparation helpers -to check canonical aliases, capped/full fallback, prompt arguments and generation deduplication without game files. +to check canonical aliases, capped/full fallback, prompt arguments, the missing 16:9 prompts and generation +deduplication without game files. `tests/romfs_prompts_test.py` checks that two `--background` runs for one folder +publish it once and that a folder with a manifest is kept. A change to the mods' ExeFS patches (`tools/exefs_patches.py`, `runtime/mods.c`, the `folded.txt` of `recomp/gen.py`) passes `.venv\Scripts\python tests\exefs_patches_test.py`, which makes its own modules and runs `gen.py` on one with a jump diff --git a/docs/controls.md b/docs/controls.md index 0a94943c..9a79db32 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -71,9 +71,11 @@ The game reads its UI archive and fonts once at boot, so the prompts change at t With `prompts = playstation` the game loads `romfs-patches-playstation` (`pad_layout = nintendo`) or `romfs-patches-playstation-xbox` (`xbox`, `auto`) the same way, written by `tools/make_romfs_patches.py --prompts playstation` and `--prompts playstation-xbox`: the same 60 fps patches, with the face buttons' images and the diamond's letters drawn as ○ × △ □, the shoulders and triggers as L1 R1 L2 R2, Options and Share, and the button guide's L and ZL images. The game's text fonts already have the four shapes, so the diamond's panes and messages hold those characters instead of the letters. -The Switch prompts stay, with a note under *Button prompts* and a `RomFS overlay: ...` line in the log, when the folder is missing (an install made by an older setup, or one where the setup could not prepare it and showed a warning; running the setup again on the install folder writes it), when it fails its check, with a game resolution of another shape than 16:9 that has no folder of its own (below), and when the `romfs_mods` folder replaces one of its files: `romfs-patches` then loads in its place, where two overlays replacing one file would stop the game. In a source build, `.venv-py314\Scripts\python tools\make_romfs_patches.py --version --prompts xbox` (and `--prompts xbox-label`) writes `build\ omfs-patches-xbox` (`-label`); `--prompts playstation` and `--prompts playstation-xbox` write `build\ omfs-patches-playstation` and `-playstation-xbox` the same way. It needs fontTools from `tools/requirements-py314.txt`. `--xbox-prompts` is the older name of `--prompts xbox`. +The Switch prompts stay, with a note under *Button prompts* and a `RomFS overlay: ...` line in the log, when the folder is missing (an install made by an older setup, or one where the setup could not prepare it and showed a warning; running the setup again on the install folder writes it; an install whose setup's tools sit next to the game makes it itself, see below), when it fails its check, with a game resolution of another shape than 16:9 that has no folder of its own (below), and when the `romfs_mods` folder replaces one of its files: `romfs-patches` then loads in its place, where two overlays replacing one file would stop the game. In a source build, `.venv-py314\Scripts\python tools\make_romfs_patches.py --version --prompts xbox` (and `--prompts xbox-label`) writes `build\ omfs-patches-xbox` (`-label`); `--prompts playstation` and `--prompts playstation-xbox` write `build\ omfs-patches-playstation` and `-playstation-xbox` the same way. It needs fontTools from `tools/requirements-py314.txt`. `--xbox-prompts` is the older name of `--prompts xbox`. -At a game resolution of another shape than 16:9 the game loads `romfs-patches-