A mod file whose name carries Product.<n> and which the RomFS lacks was counted as made for another game version and
never served. The game does ask for such names: on 1.4.3 with mods on, the file trace (trace = fs) shows it opening
Sound/Resource/Pack_MasterSword.Product.110.bars.zs, while its RomFS holds only the Product.140 and the unversioned
file. A sound mod that ships its pack under all those names was silent here and works on a console, where LayeredFS
shows the game every file of a mod. Such files are now added overlays like any other new file. Another version's
resource size table is still not served and still lends its entries; the files are still counted, and the Mods tab
and docs/mods.md now say they are read only when asked for by name.
tests/mods_romfs_check.py gets a case for it. Not run here: the test and --probe-fs need a build and the game's files.
runtime/romfs.c compiles with llvm-mingw.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgQM2zwuVagwScByEJhT8V
mods_romfs_check needs both a built totk.exe and the extracted romfs, and the romfs was hard-coded to build/extracted/<version>/romfs in two places inside the test. Needs now compose with '+' (exe+romfs) and each gets its own placeholder, the romfs is found in the extracted tree, the work dir or the GUI builder's record (build/build_gui.json), and any build/v143-*/totk.exe counts as the built exe - so the test runs on the layouts people actually build in instead of failing on a path it assumed. The test takes --romfs; its default is the old path, so running it by hand is unchanged.
The game sizes the buffer for a file from its entry in
System/Resource/ResourceSizeTable.*.rsizetable.zs, so a mod file that grew
could fail to load, and a file a mod added had no entry. With a player mod
enabled, romfs.c restbl_overlay now rebuilds the table at start from:
- the game's table;
- every table of this version that a mod (or the Xbox prompts folder) ships,
where the larger entry wins;
- a mod's table for another version, for that mod's own files only;
- each served mod file: a grown file's entry rises by the growth times its
type's factor, and an added file gets an estimate.
The factors come from the 1.4.3 table measured against its own files (most
types need the size plus at most 8 KiB; bfres 1.5x, bkres 2x, bgyml 3.85x).
The result is served from <profile>/mods/ and takes about 90 ms. A mod's
table no longer counts as a clash with the Xbox prompts. Game entries are
never lowered.
tests/mods_romfs_check.py checks the merged table and now passes probe-fs a
profile of its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Player mod files are checked by identity, not hashed, and a path several overlays give is served by one: a higher mod
beats a lower one, any player mod beats the romfs_mods manifest and the port's own patches. A mod path that differs from
a RomFS path only in case is served under the RomFS spelling. Files named for another game version (.Product.<n>.,
missing from this RomFS) are counted and left out. A player mod that replaces a file of the Xbox prompts folder sends
the game back to the Switch prompts, as a romfs_mods manifest already did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>