[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109377":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":15,"starSnapshotCount":15,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},109377,"ocarina-of-time-recomp","jaigner-hub\u002Focarina-of-time-recomp","jaigner-hub","Static recompilation of The Legend of Zelda: Ocarina of Time into a native PC program",null,"C",300,35,27,4,0,244,54.67,"MIT License",false,"main",true,[],"2026-11-24 04:01:28","# Ocarina of Time PC Recomp\n\nResearch project: static recompilation of *The Legend of Zelda: Ocarina of Time* (title id `04004860224DEC00`) into a\nnative Windows program, by the method of [totk-pc-recomp](https:\u002F\u002Fgithub.com\u002Fvalentderah\u002Ftotk-pc-recomp) as carried\nto further games by [fe3h-pc-recomp](https:\u002F\u002Fgithub.com\u002Fjaigner-hub\u002Ffe3h-pc-recomp) and\n[metroid-prime-4-recomp](https:\u002F\u002Fgithub.com\u002Fjaigner-hub\u002Fmetroid-prime-4-recomp). The game's code is lifted to C,\ncompiled for x86-64 and linked with a host runtime that stands in for the console's OS and graphics API on Vulkan.\n\nThis is the fourth game on that code and the first Switch 2 title, so the project also tests how much of the shared\ncore survives a new console generation.\n\n## Status\n\nAs of 2026-11-06 (details and dates in [docs\u002Fplan.md](docs\u002Fplan.md), the shader work in\n[docs\u002Fphase3.md](docs\u002Fphase3.md)):\n\n- The dump extracts (`tools\u002Fextract_nup.py`, the Switch 2's `.nup` container and zbic-compressed NSOs), the three\n  game modules lift to C and `oot.exe` builds and links (Phase 1).\n- The game runs its whole start-up without a crash: audio, saves, the NPLN services offline, 3,661 shader programs\n  loaded, and presents frames (Phase 2). On the way the port met the Switch 2 and SDK 22 differences listed in the\n  plan (new kernel queries, thread-local layout, PAC prologues, NVN2 entry points).\n- Phase 3, the shaders: the Switch 2's shaders are SM86 (Ampere) code in an NVN2 container, which the Maxwell\n  translator from the earlier ports cannot read. `tools\u002Fshader_census.py` pulls the 14,363 programs out of the game's\n  archives, `runtime\u002Fsm86_lower.c` lowers them to Maxwell in front of the unchanged translator (93.6% of the corpus\n  lowers, and every lowered program translates), and the host binds the lowered jump tables itself. With that the\n  boot logo renders at 60 fps through translated shaders.\n- The title screen, which in this version is a looping cinematic, plays. SDK 22's movie library decodes through\n  console services this host does not serve; `runtime\u002Fov_movie22.c` replaces it and decodes the AV1 stream with\n  dav1d, and the game's neural upscaler, which runs on the Switch 2's tensor cores (HMMA, LDSM, MOVM), upscales it\n  to 2560x1440. HMMA runs on the host GPU's tensor cores through Vulkan cooperative matrices, and the title plays at\n  60 fps. Next: the 656 skinning vertex shaders the lowering still\n  refuses (register pressure), the mesh stages, and whatever lies past the cinematic.\n\nThis repository contains no game content. You need your own dump of the game and the keys from your own console. The\ncontent check (`tools\u002Fcheck_content.py`, run by the pre-commit hook and CI) keeps it that way.\n\n## Building\n\nThe game is not playable yet (see Status); these steps build what there is. Commands are shown for Windows; from WSL\nthe same scripts run (the build itself still uses Windows Python and MSYS2 through interop).\n\nNeeds:\n\n- Python 3.14 or later for the extraction (its standard library reads zstd), and a Python 3.12 or later venv with\n  `tools\u002Frequirements.txt` for the generator and the build.\n- MSYS2 with the UCRT64 toolchain: gcc (for `tools\u002Fbuild_zbic.py`), clang, lld and ninja, and the libraries the game\n  links (SDL3, Vulkan headers and loader, Vulkan Memory Allocator, opus, libvpx, dav1d). The tools look for it in\n  `OOT_MSYS2`, then `toolchain\u002Fmsys64` in the repository, then `C:\\msys64`.\n- The .NET 10 SDK and the MSVC build tools for the shader translator.\n- A Vulkan GPU; the title screen's upscaler is fastest with `VK_KHR_cooperative_matrix` (recent NVIDIA, AMD or Intel).\n- About 30 GB free for the extracted RomFS, besides the dump.\n\nSteps:\n\n1. Copy `config.example.toml` to `config.local.toml` and point `base` at your `.nup`.\n2. `python tools\u002Fbuild_zbic.py` builds the decoder for the Switch 2's compressed executables.\n3. `py -3.14 tools\u002Fextract_nup.py` extracts the ExeFS and RomFS to `build\u002Fextracted\u002Fv131072\u002F` and checks every file\n   against the hash in the container. `tools\u002Fbuild_game.py` takes only a checked RomFS, so do not pass\n   `--no-verify`; to redo only the RomFS, add `--romfs-only`.\n4. `python recomp\u002Fgen.py --exefs build\u002Fextracted\u002Fv131072\u002Fexefs --out generated\u002Fv131072` lifts the game's code to C\n   (about a gigabyte of it).\n5. `python tools\u002Fbuild_xlate.py` builds the shader translator, then `python tools\u002Fbuild_game.py` compiles and links\n   `build\u002Fv131072\u002Foot.exe`.\n6. Run `build\\v131072\\oot.exe`, or `python3 tools\u002Frun.py` from WSL, which also sets the environment and keeps the\n   window's focus (the game pauses without it).\n\n## License\n\nMIT, see [LICENSE](LICENSE). Code from other projects is listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).\n","这是一个将《塞尔达传说：时之笛》（Switch 2 版本）静态重编译为原生 Windows 程序的研究型项目。它通过逆向提取游戏二进制模块、将其反汇编并提升为 C 代码，再经 x86-64 编译与 Vulkan 运行时链接，替代原主机操作系统和图形接口。项目支持 SDK 22 特性适配，包括 NVN2 图形容器解析、SM86 着色器向 Maxwell 指令集的自动降级、AV1 视频解码（dav1d）及基于 Vulkan Cooperative Matrices 的神经上采样（HMMA）。适用于游戏逆向工程研究、跨平台重编译技术验证与任天堂新旧平台兼容性分析。",2,"2026-11-14 04:36:06","CREATED_QUERY"]