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>
The size check added in this pull request raised a plain ValueError, which the installer maps to
check.unpack_failed. Before it, such a block ended in a hash or length mismatch and the player saw
check.input_damaged. ncz.unpack_ncz now turns the new BlockSizeError into DamagedFile, like ZstdError and EOFError.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A layer that crashes hostcheck at vkCreateInstance also breaks totk.exe --prepare-shaders in the prepare step and the
game (runtime/vk_device.c create_instance loads the same implicit layers): with the PR's warning the install failed
again after lift and compile. Check.probe_host now turns each listed implicit layer off alone, names the one whose
absence lets the probe pass with its manifest path in check.vulkan_layer_crash, and says how to turn it off
(VK_LOADER_LAYERS_DISABLE=<name> for the user account); when no single layer explains it, check.vulkan_layers_crash
lists the installed ones and offers ~implicit~. The list covers the loader's places: VK_(ADD_)IMPLICIT_LAYER_PATH, the
registry in the 64-bit view or the Linux implicit_layer.d folders, with names read from the manifests. A failed host
check is kept on the context, so key() and run() no longer build and crash it twice, and the App Control reputation
codes 4557-4559 and 4581-4583 count as a block too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docstring names %LOCALAPPDATA%\TotK Recomp\setup.json; "\T" is an invalid escape sequence, which Python 3.14 (the
setup's bundled Python) reports as a SyntaxWarning every time the module is compiled, and which a later Python turns into
a SyntaxError that would stop the setup from starting. A raw docstring keeps the text as written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The budget was the smaller of 50 GiB and 80% of the RAM, so RAM that other programs held counted as available: on a
16 GiB laptop with 2 GiB free it allowed 16 jobs of JOB_MEM (12 GiB), and the compile paged or a job ran out of
memory. compile_budget also takes 80% of hostmem.available_ram (free physical memory, capped by a job memory limit),
as recomp/gen.py already does for the lift workers; off Windows, where that is unknown, the budget is as before. The
build prints the budget and the free memory it saw. tests/compile_budget_test.py covers it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An instruction line of llvm-objdump starts with its address: short and indented in an object, 9+ hex digits at the
start of the line in a linked .exe or .dll. The scan kept only lines with leading whitespace, so it skipped every
instruction of a linked image and reported it clean, although the usage line names executables. It now keeps lines
that start with an address. tests/check_isa_test.py covers both forms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hostcheck flushes what it found before each Vulkan call, so a probe killed inside Vulkan still shows how far it got.
Check.probe_host logs the exit code as Windows reports crashes (0xC0000005), runs a probe that died inside Vulkan once
more with the implicit layers off (VK_LOADER_LAYERS_DISABLE=~implicit~) and, when that passes, goes on with a warning
that lists the installed implicit layers; when it crashes again it stops with check.vulkan_crash. A probe Windows
refuses to start (Smart App Control and other App Control policies, group policy, an antivirus) now stops with
check.host_blocked instead of an uncaught OSError. Issues #1345 and #875.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>