# Adapted from MacNativeGames games/totk/scripts/make_romfs_patches.py @ ebe621d (MIT, Copyright (c) 2026 # MacNativeGames contributors). """Build the 60 fps RomFS overlay for TotK 1.1.0, 1.2.1 or 1.4.3 (runtime/romfs.c, TOTK_ROMFS_PATCHES). UI/LayoutArchive/Common.Product.<110 or 140>.Nin_NX_NVN.blarc.zs: the weapon / shield / material quick menus capture the game picture for their background when the panes C_CaptureBG_00, C_CaptureClearBG_00 and P_CaptureClearBG_00 become visible at animation frame 1.0 (anim/ShortCutBG_00_In.bflan), AutoBuilder the same with C_CaptureBG_00 (anim/AutoBuilder_00_In.bflan). UI animations advance 0.5 frames per game frame at 60 fps, so the capture lands after the world stopped drawing and the background can be black. The visibility keys move to frame 0.0: the live world is captured at once (upstream checked weapon, shield, material and ability wheel at 60 fps, and 30 fps). The game-over flow fix of the same upstream script is 1.0.0 only (1.1.0, 1.2.1 and 1.4.3 run DmF_SY_GameOver.110) and is left out. --aspect x (a game resolution of another shape than 16:9, such as 3440x1440 or 1280x800) also lays the UI out for that shape (tools/ultrawide_layout.py): menus keep their 16:9 proportions in the middle, full-screen backgrounds cover the screen and the HUD moves to the screen's corners (wider) or its top and bottom edges (narrower). totk.exe loads that overlay from romfs-patches-x when the game resolution is that size (runtime/romfs.c overlay_init); the camera's side of it is the patch set aspect (recomp/patches-v121.txt, patches-v143.txt). --hud 21:9 | 16:9 (with --aspect, a screen wider than that; default full) keeps the HUD within the middle 21:9 or 16:9 of the screen instead of its corners (totk.ini hud_width). The folder is romfs-patches-x-hud21x9 or -hud16x9, which runtime/romfs.c overlay_init loads in place of romfs-patches-x when hud_width asks for it. --prompts xbox | xbox-label: the same overlay with Xbox button icons in the game's prompts, for prompts = xbox (runtime/romfs.c overlay_init loads romfs-patches-xbox or romfs-patches-xbox-label in place of romfs-patches). Drawn from the game's own files on the player's machine, nothing added (tools/button_icons.py, which needs fontTools): - both: L, R, ZL, ZR, Plus, Minus and the d-pad become LB, RB, LT, RT, Menu, View and a cross in the button font (scft/External.bfotf, the same font in each Font/Font*.Nin_NX_NVN.bfarc.zs), and L and ZL in the button guide's images (Nt_KeyTexL_00 and Nt_KeyTexZL_00 of timg/__Combined.bntx in the Common archive). The fonts grow, so the overlay also carries the resource size table (System/Resource/ResourceSizeTable.Product....rsizetable.zs) with their entries raised by as much. - xbox, for pad_layout = nintendo. That layout plays an Xbox pad by position: the button that does Switch A is labelled B, so the face buttons' prompts are swapped to name the labels, A with B and X with Y: - the action prompt (blyt/DoCommand_00.bflyt) draws the letter images Nt_KeyTexA/B/X/Y_00 of timg/__Combined.bntx in the Common archive: their image data is swapped (same format, size and tiling). Around it, a diamond names the other face buttons with one-letter text panes (T_B_00, T_X_00, ...). The game fills them from the messages of the same name in LayoutMsg/DoCommand_00.msbt of each Mals/ archive, over the layout's own text: both have their letters swapped the same way. The diamond's shape (Nt_KeyBtnSubBase*) shows the button's position, which stays right. - every other prompt: the glyphs U+E040 A, U+E041 B, U+E042 X, U+E043 Y of the button font trade places. - xbox-label, for pad_layout = xbox and auto. Those layouts put Switch A on the button labelled A (auto picks xbox for every pad not labelled the Nintendo way), so the face buttons keep their letters. The action prompt's diamond is laid out as an Xbox pad's (bflyt_xbox_diamond): A at the bottom, B on the right, X on the left, Y at the top, the button the prompt names lit in its place with its bar. --prompts playstation | playstation-xbox: the same overlay with PlayStation button icons in the game's prompts, for prompts = playstation (romfs-patches-playstation for pad_layout = nintendo, romfs-patches-playstation-xbox for xbox and auto). The face buttons become the circle, cross, triangle and square shapes (button_icons.PS_FACE: with nintendo A is the circle and B the cross, as the buttons sit; with xbox and auto A is the cross and B the circle), the shoulders and triggers L1 R1 L2 R2, Plus and Minus Options and Share, and the d-pad keeps its cross. The game's text fonts get the four shapes, so the diamond's letters become those characters; playstation-xbox lays the diamond out as xbox-label does, since the face buttons sit where an Xbox pad's do. Drawn from the game's own files like the Xbox prompts (tools/button_icons.py). --xbox-prompts is the older name of --prompts xbox. With --aspect, romfs-patches-