From f2800cb3865136aa897c6fa290a4bf54f80a7824 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Thu, 29 Oct 2026 10:36:41 +0300 Subject: [PATCH] Copy build//romfs-patches into a build made in another directory: totk.exe loads the 60 fps overlay only from beside its romfs-index.bin, so task builds ran without it and the quick menus showed a black background Co-Authored-By: Claude Opus 5.5 --- tools/build_game.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/build_game.py b/tools/build_game.py index bf3a3d95..8546c37a 100644 --- a/tools/build_game.py +++ b/tools/build_game.py @@ -168,6 +168,21 @@ def write_if_changed(path, text): path.write_text(text, encoding='utf-8', newline='\n') # Ninja and clang read UTF-8; paths may be non-ASCII +def copy_romfs_patches(version, out): + """totk.exe loads romfs-patches beside romfs-index.bin (runtime/romfs.c overlay_init). tools/make_romfs_patches.py + writes them into build/ only, so a build in another directory ran without the 60 fps overlay (the quick + menus' captured background turned black). Copies them when their manifest differs.""" + src = ROOT / 'build' / version / 'romfs-patches' + dst = out / 'romfs-patches' + if src.resolve() == dst.resolve() or not (src / 'manifest.tsv').is_file(): + return + if (dst / 'manifest.tsv').is_file() and (dst / 'manifest.tsv').read_bytes() == (src / 'manifest.tsv').read_bytes(): + return + shutil.rmtree(dst, ignore_errors=True) + shutil.copytree(src, dst) + print(f'romfs patches: copied from {src}') + + def c_string(s): return '"' + s.replace('\\', '\\\\').replace('"', '\\"') + '"' @@ -666,6 +681,7 @@ def main(): else: romfs_index.write_placeholder(out) print(f'build_game: warning: no {paths["romfs"] / "index.json"}; totk.exe will have no RomFS', file=sys.stderr) + copy_romfs_patches(args.version, out) global RUNTIME RUNTIME = (args.runtime or RUNTIME).resolve() stale = stale_shaders(RUNTIME)