Zonai Fieldworks writes one stub per member hook in a row at init and points a gate slot at it when the player switches
the member on. init_code took only the first stub of the row as a start and read the 8-byte callback after it as more
code, so the other stubs (Hookshot at plugin2+0x135048, Fleet Sync at plugin2+0x1350f0) were never lifted and switching
them on ended the game with "no function at guest pc".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
exlaunch adds a table offset to main's base, so an update the plugin's table lacks hooks main+0x0 (Challenge
Mode's Enemy Health Regeneration names 1.0.0 to 1.4.1). Nothing runs there, on the Switch either; the site line
made the generator refuse the lift ("patched instruction is a trap") and the installer dropped every plugin. The
report notes such a hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plugin built with default visibility calls its own exported functions
through its PLT. Challenge Mode's Enemy Health Regeneration plugin
(exefs subsdk8) does so for the std::vector<const char*> constructor it
carries, and the service run counted that as a library call outside the
reviewed list, so the plugin was refused and its whole mod stayed off.
runtime/loader.c resolve binds such a JUMP_SLOT straight to the plugin's
own definition (a host override still wins and stays counted), and
tools/exefs_plugins.py plt_imports maps the PLT stub to that code, so
the reach check follows into it instead of naming an import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "save to the album?" window showed a 4:3 or 16:10 photo in a 16:9 frame, stretched across: N_FirstOut_00's
scale_y k, there for the compendium's square photos, also undid N_InOut_00's taller frame for the album photo under
it. The scale goes on N_PictureBook_00 and the album's question and buttons (N_AlbumCon_00) instead, and those move
out by the frame's extra half height. The clock of an inn's choices (Time_00) stayed in the middle 16:9 while
MessageDialog_00 went to the bottom edge, so it covered the last choices; it goes to the bottom edge too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The libSDL3.so.0 the release puts next to the game links system libraries a minimal system may lack (libXss.so.1 on AnataseOS in #1315 and #1428, libdecor-0.so.0 on Batocera in #1419). The loader then stopped totk --prepare-shaders with exit code 127 after the half hour of lift and compile, and the setup reported only that preparing the shaders failed.
The check step now runs ldd on the release's libraries (Linux, not in a repository build) and stops with check.libraries_missing, naming the missing files and, for the common ones, the package that provides them on Fedora, Debian/Ubuntu and Arch (LIBRARY_PACKAGES). When the game still fails to start in the prepare step, the loader's "error while loading shared libraries" lines in its log give prepare.libraries_missing in place of prepare.shaders_failed. Both messages are in all twelve catalogs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The full map's width was held at 2250 by AppMap_00_MiniMap's size keys (they win over the layout's sizes): wide_anim sets them to 2250 / k, so the map is drawn across a 32:9 screen; the layer tabs and the time and position move to the screen's edges. The loading map is a capture of the 3 x 3 world map tiles of 840 units around the player's tile (TOTK_DUMP: nine 840x840 tile draws into the capture), so a capture wider than about 1680 shows black where the player stands near a tile's edge: loading_map keeps it at most 1660 wide from the screen's left edge, moves the map's slide keys (LoadingFade_00_BarIn and BarOut) with it, and widens the side panel, a window whose frame keeps its proportions, to the screen's right edge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AppMenuOverlay_00 keeps a full-width root, so the stone and light pieces of the map's side frame (N_Frame_00, P_Frame{L,R}*) were stretched across a 21:9 or 32:9 screen; they now take scale k at the edges. The loading screen widened N_Base_00 back to the screen, which stretched the map capture inside it; instead the capture panes and their pictures get a size of 1920/k - 450 (1470 at 16:9), so more map shows unstretched, and the side panel stays at the right edge at its own width. The map's cut and backing panes (AppMap_00 N_Cut_00 and the others) take 2250/k as a size. ultrawide_layout.py gains the pane width field (+76); tests/hud_layout_test.py leaves these three layouts out of its byte comparison with the older implementation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It takes the 32:9 layout folder (3840x1080's, cfg.c cfg_shape_size); totk.ini.example names the common 21:9 and 32:9 sizes and hud_width for the HUD in the middle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A game resolution whose shape the fifteen listed sizes did not cover (13:6 on a phone streamed to, 4:3) drew 16:9 with bars: neither the setup's Shapes step (installer/screens.py shape_size) nor the game's background generator (runtime/romfs.c romfs_folders_prepare) made a layout for it, though tools/ultrawide_layout.py handles any aspect ratio and runtime/romfs.c overlay_init already loads a folder of the exact size. cfg.c cfg_shape_size and screens.py shape_size now give an unlisted shape from 4:3 to 32:9 its own size, so both make romfs-patches-<w>x<h> for it; a display of an unlisted shape still keeps the 1920x1080 default and gets no folder. The list gains 4:3 (1440x1080, 1600x1200, 2048x1536, 2732x2048) and 19.5:9 and 20:9 phone sizes (2340x1080, 3120x1440, 2400x1080, 3200x1440), in the menu's game resolution row too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build-cache/plugins.stale changes no input of the lift or compile key, so the rebuild the game started planned only
check and cleanup, never ran the plugin's service run again, and the plugin stayed stale. A non-empty plugins.stale
now makes Lift and Compile not current (installer/steps.py plugins_stale); Compile too, since the transient lift runs
only with the step after it. Lift.run clears the file, so the next start plans nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The expect line of such a word says `* *` (tools/exefs_plugins.py plugin_lines), recomp/patches.py carries it into
RT_PLUGIN_WRITES as a flag, and runtime/plugin_init.c check_writes accepts any value there through
runtime/plugin_writes.h plugin_write_find. Hook branches in .text and pointers into a plugin's .text keep the exact
match. Zonai Fieldworks' Self Recall takes its storage off a pool size at main+0x3ad6eb8 that grows with the texture
heap of render_scale, so its plugin went off at every start with a grown heap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With restbl_cache = 1 on the restbl mods: built on the first start, served on the second with the same bytes, built
again after a rewritten mod file, an added or removed mod, another order and a new totk.exe, and after a torn or
random key file and a damaged or missing table. With the default 0 the key is neither read nor written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FSR 4 is a fourth engine of the scene upscaler beside DLSS and FSR 3.1 and takes their frame point, jitter, per-object
motion vectors, mip bias, fsr_sharpness, FXAA skip and dynamic resolution hold. The PR's dlaa_backend setting, its
FSR 3 through the DLL and its separate Upscalers row are left out: dev builds FSR 3.1 from the SDK 1.1.4 sources.
Checked on an RX 9070: FSR 4.1.2 at quality, 1280x720 -> 1920x1080, picture clean; without the DLLs the upscaler stays
off with a log line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pack_shader_cache.py picked 8 readers on every machine. It now takes half the logical CPUs, 1 to 8, so a 1- or
2-CPU PC reads one file at a time, and reads serially with less than 512 MiB free RAM (tools/hostmem.py, as the
compile and lift workers use). --read-workers still overrides; the log names the choice.
The read-ahead is also capped at 32 MiB of file data by the listed sizes, beside the two files per reader; a file
larger than the cap is read alone.
Any failure of the parallel path (a thread that does not start, a MemoryError in a reader, an executor error) prints
a line and reads the remaining files serially, so the pack still completes with the same bytes.
Tests cover the worker choice, the byte cap and the three fallbacks, each giving the same pack as a serial run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR's FSR 4 path (runtime/vk_ffx.c over AMD's FSR SDK 2.4 signed libraries, ffx_api_min.h, the cooperative
matrix and float8 device extensions in vk_device.c), its setup step that downloads amd_fidelityfx_loader_vk.dll and
amd_fidelityfx_upscaler_vk.dll, its notices and the FXAA copy shader hash 0x9d065204aac9766b now serve dev's own
scene upscaler as UPSCALER_FSR4. FSR 4 goes through vk_dlaa.c fsr_evaluate beside FSR 3.1: the same frame point,
jitter, motion vectors with the per-object pass, camera from vk_fg_camera, mip bias, fsr_sharpness, FXAA skip and
dynamic resolution hold.
Dropped from the PR: the dlaa_backend setting, FSR 3 through the DLL and the separate Upscalers row. vk_ffx.c pins
FSR 4 only; a device the libraries offer no FSR 4 for runs with the upscaler off and the menu says so. It keeps one
context per output size with dynamic resolution, like vk_fsr3.cpp, waits on the SDK's ring depth and is released
before the device goes. The menu's scene upscaler row gets "AMD FSR 4" (Windows; marked when the libraries or the
GPU are missing). The setup's FSR box and its strings are in all eleven installer catalogs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The extraction writes build/extracted/v0/romfs/romfs.bin (17 GB) and no other
tool in the repository reads it: build_game.py, gen.py, prepare_shaders.py and
package_build.py all take the version's own directory, and merge_update_romfs
takes the base Program NCA from the base game file itself and verifies all six
IVFC levels of what it merges.
The base game's ExeFS still decides the file is TotK 1.0.0, so damage is still
found, only later, with a message that names the damaged file.
The flag is off by default: a run without it extracts and checks as before.
Zonai Fieldworks was refused at several steps; each is now handled:
1. The start-up asked GetInfo 6, 7, 16 and 17 and SetHeapSize; runtime/plugin_init.c serves them.
2. Its start-up calls main where the lift has no function start. The tool names those addresses (--entries-out) and
the installer lifts again with them as `entry` lines, up to four rounds (installer/steps.py PLUGIN_ENTRY_ROUNDS).
3. Branch hooks into the middle of game functions (far-jump veneers) and pointer swaps in main's data are accepted
hook kinds; the veneer targets seed the plugin's lift, and an Orig trampoline counts as a seed.
4. Code the start-up writes into the plugin's own .text (hook pads it switches to during play) is found by comparing
the image before and after the init, and seeds the lift (init_code). Without it the game stopped with "no function
at guest pc" when a feature switched on.
5. recomp/gen.py: a branch-out alternative on a flag-writing site leaves with the flags from before the site; an inline
hook may sit on a blr.
6. nn::fs::MountSdCard mounts <profile>/sdcard (runtime/fs_host.c), and nn::settings language codes are answered
(runtime/ov_system.c).
The import check now also allows what the game's main imports (--exefs, game_imports): the game runs on those paths,
so the runtime serves them. Left out: nn::ro, the C runtime start, the thread-local allocator hook and the shader
compiler. Break in code the hooks reach is allowed (an abort ends the game with the reason, as on the Switch), and
RenameFile, DeleteDirectoryRecursively, Commit and Unmount join the SD card calls. Checked: Zonai Fieldworks, The Second
Quest, Challenge Mode and Material Columns on 1.4.3, Full Inventory Expansion, Quick Weapon Durability and Magic of the
Kingdom on 1.2.1 accepted; UltraCam's init still crashes its service run. Plain lift unchanged; probes 4/4 on both
versions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>