Commit Graph
302 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 a76224f8a6 Fail the install when romfs/ is gone or unreadable after cleanup
An install whose romfs/ went empty and unreadable after the extraction had verified it (a folder Windows was still
deleting) ended with result ok, and the game stopped at its first file read. Cleanup now checks that romfs.bin and
index.json are still there, match the verified size and hash record, and that romfs.bin opens; otherwise it fails with
cleanup.romfs_unreadable, which tells the player to restart Windows and run the installer on the same folder (resume
extracts the game data again). Reported in #107.

tests/installer_test.py CleanupTest: an emptied, removed or resized romfs passed cleanup before, fails now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:42:03 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8ba0d5ce15 Merge task/amdfix: 3D BC stand-ins and recorder-ended parts for AMD RDNA2 (#5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:39:36 +03:00
Valiantsin DzerakhandClaude Opus 5.5 efbff61306 Merge task/lowres: 1280x720 and 1600x900 game resolutions in the menu (#36)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:26:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 be4d8f5245 Merge task/sixaxis: drop six-axis samples from before StartSixAxisSensor (#104)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:26:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a90b1f4ca9 Merge task/audiolat: skip audio piled up after a device stall (#98)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:26:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 58e52aa180 Merge task/deadzone: stick dead zone setting (#12 #99 #111 #115)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:26:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 605662ca87 Offer 1280x720 and 1600x900 as game resolutions in the menu
The game resolution row started at 1920x1080 although resolution.c accepts sizes from 1280x720, so weak GPUs and
integrated graphics had to edit totk.ini to draw the game smaller. A 1280x720 run on 1.4.3 renders the field with a
1067x600 scene and an intact interface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:25:05 +03:00
Valiantsin DzerakhandClaude Opus 5.5 7d89fde2f0 Drop the six-axis samples from before StartSixAxisSensor
motion_restart only flagged the next sample to start a fresh frame, so a read in the frame of the Start returned the
previous session's 16 states as live, and for the next 60 ms 15 of the 16 were from before it, with the angle jumping
back to zero between two reads. Motion aim was dead when the bow was first drawn and lagged after that. A restart now
hides the older samples and zeroes the angle; sampling numbers keep counting.

--probe-services checks a restart in the middle of a turn: 16 old states in the Start frame before, none after.
Reported with the cause and a harness in #104.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:22:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 42a1d32710 Skip audio that piles up in the output ring so the sound delay stays short
A stalled audio device (a wireless headset waking up, a change of the default device) filled the 340 ms ring, the
render thread then dropped new frames and the queue stayed full for the rest of the session: about a third of a second
of delay on top of the device's own. ring_pull now skips what is queued beyond the prefill, the device's request and
40 ms. The 5 s level line (trace = audio) reports the queue and the skipped frames.

With the SDL audio thread suspended for 1.5 s: before, 325-340 ms queued for the rest of the run; after, 10 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:20:41 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ed1973a68b Add a stick dead zone setting for drifting gamepads
stick_deadzone (0 to 50 percent, default 8) replaces the fixed per-axis cutoff of 2500. The zone is round and the
travel past it is scaled to start at 0, so a drifting stick rests centred and full deflection still reaches full.
The Controls tab shows it as a slider; --probe-cfg checks the math (input_pad_stick).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:05:54 +03:00
Valiantsin DzerakhandClaude Opus 5.5 25b200f94c Draw 3D BC textures through stand-ins and let the recorder end its parts
AMD driver 26.10.1 on RDNA2 cards wrote past the end of a 3D BC4 volume made
BLOCK_TEXEL_VIEW_COMPATIBLE and 2D_ARRAY_COMPATIBLE, which lost the device at the
logo (issue #5). 3D BC textures no longer get block views: draws into a level go
to an uncompressed 2D array stand-in that is copied back at the pass end
(TOTK_BLOCK_VIEWS_3D=1 restores the old path).

Parts the recorder thread recorded and the submitting thread ended turned the
scene green, then white, on the same driver once a submission was split. The
recorder now writes the closing breadcrumb and ends the part itself
(TOTK_REC_END=0 restores the old split). The recorder stays off on AMD by default.

Based on the patch Pelipooper posted in issue #5; stand-ins extended to every
mip level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 23:50:02 +03:00
Valiantsin DzerakhandClaude Opus 5.5 fb06577c23 Target Windows 10 in the runtime flags so llvm-mingw sees the DPI functions
llvm-mingw's headers default to Windows 7 and hide AdjustWindowRectExForDpi, GetDpiForWindow and the other per-monitor
DPI functions, so the release toolchain failed on gfx_window.c and dpi_probe.c. MSYS2's headers already default to
Windows 10, the port's minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.1.6
2026-10-30 20:54:28 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6c27e70249 Raise the version to 0.1.6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:51:22 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b0ec992afd Merge task/cubeflag: cube compatible only for cube textures
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:30:12 +03:00
Valiantsin DzerakhandClaude Opus 5.5 4d7fa271d4 Make only cube textures cube compatible
Every square 2D array of 6 or more layers was created cube compatible, though the replay makes cube views only of
images whose own target is a cubemap or cubemap array (vk_exec_draw.c get_view). On AMD's Windows driver the flag
changes the image layout, and Savage Wind Recomp traced rainbow blocks on terrain that moved with the mip level to
it (their issue #59, BotW on an RX 580 and a 7800 XT); our AMD and Intel reports show the same symptom (#42, #67,
#81). The flag now goes to cube targets only, on every driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:15:39 +03:00
Valiantsin DzerakhandClaude Opus 5.5 332dfce18e Merge task/cmpfmt: depth twins for compare-sampled colour textures in compute passes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:09:42 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3b5469a83f Sample compare-sampled R32F and R16 textures of compute passes through a depth twin
TotK's compute passes sample a 4x4 R32_SFLOAT texture through a shadow sampler. Vulkan allows depth comparison only
on formats with SAMPLED_IMAGE_DEPTH_COMPARISON, which AMD's drivers do not give R32_SFLOAT, so the result there was
undefined (20 validation errors in 40 s of field play). Such an image now gets a D32_SFLOAT (or D16_UNORM) twin
copied through a buffer right before each dispatch that samples it, and the dispatch samples the twin. Formats the
driver compares as they are keep the colour image. TOTK_DEPTH_TWIN=0 turns it off. Design after Savage Wind Recomp's
depth twins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:09:36 +03:00
Valiantsin DzerakhandClaude Opus 5.5 fb13c05870 Merge PR #86: drop released textures that reload intact when video memory runs low
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:56:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1a689a5b1d Merge task/gpucrash: recorder thread off on AMD, GPL off on AMD's RDNA 1/2 driver, GPU breadcrumbs on a lost device
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:53:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 43704c0d9f Turn off the recorder thread on AMD GPUs and GPL on AMD's RDNA 1/2 driver, and log GPU breadcrumbs on a lost device
AMD drivers lost the device at boot or at menu opens with the recorder thread; vk_recorder = 0 ended it for three
RX 9070 XT users (issue #5), and RADV saw an illegal opcode at the end of a command buffer (issue #40). It now
defaults to off on vendor 0x1002; TOTK_VK_RECORDER=1 turns it back on.

On AMD's separate driver branch for RDNA 1/2 ("AMD proprietary shader compiler") every device loss came with a cold
pipeline cache and draws waiting on fast-linked pipelines, and the recorder setting did not help there. TOTK_GPL now
has no fixed default: off on that branch, on elsewhere.

VK_AMD_buffer_marker breadcrumbs (vk_crumbs.c) mark the start and end of each submission part, upload batch, ASTC
decode chunk and present; on device lost the log names the last point the GPU reached and the last one it finished.

vk_fsr.c ensure_images held no queue lock around vkDeviceWaitIdle, which needs every queue externally synchronized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:48:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 473acfda2e Merge task/nosleep: keep the display awake while the game window is up
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:37:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 09cf49ee25 Merge task/shaderlist: read the packed pipeline keys of the current shader list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:35:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3332250df4 Merge task/dpiaware: per-monitor DPI awareness for the window, fullscreen and the overlay
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:35:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 389a516f8d Read the packed pipeline keys of the current MacNativeGames shader list in prepare_shaders
Since MacNativeGames f024ef04 the R and B rows keep the key as "<vs variant>:<fs variant>:<rest>" instead of plain hex,
and parse_list stopped with a ValueError on a source checkout. The pinned release list parses as before (identical
variants and priorities); the current one gives 58053 variants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:35:10 +03:00
Valiantsin Dzerakh f930e56825 Merge task/fade: floor the 1.4.3 LOD and pre-actor fade increments at 1 2026-10-30 15:30:46 +03:00
Valiantsin DzerakhandClaude Opus 5.5 afa3607259 Keep the display and the system awake while the game window is up and not minimized
Windows turned the monitor off after its idle timeout during play, since gamepad input does not count as activity (#7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:30:16 +03:00
Valiantsin DzerakhandClaude Opus 5.5 39ab925588 Merge task/wbcap: diagnostic fence write-back limit and its trace log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:28:18 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6dbecab25d Merge task/amd-devlost: log the VK_EXT_device_fault report on device lost
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:27:58 +03:00
Valiantsin DzerakhandClaude Opus 5.5 bb1b675381 Floor the 1.4.3 LOD and pre-actor fade increments at 1
Above about 63.5 fps the fade step trunc(2.1 * ratio) is 0, so objects that start a fade stay translucent or
invisible until a slower frame moves them on (issues #10, #37). Switching to 60 fps and back cleared it because the
60 fps step is 1. Port of MacNativeGames' high-FPS fade fix as a fade set under TOTK_HIGHFPS_FIX.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:27:44 +03:00
Valiantsin DzerakhandClaude Opus 5.5 abb00c500c Add a diagnostics key for the fence write-back size limit and trace the targets it skips
wb_fence_limit (TOTK_WB_FENCE_LIMIT, default 65536) replaces the fixed 64 KiB limit of the write-back done when the CPU waits for a fence. With trace = gfx the log names each dirty target left on the GPU because of its size and each target over 64 KiB that a raised limit wrote back. Meant to test whether the fuse weapon switch bug (#18) and the Purah Pad camera bug (#13, #63) come from a target the game reads on the CPU without an invalidate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:27:42 +03:00
arthurhfcardosoandClaude Sonnet 5.5 444abcbebb Drop released textures that reload intact when video memory runs low
On a 4 GiB GPU the released-texture list (up to 2048 entries, each ASTC texture decoded to RGBA8) filled video memory and the heap spilled into system memory: a Depths lava scene went from 12 ms to 60 ms of GPU time per frame and about 16 fps. Above tex_vram_pressure percent of the device-local budget (default 90, 0 = off), each submit now destroys up to 32 of the oldest released entries.

Only entries that come back intact are dropped: mirrored textures the GPU never wrote, which are uploaded again from their storage. A render target exists only in its image; dropping those made textures come back empty (black flashes in the Depths boss fight, about 170 "left uninitialised" aliases a minute).

Adds the setting to totk.ini and the Advanced tab, and a perf log line with the released count and drops.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 09:26:36 -03:00
Valiantsin DzerakhandClaude Opus 5.5 fcaecabad4 Make totk.exe per-monitor DPI aware so fullscreen and the window use physical pixels
The manifest declared no DPI awareness, so Windows ran the process DPI-unaware: on a 4K monitor at 150% scale the
fullscreen window and its swapchain were 2560x1440, the 4K game image was shrunk to it and Windows stretched the
result back up, blurred (issues #25, #56, #31).

The manifest now declares PerMonitorV2 (true/pm for older Windows 10). The window frame is measured at the window's
DPI, a framed window keeps its client size when it moves to a monitor at another scale, WM_DPICHANGED takes the
suggested rect or keeps fullscreen over the monitor, and window_size means screen pixels. The menu's minimum text
size follows the window's DPI, and the text entry dialog is measured at the game window's DPI. --probe-dpi prints
the process awareness and fails unless it is per-monitor v2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:40:04 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8eaf198443 Merge task/fps90: offer 90 FPS in the frame rate limit menu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:30:29 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d8547a84ac Offer 90 FPS in the frame rate limit menu
GitHub issue #21 asks for a 90 fps limit. fps_limit = 90 in totk.ini already worked, because frame_rate.c accepts any whole
rate from 30 to 360 and cfg.c does not validate the values column. The menu row and the documented value lists did not
name it. Added 90 to the menu between 60 and 120 (new catalog id UI_MENU_FPS_90 in both languages), to the FPS_LIMIT
row in cfg.c and to totk.ini.example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:30:09 +03:00
Valiantsin DzerakhandClaude Opus 5.5 184d5798cd Merge task/zhlang: map zh-CN and zh-TW to the Chinese codes TotK accepts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:27:46 +03:00
Valiantsin DzerakhandClaude Opus 5.5 67116a387f Map the zh-CN and zh-TW game languages to zh-Hans and zh-Hant
Choosing Simplified Chinese in the installer wrote lang = zh-CN to totk.ini and the game showed Japanese: ov_language() handed the code to nn::oe::GetDesiredLanguage unchanged, and TotK only accepts zh-Hans and zh-Hant for Chinese. Reported in #72 and #68.

ov_language() now maps both old spellings, so existing totk.ini files keep working and cfg.c still accepts them. The F1 menu offers one row per language under the canonical codes. The installer lists only zh-Hans and zh-Hant, writes them, and reads zh-CN or zh-TW from the CLI or from a recorded totk-install.json as the canonical code, so a repair or update of an old install does not fail with check.lang_unknown and rewrites the ini. --probe-services prints the configured language and checks the four Chinese codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:27:19 +03:00
Valiantsin DzerakhandClaude Opus 5.5 112fb2dd74 Log the VK_EXT_device_fault report when the device is lost
vk_device_fault_report queries vkGetDeviceFaultInfoEXT once per process after VK_ERROR_DEVICE_LOST and logs the
description, the faulting addresses with type and precision, and the vendor codes. The submit, upload, occlusion
query and wait fatals call it before rt_fatal, and the present path calls it on a failed acquire, blit submit or
present. Threads that lose the device together wait until the report is written. The extension counts as usable only
when the driver reports the deviceFault feature. No cost unless the device is lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:21:14 +03:00
Valiantsin DzerakhandClaude Opus 5.5 30c6c13161 Merge task/linkcomma: link build folders that contain a comma
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:49:23 +03:00
Valiantsin DzerakhandClaude Opus 5.5 4a961a8b8d Pass the linker map path with -Xlinker so build folders containing a comma link
The installer names its temp folder after the game title (Legend of Zelda, The - ...), and clang splits -Wl, values at every comma, so lld received a truncated --Map path and a stray input file. Fixes issue 47.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:49:06 +03:00
Valiantsin DzerakhandClaude Opus 5.5 31c8caa45e Merge task/genmem: size the code generator's worker pool by free memory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:46:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a5711539e1 Size the code generator's worker pool by free memory so it stops running out of RAM
gen.py started one emit worker per CPU, about 1.3 GiB each on 1.4.3, so many-core machines with modest RAM died with a MemoryError during "Translating code to C" (issues 17, 28, probably 66). The default is now min(CPU count, 80% of the free physical memory / 1.5 GiB), at least 1, capped by the memory limit of the enclosing job object if there is one. --jobs still overrides it, and the chosen count and its reason are logged. The memory helper is tools/hostmem.py, shipped with the release tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:43:50 +03:00
Valiantsin Dzerakh c3b9a4e7f6 Update README.md 2026-10-29 18:05:56 +03:00
Valiantsin DzerakhandClaude Opus 5.5 701bd62820 Bump the version to 0.1.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.1.1
2026-10-29 17:54:04 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8691f6d724 Remap keys, mouse buttons and controller buttons from the Controls tab
Every Switch button and the eight stick directions the keys drive get two key cells and a controller cell under the
button layout. A cell takes the next key, mouse button or controller button pressed; a key in use moves over, a
controller button swaps. The tab writes bind_ lines (new: bind_LSTICK_* / bind_RSTICK_*, key:default, pad:default) and
input_win.c builds the tables again when one changes, so remapping applies while the game runs. More keys can be
bound: Enter, Backspace, right Shift and Ctrl, Alt, the numpad, punctuation, F2-F7, F9, F12, mouse buttons 4 and 5.
Alt alone no longer enters the window menu loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:53:57 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f307b1cdea Add a Planned section to the README and move the AI agents note to the end
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:22:37 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ba0f33e044 Pick the gamepad button layout by the pad's labels, with a Button layout row on the Controls tab
The gamepad map was by position only, so on an Xbox pad the button labelled A pressed Switch B. pad_layout = auto
(default) keeps the Nintendo layout for a pad whose east button SDL reports labelled A and uses the Xbox layout (south
A, east B, west X, north Y; cross A on a PlayStation pad) for the others; nintendo and xbox force one. It applies at
once; bind_ lines name physical buttons and apply on top of either layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:20:03 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f654da3d8b List the performance and diagnostics keys in totk.ini.example with what each does and its default
The file pointed at the Advanced tab for them; it now has every key the tab shows, grouped as the tab groups them, and
a [diagnostics] section for trace and the flight recorder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:20:03 +03:00
Valiantsin Dzerakh 75287586c9 Update README.md 2026-10-29 16:01:25 +03:00
Valiantsin DzerakhandClaude Opus 5.5 7beffd51a5 Add a funding link to the DonationAlerts page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 15:33:29 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f2800cb386 Copy build/<version>/romfs-patches into a build made in another directory: totk.exe loads the 60 fps overlay only from beside its romfs-index.bin, so task builds ran without it and the quick menus showed a black background
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 14:45:34 +03:00