The device sink loop now writes every output channel; upstream's TOTK_AUDIO_DUMP gets the front pair before clipping.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The replay marks the start and the end of every render pass and dispatch
(vk_exec.c vk_exec_pass_begin and vk_exec_pass_end, vk_exec_draw.c
op_dispatch and op_dispatch_ind), outside the pass so no pass is broken.
With VK_AMD_buffer_marker the GPU writes the last started and finished mark
into words 2 and 3 of the breadcrumb buffer; with
VK_NV_device_diagnostic_checkpoints the same points are checkpoints, read
with vkGetQueueCheckpointData2NV after the loss. A ring of 4096 records maps
a mark to its submission, index, target formats and size, draw count and the
input ids of the first and last draw's shaders. vk_device_fault_report logs
both marks with their records. The calls go through the recorder thread.
TOTK_PASS_CRUMBS (menu: GPU pass marks): unset, AMD buffer marks only; 1,
also NVIDIA checkpoints, whose extension is enabled only then; 0, none.
The design follows Savage Wind Recomp 3fae40c; the code is ours.
--probe-vkexec gets a pass marks part: pass, dispatch, pass in one
submission; the marks read back after the fence name the last pass and the
report text says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mixer folded the game's 5.1 device sink down to stereo and IAudioDevice told the game it had two channels.
audio_channels (auto, stereo, 5.1; Sound tab, Speakers) now opens the SDL stream with six channels in the device sink's
order (FL FR C LFE RL RR) and reports six to the game, which then mixes for 5.1. auto picks 5.1 when the default
playback device has six or more channels (a 5.1 or 7.1 speaker setup in Windows) and stereo otherwise; stereo keeps
the existing downmix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_putenv_s in cfg_probe.c and _stricmp in the menu's key binding row stopped the Linux runtime library from compiling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mod that patched the game code (.ips, .pchtxt) stayed off as a whole.
tools/exefs_patches.py now reads IPS, IPS32 and IPSwitch files from each
mod's exefs folder and from atmosphere/exefs_patches/<name>/. It keeps the
ones whose build id is main's and turns their writes into main's code into
one patch set per file. The writes go through the same rules as the code
cheats (tools/cheats.py convert). A file that writes main's data, or that the
rules cannot express, is unsupported as a whole. The setup's lift runs it
after cheats.py and writes build-cache/exefs.status.
runtime/mods.c checks each patch file against that status:
- a built file's set is switched on with its mod;
- a file the build lacks keeps the mod off and starts the rebuild at the next
start, like a code cheat does;
- an unsupported file keeps the mod off, and the Mods tab shows the reason;
- a file for another version is counted and left out.
A mod patch on a site of one of the port's own sets turns that set off while
the mod is on, and the Mods tab names it. The Mods tab also gets the "Rebuild
the game now" row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code cheats need the game lifted and compiled with them. Running the setup
again did that, but it lifted and compiled everything and prepared the
shaders again.
- The setup keeps the generated C and the objects in its temp folder (about
1.3 GB). gen.py rewrites only the chunks whose C changed, so Ninja
recompiles only those. One new code cheat on 1.4.3 took a 47 s lift and
19 s of compile and link on 24 cores.
- Prepare's key no longer follows the compile key, only the runtime, the
translator and the game version, so a rebuild keeps the prepared shaders.
- The cleanup writes build-cache/rebuild.txt, the command that opens the
setup window in a new --rebuild mode on the install folder. That mode runs
at once and starts the game again when it succeeds.
- At start, runtime/cheats.c runs that command and exits when an enabled
mod has code cheats the build lacks (plat_spawn, new for Windows and
Linux). build-cache/rebuild.skip keeps a failed or cancelled rebuild from
starting again for the same cheats. "Rebuild the game now" on the Cheats
tab tries again, and [mods] mods_rebuild = off turns the rebuild off.
Scripted runs never start it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cheat file is now part of a mod: mods/<mod>/cheats/<build id>.txt, or the
Atmosphere places inside the mod folder, the file name in any case. The port
ships no cheat files any more (the MyNXCheats files and their notice row are
gone).
- tools/cheats.py --mods builds the code cheats of every mod folder; a
cheat's key hashes "<mod folder>/<name>", so two mods' cheats of one name
keep their own switches.
- The setup reads the cheats from <install>/mods and writes the status to
build-cache/cheats.status.
- runtime/cheats.c reads the files of the enabled mods the port can use, in
the Mods tab order, and the status from build-cache.
- A mod with only cheats is usable. The Cheats tab groups the cheats by mod,
and the Mods tab says how many cheats a mod brought.
- The cheat texts are in all four menu languages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged onto the mods folder (task/mods1); the Cheats tab sits after Mods. The cheats' menu text and the cheat file's
place are reworked for the mods folder in the commits that follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each mod is a row with its switch, the files it serves and why it is unused when it is; the top and left face buttons,
Ctrl+Up and Ctrl+Down or the drawn arrows move it. The real-time step, cloth and high-fps fix switches move here from
the Game tab under the port's own patches. The text is in the catalog in English, Russian, Brazilian Portuguese and
Simplified Chinese. The tester guide says where mods go and how TKMM's merged output fits in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-stick rows of #175 declared a second `note` in tab_controls, beside the button prompts note
dev added there, and runtime/ui/menu.cpp did not compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/cfg.c: the known names take both sides, the per-stick dead zones beside the shadow and
DLSS switches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Amiibo page reads its text from the catalog (UI_MENU_AMIIBO_*, in all four menu languages)
instead of English literals, and its status line keeps an id and the file name so it follows a
menu language change. Folders show as name/ in the list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stick reading moved from input_win.c to input.c in dev, so the per-stick dead zone and
input_pad_stick_percent are applied there, under the platform mutex. The rows sit beside the
stick camera speed and walk key rows; pt-BR and zh-Hans get the per-stick texts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sampler keeps both the DLSS mip bias and pull request #321's anisotropic level; DLAA's pass hook runs after the
contact shadows'; the extension arrays grow for NGX's extensions beside HDR's and the calibrated timestamps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps pull request #321's anisotropic filtering, which #89 added a second time, and #267's shadow_res beside #89's
shadow_scale. The HDR parameters move from byte 1408 of the support buffer to 1440: translator patches 0010 and 0011
read pcss at 1408 and shadow_spread at 1424.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FSR only enlarges (vk_fsr_record returns 0 when the picture is not larger than the crop), so a 3840x2160 image in a 1920x1080 window is shrunk by the bilinear blit and the line read 'bilinear' next to a menu showing FSR (#219).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aniso (game, 2, 4, 8, 16; default 16) raises anisotropic filtering of the game's tiled, filtered, mipmapped colour
samplers, so ground and paths seen at a shallow angle stay sharp into the distance instead of smearing. Depth-compare,
nearest, unmipmapped and clamped samplers keep the game's level: clamped samplers read screen-sized buffers, where
anisotropic taps reach across an object's edge and leave a speckled fringe (the inventory's character preview). The wrap
test reads the game's own modes, so mirror-clamp samplers stay out on devices without mirror-clamp-to-edge, where they
map to mirrored repeat. Read at start, as samplers are cached.
Ported from the aniso half of itaskaev2's shadow and filtering commit and applezra's follow-up that limits it to tiling
samplers. On the Screen tab of the settings menu (English and Russian) and in totk.ini.example.
Co-Authored-By: itaskaev2 <165683571+itaskaev2@users.noreply.github.com>
Co-Authored-By: applezra <Ezra.s.swenson@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With hdr = 1 the game's tonemap shader is replaced by one that keeps highlights up to the display's peak, the present
reads the float picture the game copies into its 8-bit window texture, and a compute pass encodes it as PQ in Rec. 2020
for an HDR10 swapchain. Peak, paper white and HUD brightness are live settings in the menu and totk.ini. The approach
follows the RenoDX TotK mod by souperman9 and Musa; no code was copied.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each frame the engine sizes its shadow cascades to the area they cover (main+0xcebdf4 in 1.2.1): from 960 down to about
400 near the ground, so leaf shadows turn coarse, and every change of size moves the shadow texels, so they jump instead
of sliding. The Switch does the same; the community mods force a fixed size. The shadow patch set loads the size from
patch page +92 just before the engine rounds it (main+0xcec22c in 1.2.1, 0x683604 in 1.4.3), and the menu's Shadow map size
(shadow_res in totk.ini) chooses it: game, 512, 768, 1024 (default), 1536 or 2048, with the texture heap grown above 960. A write
watch on the size field found the one writer; with the setting, every shadow map in both versions is the fixed size.
recomp/patches.py lists the patch page words in use.
The atlas takes the glyphs of the four CJK rows (ja, ko, zh-Hans, zh-Hant), so MENU_LANG switches while the game runs
without rebuilding it, and the Menu tab lists Simplified Chinese next to English and Russian.
Co-authored-by: deepseek-v4.1-flash-1017 <noreply@deepseek.com>
The menu and the software keyboard hold the game's input until everything they saw is released again, and that release
test counted buttons only. With the walk key a keyboard stick moves part way without setting a direction bit, so the
movement went through the moment the menu or the text entry closed; the four axes count as held now.
The walk key's conflict note reads the bindings from a snapshot rather than the live table that the polling thread
rebuilds, and it looks at every key of an action instead of the two its cells show, so a key bound third still names the
action it presses.
Co-authored-by: deepseek-v4.1-flash-1017 <noreply@deepseek.com>
A keyboard key is all or nothing, so the game only ever saw a full tilt from it and the keyboard could not walk. While
the key named by walk_key is held, the two keyboard stick samples are scaled to walk_scale, the same thing yuzu and eden
do with their modifier setting; the gamepad's axes and the mouse camera keep their own values.
0.51 rather than half: a sample of 32767 times 0.5 is 16383, one short of the 16384 the game's stick-direction bits
need, so half a tilt would leave the direction clear while the axis moved. No key is on by default, because Shift is B
in the default bindings. The Controls tab lists the keys players pick, steps the scale in hundredths and names the
action a key also presses.
Co-authored-by: deepseek-v4.1-flash-1017 <noreply@deepseek.com>
With TOTK_COLOR_* away from their defaults, present_image runs one compute pass (vk_color.c) that writes the game
picture's crop, adjusted, into an RGBA16F image, which FSR 1 or the blit then scales. At the defaults nothing is
recorded and the present takes the same source, format and rectangle as before. The Screen tab gets a Colour group
(profile and four sliders) after the field-of-view slider of #248; cfg.c and totk.ini.example keep both settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TOTK_FOV (70..140 percent, Screen tab, live) multiplies the camera's vertical view angle through the new patch set fov
at the two camera routines the aspect set patches; page +60 holds the factor. At the default 100 the set is off and the
camera runs the game's own instructions. Both fov sites and the rest of the 1.4.3 table pass patches.check against the
1.4.3 main. 1.2.1 and 1.1.1 have no fov sites and log that the setting does nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The menu merges the Japanese, Korean and Chinese language names from a system font. Dear ImGui asserts on a font
stb_truetype cannot parse, and the assert ends the process with 0xc0000409 (exit code 127 in a shell) and no line in
the log, a few seconds after the window opens: the report of an AMD laptop on Windows 11 Home Single Language (#176)
matches that, and a test build of our ImGui with a damaged font exits the same way. A cut-off font passes the parse
and faults later, when the glyphs are made, because stb_truetype reads tables without bounds checks.
fonts_up now runs each system font through a private copy of stb_truetype whose asserts only mark the font bad, after
checking that every table of its directory lies inside the file, and leaves out a font that fails with a log line.
--probe-window checks that the test takes the embedded Roboto and refuses a cut-off copy, one without a character
map and one with an unknown tag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row was labelled "Virtual core gate" with the text "Lets only one thread run per virtual core, as on the
console", but switching it on wrote free_cores = 1, which lifts the gate. Without the gate guest threads run in
parallel on one virtual core, and TotK keeps its per-core data without locks: an Arc B580 player who turned it on
crashed at every start with "CallCommands: command handle ... is not a live recording" (#212). free_cores stays an
ini key for experiments; the log now says when it is set, and totk.ini.example warns that the game can crash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: the known-key and section lists in cfg.c keep both sides; vk_backend.c, vk_device.c and vk_exec_draw.c include platform.h and vk_dlaa.h; create_instance takes the window's instance extensions from gfx_window_vk_extensions as on main, in a 12-entry array for NGX's.
The camera update and setup routines that the aspect set patches load the camera's vertical view angle a few words
before the ratio and pass it to sead's perspective projection. The new set fov loads the angle as before and multiplies
it by a factor the runtime writes to patch page +60, so TOTK_FOV (70..140 percent, menu Screen tab, live) widens or
narrows the view. The game's own zooms (bow, scope) scale with it; 100 switches the set off.
Checked on 1.4.3 at 1920x1080 at 70, 100, 130 and 140: the view narrows and widens around Link, the HUD is unchanged,
no objects appear or vanish at the edges, no validation errors. 1.2.1 has no fov sites yet (its original words are
unverified here); the setting logs that and does nothing there.
Issue #136. With TOTK_COLOR_* away from their defaults, present_image runs one compute pass (vk_color.c, shaders/color_grade.comp) that writes the game picture's crop, adjusted, into an RGBA16F image, and FSR 1 or the blit scale that one; at the defaults nothing runs. The Screen tab gets a Colour group: a profile (Game's own, Vivid, Clarity, Custom) that sets the four values, and the four sliders. The adjustment, its order, ranges and presets are STS78721's patch from the issue, reworked onto dev: it now applies with FSR 1 scaling as well as the blit, its menu texts come from the catalog in English and Russian, and the patch's unused accessors and build_game.py change are left out.
Co-authored-by: STS78721 <134802927+STS78721@users.noreply.github.com>
The restart moves into gfx_present.c's gfx_window_closed, which the Win32 and SDL windows share, and linux.c gets
plat_restart and plat_restart_wait: posix_spawn of /proc/self/exe with no descriptor past stderr and the default
signals, and a wait on a pidfd. The prompts code takes plat_file_exists, plat_setenv, strcasecmp and strdup, and the
menu and the log say a game resolution of another shape than 16:9 (16:10 now as well as 21:9) keeps the Switch prompts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged with applezra's follow-ups on the same branch: the sun shadow filter narrowed by the shadow map scale
(translator patch 0011), anisotropic filtering forced only on tiling samplers, and TOTK_DUMP_UBO with a vec4 count.
Conflicts with dev: cfg.c (names, display section, defaults next to aspect and device_profile), menu.cpp (the new rows
after the aspect row), vk_texture.c (the pool alias check takes scale == 1 and dev's bind_pool_memory size argument),
build_xlate.py (patches 0005-0011 are ours; the Linux note kept), totk.ini.example (both sections). The contact pass
release went into gfx_present.c, the shared half of the old gfx_window.c.
aniso defaults to game: the picture stays as before until a player raises it in the menu.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>