The texts that came with the audiodrain set (docs/settings.md, totk.ini.example, the comments in patches-v121.txt and patches-v143.txt) said that above about 200 game updates a second the game switches its sound off. Every run behind them had captured the mix with audio = none. With a device playing, on Linux with PipeWire, the game keeps its sound at 240 fps without the set. The guard (1.2.1 main+0x9bcdc4) sets its count back to 0 whenever a free list is there (0x9bce00), which takes two audio frames between two updates of the game. The mixer's timer renders one frame every 5 ms, so at 240 updates a second that never happens and the count reaches 300. A device paces the render thread in bursts after each period (audren.c, gap_ns: 4 ms apart on Linux; 0 on Windows, read from the code and not measured), so it happens several times a second. Sampled on the render thread on Linux with PipeWire's 1024-frame periods: 200 frames a second either way, 76% of them 4 ms after the one before with the device, 939 of 940 at 5 ms with the timer. The count and the switch have not been read in a run. The mixer also keeps time by its timer while a device takes nothing. Measured at fps_limit 240, same save and input script, with the game's audio stream paused from outside (pw-cli on its PipeWire node, not a real device stalling) while the game ran at 240 fps. On 1.2.1 with the set off a pause of 5 s (two runs) and of 2 s (two runs) left the game silent to the end of the run, also after the device resumed, and a pause of 1 s (one run) did not; with the set on a pause of 5 s (two runs) left only the gap. On 1.4.3, one run each: silent after a pause of 5 s and of 2 s with the set off, sound after a pause of 5 s with it on, sound with a device and no pause with the set off. The numbers without a device now come from runs that can be named: 1.2.1 6 of 119 and 111 of 119, 1.4.3 3 of 119 and 113 of 120 (set off and on). They replace 5 of 118 / 108 of 118 and 2 of 118 / 110 of 119, which I cannot match to a run any more. Text only: no code, no site and no default changes. Not measured: Windows, a device with periods of 240 frames or less, a real device stalling, 1.4.3 with a device and the set on. Co-Authored-By: Claude <noreply@anthropic.com>
TotK Recomp
TotK Recomp is a static recompilation of The Legend of Zelda: Tears of the Kingdom (Nintendo Switch, 2023) into a native x86-64 application for Windows and Linux (docs/architecture.md).
Important
No game files are included. You need your own legally obtained copy of Tears of the Kingdom, dumped from your own console: the base game and the 1.1.0, 1.2.1 or 1.4.3 update. Instructions for obtaining those files will not be provided.
The game is built from your files on your machine, so the result contains the game. It is for your own use. Do not share it.
Status
Early development. The game is playable on Windows and Linux; visual bugs and crashes are still expected.
Report problems as issues, following CONTRIBUTING.md.
Features
- Native code, not emulation
- Game updates 1.1.0, 1.2.1 and 1.4.3; 1.2.1 and 1.4.3 saves carry over between them
- Takes NSP and XCI game files, and compressed NSZ and XCZ as they are: the setup unpacks them itself
- 60 fps by default; up to 144 fps or the monitor's refresh rate (experimental)
- Custom resolutions (1080p, 2k...), supersampling and AMD FSR 1 upscaling
- NVIDIA DLSS / DLAA on RTX GPUs: the setup downloads
nvngx_dlss.dllfrom NVIDIA's DLSS SDK repository (github.com/NVIDIA/DLSS, NVIDIA RTX SDK license) when it finds an RTX GPU; untick it in the setup to skip it - HDR10 output with peak, game and HUD brightness settings
- 16:10 (Steam Deck, handhelds), 3:2 (Surface, Framework), 21:9 and 32:9 (ultrawide) game resolutions, with the camera and the interface in that shape
- Anisotropic texture filtering up to 16x, for sharp ground into the distance
- In-game settings menu (F1) and performance overlay (F10)
- Play time across runs on the Game tab of the settings menu, kept in
playtime.txtnext to the saves - Discord Rich Presence ("Playing TotK Recomp" with the play time), off by default, own application id supported
- Setup and in-game menu in English, Russian, Brazilian Portuguese and Simplified Chinese
- Keyboard, mouse and gamepad with remapping, rumble and gyro
- Stereo or 5.1 surround sound output
- Xbox and PlayStation button prompts: Xbox's LB, RB, LT, RT, Menu, View and A, B, X, Y, or PlayStation's ○ × △ □, L1, R1, L2, R2, Options and Share, as labelled on the button to press, with either button layout
- Shaders prepared at install instead of during play
- Mods made for emulators: unpack a mod into the
modsfolder next tototk.exe; switch and order them in the menu. RomFS mods, TKMM's merged output and ExeFS code patches (.ips,.pchtxt) work; the game rebuilds itself for code patches (docs/mods.md). HD texture packs work: the port grows the texture heap a pack asks for by itself. Tested with the HDPacks.com 4K Texture Pack v1.0 on 1.4.3 and 1.2.1; other packs come with no guarantee - Atmosphère cheats: put a cheat file into a mod and switch its cheats in the menu (docs/cheats.md)
Planned
- VRR
Installing
Windows
Requirements: Windows 10 or later, an x86-64 CPU with SSE4.2 (AVX2/FMA machines get a faster build), a GPU with Vulkan 1.3 and VK_EXT_external_memory_host, about 36 GiB free during setup (20 GiB after).
- Download
TotK-Setup-<version>-windows.zipfrom Releases and unpack it. - Start
TotK-Setup.exe. If SmartScreen warns about an unsigned app, choose More info, then Run anyway. - Pick your game files, the language and an install folder, and press Start. The setup builds the game once. With an NVIDIA RTX GPU it also downloads NVIDIA DLSS, unless you untick Download NVIDIA DLSS; turn DLSS on in the menu (F1).
- Play
totk.exefrom the install folder.
Linux
Requirements: as on Windows, plus Linux 6.7 or later and glibc 2.34 or later (Ubuntu 22.04, Debian 12, Fedora 35, SteamOS 3).
- Download
TotK-Setup-x86_64.AppImagefrom Releases, or build it (docs/installer.md, "Linux release"). - Make it executable (
chmod +x TotK-Setup-x86_64.AppImage) and start it. On a Steam Deck, do this in Desktop Mode. - Pick your game files, the language and an install folder, and press Start.
- Play
totkfrom the install folder.
To update, run a newer setup on the same folder; saves and settings are kept. Settings are in the in-game menu and in totk.ini (totk.ini.example lists every key). Controls: docs/controls.md.
Credits
TotK Recomp builds on the projects below. What was taken from each, with its license, is listed in THIRD_PARTY_NOTICES.md.
- LAS Recomp
- MacNativeGames
- d2r-mobile and nxnative
- SavageWindRecomp
- Ryujinx
- deko3d
- hactool
- SDL 3, Dear ImGui, AMD FSR 1, Vulkan Memory Allocator, libopus, libvpx, Zstandard
- Switchbrew and the Switch homebrew community
License
The project's own code is under the MIT License; third-party code keeps its own license (THIRD_PARTY_NOTICES.md). The license grants nothing for Nintendo's game.
TotK Recomp is an independent, non-commercial fan project, not affiliated with or endorsed by Nintendo. The Legend of Zelda, Tears of the Kingdom and Nintendo Switch are trademarks of Nintendo.
Building from source
docs/building.md lists the toolchain and the steps. Everything the build writes stays under build\ and generated\, which git ignores; run tools/check_content.py before a commit. Testers: docs/tester-guide.md.
Most of the code and documentation is written by AI coding agents (Claude Code) under the maintainer's direction; the maintainer plays every build and decides what is merged. AGENTS.md holds the rules they work under.