Commit Graph
1116 Commits
Author SHA1 Message Date
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 4e3464767e Merge pull request #1164 into task/prfix: A chunk of the chunked replay records a new pool-bound image's first transition and clear in its own command buffer, which removes the black strip by the quick menu (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:34:52 +03:00
Valiantsin DzerakhandClaude Opus 5.5 06088863bc Merge pull request #1163 into task/prfix: DLSS arms only on a light target more than half the scene size, so the frame no longer goes dark when the quick weapon menu closes (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:34:52 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b8800bac86 Merge pull request #1162 into task/prfix: DLSS arms only on a light target of the scene's shape, so the inventory icon no longer stretches over the menu (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:34:51 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d77a637053 Merge pull request #1184 into task/prfix: DLAA ends the scene only at a bloom pass of the scene's shape without depth, so distant mist no longer flashes (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:34:48 +03:00
ipavlin98 c18f3d6c5c End the DLAA scene only at a bloom pass of the scene's shape without depth, so the sky lookups and the quarter-size particles that follow transparents drawn early no longer end it before the mist, which DLSS then missed on runs of frames and the distant mist flashed between them 2026-11-14 05:37:10 +03:00
ipavlin98 a02413d2f6 Keep DLSS on frames where the game draws a half-size mip chain of the scene before the light target: the bloom chain's start now needs level 0, as the chain's level 1 ended the scene before anything was armed, DLAA skipped those frames and the picture flickered between anti-aliased and plain ones 2026-11-14 05:37:10 +03:00
Valiantsin DzerakhandClaude Opus 5.5 673229727d Merge task/vloc: lifted functions keep their 8 most used V registers in host registers, 4-6% less guest time in a town
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 20:42:31 +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
Valiantsin DzerakhandClaude Opus 5.5 520e80eb18 simd.h reaches V registers through macros that a chunk built with RT_VLOCALS maps to function locals
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>
2026-11-13 19:05:12 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a5b3fcdc92 Merge task/patchside: ov_ability.c is compiled per install, so a release starts on 1.4.3 again, and the library build stops on any source with a per-version header (#1005)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:07:47 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bdba6ba83f Compile ov_ability.c per install, so 1.4.3 starts from a release again
The ability target guard registers its host function on the game version's patch page (patches.h), but it was left
out of INSTALL_SIDE and went into libtotkrt.a, which make_release builds once from 1.2.1's generated headers. On a
1.4.3 install that address lies inside sdk and dispatch stops at start ("host function at 0x700472bf60 lies inside
module sdk"). The library build now also stops when a library source includes a per-version header. (#1005)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:06:37 +03:00
ipavlin98 1a3b2936d6 Arm DLSS only on a light target more than half the scene's size, so the half-size effects target that armed on frames around the quick weapon menu, where the half-size G-buffer came first, is no longer scaled to the output in place of the scene 2026-11-13 08:46:42 +03:00
ipavlin98 6ef1eafca7 Arm DLSS only on a light target of the scene's shape, so the square targets the inventory renders item icons into are no longer scaled to the output and drawn over the menu 2026-11-13 08:46:41 +03:00
Valiantsin DzerakhandClaude Opus 5.5 00baa18d14 Merge task/pr1146: pull request #1146, separate Music, SFX and Voice volume settings in the Sound menu; sounds are classified by their RomFS names, BARS entries and ADPCM coefficient tables, only while one of the three is below 100 (#722, RxEmam)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 08:38:24 +03:00
ipavlin98 cefc618f70 Record a new pool-bound image's first transition and depth clear inside the chunk that makes it, at its op, so the clear no longer runs after the chunks already on the GPU and blanks a strip of what they rendered into the shared storage, seen for a frame right of the quick weapon menu while its icons are drawn 2026-11-13 08:38:20 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f83fdbbd0b The music, effects and voice volumes classify nothing at their defaults, look a voice up once per wave buffer, and count unmatched sounds as effects (#722)
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>
2026-11-13 08:38:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 25f42aa84e Merge pull request #1146 into task/pr1146: separate Music, SFX and Voice volume sliders
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 08:26:13 +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 49e990fedf Merge task/pr552: pull request #552, the HDR tonemap rebuilds bright colours from the game's SDR picture with RenoDX's MacLeod-Boynton hue and purity transfer, Neutwo peak mapping and gamma 2.2 correction, replacing #442's highlight blend; hdr_hue now scales it (Zenrap0518)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:21:59 +03:00
Valiantsin DzerakhandClaude Opus 5.5 97dd94eb99 The HDR hue setting drives the RenoDX colour reconstruction, its matrix chains fold at compile time, and the notices name the adapted code
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>
2026-11-12 23:21:04 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9902e01aae Merge pull request #552 into task/pr552: RenoDX's colour reconstruction for the HDR tonemap
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>
2026-11-12 23:20:36 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c89b0f3ee3 Merge task/abilguard2: the Recall / Ultrahand target check also drops a target whose link record points into unreadable memory (#1005, #1137, #1145)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:31:46 +03:00
Valiantsin DzerakhandClaude Opus 5.5 47e6d908f7 The ability target check also drops a target whose link record the game would follow into unreadable memory (#1005, #1137, #1145)
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>
2026-11-12 20:31:40 +03: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 ad54ab4910 Merge task/promptgen: the setup writes the shaped RomFS folders only for the player's screen shapes and prompt style, one folder per shape instead of per size, and the settings menu can prepare a missing one
Before, the setup wrote every prompt style for all 15 sizes: 64 folders, about 6.5 min and 370 MB of Common layout
archives. Now the four 16:9 folders stay, PcPrompts writes only the 16:9 keyboard prompts from the bind_ lines, and
the new Shapes step writes the layout and the selected style's prompts for the shapes of the connected displays and
the configured output_res. The game maps a resolution to its shape's folder, an exact-size folder from an older
install still wins, and the game-resolution row offers to start the generator for a missing shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:03:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 fa524128ce The settings menu starts each shape's generator once per game start and draws the keyboard prompts from the bindings
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>
2026-11-12 19:02:31 +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 887ce32343 Open the wheel's weapon bar only where the camera hooks saw free roam, a lock-on or a mount
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>
2026-11-12 18:29:24 +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 2e494481d3 Smooth map zoom takes the wheel only on the map menu_cursor.c finds
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>
2026-11-12 18:25:40 +03:00
0xEmz 1f224dc0f9 Add separate Music, SFX, and Voice volume sliders (#722)
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.
2026-11-12 17:25:33 +02:00
Valiantsin DzerakhandClaude Opus 5.5 8ef46a245a Name Ultrahand as the game does in the Russian and Portuguese gameplay tweak texts
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>
2026-11-12 18:25:14 +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 24be739310 Merge pull request #1142: the setup names an antivirus or a running game when it cannot write totk.exe, instead of the bare compile failure (itaskaev2) (#1122)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:19:47 +03:00
itaskaev2andClaude Opus 5.5 f854d67e6f Name the other program that holds totk.exe when the setup cannot link it
When ld.lld cannot write the totk.exe it links in the setup's temp build folder (Permission denied), the setup
showed only "Compiling totk.exe failed". In #1122 the holder was an antivirus that flagged the new exe, not a
running game. The compile step now recognises that failure in the build log and says what to do: close the game,
exclude the setup's and the install folder from the antivirus, restart Windows and run the setup again. Texts in
en, ru, pt-BR and zh-Hans; build_game.py's own line names the antivirus too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:17:51 +01: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
Valiantsin DzerakhandClaude Opus 5.5 357d148066 Merge pull request #1128: the chunked replay no longer freezes or crashes in chunk_record with replay_workers above 0, the target history's oldest-way search stays in its set (ipavlin98) (#1104)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:57:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 7692aabdc5 Merge task/vkey: a freed holder behind the optional reference at object +0x6b0 no longer crashes the game in main+0x1bd0138 / 0x1622bec, its target counts as absent (#1005)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:47:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b80a568df5 Treat a target below 4 GiB behind the optional reference at object +0x6b0 as absent, so the freed-holder crash in main+0x1bd0138 stops on 1.4.3 and 1.2.1 (#1005)
The holder of the PlayerVirtualKey request can be freed while the request still points at it; its first word then reads
as a small number and the game dereferences it as the target actor. No guest object lives below 2^32, so such a target
now takes the game's own branch for a null target. Same TOTK_OPTREF_GUARD switch as the existing optref site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:47:32 +03:00
0xEmz 312e59a9f7 Add optional mouse wheel and keyboard gameplay tweaks (gameplay_tweaks_enabled, off by default). 2026-11-12 03:29:24 +02:00
ipavlin98 3a8f93c64b Pick the oldest way of a target history set by index from the set's start, so a new target no longer overwrites the chunked replay's state (#1104)
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.
2026-11-11 23:51:01 +03:00
Valiantsin DzerakhandClaude Opus 5.5 0ded6164a0 Describe optref_guard, ability_guard and report_guard in docs/settings.md (#1005)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:19:05 +03:00
Valiantsin DzerakhandClaude Opus 5.5 42c458712d Crash guards switchable from totk.ini: optref_guard, ability_guard, report_guard (#1005)
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>
2026-11-11 17:16:10 +03:00
Valiantsin DzerakhandClaude Opus 5.5 5d8c2ceb30 Drop an ability target only where the game would fault on it, and keep the live-actor test as a log line (#1005)
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>
2026-11-11 16:59:35 +03:00
itaskaev2andClaude Opus 5.5 fc985e690e Bring back the game window's pointer image as pointer_image, off by default
#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>
2026-11-11 14:48:24 +01:00