From bc578148ab875a84cebe35780e3a572ff0bcf94d Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Thu, 12 Nov 2026 18:54:21 +0300 Subject: [PATCH] Write RomFS layout folders only for the screen shapes and prompts this player uses The setup wrote 64 patch folders: every prompts style for all 15 shaped game resolutions. The new shapes step (installer/screens.py) writes romfs-patches-x only for the shapes of the connected displays, the output_res the game defaults to on each and the totk.ini output_res, and the prompts' shaped folder only for the style totk.ini selects. One folder per shape: the runtime maps the game resolution to its shape's size (cfg.c cfg_shape_size, the closest ratio within 1%), and an exact-size folder from an older install still wins. The settings menu marks a game resolution whose shape has no folder and can start the generator for it in the background, for the next start. Co-Authored-By: Claude Opus 5.5 --- docs/installer.md | 27 ++++-- installer/gui.py | 2 +- installer/guilogic.py | 2 +- installer/screens.py | 174 ++++++++++++++++++++++++++++++++++++ installer/steps.py | 149 +++++++++++++++++------------- installer/text/en.json | 2 + installer/text/pt-BR.json | 2 + installer/text/ru.json | 2 + installer/text/zh-Hans.json | 2 + runtime/cfg.c | 28 +++++- runtime/cfg.h | 3 + runtime/cfg_probe.c | 32 +++++++ runtime/fs.h | 8 ++ runtime/romfs.c | 145 +++++++++++++++++++++++++----- runtime/ui/menu.cpp | 35 +++++++- runtime/ui_text.c | 20 +++++ runtime/ui_text.h | 2 + tests/installer_test.py | 90 ++++++++++++++++++- 18 files changed, 624 insertions(+), 101 deletions(-) create mode 100644 installer/screens.py diff --git a/docs/installer.md b/docs/installer.md index 273a88ec..9a6e0bfb 100644 --- a/docs/installer.md +++ b/docs/installer.md @@ -72,23 +72,34 @@ loads the saves 1.4.3 wrote. `totk.exe --prepare-shaders`) in the install folder, then fold the shader cache's loose files (four per shader, about 117,000) into `shader-cache/shader-cache.pack` (`tools/pack_shader_cache.py`). totk.exe reads the pack first and writes the translations it makes in play as loose files; running the tool again with the game closed folds those in. - The patches are written four times: `romfs-patches`, `romfs-patches-xbox` and `romfs-patches-xbox-label` + The patches are written three times: `romfs-patches`, `romfs-patches-xbox` and `romfs-patches-xbox-label` (`--prompts`: Xbox button prompts for `prompts = xbox`, the first for `pad_layout = nintendo`, the second for `xbox` - and `auto`), and `romfs-patches-pc` (keyboard and mouse prompts for `prompts = pc`). Each of the three prompt - folders is then laid out once more for each game resolution of another shape, `romfs-patches-