Commit Graph
335 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 1974b671be Merge pull request #1263: with DLAA, fog and particles can be drawn over the smoothed picture, so dust in shrine fog no longer vanishes; off by default until checked on NVIDIA (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:07:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c76a38852e The DLAA effects switch sits with the other DLSS settings and is read only while DLSS runs
dlaa_effects_after moves to the Screen tab under the DLSS rows, to [display] in totk.ini and totk.ini.example next
to dlss_char_mask, and vk_dlaa_frame reads it after the dl_active check, so a game without DLSS does no new work
per frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:05:44 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f53b86c61d Merge pull request #1253: sync_ahead works on game 1.1.0, and game-time scripts find the player there (Marjaperse)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:01:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e031ac596a Merge dev into task/pr1263
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:59:52 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bd8c5d637f Merge task/objreuse: a private build compiles only the generated chunks that differ from the main build, so a private lift of a patch builds in seconds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:38:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2b95408642 A private build reuses each main build object whose compile is provably the same, also for a private lift in another generated dir
build_game.py used to reuse build/<ver>'s generated objects only as a whole and only for generated/<ver>, so a private
lift of a patch change (gen.py --out generated/<ver>-prN, build_game.py --gen) compiled all 421 chunks, about 5 min on
12 jobs, for one changed chunk. main_objects now decides per object: same compiler, flags and rule in the main
build.ninja (with the main runtime/ and generated dir in place of ours), main build up to date, and every file the main
compile read according to its Ninja deps log byte-identical on our side and unchanged since the object was written
(NTFS ChangeTime, st_ctime elsewhere), the compiler binaries too. A file new on our side whose name those compiles
included or probed blocks the reuse. Anything unknown compiles. The build prints "reused N of M generated objects",
--verbose lists the rest with the reason; obj/reused.txt lets a later build delete a copied object before compiling it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:37:43 +03:00
shinodanpenandClaude 037a39d303 The sound engine's audio thread takes every queued command list, so the game keeps its sound above 200 fps (#337)
The game thread hands its sound commands to the audio thread in lists: 16, of which 4 are always held, so at most 12
wait in the command ring. The game thread submits at most one per update (1.2.1 main+0x9bd144), the audio thread
takes one per 5 ms audio frame (after a list, main+0x883780 goes on past the ring's check). Above about 200 updates a
second the ring stays full. The game's guard (main+0x9bcdc4) counts the updates that find the ring of free lists
empty and exactly 12 lists in the command ring (0x9bce1c cmp w9, #0xc); the count returns to 0 only when a free list
is there. At every multiple of 300 (10 s at 30 fps, 1.25 s at 240) it clears the sound command switch
(main+0x2268bfc) and stops every active voice (main+0x226f29c). Only the switch's constructor sets it to 1
(main+0xf31ce8, from the engine's init main+0xf31530), so the game is silent until it is restarted.

Measured on 1.2.1 (Linux, RX 6750 XT), same save and scripted input, mix dumped without a device: with fps_limit 60,
144, 180, 200 and 201 the mix has sound; with 205, 210, 220, 230, 239 and 240 it goes silent after the boot logo and
stays silent, also at the 130-148 fps of the scene that follows. The guard is read from the code; the switch going
to 0 has not been observed in a run.

The set audiodrain (TOTK_AUDIO_DRAIN_FIX, audio_drain_fix, on by default) sends the audio thread back to the ring's
check after each list, so it takes every queued list in the pass: one site per version (1.2.1 main+0x883780, 1.4.3
main+0x149244), each going to a target the game's own code already branches to in the same way (1.2.1 main+0x883c18,
1.4.3 main+0x149700). The setting is in runtime/cfg.c, totk.ini.example and docs/settings.md.

At fps_limit 240, 120 s runs of one build per game version with the set switched, seconds with sound in the mix: on
1.2.1 5 of 118 with the set off and 108 of 118 with it on; on 1.4.3 2 of 118 off and 110 of 119 on. Not run:
Windows. Not covered: 1.1.0, whose main we do not have, so its table has no site and it keeps the game's code.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-17 18:56:55 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a5c3e0f9f5 A game with a mod plugin no longer stops at start: plugin_trace has its row in the settings table (#845)
plugin_init.c reads TOTK_PLUGIN_TRACE through cfg_bool, which stops the game when the key is unset and metas[] has no
row. Every test run set the key, so only a plain start hit it. tests/settings_doc_check.py now fails on any
cfg_value/cfg_int/cfg_double/cfg_bool reading without a metas[] row that is not guarded by cfg_get of the same key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:49:27 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e7c901b864 The setup's builds name every path relative to the build kit, so a moved game folder rebuilds incrementally (#845)
tools/build_game.py --portable writes build.ninja paths on the tools' drive relative to the kit, also through '..'
(the generated C and objects in build-cache/work), names the compiler, windres and ar the same way (backslashes:
CreateProcess does not find a relative program with forward slashes), and passes clang -resource-dir and --sysroot
relative to the kit, because clang names its own headers by its absolute folder whatever argv[0] says. The Ninja deps
log then holds no absolute path. installer/steps.py build_args passes --portable for the build kit.

Measured on an install moved after a portable build: the rebuild compiled modules.c only, 3.5 s; before, the move cost
a full compile of 430 objects (335 s on 12 cores). Without --portable build.ninja is byte-identical to before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:57:12 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8c9c18a6d2 A kit whose replacement fails is put back, so the game keeps a build kit; docs rewrapped to 120 columns (#845)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:06:32 +03:00
Valiantsin DzerakhandClaude Opus 5.5 501f0d3e6f The setup installs a build kit into the game folder, and the game's rebuild for code mods runs from it (#845)
The rebuild for ExeFS patches, code cheats and mod plugins ran the setup window from the setup folder, whose absolute
path build-cache/rebuild.txt held, with the generated C and objects in that folder's temp/. A moved or deleted setup
folder left code mods without a rebuild.

- A new Kit step after the check copies the release folder without TotK-Setup.exe into <game>/build-kit
  (installer/layout.py KIT_ITEMS), and every later step runs its tools from there. A newer setup replaces the kit,
  the kit's own rebuild keeps it.
- The release's temp folder is <game>/build-cache/work, so the lift cache and the objects stay with the game.
- rebuild.txt names the kit relative to the game folder; runtime/cheats.c and runtime/romfs.c resolve relative
  entries against the exe's folder.
- runtime_key drops the lines of clang --version that name its folder, so a rebuild from the kit or a moved game
  folder keeps the compile and prepare steps the setup recorded.
- An update over an install of an older setup moves that setup's temp folder into build-cache/work when both are on
  one disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:54:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 791e077c54 docs/mods.md: removing a plugin mod starts the rebuild without it (#845)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:36:10 +03:00
ipavlin98 40c0071dd2 With DLAA, DLSS runs before the fog and the particles, which are drawn over its picture without jitter, so the dust in shrine fog no longer vanishes
DLSS ran at the bloom, after the volumetric fog composite and the particle pass. Neither has motion vectors or jitter
of its own, and DLSS wiped out the smallest motes. In DLAA mode DLSS now runs right after the deferred lighting: the
light target is the G-buffer's scene colour target, the lighting is the first pass into it after the G-buffer, with
a D16 depth, and the first pass into it with any other depth (the scene's, none, or the D16 of an ability's highlight)
is an effect. The order of the effects changes from frame to frame (the yard's half-size effects pass is in some
frames only; with Ultrahand or Ascend open the highlight comes before or after the fog layer), and rules that waited
for one of them, or took any D16 pass for the lighting, flickered. As a safety net the point is used only after it
held for 60 frames with nothing of the scene drawn after it; otherwise DLSS stays at the bloom.

dlaa_effects_after (Advanced tab, Render fixes, default 1, live) turns it off. The upscaling DLSS modes are unchanged.
2026-11-17 09:41:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b9b8f3dce1 Each mod plugin is built or refused on its own: one that is refused, crashes or hangs costs only itself (#845)
tools/exefs_plugins.py ran every plugin's init in one service run and refused them all when one was refused. Now a run
without inits lists the plugin modules, then each plugin runs in service runs of its own (TOTK_PLUGIN_ONLY, the others
stay loaded): a refused svc, a crash (the FATAL line is the reason), a timeout or a failed check refuses that plugin
alone, with its reason in plugins.status; the rest are built in. 4 plugins take 2.3 s.

At start, plugins_start compares each plugin right after its own init and takes its branches out of main's .text before
the next one, so each init sees the game's bytes, as in its service run. Only that init's aliases are flushed: the
start stays at 113 ms for Full Inventory Expansion + Quick Weapon Durability (107 ms before).

The installer's second lift keeps every plugin of the service runs in the layout when one is built: the records hold
that layout's addresses. A refused plugin stays loaded and never starts. A mod with a built plugin and a refused one,
used without its code, runs the built one (mods.c; --probe-mods case T).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:25:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8cee1afe5d The rebuild builds mod plugins in: service run, checks, patch sets and status lines (#845)
After the design in #845 by itaskaev2. tools/exefs_plugins.py writes an accepted plugin's patch set
(recomp/patches.py plugin lines and hook sites, one ordered set mod_<hash> per plugin, several plugins
in one record told apart by their hooks) and a line per plugin of build-cache/plugins.status: built, or
refused with the first reason. It also checks the code the hooks reach (direct branches and calls from
the stubs, impls, callbacks and targets): no svc but OutputDebugString, imports only from a reviewed
list. The init's imports may now include malloc, free, memcpy, memmove and memset, because the init runs
again at every start and its heap blocks exist while the game runs.

The setup's lift step runs the plugin stage when a mod has exefs/subsdk*: a lift with the plugins, a
totk.exe of it in the compile step's folder, the service run, then the lift with the hook sites; a failed
stage warns (warn.plugins_skipped) and installs without the plugins. docs/mods.md describes what works,
what is refused and why, and the rebuild.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:48:31 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b488d9e41d totk.exe --plugin-init runs a mod plugin's init on our kernel and records what it did (#845)
The plugin service run loads the modules as boot does, runs sdk's DT_INIT and then each plugin's from nn::init::Start's
module-init callback (rtld initialises the last loaded module first), writes the record and exits before any game
constructor, graphics or audio. The record holds every word the init wrote into a game module, the plugin's image
before and after its init, the process-memory maps, and the svcs and imports it called.

exlaunch's init needs a Switch-like address space: QueryMemory shows the game's own rtld image below main and the
host's ranges as Inaccessible (it takes Code RX runs for modules), and a 64 GiB free pool for its random alias picks.
New svcs: GetSystemTick, GetInfo 65001 (current process handle), and Map/UnmapProcessMemory, which only the service
run serves: an alias is a copy whose changed words go back into the source when it is unmapped. Any other svc, such
as the CreateSession fallback, ends the run with a reason. nn::oe::GetDisplayVersion is answered with the build's game
version. The game calls none of these svcs; the SVC trace test is still one mask test per SVC.

After the design in #845 by itaskaev2, with the init run natively instead of under Unicorn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:05:19 +03:00
Marjaperse 8c147cf6dd Enable sync ahead for game version 1.1.0
Recognize the verified per-frame NVN wait site while retaining replay and shadow-memory guards. Document support and cover wait selection, polls, unrelated calls, fence completion, timeouts, and disabled modes with a deterministic backend.

Validated 1.6 million wait selections, runtime probes, and a two-minute gameplay smoke test in the v0.4.1 test build. The smoke test retained DLAA and display settings on a disposable profile copy; no FPS improvement is claimed.
2026-11-16 21:42:00 +02:00
Valiantsin DzerakhandClaude Opus 5.5 873903d98f The Mods tab order decides code sites too, conflicts show per mod, and each mod can be used without its code
Load order: mods_exefs_apply ranks each mod's patch sets by its position (rt_patch_rank) and runtime/patches.c fills
the pick byte of every contested site from the sets that are on, lowest rank first; a tie (two files of one mod)
goes to the later file, as emulators apply a mod's files in name order. Reorder and restart, no rebuild. The pick is
redone when an ordered set is switched at run time. Nothing changes for sites one set patches.

Conflicts: one table (mods_conflict) of winner, loser, part (files, data bytes, code sites) and count. romfs.c fills
it for files, mods_exefs_apply for the data bytes two mods stored and for the contested code sites. The log has both
directions per entry and one line per contested code site; each row of the Mods tab lists what the mod overrides and
what overrides it.

Use without its code: a per-mod switch under the row of a mod with a code module or an ExeFS patch file the port
cannot apply (mods_no_code in totk.ini, off by default). On, that code is left out and the rest of the mod is used;
the row says what is left out and why. mods_without_code = 1 holds it on for every mod and now covers the
unsupported patch files too.

--probe-mods: order to winner at contested sites in both orders, the same-mod tie, a switched-off mod, a run-time
switch of the winner, the conflict table for data and code, the per-mod switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:11:43 +03:00
8e098e95a8 A mod with a code module the port cannot run can be used without it (mods_without_code)
Taken from PR #790, which carries Eric Dallo's work from his fork (ericdallo/totk-pc-recomp, 6241358f): only its
mods_without_code part, adapted to dev, which has the ExeFS data writes already (#835) and no plugin runner. A mod with
an exefs/subsdk* or a replaced exefs/main stays off as a whole; mods_without_code = 1 under [mods] uses the rest of it
(RomFS files, cheats, ExeFS patch files) without that code. ModInfo.code names the modules that do not load; the
scan logs it, the Mods tab says it on the mod's row and shows the switch once such a mod is there.

Co-Authored-By: itaskaev2 <165683571+itaskaev2@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:56:42 +03:00
Valiantsin DzerakhandClaude Opus 5.5 684ca3d9f3 Merge pull request #1237: barrier_merge, off by default, keeps a render pass open through the game's texture-invalidating barriers (ripps818)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:28:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 005881da20 barrier_merge docs name the by-region limit instead of an unexplained edge difference
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:05:34 +03:00
Valiantsin Dzerakh 589e1cc03c Merge branch 'pr/1237' into task/pr1237 2026-11-16 17:50:44 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a16120452d Merge pull request #1233: falling rain draws with shadow storage (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:50:29 +03:00
Valiantsin Dzerakh c9f155b72f Merge branch 'pr/1239' into task/pr1239 2026-11-16 17:48:33 +03:00
itaskaev2andClaude Opus 5.5 0a92f9b186 Hold Reflex to the pacer's frame limit, so fps_limit = display no longer caps it at 60
reflex_apply_locked read TOTK_FPS_LIMIT with cfg_int, which turns "display" into the setting's default, 60: with
Reflex on, a 144 Hz monitor stayed at 60 fps. It now takes frame_step_limit_hz, the rate the pacer holds (the
setting, the monitor's rate for display, 60 without the real-time step), and checks it on every present, as the
window measures the monitor's rate after the swapchain is made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:12:34 +01:00
ripps818andClaude Sonnet 5.5 61a407b0e1 Add barrier_merge: keep a render pass open through the game's texture-invalidating barriers
The runtime ended the Vulkan pass at every game Barrier. A Barrier that asks only for fragment ordering and texture
invalidation (ORDER_FRAGMENTS | INVALIDATE_TEXTURE) now leaves the pass open when none of the pass's draws can write a
storage buffer or image, and the next draw sees the writes through a by-region barrier in the feedback layout. Off by
default (barrier_merge = 0, TOTK_BARRIER_MERGE). TOTK_TRACE=gfx also prints how many passes ended by a change of targets
and by the game's Barrier, how many Barrier calls were merged and which NVN barrier bits they carry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 22:00:38 -06:00
ipavlin98 77a52e4577 TOTK_WB_MERGE=0 also turns off the shadow storage's word merge, so the two can be compared 2026-11-16 03:55:56 +03:00
ipavlin98 cabbfc5c86 Shadow storage merges pending GPU writes word by word in both directions, so falling rain draws with shadow = 1: the CPU copy into the shadow skipped every range a recorded GPU write covered, and the particle buffer the rain shaders update is always one, so new drops never reached the GPU, and the copy back at the fence put the shadow's whole range over them 2026-11-16 03:46:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c5b1cc7fac The GPU address map for device faults is off by default (#1174)
With VK_EXT_device_address_binding_report enabled, AMD's Windows driver (26.10.1) tracks every bound range in a
chained hash map that it searches on nearly every recorded command. The chains grow as textures stream in and out, so
after 5-10 minutes in a busy area recording a submission cost 3-4 times more and an RX 9070 XT fell from 60 to 20-30
fps. The map only serves the fault report after a device lost, so TOTK_ADDR_REPORT now defaults to 0 and =1 turns it
on for a run that chases a fault. ADDR_REPORT is a known key now, so the ini line no longer logs "unknown key".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:13:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ccf9837764 TOTK_BIND_INC is off by default
With it on, a GTX 1050 Ti lost the device at one place in the world, after the validation layer reported a descriptor
pool reset while a command buffer still used it and binds of that pool's sets. The cause is not found and the slower
diagnostic runs did not bring the loss back. bind_inc saves about 1% of the frame, so it waits until the cause is known;
bind_inc = 1 in totk.ini still turns it on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:11:50 +03:00
codexx-dev fc87618233 Demote instead of OpKill on AMD's drivers so a discard keeps the quad's derivatives defined (#164) 2026-11-14 21:25:22 -03:00
Valiantsin DzerakhandClaude Opus 5.5 0ce53aa7c7 The DualSense and DualShock 4 touchpad click is a bindable gamepad input named touchpad, shown and captured on the Controls tab (#482)
PAD_TOUCHPAD follows the paddles in input_map.h and reads SDL_GAMEPAD_BUTTON_TOUCHPAD in input.c pad_physical, so
input_capture sees the click when a Controls cell waits for a press (#852 had no pad id to report it). It is unbound by
default; pads without a touchpad never report it held.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 22:19:51 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2f32f21f5c The incremental draw preparation is on by default, and bind_inc and memx are listed in totk.ini.example (#381)
TOTK_BIND_INC had no settings row, so unset meant off. It now has one with default 1, like TOTK_MEMX: 0 or off turns
it off, check keeps the comparison mode. The check mode found 0 differences on 13 scenes (town, fight2, Kakariko,
Great Sky Island, Depths lit and dark, a shrine, rain, a cave, evening, a field, the menus, entering a building).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 20:03:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d52c16e651 Merge dev into task/bindinc: the incremental binding keeps its logic and takes dev's inline compares and copies (TOTK_MEMX)
The ten conflicts in runtime/vk_exec_draw.c were dev's memcmp/memcpy -> MX_EQ/MX_NE/MX_CPY swap on lines task/bindinc
had rewritten. Each keeps the task/bindinc code with the swap applied to its hot-path compares and copies (push and set
signature compares, the shader memo's pipe compare, the pipeline memo and recorded-state compares, the vertex
attribute and stream lists). The check-mode compares that call bi_mismatch keep memcmp as the reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 18:47:31 +03:00
Valiantsin DzerakhandClaude Opus 5.5 35c590bacd Start the Linux rebuild through the AppImage file, not its vanished mount
The setup wrote the path of its Python inside the AppImage mount into
build-cache/rebuild.txt. The mount is gone once the setup exits, so the
game could not start the rebuild for code cheats and ExeFS patches, kept
its old code, and rebuild.skip then stopped every later attempt. The
command now starts $APPIMAGE --rebuild <install folder>, and a rebuild
that does not start leaves no rebuild.skip (#560, #403)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:12:35 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3fc643cb65 Merge pull request #996 into task/pr996: lift again only the chunks whose inputs changed
The conflict in recomp/gen.py was the Usage line and the options next to --v-locals and --v-trust; both are kept, and
v_locals and v_trust are in the Emitter options the cache key holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:16:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e654aa288f Merge pull request #1165 into task/prfix: SHADOW is a known totk.ini key (itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:34:52 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ff3a95d0f1 A draw whose pipeline state no op changed takes the previous draw's pipeline and state without building and comparing them (TOTK_BIND_INC)
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>
2026-11-13 23:42:11 +03:00
Valiantsin DzerakhandClaude Opus 5.5 2abfa23a67 Bind ops mark the slots whose bytes they changed and a per-draw census counts what the next draw could keep (TOTK_BIND_INC)
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>
2026-11-13 23:40:01 +03:00
Valiantsin Dzerakh 1a1f21ebe0 Merge branch 'dev' into task/vloc 2026-11-13 20:11:40 +03:00
Valiantsin DzerakhandClaude Opus 5.5 44bc5887f0 gen.py keeps 8 V registers per function in locals by default
K = 8 cut guest time 3.9-6.2% in the town on a 7900X against K = 0. func.py tests the same default; --v-locals 0
gives the previous output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 20:11:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 eb8c7ea888 gen.py --v-locals K keeps the K most used V registers of each function in C locals
recomp/vlocals.py rewrites each emitted function: c->v forms become the RT_VLOCALS accessors of runtime/simd.h, the
K registers the function names most get bits in VMASK, they are loaded at entry, stored where the dirty mask may hold
them before calls and exits, and reloaded after calls; --v-trust skips the reload of V8-V15. A function with a form the
rewrite does not know keeps every register in the Cpu. K = 0, the default, emits the same C as before. The manifest
counts the rewritten functions and syncs. tests/diff/func.py takes --v-locals, --v-trust and --work (one work
directory per concurrent run).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:40:05 +03:00
itaskaev2andClaude Opus 5.5 5c57d94098 List shadow among the known settings and document it as a totk.ini key
The runtime reads TOTK_SHADOW through cfg_get, so `shadow = 1` in totk.ini already turns shadow storage on, but the
key was missing from cfg.c known[]: every such totk.ini logged "unknown key 'SHADOW'", which reads as if the line did
nothing. The docs only named the environment variable.

known[] now has SHADOW, totk.ini.example describes `shadow` next to sync_ahead (which needs it), and the sync_ahead
text, its log line, docs/building.md and docs/architecture.md name the totk.ini key next to TOTK_SHADOW. Behaviour is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:41:44 +01:00
Valiantsin DzerakhandClaude Opus 5.5 e6839387fc Merge task/abilityguard: a stale Recall / Ultrahand target is dropped only where the game would fault on it, replacing the 4 GiB target check, and the model scene report loop gets a bound (#1005, #1137, #1145)
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>
2026-11-12 19:57:07 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bc578148ab Write RomFS layout folders only for the screen shapes and prompts this player uses
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>
2026-11-12 19:02:31 +03:00
Valiantsin DzerakhandClaude Opus 5.5 df3e90dc4c Merge task/pr1136: opt-in gameplay tweaks for keyboard and mouse, the wheel turns and moves an Ultrahand object, switches weapons, steps the D-pad strips and zooms the map smoothly (RxEmam)
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>
2026-11-12 18:29:37 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a9de583d79 Merge pull request #1002: game 1.1.0 gets the core frame and camera patch sets of 1.2.1 and 1.4.3, so the frame rate, cursor, field of view and aspect ratio options work on it (shenjackyuanjie)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:29:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d14e2a8f62 Merge pull request #1136 into task/pr1136
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:21:53 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b6c5d37fb7 Merge pull request #1115: on Linux the menu asks fontconfig for its CJK font before the five fixed paths (jcleng)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:57:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 608f915156 Merge pull request #1118: the game window's own pointer image returns as pointer_image, off by default (itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:57:00 +03:00