35 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 2fe1ea1716 Bump the bundled Windows SDL to 3.4.20 (#912)
SDL 3.4.20 uses default Switch controller stick and IMU calibration when the
pad has none, which fixes the infinite gyro readings on the Beitong Asura 2 Pro+.
The pins in tools/make_release.py (version, zip and devel sha256, SDL3.dll sha256)
and the Windows rows of THIRD_PARTY_NOTICES.md follow. The sniper sysroot row stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 08:53:49 +03:00
Valiantsin DzerakhandClaude Opus 5.5 0e1ddb41e0 Scale the 1.2.1 map cursor and vertical aim steps by the frame ratio
The map cursor, the vertical Ultrahand aim and the vertical gyro aim moved a fixed step per frame, so above 30 fps they ran faster with the frame rate (#44, #394). The new set cursor multiplies each step by the game's own 30 Hz ratio, ported from MacNativeGames 363a6eb and switched by TOTK_HIGHFPS_FIX.

Map pan with the same stick input on 1.2.1: 398 px/s at 30 fps, 1150 px/s at about 105 fps before, 402 px/s after. The Ultrahand and gyro sites were not exercised in game. 1.1.0 is not covered: its module is not available here to check the sites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 17:48:48 +03:00
local 8ff29be86f Use the mouse in the game's menus on 1.4.3
While one of the game's menus has its focus box (the title, the save list, the inventory, Options, shops,
dialogue choices), the cursor is released from the mouse camera and shown; the item under the pointer takes
the focus as the d-pad would, a left click is A on it and a right click is B. runtime/menu_cursor.c reads
eui's screens at each pad read and moves the focus with the writes eui::BoxCursorMgr::moveBoxCursor makes,
adapted from Weeping of the Empire's totk_menu_cursor.cpp (1.0.0, MIT), with eui::ScreenMgr's instance placed
in 1.4.3 at main+0x3acf960. menu_cursor = 0 turns it off.
2026-11-04 07:56:03 +03:00
Valiantsin Dzerakh f30bbf048a Merge pull request #281: Add HDR10 output (ProSep)
# Conflicts:
#	THIRD_PARTY_NOTICES.md
#	runtime/cfg.c
#	runtime/vk.h
#	runtime/vk_device.c
2026-11-01 11:15:24 +03:00
Valiantsin Dzerakh 4524fed813 Merge pull request #211: Show Xbox button icons in the prompts, with a Button prompts setting that follows the pad layout (waxyfeet)
# Conflicts:
#	docs/installer.md
#	runtime/cfg.c
#	runtime/ui/menu.cpp
#	runtime/ui_text.h
2026-11-01 11:14:40 +03:00
Valiantsin Dzerakh 57129898e8 Merge pull request #296: Run the game on x86-64-v2 CPUs without AVX2 (chen3feng)
# Conflicts:
#	README.md
2026-11-01 11:10:05 +03:00
CHEN Feng 34b4faee7c Run the game on x86-64-v2 CPUs without AVX2
-march=x86-64-v3 kept the port and the installer to CPUs with AVX2 and FMA. --cpu v2 compiles the generated code and the runtime for SSE4.2 instead. Without FMA3 the FP lowering calls fma/fmaf, so runtime/fma.c provides correctly rounded ones (musl, MIT) that honour MXCSR's rounding mode, FTZ and DAZ; the UCRT's software fallback rounds incorrectly by up to half an ulp. simd.h's fast paths keep their assumptions.

The installer's host check asks for x86-64-v2 and selects libtotkrt.a or libtotkrt-v2.a; both release scripts build and ship the pair. The differential tests compile fma.c as well, so a --cflags=-march=x86-64-v2 run tests it.

Tested on an i7-3770K (no AVX2, FMA or BMI) with an RTX 3060 Ti, game 1.4.3: the installer ran end to end, --selftest passed and play holds 40-60 fps at 1080p. fma and fmaf matched 152,288 exact vectors over two seeds, including ties, subnormals and every rounding mode, FTZ and DAZ combination. The v3 build is unchanged: fma.c is an empty translation unit there.
2026-11-01 07:09:13 +08:00
ProSepandClaude Opus 5.5 007786d487 Add HDR10 output
With hdr = 1 the game's tonemap shader is replaced by one that keeps highlights up to the display's peak, the present
reads the float picture the game copies into its 8-bit window texture, and a compute pass encodes it as PQ in Rec. 2020
for an HDR10 swapchain. Peak, paper white and HUD brightness are live settings in the menu and totk.ini. The approach
follows the RenoDX TotK mod by souperman9 and Musa; no code was copied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:17:12 +01:00
Valiantsin DzerakhandClaude Opus 5.5 da6cd4009e List the bundled libXft and libXrender in the third-party notices
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:05:30 +03:00
lcd1232 d0e27b95c4 Restore Cyrillic rendering in the Linux installer with Xft 2026-10-31 17:40:54 +04:00
Deon FoucheandClaude Opus 5.5 01d69bf6d1 Merge dev into xbox-button-icons, with the restart and the prompts on the Linux port's portable calls
The restart moves into gfx_present.c's gfx_window_closed, which the Win32 and SDL windows share, and linux.c gets
plat_restart and plat_restart_wait: posix_spawn of /proc/self/exe with no descriptor past stderr and the default
signals, and a wait on a pidfd. The prompts code takes plat_file_exists, plat_setenv, strcasecmp and strdup, and the
menu and the log say a game resolution of another shape than 16:9 (16:10 now as well as 21:9) keeps the Switch prompts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:14:22 +10:00
Deon FoucheandClaude Opus 5.5 f7d563db05 Draw Xbox button icons into the prompts overlay with make_romfs_patches.py --prompts
tools/button_icons.py, adapted from MacNativeGames' make_button_icons.py, draws LB, RB, LT, RT, Menu, View and a d-pad
cross into the button font of every font archive and into the button guide's L and ZL images, with the letters cut out
in the game's own text fonts, and raises the resource size table for the archives that grow. --prompts xbox swaps the
face buttons as --xbox-prompts did (now its older name); --prompts xbox-label keeps their letters for the xbox and auto
pad layouts. The plain overlay is unchanged. tests/romfs_prompts_test.py runs both on a RomFS it builds itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:50:17 +10:00
Valiantsin DzerakhandClaude Opus 5.5 43a18a9bb1 Merge pull request #60: Linux port (AppImage) and Steam Deck support (wdiasjunior)
The branch forked 79 commits before main and 98 before dev. Resolutions:

1. Aspect ratio: dev's implementation stays (camera patch at page +56 on 1.4.3, tools/ultrawide_layout.py layouts per
   size in romfs-patches-<w>x<h>, the aspect = fit|stretch setting). The PR's second implementation is dropped: the
   aspect sets of patches-v121.txt and patches-v143.txt (the 1.4.3 one patched the same viewport sites as dev's),
   tools/aspect_layouts.py, the resolution.c shapes that limited game resolutions to 16:9, 16:10 and 21:9, and the
   picture_fit setting. Its letterbox code (gfx_fit_rect) is kept and reads TOTK_ASPECT.
2. Code dev changed where the PR moved it: the stick dead zone, the test gamepad and the paddles go to input.c; the
   DPI awareness, keep-awake and IME detach of gfx_window.c go to gfx_window_win.c; device fault reports and GPU
   breadcrumbs to gfx_present.c. gfx_window_dpi gets an SDL version.
3. dev's Win32 calls in shared code go through platform.h: the shader cache pack reader (PlatFile), the romfs
   overlay checks, the audio pacing waits, the motion, ASTC and device fault locks. plat_cpu_usable and
   plat_commit_info get Linux versions; plat_cpu_count counts the machine's processors on both. dpi_probe.c becomes
   dpi_probe_win.c.
4. assume_focus defaults to 1 as the PR has it (a load interrupted by a focus loss can stop for good) and stays live,
   with dev's Game tab row.
5. The frame limits 40 and 45 join dev's list. The BC 3D storage fallback for Vega only runs with
   TOTK_BLOCK_VIEWS_3D=1, since dev makes 3D BC images without block views by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:26:42 +03:00
Valiantsin DzerakhandClaude Opus 5.5 09da9f1687 Credit the TOTK-Ultrawide mod for the pane list and offsets in the third-party notices
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 07:45:22 +03:00
Seth 582f675e88 Render a game resolution wider than 16:9 at its own shape, with black bars as the fallback
An output_res such as 3440x1440 now widens the camera's view to that shape on 1.4.3: patches-v143.txt
sets the aspect ratio at the camera and viewport sites that hand it to the perspective projection.
The HUD and menus come from a romfs-patches-<w>x<h> overlay that make_romfs_patches.py --aspect
builds through tools/ultrawide_layout.py, and romfs.c overlay_init picks that overlay when the game
resolution is not 16:9. The installer prepares it for 2560x1080, 3440x1440, 3840x1600 and 5120x2160.

When the window's shape differs from the game resolution's, the new aspect setting keeps the
picture's shape with black bars (fit, the default) or stretches it over the window.
2026-10-31 07:43:44 +03:00
Valiantsin DzerakhandClaude Opus 5.5 87e0275991 Credit MacNativeGames for the 1.4.3 fade fix in the third-party notices
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 07:43:02 +03:00
Wellington Dias 89b5126da0 Declare the clobbers mbedtls's x86-64 multiply asm lacks, so a clang-built hactool verifies signatures.
hactool's bundled mbedtls 2.6.1 adds into memory and changes the flags in its MULADDC asm without saying so. gcc builds
happen to work; clang, the Linux release's compiler, keeps values in registers across it at -O1 and above, so every RSA
check failed (NCA header, NPDM, ACID) and the AppImage's setup stopped at the update merge. Found by installing from the
mounted AppImage; a bisection of the mbedtls objects pointed at bignum.o, and the memory and cc clobbers (as later
mbedtls releases have them) fix it. With the patch the full install from the AppImage completes and the game runs.
2026-10-30 14:28:35 -03:00
Wellington Dias 29a14d69fe Build the setup for Linux as an AppImage.
tools/make_release_linux.py assembles the Linux release folder and packs it with the static type-2 AppImage runtime:
python-build-standalone 3.14 with tkinter, LLVM 23.1.4 (clang, lld, llvm-ar) and the part of the Steam Runtime 3 sniper
SDK sysroot a game build reads, so the game, hostcheck, hactool and the translator need no newer glibc than 2.31 and run
on SteamOS. The game it builds needs only glibc, the system's Vulkan loader and the libSDL3.so.0 beside it; Opus, libvpx,
zstd and libstdc++ are linked in. --prove builds generated/v121 with the folder alone and runs the probes.

The installer runs on Linux: release and dev layouts, temp under the XDG cache (the AppImage mount is read-only), cancel
through the CLI's process group, language from LANG, xdg-open and a PNG icon, texts that name the right executable, and a
warning on kernels older than 6.7. hostcheck reads x86-64-v3 from CPUID, since clang's __builtin_cpu_supports reads it
from libgcc, which before GCC 12 has no level bits. build_game.py takes --sysroot, build_hactool.py --cc and
build_xlate.py --llvm/--sysroot; linux.c carries the Linux 6.7 write-watch definitions for older headers.

Also: shader_census.py and package_build.py use the Linux executable names, and probe-shader writes its shader path with
forward slashes.
2026-10-29 18:00:26 -03:00
Valiantsin DzerakhandClaude Opus 5.5 f646e521f0 Bring the README and docs up to date with 1.4.3, the menu, the installer and the log file
The README is a front page now: a general status, a short feature list, install steps from a release, credits as a
list of links that points to THIRD_PARTY_NOTICES.md, the build steps last. The licence table moved into the notices.
The build steps take the game version as <ver>; 1.4.3 is the primary version in the architecture doc, which also
gains the zstd host decoder, the settings table and menu, spin gates, the uniform snapshot and the resolution patches.
Controls list F1, F10, F11 and the menu keys; the tester guide and CONTRIBUTING point to logs\totk.log.

THIRD_PARTY_NOTICES.md: the four code rows that sat in the installer table move to the main table, the zstd rows
cover ov_zstd.c and the release package, the MacNativeGames resolution commit is given in full, the NVN proc list and
the compiler runtime of a source build are listed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:49:34 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3984344635 Spin wait gates: tools/spin_waits.py (the nxnative search) lists the loops that only another thread can end, the patch tables carry them as spin lines (857 in 1.4.3, 864 in 1.2.1), the generator sends their back-edges through rt_spin_gate, and the gate pauses the core once per pass and hands the virtual core to a waiter after 50 us of polling (TOTK_SPIN, TOTK_SPIN_HANDOFF_US)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:51:47 +03:00
Valiantsin DzerakhandClaude Opus 5.5 89cc960f09 Menu navigation with the left stick and back from the bottom buttons; AMD sensors and the picture lines in the performance overlay
The left stick now moves the menu cursor as the D-pad does (ImGui only scrolled with it). The page's rows are a
direct NavFlattened child of the menu window: behind a second child level ImGui did not clip them, so up from
Continue went to the tabs and down from the tabs to Continue.

The full overlay reads temperature, board power, clock and GPU load from ADL's PM log on AMD GPUs (matched by PCI
bus), and shows the window, game image and 3D scene sizes, the scaling to the window (FSR and its sharpness), the
frame limit and the presentation mode in use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:21:41 +03:00
Valiantsin DzerakhandClaude Opus 5.5 eca89641fa Keep 1.2.1's scene at the wanted size, package zstd for the installer
1.2.1 renders the scene size it reads, while 1.4.3 scales it by output width / 1920: on 1.2.1 the scene set is on
whenever the output grows (2560x1440 gave a 1600x900 scene before, 2133x1199 now). An output at or below the shipped
size needs no grown HeapDef. The release deps carry the static libzstd and its header, totk.ini.example the four new
keys, THIRD_PARTY_NOTICES.md the MacNativeGames sites, FSR 1 and zstd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:56:28 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ad70afaee0 Build hactool from the repository: tools/build_hactool.py fetches the pinned commit, applies tools/hactool/*.patch and links a static exe
The MacNativeGames BKTR and title-key changes and our UTF-8 manifest lived only in the maintainer's toolchain folder, so
nobody else could build the hactool that extraction and the installer need. The script's exe matches the one in use
byte for byte apart from its build time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:18:23 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e6116bc8bb Draw the full performance overlay from perfmon: CPU, GPU and memory load, temperatures, frame times with a graph and the render thread's waits
The panel's columns are as wide as the widest value they can show and the numbers are right-aligned, so the panel keeps its width while the numbers change. It sits in front of the open menu. FPS mode keeps its one line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 20:55:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b0805112ed Merge main into task/menu: the docs and comment cleanup, with the Dear ImGui set-up of menu.cpp kept in the LAS Recomp notices row
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:16:23 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f8d584b3db Add the tabbed settings menu: option rows over the cfg table for the Screen, Game, Sound, Controls and Menu tabs, Continue and Quit game in the bottom row, and a note when totk.ini cannot be written
Rows read and write their key through cfg, mark the default, say "after restart" for start-only settings and grey out what an environment variable fixes; totk.ini is written 0.4 s after the last change and when the menu closes. The graphics card list comes from the Vulkan devices, the window sizes from the monitor, and the language names of Japanese, Korean and Chinese are drawn with glyphs merged in from a system font (plat_font_path). The font atlas and style follow the window height. TOTK_MENU_TEST saves one shot per tab and ignores real input meanwhile; TOTK_MENU_TEST_SET sets settings at given frames (SAVE=1 writes totk.ini). A background test window going fullscreen no longer comes to the front or takes focus, and the log names the present mode the swapchain gets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:13:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 283e1f18cf Bring the published docs up to date for the public repository
The README now names the three test machines, the installer, remapping and the mouse camera, and lists the open bugs. The backlog drops the dated diary, finished steps and local paths and keeps every open item with its evidence. Citations into our code name functions instead of line numbers that had drifted, build/ notes are no longer cited, and the toolchain doc lists opus and libvpx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:53:19 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c6a7a28ab4 Compile Dear ImGui and draw the menu overlay into the swapchain image, behind the test hook TOTK_MENU_TEST until the pages are agreed
The window follows TOTK_WINDOW_SIZE, TOTK_FULLSCREEN and TOTK_VK_PRESENT while the game runs, and F11 saves the fullscreen state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:35:24 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c3b3c297cf Merge main into task/menu: keep main's button remapping, Esc cursor release and new settings beside the live settings, with one live mouse sensitivity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:27:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9fea5cc37b Credit MacNativeGames for the virtual-core preemption in THIRD_PARTY_NOTICES.md and the kernel.c header
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 23:49:11 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9a859dfb2c Decode ASTC textures with a compute shader in the upload batch, or upload them natively where the device samples ASTC, behind TOTK_ASTC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 14:42:51 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a4bb2d5355 Document the UTF-8 manifests of hactool and totk.exe and the damaged file message
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:35:41 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1ece856440 Add tools/make_release.py, which assembles the installer release folder from pinned downloads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:22:46 +03:00
Valiantsin DzerakhandClaude Opus 5.5 a2f97e84ca Vendor Dear ImGui 1.91.9 core and Vulkan back end for the in-game menu, unmodified from LAS Recomp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:54:57 +03:00
Valiantsin DzerakhandClaude Opus 5.5 19c9b648d1 Add the recompiler, Windows runtime, tools and docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:27:54 +03:00