Commit Graph
1501 Commits
Author SHA1 Message Date
Valiantsin Dzerakh 719cff3a4c Merge commit 'refs/pull/1384/head' of https://github.com/valentderah/totk-pc-recomp into task/pr1384 2026-11-23 18:25:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1b303282a3 Merge pull request #1372: the shader-cache packer reads the loose files on up to 8 threads (half the logical CPUs, 1 below 512 MiB free memory, 32 MiB read ahead, serial reads on any failure), with a byte-identical pack (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:24:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 fe8573916e Merge pull request #1368: FSR 3.1 and frame generation skip protected and AMD device-coherent memory types, which gave full-screen noise on RADV; the pick on Windows AMD is unchanged (gurrgur)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:43:36 +03:00
Valiantsin DzerakhandClaude Opus 5.5 96f9f868ba THIRD_PARTY_NOTICES.md counts the FidelityFX backend's memory type choice among our own changes to the SDK
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:43:07 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f1ec56b592 Merge pull request #1245: AMD FSR 4 upscales the 3D scene on Windows through AMD's signed FSR SDK 2.4 libraries (scene_upscaler = fsr4, off by default), and the setup can download them (codexx-dev) (#1409)
FSR 4 is a fourth engine of the scene upscaler beside DLSS and FSR 3.1 and takes their frame point, jitter, per-object
motion vectors, mip bias, fsr_sharpness, FXAA skip and dynamic resolution hold. The PR's dlaa_backend setting, its
FSR 3 through the DLL and its separate Upscalers row are left out: dev builds FSR 3.1 from the SDK 1.1.4 sources.
Checked on an RX 9070: FSR 4.1.2 at quality, 1280x720 -> 1920x1080, picture clean; without the DLLs the upscaler stays
off with a log line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:39:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e3befaebcc Merge pull request #1368: FSR 3.1 and frame generation skip protected and AMD device-coherent memory types (gurrgur)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:29:21 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9978eb2948 Merge pull request #1371: GPUs without VK_EXT_external_memory_host run on shadow storage instead of being skipped; GPUs with it see no change (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:27:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c581b779fa Size the shader cache readers for the machine and fall back to serial reads on any failure
pack_shader_cache.py picked 8 readers on every machine. It now takes half the logical CPUs, 1 to 8, so a 1- or
2-CPU PC reads one file at a time, and reads serially with less than 512 MiB free RAM (tools/hostmem.py, as the
compile and lift workers use). --read-workers still overrides; the log names the choice.

The read-ahead is also capped at 32 MiB of file data by the listed sizes, beside the two files per reader; a file
larger than the cap is read alone.

Any failure of the parallel path (a thread that does not start, a MemoryError in a reader, an executor error) prints
a line and reads the remaining files serially, so the pack still completes with the same bytes.

Tests cover the worker choice, the byte cap and the three fallbacks, each giving the same pack as a serial run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:27:09 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d9ecad571d The architecture notes and the vk_pool_init comment say that CPU-visible pools get shadow storage where VK_EXT_external_memory_host is missing, and RenderDoc no longer stops device creation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:27:06 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9469ad0675 Merge pull request #1371: a GPU without VK_EXT_external_memory_host runs on shadow storage (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:21:21 +03:00
Valiantsin Dzerakh a80cb1e35d Merge PR #1372 head into task/pr1372 2026-11-23 14:20:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c6794dfe97 Merge pull request #1418: extract.py --skip-base-romfs leaves out the 17 GB base RomFS image that no build of 1.1.0, 1.2.1 or 1.4.3 reads (kaiyao7)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:19:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 802cb39fe0 Document extract.py --skip-base-romfs in the build guide
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:19:05 +03:00
Valiantsin Dzerakh 768dc30b36 Merge PR #1418: extract.py --skip-base-romfs leaves out the base RomFS nothing reads 2026-11-23 14:18:55 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f9585d984b Merge pull request #1382: on Intel with Mesa ANV a by-region barrier before draws whose vertex shader reads a storage buffer stops the white and dark smoke and sky flashes; off by default, anv_vs_barrier = 1 turns it on (mattheuspaivadini) (#927)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:17:49 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d98996b6e2 Turn the ANV vertex-shader storage barrier off by default on every GPU; players opt in with anv_vs_barrier = 1 (#927)
The barrier costs about 5% of the frame rate on an Iris Xe and was only tested there. TOTK_ANV_VS_BARRIER and anv_vs_barrier still force it on with 1 and off with 0. docs/settings.md says what it fixes, what it costs and that only Intel GPUs with Mesa ANV on Linux are affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:17:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3026d91e31 Merge PR #1382: ANV vertex-shader storage buffer barrier (#927)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:16:31 +03:00
Valiantsin DzerakhandClaude Opus 5.5 be98dbc336 Merge pull request #1245: AMD FSR 4 as a fourth scene upscaler, scene_upscaler = fsr4 (codexx-dev)
The PR's FSR 4 path (runtime/vk_ffx.c over AMD's FSR SDK 2.4 signed libraries, ffx_api_min.h, the cooperative
matrix and float8 device extensions in vk_device.c), its setup step that downloads amd_fidelityfx_loader_vk.dll and
amd_fidelityfx_upscaler_vk.dll, its notices and the FXAA copy shader hash 0x9d065204aac9766b now serve dev's own
scene upscaler as UPSCALER_FSR4. FSR 4 goes through vk_dlaa.c fsr_evaluate beside FSR 3.1: the same frame point,
jitter, motion vectors with the per-object pass, camera from vk_fg_camera, mip bias, fsr_sharpness, FXAA skip and
dynamic resolution hold.

Dropped from the PR: the dlaa_backend setting, FSR 3 through the DLL and the separate Upscalers row. vk_ffx.c pins
FSR 4 only; a device the libraries offer no FSR 4 for runs with the upscaler off and the menu says so. It keeps one
context per output size with dynamic resolution, like vk_fsr3.cpp, waits on the SDK's ring depth and is released
before the device goes. The menu's scene upscaler row gets "AMD FSR 4" (Windows; marked when the libraries or the
GPU are missing). The setup's FSR box and its strings are in all eleven installer catalogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:13:20 +03:00
kaiyao7 7e54200454 extract.py: --skip-base-romfs leaves out the 17 GB base RomFS that nothing reads
The extraction writes build/extracted/v0/romfs/romfs.bin (17 GB) and no other
tool in the repository reads it: build_game.py, gen.py, prepare_shaders.py and
package_build.py all take the version's own directory, and merge_update_romfs
takes the base Program NCA from the base game file itself and verifies all six
IVFC levels of what it merges.

The base game's ExeFS still decides the file is TotK 1.0.0, so damage is still
found, only later, with a message that names the damaged file.

The flag is off by default: a run without it extracts and checks as before.
2026-11-23 16:23:55 +08:00
Valiantsin DzerakhandClaude Opus 5.5 5e5f34cd40 Merge task/plugfix: mod plugins with branch hooks, pointer swaps, SD card files and hooks switched during play build in, and may call what the game calls; Zonai Fieldworks starts (#1388)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:36:07 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3fe8d7a1d9 Mod plugins that hook the middle of game functions, swap pointers in the game's data, use the SD card or switch their hooks during play build in, and may call what the game itself calls; Zonai Fieldworks starts (#1388)
Zonai Fieldworks was refused at several steps; each is now handled:
1. The start-up asked GetInfo 6, 7, 16 and 17 and SetHeapSize; runtime/plugin_init.c serves them.
2. Its start-up calls main where the lift has no function start. The tool names those addresses (--entries-out) and
   the installer lifts again with them as `entry` lines, up to four rounds (installer/steps.py PLUGIN_ENTRY_ROUNDS).
3. Branch hooks into the middle of game functions (far-jump veneers) and pointer swaps in main's data are accepted
   hook kinds; the veneer targets seed the plugin's lift, and an Orig trampoline counts as a seed.
4. Code the start-up writes into the plugin's own .text (hook pads it switches to during play) is found by comparing
   the image before and after the init, and seeds the lift (init_code). Without it the game stopped with "no function
   at guest pc" when a feature switched on.
5. recomp/gen.py: a branch-out alternative on a flag-writing site leaves with the flags from before the site; an inline
   hook may sit on a blr.
6. nn::fs::MountSdCard mounts <profile>/sdcard (runtime/fs_host.c), and nn::settings language codes are answered
   (runtime/ov_system.c).

The import check now also allows what the game's main imports (--exefs, game_imports): the game runs on those paths,
so the runtime serves them. Left out: nn::ro, the C runtime start, the thread-local allocator hook and the shader
compiler. Break in code the hooks reach is allowed (an abort ends the game with the reason, as on the Switch), and
RenameFile, DeleteDirectoryRecursively, Commit and Unmount join the SD card calls. Checked: Zonai Fieldworks, The Second
Quest, Challenge Mode and Material Columns on 1.4.3, Full Inventory Expansion, Quick Weapon Durability and Magic of the
Kingdom on 1.2.1 accepted; UltraCam's init still crashes its service run. Plain lift unchanged; probes 4/4 on both
versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:35:59 +03:00
Valiantsin DzerakhandClaude Opus 5.5 942b6b7b2b Merge task/plugfix: mod plugins whose hooks use exlaunch's exl_inline_hook_with_fp_impl build; Magic of the Kingdom starts (#1388)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:41:34 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c603112fca The plugin check accepts exlaunch's exl_inline_hook_with_fp_impl, the inline-hook entry that saves d0..d15 next to x0..x29. Magic of the Kingdom's hook stub calls it and was refused for it (#1388)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:40:59 +03:00
mattheuspaivadiniandClaude Sonnet 5.5 5b15fc0df6 Keep fb_dirty across the ANV vertex-storage barrier, so feedback_prepare still learns the feedback targets (#927)
feedback_barrier clears fb_dirty, and feedback_prepare learns which targets go into the feedback layout from m & fb_dirty. A barrier recorded only for a vertex shader's storage read could hide a later attachment read from it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:05:13 -03:00
PC ab9dcc9bcb The in-game menu comes in Vietnamese: a full text_vi row (every menu id, checked against the English printf specifiers), a Tiếng Việt choice on the Menu tab, vi among the values of menu_lang, and the Latin Extended and Vietnamese ranges in the menu font atlas, which Roboto already covers. The text inside the performance overlay and the DLSS model row keep their English names, and the graphics terms follow common Vietnamese usage (họa tiết, bộ đổ bóng, đường ống, lệnh vẽ, tệp)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 408c1badfcdad3d85bf06ab09505a6d2669a2427)
2026-11-22 18:41:36 +01:00
mattheuspaivadiniandClaude Opus 5.5 4c95df372a On Mesa's ANV, put a by-region barrier before a draw in a pass whose vertex shader reads a storage buffer (#927)
On an Iris Xe with ANV the half-resolution particle pass drew campfire smoke and clouds as white or dark blobs and
turned the sky white for single frames. Such draws read stale data inside the pass unless the sampler cache is
invalidated first; a stall alone or the attachment flush alone does not help. The barrier is feedback_barrier, which
the feedback loops already record inside passes. TOTK_ANV_VS_BARRIER (anv_vs_barrier) turns it off or on elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:45:13 -03:00
itaskaev2andClaude Opus 5.5 23ac5f18d1 The setup speaks Vietnamese, picked from a Vietnamese Windows or locale, launcher message included
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:11:26 +01:00
itaskaev2andClaude Opus 5.5 37d49d80d2 The in-game menu and the overlay speak German, French, Spanish, Italian, Dutch, Japanese and Korean, every one of the 670 menu texts, picked from the Windows display language or the Menu tab, with every Chinese Windows on the Simplified Chinese menu (the menu part of pull request #497, completed for today's menu)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:11:26 +01:00
Valiantsin DzerakhandClaude Opus 5.5 7f17cad783 Merge task/tramp: mod plugins with exlaunch's long trampolines build, and hooked game code reads the flags the plugin's callback left; Challenge Mode starts (#578, #1360)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:43:07 +03:00
Valiantsin Dzerakh 0e810f429a Merge branch 'dev' into task/tramp 2026-11-22 16:42:36 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3c62640d80 Flags pass between a mod plugin's code and the game as on the Switch: exlaunch's inline hook saves no NZCV, so a hooked site goes on with the flags its callback left. Challenge Mode's hooked b.eq sites follow its version check (#578, #1360)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:42:31 +03:00
Valiantsin Dzerakh 89c8997bfb Merge pull request #1357: run_all skips the compiler suites when no clang is found, registers eight existing suites and finds the native executable on Linux (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	tests/run_all.py
2026-11-22 16:22:40 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8c204500ed Merge pull request #1363: build_game sizes the compile jobs by free memory as well as RAM, so a PC with little free memory does not page during the setup's compile (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:22:25 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6af609e1b1 Merge pull request #1362: check_isa scans the instructions of a linked .exe or .dll too, not only objects (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:22:08 +03:00
Valiantsin Dzerakh 18ce808d03 Merge task/pr1363 into task/pr1357 2026-11-22 16:21:08 +03:00
Valiantsin Dzerakh d6b484a5c9 Merge task/pr1362 into task/pr1357 2026-11-22 16:21:03 +03:00
Valiantsin Dzerakh 3fd3eb7be9 Merge PR 1357 2026-11-22 16:17:39 +03:00
Valiantsin Dzerakh 2bfde7ac0c Merge PR 1363 2026-11-22 16:17:00 +03:00
Valiantsin Dzerakh cfbfa70c63 Merge PR 1362 2026-11-22 16:14:22 +03:00
Valiantsin DzerakhandClaude Opus 5.5 57137cb108 Merge pull request #1355: the setup reads output_res, prompts, pad_layout and hud_width with the game's INI rules (quotes, last non-empty value), so it prepares the layouts the game will use (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 85c0de3aa3 Merge pull request #1352: the installer reads and rewrites the last non-empty lang setting in totk.ini, as the game does (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:16 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9812378665 Merge pull request #1350: the installer rejects a state file with malformed fields as unreadable before prefill and resume, instead of a traceback (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:15 +03:00
Valiantsin DzerakhandClaude Opus 5.5 af60f6a062 Merge pull request #1349: the shader-cache packer checks a pack's entry count and index size against the runtime's limits before it reads the index, and rebuilds a broken pack from the loose files (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:14 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9db523827d Merge pull request #1366: the recent-install module's docstring is a raw string, so Python 3.14 compiles it without an invalid escape warning (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:14 +03:00
Valiantsin DzerakhandClaude Opus 5.5 6322727b67 Merge pull request #1351: the NSZ block reader skips stored padding after a raw block and bounds each compressed block by its declared size, as nsz's reader does; a block of the wrong size is still a damaged file (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:12:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 589bd9e08f A block that decompresses to the wrong size is a damaged file again, so the installer asks for a fresh copy
The size check added in this pull request raised a plain ValueError, which the installer maps to
check.unpack_failed. Before it, such a block ended in a hash or length mismatch and the player saw
check.input_damaged. ncz.unpack_ncz now turns the new BlockSizeError into DamagedFile, like ZstdError and EOFError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:11:48 +03:00
Ruan Shannon b4dcc3431f tools/pack_shader_cache.py reads the loose files with 8 bounded readers
pack() read every loose file one after the other. On Windows each open costs milliseconds (the antivirus scans it), so
folding a fresh cache was dominated by waiting: 12000 loose files took 79-90 s. The files are now read ahead by a pool
of 8 threads (--read-workers, 1..16; 1 reads serially), at most twice that many in flight, and written in the same
sorted order, so the pack is byte-identical. 12000 files: 18-20 s. The CLI prints read and cleanup progress every 5 s.
tests/pack_shader_cache_test.py checks parallel against serial packs, fresh and incremental, and the bounded read-ahead.
2026-11-22 05:10:48 -08:00
Valiantsin Dzerakh 936b0e264c Merge pull request #1355 head 2026-11-22 16:05:01 +03:00
Valiantsin Dzerakh 516b1d2ab5 Merge branch 'pr1351-head' into task/pr1351 2026-11-22 16:04:59 +03:00
Valiantsin Dzerakh 0894366f29 Merge pull request #1352 head 2026-11-22 16:04:58 +03:00