Files
NX2navi/AGENTS.md
Claude c403547c8b Add the NX2navi launcher: a one-click setup that builds the game from the player's dump, starts it and keeps it up to date.
NX2navi-Setup.exe installs the launcher into %LOCALAPPDATA%\Programs\NX2navi without administrator rights, with
shortcuts and an Apps entry. The launcher finds the player's .nup, downloads the build tools itself (the MSYS2 UCRT64
packages toolchain.lock.json pins, checked by sha256 and unpacked without pacman, and zbic from PyPI) and runs
tools/make_game.py, whose steps it shows with their progress. Its window follows the game's options menu: colours
sampled from it, the menu's filigree, the white glowing cursor, the Triforce in the title band and as the programs'
icon, and all text in the game's Cetra Display, decoded from the player's own dump. Mouse, keyboard and an XInput
pad drive it.

Updates come from GitHub releases (NX2navi-update.json): the new version is downloaded, checked and staged beside
the running one, the stub restarts into it and falls back to the previous version when it fails to start, and the
game is rebuilt without the dump. make_game.py now keys its exefs and romfs steps on the game files alone, has
--rebuild and --events, compiles only the files whose source, headers, flags or compiler changed, and replaces
ocarina.exe only once the new one links. tools/make_launcher.py builds the release on Windows or Linux.

Tested: tests/launcher_test.py (19 tests), the real toolchain download and install, and under Wine 11 the setup,
the stub, the window on the bundled Windows Python, an update from a local feed by clicking Updates, the rollback
of a version that fails to start, and the downloaded clang compiling and linking a program against the game's
libraries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Merged onto the current port: make_game.py keeps the launcher's step keys, cached link and in-place swap, and its
own runtime manifest (windres), AMD's FidelityFX library and the shader preparation, which becomes a step of its own
("shaders") that the launcher shows in its install, rebuild and update jobs. make_launcher.py ships the shader tools
and, with --ffx, AMD's library.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 14:50:52 -05:00

2.7 KiB

NX2navi

Static recompilation of Ocarina of Time (Switch 2, ARM64, game version 1.1.1) into a native Windows x86-64 exe with a Vulkan renderer. Design: docs/architecture.md. Toolchain, build commands and tests: docs/building.md. The players' launcher, setup and updates: docs/launcher.md.

Game content boundary

This repository is private, and its additions are all rights reserved (LICENSE-ADDITIONS). It still never holds game data: game data lives outside it and every derived file stays in ignored folders.

  • The user's game and key paths are in config.local.toml (ignored). Pass the keys file path to tools; the tools read it themselves. Key values stay out of your output, logs, commands and files.
  • Everything extracted or generated goes under build/ or generated/.
  • Every file the code generator emits carries the marker defined as GENERATED_MARKER in tools/check_content.py.
  • Run python tools/check_content.py --staged before proposing a commit. It is the same check CI runs.

Reusing code

refs/ holds the pinned checkout the build reads (tools/fetch_refs.sh recreates it). Read-only.

  • Copy only MIT, BSD, ISC, zlib or Apache-2.0 code, keep its header, and add a row to THIRD_PARTY_NOTICES.md.
  • GPL code is never copied: write our own.
  • tools/vendor/ stays byte-identical to its source; Windows changes go in tools/extract.py.

Code

  • Build C with MSYS2 UCRT64 Clang (C:\msys64\ucrt64\bin). Generated C uses GNU extensions, so cl.exe is out. Call Ninja from that directory by full path or put it first on PATH.
  • Two Python environments: .venv (3.12) for the lifter and the build, .venv-py314 for the extraction and shader scripts, which need compression.zstd.
  • Generated C is never edited by hand: change the generator (recomp/).
  • Every lifter change passes the differential tests against Unicorn (docs/building.md, "Checks"). After changing recomp/jumptables.py, tests\jumptables_check.py reports 0 disagreements on 1.2.1 and 1.4.3.
  • recomp/layout.py alone decides module bases.
  • Graphics bugs: docs/maxwell.md lists the Maxwell behaviour the Vulkan path must match, what goes wrong when it does not, and what our runtime does.
  • Comments say what the code does and why, in words that stand on their own. Cite our code by file plus function (a line number may follow as a hint). Comments and docs do not name other projects or say where code came from: the license header of copied code and its THIRD_PARTY_NOTICES.md row carry that.

Writing

Code, comments, docs and commit messages are in English. Commit messages are plain sentences without type prefixes.