Commit Graph
1053 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 507e27da91 Treat an invalid optional reference at object +0x6b0 as absent on 1.4.3, so the random crash in main+0x1bd0138 stops (#1005)
The game checks the reference only for null, and players' crash dumps show it holding 0xffffffffffffffff after minutes to hours of play. MacNativeGames met the same field holding 0xffff0000ffffffff during a save load. Set optref (TOTK_OPTREF_GUARD, on by default) turns the cbz into a test for null or negative; valid holders are heap addresses below 2^63.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:26:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 0fef33ce30 Merge task/pr1112: DLSS upscaling on 1.2.1 shows the whole picture, the game's own scaling draw is skipped after DLSS (#1112 by itaskaev2, #1106)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:42:34 +03:00
Valiantsin Dzerakh 346f22bbd4 Merge pull request #1112 into task/pr1112 2026-11-11 14:41:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a143cc1e6e Merge task/pr1087: grass_range, how far around the camera grass grows, off by default (#1087, #1085 by itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:53:25 +03:00
itaskaev2andClaude Opus 5.5 be5f4db3bf Skip 1.2.1's own scaling draw after DLSS instead of feeding it DLSS's picture (#1106)
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>
2026-11-11 11:53:25 +01:00
Valiantsin Dzerakh 873fc64b41 Merge pull request #1087 into task/pr1087 2026-11-11 13:20:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 11c3ce1319 Merge task/kbmwave: T in the PC text prompts, opt-in mouse clicks on the map and in dialogue, the mouse wheel in menus, strips and the camera (#1098, #1096, #1097, #1092, #356, #62, #147)
Pull requests by lwj10case (#1098, #1096, #1097) and itaskaev2 (#1092); #1092's pointer image left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:18:29 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6576272a15 Leave the pointer image of pull request #1092 out: it changes the pointer for every player without a switch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:13:22 +03:00
Valiantsin Dzerakh deba1a9b82 Merge pull request #1092 into task/kbmwave
# Conflicts:
#	runtime/input.h
#	runtime/menu_cursor.c
2026-11-11 13:12:21 +03:00
Valiantsin Dzerakh fc1cf24c42 Merge pull request #1097 into task/kbmwave
# Conflicts:
#	docs/controls.md
#	runtime/cfg.c
#	runtime/input.c
#	runtime/menu_cursor.c
#	runtime/ui/menu.cpp
#	runtime/ui_text.c
#	runtime/ui_text.h
#	totk.ini.example
2026-11-11 13:11:10 +03:00
Valiantsin Dzerakh 24bcc546e9 Merge pull request #1096 into task/kbmwave 2026-11-11 13:10:00 +03:00
Valiantsin Dzerakh 6ec533524c Merge pull request #1098 into task/kbmwave 2026-11-11 13:10:00 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f23dc9ffb2 Merge pull request #1101: a mod's file named for another game version is served under its own name, so a sound mod that ships one plays (xellow78-lgtm)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:08:04 +03:00
Valiantsin Dzerakh 05003d517d Merge pull request #1101 into task/pr1101 2026-11-11 13:06:28 +03:00
Valiantsin DzerakhandClaude Opus 5.5 725c76b213 Merge pull request #1108: escape the pipes that split two docs tables and unlink the missing docs/milestones folder (viwe-monai)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:04:54 +03:00
itaskaev2andClaude Opus 5.5 9577d31f8b Zoom the Purah Pad's camera with the mouse wheel
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>
2026-11-11 10:23:19 +01:00
itaskaev2andClaude Opus 5.5 722a9c972a Describe the menus' dead zone and the pointer image in docs/controls.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:11:28 +01:00
viwe-monai 3360eca908 docs: escape table-splitting pipes and unlink the missing docs/milestones dir 2026-11-11 16:48:11 +08:00
itaskaev2andClaude Opus 5.5 c0ca89fdda Keep the wheel's focus until the pointer leaves a dead zone, and draw a pointer of our own
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>
2026-11-11 09:44:01 +01:00
Louis JusticeandClaude Opus 5.5 9f17d7899d Turn map_click off by default, so each key presses one controller button unless the player opts in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:54:30 -05:00
Louis JusticeandClaude Opus 5.5 b477b489ff Turn dialogue_click off by default, so each key presses one controller button unless the player opts in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:54:10 -05:00
Louis JusticeandClaude Opus 5.5 34ee6684a9 In dialogue the left mouse button presses B and the right one A instead of their bindings (dialogue_click, game 1.4.3).
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>
2026-11-10 19:38:43 -05:00
itaskaev2andClaude Opus 5.5 a10c546a06 Scroll with the mouse wheel in the game's menus and along the D-pad strips
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>
2026-11-11 00:23:48 +01:00
Louis JusticeandClaude Opus 5.5 c2716d2e7c The keyboard and mouse text prompts show Y as T, and the setup draws the PC prompts from totk.ini's bindings.
Y has two default keys: the left mouse button, which is a menu's A while the pointer is shown, and T, which presses Y
everywhere. The button font (menu guides, the dialogue log) now shows Y as its first bound key that is not a mouse
button; the button guide in play and the action prompt keep the left button. The PC prompts are a setup step of their
own, keyed by the bind_ lines of the install's totk.ini, so running the setup again after rebinding redraws them
without preparing the shaders again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:11:38 -05:00
Louis JusticeandClaude Opus 5.5 1becabd8f6 The left mouse button presses A on the Purah Pad's map instead of its binding (map_click, game 1.4.3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:27:03 -05:00
Valiantsin DzerakhandClaude Opus 5.5 cc2b77bc4f Merge task/pr913: NVIDIA Reflex low latency, off by default, NVIDIA only (#913, #638 by STS78721, carried by itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 23:28:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 7fa727bbc5 Skip the present lock for the Reflex frame ID when nothing reads it, and declare the front end's Reflex calls in gfx.h
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>
2026-11-10 23:24:11 +03:00
Valiantsin DzerakhandClaude Opus 5.5 52b099bacb Merge pull request #913: NVIDIA Reflex low latency, off by default (#638 by STS78721, carried by itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 23:21:50 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9f062e1d27 Merge task/pr864: tests/run_all.py runs every test with its interpreter, from pull request #864 (#675 by zzs181, carried by itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 23:08:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bb339a614d Import at the top of tests/run_all.py and list cheats_vm_check
json, shutil and tomllib were imported inside the functions that use them. cheats_vm_check came into dev after the
table was written; it compiles runtime/cheats.c with clang like mouse_direct_check, so it takes the same cc need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 23:08:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8fc4d0a2d2 Merge pull request #864: tests/run_all.py, one entry point for the tests (#675 by zzs181, carried by itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 23:04:41 +03:00
toadjiangandClaude Opus 5.5 5e6ebd8bbc Free all DLSS size slots when the preset changes
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>
2026-11-10 23:02:05 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1cbe7bdb79 Merge pull request #990: the AppImage shadow test refuses a venv interpreter instead of passing without the user site (jay23606)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 22:59:10 +03:00
Valiantsin DzerakhandClaude Opus 5.5 dd91d60ba3 Merge pull request #1075: unpack a release archive again when its pin changes (ipavlin98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 22:57:47 +03:00
Valiantsin DzerakhandClaude Opus 5.5 89de7b6c6e Merge pull request #1071: describe climb_fix in totk.ini.example (itaskaev2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 22:57:46 +03:00
Claude 2cc0a4eaa6 Serve a mod's file named for another game version under its own name instead of leaving it out
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
2026-11-10 14:32:15 -05:00
itaskaev2andClaude Opus 5.5 9680b8e6ec Add grass_range: how far around the camera grass grows
The game grows grass blades only inside its near grass map, a 62.5 m square around the camera drawn into 256x256 and
128x128 textures, so on open meadows the grass appears a short way in front of the player. grass_range (percent, 50
to 400, default 100) scales the map's extent, step and both textures together through a new grass patch set (1.2.1
and 1.4.3) that loads them from patch page +128..+144, and grows the HeapDef grass heap and the application pool for
the larger textures. At 100 the set stays off and nothing changes. A row in the Display menu, text in all four menu
languages, and totk.ini.example describe it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 20:13:59 +01:00
ipavlin98 5956d6dd46 Unpack a release archive again when its pin changes instead of reusing the old archive's files 2026-11-10 21:08:37 +03:00
itaskaev2andClaude Opus 5.5 95052a280e List the tests added since, and the differential tests, in tests/run_all.py
The table predates exefs_patches_test and leaves out settings_doc_check, mouse_direct_check and tests/diff. A name may now name a script below tests/ (diff/simd), and a need of a compiler (cc, which mouse_direct_check passes as --cc) runs without --all, as only game files, a build, the embeddable Python and a desktop wait for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:21:14 +01:00
zzs181 5635dd5e3a Let a test need more than one thing, and find the romfs where it actually lives
mods_romfs_check needs both a built totk.exe and the extracted romfs, and the romfs was hard-coded to build/extracted/<version>/romfs in two places inside the test. Needs now compose with '+' (exe+romfs) and each gets its own placeholder, the romfs is found in the extracted tree, the work dir or the GUI builder's record (build/build_gui.json), and any build/v143-*/totk.exe counts as the built exe - so the test runs on the layouts people actually build in instead of failing on a path it assumed. The test takes --romfs; its default is the old path, so running it by hand is unchanged.
2026-11-10 18:21:14 +01:00
zzs181 88cd32fddf Add tests/run_all.py: one entry point for the tests, each with its interpreter and needs
Each test already says in its header how it wants to be run; this reads that intent into one table (.venv for the lifter, .venv-py314 for the extraction tools) and runs them all:

    python tests/run_all.py                 # the ones that need no game files
    python tests/run_all.py --all           # also the ones that read game files or a built totk.exe

A need that cannot be met here is SKIP with the reason, never a failure: a missing game dump is not a broken build. Exit is 0 when nothing failed, 1 when something did. Windows picks clang up from C:/msys64/ucrt64/bin for the tests that compile C; on any other host the PATH is left alone. No third-party imports, so this runs before any venv is trusted.
2026-11-10 18:21:14 +01:00
itaskaev2andClaude Opus 5.5 6d6b66461b Reflex: one present ID per frame from its start to its present; mode again on a new swapchain; presentId feature
The latency markers and the present carried different present IDs: g_reflex_present_id went up only in flip_locked, so
frame k's simulation, input and submits had ID k and its present k+1 (and with frame_queue or replay_async frames could
share one). Each frame now gets its ID once, when the game acquires its window texture (SIMULATION_START,
vk_reflex_frame_begin), and carries it: INPUT_SAMPLE and SIMULATION_END take the game's current frame, a submission
the frame of the thread that submits it (the game thread's, or the one the replay thread got with its ReplayItem, or
the present thread's from its PresentJob), and the present the frame of its blit (PresentJob.pid -> g_flip_pid). A
present without a frame ID takes the next value, as present IDs must grow on a swapchain.

From the review: a new swapchain sets the sleep mode again (it starts with low latency off), Reflex is off without the
presentId feature, REFLEX sorted in known[], and the ru and pt-BR descriptions name the Boost option as the menu does.

TOTK_TRACE=perf logs every 600 presents the frame start to present time, and with Reflex on how many of the driver's
reports (vkGetLatencyTimingsNV) came back with every marker and their simulation start to GPU render end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:20:16 +01:00
itaskaev2andClaude Opus 5.5 41623cec85 Call vkLatencySleepNV under the present lock
The swapchain must be externally synchronised, and the acquire and the present use it under g_pl on the present
thread while the game thread calls vk_reflex_sleep. With reflex = boost and TOTK_VK_VALIDATION=1 the validation layer
reported 20 threading errors in 30 s (vkLatencySleepNV against vkAcquireNextImageKHR and vkQueuePresentKHR). The
earlier head of #638 (318acd8) took the lock here; the rebase onto dev lost it. The semaphore wait stays outside.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:20:16 +01:00
itaskaev2andClaude Opus 5.5 c811d0e06d Carry Reflex's present ID through the recorder's submission
vk_sync_submit chains a VkLatencySubmissionPresentIdNV when the device has VK_NV_low_latency2, and on dev the
recorder thread (on by default except on AMD) makes that submission. rec_submit stopped the process on any pNext,
so every NVIDIA GPU with the extension would have failed at its first recorded submission. The recorder now copies
the present ID into its packet and chains it again in submit_run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:20:16 +01:00
Tears of the SteelTemple 3209ea4358 Implement Native NVIDIA Reflex Low Latency (VK_NV_low_latency2)
- Enable VK_NV_low_latency2 and VK_KHR_present_id with present ID features
- Add VkSwapchainLatencyCreateInfoNV to swapchain creation
- Link present and submission IDs with standard Vulkan latency types
- Insert latency markers: simulation start/end, input sample, render submit, and present
- Gate all extensions and latency chains on reflex != off (RESTART setting)
- Log graceful notice when Reflex is requested on unsupported hardware
- Add UI menu setting and translations for en, ru, pt-BR, zh-Hans
- Document reflex setting in totk.ini.example and docs/settings.md
2026-11-10 18:20:16 +01:00
itaskaev2andClaude Opus 5.5 2a564f648c Describe climb_fix in totk.ini.example
tests/settings_doc_check.py failed on v0.4.0: CLIMB_FIX is in known[] and described in neither file. It is a player
setting with a menu toggle under [frame rate], so it goes next to highfps_fix; frame_rate.c turns it off without the
real-time step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:11:32 +01:00
Valiantsin DzerakhandClaude Opus 5.5 7a37fc3c34 Up version 0.4.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.4.0
2026-11-10 19:25:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bb8b4b1797 Turn the recorder thread on by default on AMD GPUs too; vk_recorder = 0 turns it off where the device is lost
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:25:37 +03:00
Valiantsin DzerakhandClaude Opus 5.5 396c4ae621 Describe the profile-guided build in docs/pgo.md: where and how to train, free play, merge, measure
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:07:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 27a63dfb0f Merge pull request #1065: Xbox prompts at every game resolution the setup lays the UI out for (cdonatom, #378)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:59:22 +03:00