bind_vertex_buffers resolves and compares the 17 streams the vertex input reads on every draw. When the last
prepared draw bound the same set of streams in this command buffer, no op changed one of their ranges, vk_mem_gen
stayed, and with static vertex input the strides did (pipe_gen), every stream would resolve to what is bound: the
loop is skipped. check runs the loop and counts a stream it would bind again. Lookout Landing check, 60 s: 62% of
draws skip it, 0 mismatches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feedback_scan's memo is keyed by tex_serial, which every texture or image bind of either stage moves. When the memo
holds the last prepared draw's scan (BiLast.fb_ok) of the same fragment shader in the same pass, no slot was
registered since, and no marked fragment texture slot is one the shader reads (BiMask.ftex, buffer textures
included), the answer stands. check scans and compares. Lookout Landing check, 60 s: kept on 68% of draws (the memo
alone 60%), 0 mismatches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shader memo already keeps them while the program, the bound state and the first 32 handles of both stages are
equal. With the marks it also keeps them when other slots were rebound: no program or serial change, the same
pipe_gen and slot generation, and no marked texture or image slot inside the program's slot mask (slot_mask_of,
~0u while unknown), which are all answers_for reads. BiLast.sm_ok says the memo holds the last prepared draw's
shaders, so a mark cleared by a later draw never hides a change. check looks the shaders up and compares. Lookout
Landing check, 60 s: shaders kept on 65% of draws (the memo alone 55%), 0 mismatches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From task/fastrep 18eab597 (TOTK_PIPE_GEN), now under TOTK_BIND_INC: the pipeline memo keeps the pipe_gen its state
was built under; a draw with that generation and the same shaders, primitive, restart, feedback flags and depth mode
takes the memo's state and pipeline and skips the three 360-byte compares (memo, cache entry, recorded state). The
shader memo skips its compare of pipe the same way. check builds and compares as before and counts a state the
generation called unchanged that differs (bi_mismatch logs the first of each kind with its marks and generations).
The census runs only in check mode. Lookout Landing check, 60 s: 67% of draws keep the state, 0 mismatches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vk_exec_bind compares before it writes: VkExec.dirt gets a bit per program, uniform, storage, texture, image and
vertex buffer slot that changed, pipe_gen moves with every change of the pipeline state (also depth clamp, raster
discard and the target formats), fbl_serial with the feedback-layout images, OV.gen with the uniform overlays.
vk_exec_draw_new_cb, copy_state and state_reset mark everything. With TOTK_BIND_INC=on or check, bi_census sorts each
prepared draw by what changed since the draw before (nothing, uniform slots only, other slots, another pipeline) and
counts the descriptors to rebuild, the generation moves and the shader, pipeline, vertex buffer and feedback keeps;
a bind_inc line every 300 frames. No draw is prepared differently yet.
Lookout Landing, 4500 draws a frame: nothing changed 8.7%, uniforms only 55.5%, other slots 22.9%, another pipeline
12.8%; 3.4 of 11.2 descriptors a draw to rebuild; uniform overlays move on 2.3% of draws, snapshots 0.1%.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Work in progress: the generator side (gen.py --v-locals) is not written yet, so no chunk defines RT_VLOCALS and the
default build is unchanged. build_game.py gains --gen-o2 for A/B builds at the PGO optimisation level without a profile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At 100/100/100 the RomFS, zstd and Opus hooks and the mixer lookup are skipped (audio_cat_active); the
RomFS handle still keeps its category, so a stream opened earlier is classified by its later reads once a
setting moves. The mixer keeps each voice's category until it moves to another wave buffer or coefficient
table, instead of up to six scans of a 32768-entry ring per voice per frame; the ring is 4096 entries and
lookups take its lock. zstd decodes check the BARS magic before any lookup. The guesses from BWAV headers
(Opus means voice, stereo ADPCM means music) are gone: Opus streams are the DmT cutscene beds and stereo
ADPCM is common among effects. Unknown Opus output counts as effects. A once-a-minute log line counts the
categories while a setting is below 100.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hdr_hue (TOTK_HDR_HUE) scales the MacLeod-Boynton hue and purity transfer that replaced #442's blend: the default
moves from 80 to 70, where the transfer is RenoDX's default 70% hue shift and 65% SDR blowout, and 0 turns it off
as the menu text says. The shader's two-step colour space conversions become one constant matrix each and the D65
white point a constant, which halves its matrix-vector products. THIRD_PARTY_NOTICES.md and vk_hdr.c now say the
reconstruction is adapted from RenoDX at 43c067b, MIT.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shader conflict with #442's highlight hue correction is resolved in favour of #552's shader, which replaces that
blend; its SPIR-V header is regenerated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main+0x155ec (1.2.1: main+0x809ecc) stores the actor's link record [actor+0x1a8] in the owner and updates its +0x50
atomically unless the actor's state word is 7..11. A freed actor can carry a stale pointer there that the old check
let through.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ability guard (runtime/ov_ability.c) checks the holder, the actor, its component and the reference word the game
writes, so it catches every bad target seen in the reports: -1, 0x80, an empty bounding box (FLT_MAX) and a vtable in
main's data. The optref site at main+0x1bd01c8 (1.2.1: 0x1622bf4) is dropped: set ability patches the same address and
must win there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
romfs.c romfs_shape_prepare remembers the folders it started a generator for, so a second click, or the same game
resolution chosen again while one runs, starts no second generator writing into the same folder. The shaped keyboard
and mouse prompts get totk.ini as --binds, as the setup's PcPrompts and Shapes steps draw them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setup wrote 64 patch folders: every prompts style for all 15 shaped game resolutions. The new shapes step
(installer/screens.py) writes romfs-patches-<w>x<h> only for the shapes of the connected displays, the output_res the
game defaults to on each and the totk.ini output_res, and the prompts' shaped folder only for the style totk.ini
selects. One folder per shape: the runtime maps the game resolution to its shape's size (cfg.c cfg_shape_size, the
closest ratio within 1%), and an exact-size folder from an older install still wins. The settings menu marks a game
resolution whose shape has no folder and can start the generator for it in the background, for the next start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pull request #1136 with three fixes: the Russian and Portuguese rows name Ultrahand as the catalogs do, smooth map
zoom takes the wheel only on the map menu_cursor.c finds, and the weapon bar opens only where the camera hooks saw
free roam, a lock-on or a mount. Off by default (gameplay_tweaks_enabled = 0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unclassified camera is also a paused menu, a 1.2.1 menu or any screen menu_cursor.c does not read; opening the bar
there held D-pad right and moved the right stick inside that menu.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With menu_cursor = 0 map_zoom_allowed answered yes everywhere outside aiming, scope, Ultrahand and lock-on, so the
wheel in free roam pushed the right stick's Y and tilted the camera, and the weapon wheel never got the wheel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add volume_music, volume_sfx, and volume_voice sliders under the Sound tab
in the F1 settings menu and in totk.ini to control background music, sound
effects, and character voices independently.
Classifies audio streams by file path in RomFS, parses BARS and BWAV headers
for ADPCM coefficient tables and stream formats, tags decompressed Opus streams
from nn::codec, and applies per-category gain factors in the audio mixer
during voice rendering.
Localized across English, Russian, Brazilian Portuguese, and Simplified Chinese.
Documented in totk.ini.example.
The Russian rows called it Автоколесо, the catalog and the game say Ультрарука; the Portuguese rows kept the English
name where the catalog says Ultramão.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tfr_note moved its pointer inside the search loop, so each later way was counted from the way it had picked and the
search could step up to 20 entries past the set. From the last set it wrote the new entry into RP, which follows the
table: the image handle into the take word, which left the submitting thread waiting in chunks_submit for a chunk no
recording thread took (a freeze with replay_workers above 0), and level and layer into the handle list, which crashed
chunk_record reading address 0x8. --probe-vkexec gets a part that stamps a set's ways so the old search left it.
The three patch sets read their switch through cfg, so the keys already worked from totk.ini but logged as unknown and
were undocumented. They are now known keys with defaults (on), in [performance] of totk.ini.example; the settings menu
does not show them. The settings table reached 128 rows, the size of the menu's reset list, so that list grows to 256
and logs if the table ever outgrows it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game links an actor whose link record is null without complaint, so UltraTears' live-actor test could drop
targets the game handles. A target is now dropped only when the holder, the actor or its component is unreadable, or
the word the game's reference takes (+0x90, an atomic read-modify-write) is unreadable or in a module's code or
read-only data. The live-actor test logs the targets it would reject and changes nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1092's pointer image (runtime/cursor_art.c: a gold arrowhead with a dark edge, a turquoise gem and a soft shadow,
drawn at the window's DPI) was left out of dev because it changed the pointer for every player with no way to keep
the system arrow. It now comes with pointer_image (input section, live, default 0): 0 leaves the window class's arrow
as dev has it, 1 shows the image while the cursor is not captured. Win32 reads the setting at WM_SETCURSOR (the
next mouse move after a change); SDL sets the image or its default cursor when the settings change (input_sdl_idle).
The setting has its row under the mouse rows of the Controls tab, its text in the four menu languages, and
totk.ini.example and docs/controls.md describe it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set ability (1.4.3 main+0x1bd01c4, 1.2.1 main+0x1622bf0): the target actor load becomes a host call that reads the
holder safely and drops an actor failing the live-actor test (link record points back and carries its id), as
UltraTears found; the game's own cbz skips it for that frame. The answer comes back in x9, since the lifted code keeps
x21 in a C local across calls. Set report (1.4.3 only): the model scene report loop sends a negative handle or a row
index from 0x8000 to the game's handle reset, the class Weeping of the Empire met (#52, #73). Both on by default,
TOTK_ABILITY_GUARD=0 / TOTK_REPORT_GUARD=0 turn them off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plat_font_path stats five absolute paths for NotoSansCJK-Regular.ttc and takes the first that exists. That covers
SteamOS and the usual distributions, but misses any system where the font lives elsewhere, and fails outright in a
sandbox: under Flatpak /usr is the runtime and ships no CJK font, the app may only write /app, and the host's fonts
appear at /run/host/fonts. All five paths miss, fonts_up merges 0 fonts, and every Chinese character in the settings
menu renders as '?' while English stays correct.
Asking fontconfig fixes all of these at once. It is the same database Tk/Xft and every other Linux toolkit reads; it
knows /app/share/fonts, the XDG data dirs, /run/host/fonts and the per-user directories, so installing the font where
the system looks is enough and no packaging can leave the menu stranded.
libfontconfig is dlopen'd, not linked: a host without it (headless, a bare container) still builds and runs and takes
the fallback, so this adds no build dependency, and the runtime already links -ldl for the NVIDIA libraries. The
result is checked against the character before it is used, because fontconfig returns the closest pattern even when
nothing covers a character -- without that a Latin-only system hands back DejaVu Sans and the menu believes it merged
glyphs when it did not. The pattern names zh-cn and zh-tw rather than zh-hans and zh-hant, which is how Noto CJK and
fontconfig tag the faces.
menu_font_fontconfig defaults to 1 and 0 goes back to the five fixed paths, for a player whose fontconfig resolves to
a font the menu's parser cannot read. TOTK_MENU_FONT names a file directly and wins over both. A system with the font
where the old paths expect it sees no change, and Windows, whose font names are fixed, is untouched.
Verified against the real fontconfig with the host having no CJK font, with fontconfig pointed at a directory holding
only NotoSansCJK-Regular.ttc (the Flatpak case, now resolved), with TOTK_MENU_FONT set and pointing at a missing file,
with menu_font_fontconfig=0, and with libfontconfig made unloadable (falls back quietly, no crash).
On 1.2.1 the light target is scaled to the output by an upscaler of the game's own (twelve texelFetch taps,
fragment shader e6f7ae35b8479ef3), not by the FXAA draw vk_dlaa_skip_draw knows. It addresses its source in the
scene's pixels, so DLSS's output-sized picture swapped in for the light target (tex_info) showed only its top-left
part, two thirds at DLSS quality, stretched over the screen: the "floating camera" of #1106. #660 (169d057) made the
swap reach that draw: before it, DLSS ran on another target and its picture never reached the screen on 1.2.1.
DLSS already writes its picture into the scaling pass's target, so on 1.2.1 a draw in a pass larger than the light
target, without depth, that samples the light target is now skipped (vk_exec_draw_samples). The HUD drawn later into
the same target samples other textures and stays. 1.4.3 keeps the swap, where a tonemap can be the scaling draw.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the camera (the ability wheel's camera) each notch of the wheel is a 100 ms press of the D-pad's up (in, for a
turn away from the player) or down, the zoom its button guide shows. The camera is found by its open screens: the
Purah Pad's frame and CameraPointer_00 without AppMap_00, which the Scope has (menu_cursor_camera). The Scope has no
zoom of its own, so the wheel stays unbound there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the scroll wheel, the keys or the pad move the focus in a menu, the pointer takes it back only once it has
moved 6 layout units from where it was then (menu_cursor_poll), so a hand resting on the mouse no longer undoes a
scroll. While the cursor is not captured, the game window shows a gold arrowhead drawn at the window's DPI
(cursor_art.c) instead of the Windows arrow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
By default the left button is Y, which opens the dialogue log in a dialogue box. While MessageDialog_00 is open the
left button now presses B, which advances the text and shows the rest of a scrolling line, and the right one A.
Dialogue choices keep the menu pointer, where a left click picks the choice under it, so clicking through a
conversation does not pick the choice the focus starts on. The setting is live and independent of menu_cursor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wheel did nothing outside the map. Now each notch is one step of the stick a gamepad player would move: in a menu
with the game's focus box (the inventory, shops, Options, the save list) the focus moves up or down, and while a D-pad
strip (weapons, shields, bows, materials) is held open the choice moves left or right. The strip has no focus box
while it is held, so it is found by its open screen, ShortCut_00, as the map is. The wheel now also counts while the
cursor is released over the window, where the menus have the pointer. Input scripts take WHEEL lines and a recording
writes them, and a script's one-shot MOUSE or WHEEL line goes in at the first poll at or after its tick instead of
being lost when a poll skips that tick.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vk_reflex_present_frame took g_pl on every present although only flip_locked's VkPresentIdKHR (Reflex) and
latency_note (TOTK_TRACE=perf) read g_blit_pid. nvn_api_obj.c and ov_input.c declared vk_reflex_marker,
vk_reflex_frame_begin, vk_reflex_frame and vk_reflex_sleep locally; they now come from gfx.h, the graphics layer's
interface, which gfx_present.c also sees through vk.h, so a changed signature fails to compile. vk.h stays out of
those two files: it brings in Vulkan, VMA and vk_rec.h's vkCmd* macros.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
evaluate's preset_dirty loop stopped at slot 3 of the five D.sizes entries, so a preset change left the features in
slots 3 and 4 created with the old model: they kept running until the slot was evicted. The loop now covers the whole
array through DLSS_SIZES instead of a literal.
Taken from pull request #1057 (t04dJ14n9) alone; the PR's dlss_prewarm commits are not in this change.
(cherry picked from commit a76bdf5e08)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mod file whose name carries Product.<n> and which the RomFS lacks was counted as made for another game version and
never served. The game does ask for such names: on 1.4.3 with mods on, the file trace (trace = fs) shows it opening
Sound/Resource/Pack_MasterSword.Product.110.bars.zs, while its RomFS holds only the Product.140 and the unversioned
file. A sound mod that ships its pack under all those names was silent here and works on a console, where LayeredFS
shows the game every file of a mod. Such files are now added overlays like any other new file. Another version's
resource size table is still not served and still lends its entries; the files are still counted, and the Mods tab
and docs/mods.md now say they are read only when asked for by name.
tests/mods_romfs_check.py gets a case for it. Not run here: the test and --probe-fs need a build and the game's files.
runtime/romfs.c compiles with llvm-mingw.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgQM2zwuVagwScByEJhT8V