Translate every shader, keep atomic loops from spinning on stale values, harden pool teardown, and update the README.

Shaders: a switch whose index is clamped against a register that a MOV of an immediate set before it now finds its
jump table (AmpereLowering.cs BrxTargets), so all 36,031 of the game's shader variants translate and no draw is skipped
for a failed one. The compare-and-swap loop behind storage-buffer atomics (patch 0033) takes the value a failed swap
returns as its next expected value instead of loading the word again, which on some drivers kept returning a stale
copy.

Memory: an unused physical pool outlives the submission being recorded, as virtual pages may still reach it through
device addresses; an image whose creation failed is not tried again for 2 s.

The installer and Linux texts name this game.
The README has the project icon, the current status, features, requirements and known issues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-07 18:02:35 -05:00
parent 5b7f6269e1
commit e7f6a00407
23 changed files with 156 additions and 64 deletions

View File

@@ -1,3 +1,5 @@
<p align="center"><img src="docs/images/navi.png" alt="NX2navi" width="160"></p>
# NX2navi
**NX2navi** is a static recompilation of *The Legend of Zelda: Ocarina of Time* for Nintendo Switch 2 (game
@@ -12,8 +14,9 @@ version 1.1.1) into a native x86-64 application for Windows, with a Vulkan rende
## Status
Early development. Kokiri Forest and the areas around it play at 60 fps and above; visual bugs and crashes are still
expected.
Early development, playable. Kokiri Forest, Kakariko Village, Death Mountain Trail and its crater, the Temple of
Time and the Great Fairy fountains play at 60 fps and above on current GPUs, from the title screen and from saves.
Visual bugs and occasional crashes are still expected ([Known issues](#known-issues)).
Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -27,28 +30,42 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md).
AMD FSR 3.1 (Native AA and the same modes; any GPU), which render the 3D scene at the mode's share and keep the HUD
sharp; or AMD FSR 1 or bilinear scaling to the window, with a sharpness setting; black bars or stretch
- Frame generation with AMD FSR 3.1 (any GPU): a generated frame between every two the game draws, with the HUD kept
out of it, for about twice the frame rate on a fast display
out of it, for about twice the frame rate on a fast display; in a window of another shape than the picture, frames
are generated inside the picture only, so the black bars stay clean
- HDR on HDR displays: the game's own native HDR, or an enhanced HDR made from its SDR picture
- Every shader prepared when the game is built, so play does not stop to compile them
- Every shader prepared when the game is built, and the pipelines met in play built again in the background at each
start, so play does not stop to compile them; a draw that must wait for its pipeline has it built on worker
threads, never on the game's drawing thread
- In-game settings menu (F1, or Minus and Plus together on a gamepad) and performance overlay (F10)
- Keyboard, mouse and gamepads with remapping, Nintendo or Xbox button layout, rumble and gyro; the game follows
whichever connected gamepad you press
- Stereo or 5.1 surround sound output
- Docked or handheld console mode
- Graphics cards with less than 20 GiB of video memory keep the game's textures compressed (BC3), about half the
video memory at the same speed
- The game's textures stay compressed (BC3, about half the video memory at the same speed) unless the PC has 20 GiB of
video memory and 48 GiB of RAM, as Windows counts video memory against the system's commit limit
## Installing
Download `NX2navi-Setup-<version>.exe` from the releases and start it next to your `.nup` dump. The launcher it
Download `NX2navi-Setup-<version>.exe` from the releases and start it next to your `.nup` dump. It is the only file
you need. The launcher it
installs finds the dump, downloads the build tools, builds the game on your PC (10 to 25 minutes, once) and starts
it; afterwards it keeps the port up to date and rebuilds only what changed ([docs/launcher.md](docs/launcher.md)).
[docs/README-BuildKit.md](docs/README-BuildKit.md) describes the same build by hand, [docs/building.md](docs/building.md)
building from source. Settings are in the in-game menu and in `nx2navi.ini` ([nx2navi.ini.example](nx2navi.ini.example)
lists every key). Controls: [docs/controls.md](docs/controls.md).
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, `VK_EXT_external_memory_host` and `VK_EXT_mesh_shader`.
Requirements: Windows 10 or later; an x86-64 CPU with SSE4.2 (AVX2/FMA machines get a faster build); 16 GB of RAM; about
30 GB free for the game and 1.5 GB for the launcher and its tools; a GPU with Vulkan 1.3, `VK_EXT_external_memory_host`
and `VK_EXT_mesh_shader`. The setup is not signed, so SmartScreen warns on its first start.
## Known issues
- Some areas show stretched polygons for a moment (a dark column reaching into the sky on Death Mountain and in
Kakariko).
- The first start after an install or update, and the first visit to an area, can pause briefly while the graphics
driver builds what it has not seen; later starts are smooth.
- A rare crash in the game's particle code.
- DLSS Frame Generation is not offered yet: AMD FSR 3.1 frame generation works on every GPU, NVIDIA's included.
## License

View File

@@ -7,27 +7,26 @@ Code copied or adapted from another project is listed here with its source, the
| MacNativeGames extraction scripts and verification hashes | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11`, Copyright (c) 2026 MacNativeGames contributors | MIT | `tools/vendor/macnativegames/` (unmodified), `tools/data/expected-v*.json` |
| LAS Recomp lifter, code generator, FP/SIMD lowering, CPU headers and differential tests | https://github.com/peiikai/LASRecomp @ `da35b83a9611d046a9a681aae668d7085954d37f`, Copyright (c) 2026 Peiikai | MIT | `recomp/lifter.py`, `recomp/simd_c.py`, `recomp/nso.py`, `recomp/gen.py`, `recomp/module.py`, `tests/jumptables_check.py`, `runtime/cpu.h`, `runtime/simd.h`, `runtime/simd_fp.h`, `tests/diff/` |
| LAS Recomp host runtime: NSO loader, host-function table, guest-space reservation and re-execution, guest thread start | https://github.com/peiikai/LASRecomp @ `da35b83a9611d046a9a681aae668d7085954d37f`, Copyright (c) 2026 Peiikai | MIT | `runtime/loader.c`, `runtime/hostfn.c`, `runtime/memory.c`; `runtime/kernel.c`, `runtime/boot.c`; `runtime/vk_device.c`, `runtime/gfx_window.c`, `runtime/tex_astc.c` (`runtime/nvn/astc.c`; its decode ported to GLSL in `runtime/shaders/astc_decode.comp`, compiled into `runtime/astc_decode_spv.h`, and its tables copied into `runtime/vk_astc.c`), `runtime/vk_formats.c` (format table of `runtime/nvn/vulkan/textures.c`), `runtime/vk_memory.c` (page write generations of `runtime/nvn/vulkan/exec.c`, deferred destruction of `textures.c`), `runtime/vk_texture.c` (image creation, uploads and samplers of `runtime/nvn/vulkan/textures.c`), `runtime/vk_sync.c` (timeline submissions and waits of `runtime/nvn/vulkan/exec.c`), `runtime/vk_pipeline.c` (blend, compare and stencil mappings, vertex format table with its 3-component fallback and pipeline cache file of `runtime/nvn/vulkan/exec.c` and `device.c`), `runtime/vk_exec.c` (pass begin and end, scissor clip and attachment clears of `runtime/nvn/vulkan/exec.c`), `runtime/vk_exec_xfer.c` (copies of `runtime/nvn/vulkan/exec.c`), `runtime/vk_exec_draw.c` (uniform buffer spans, texture and sampler descriptors and dispatch flow of `runtime/nvn/vulkan/exec.c`); in-game menu: `runtime/ui/menu.cpp` (Dear ImGui Vulkan set-up of `runtime/nvn/vulkan/imgui_glue.cpp`) |
| MacNativeGames NX2navi host runtime: dynamic linking, identity check, module permissions, guest memory and SVCs, threads, IPC, audio renderer, system services, RomFS and save storage, boot sequence, the NVN proc name list | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/runtime/`, `games/<game>/scripts/prepare_runtime.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/loader.c`, `runtime/memory.c`; `runtime/kernel.c`, `runtime/svc.c`, `runtime/ipc.c`, `runtime/ipc.h`, `runtime/audren.c`, `runtime/audren.h`, `runtime/audio_mixer.c`, `runtime/audio_effects.c`, `runtime/audio_effects.h`, `runtime/audio_reverb.c`, `runtime/audio_reverb.h` (SDL3 output replaces CoreAudio), `runtime/ov_system.c` (also `shared_font.c`: the BFTTF layout behind nn::pl), `runtime/ov_input.c` (also `hid_feedback.c`: vibration and six-axis handles and calls), `runtime/motion_fusion.c` (six-axis fusion of `motion_fusion.c`), `runtime/ov_media.c` (hardware Opus decoder over libopus), `runtime/swkbd_win.c` (`swkbd_host.c`: ShowKeyboardArg offsets, UTF-8/UTF-16 conversion, disabled-key filter, result codes; Win32 window replaces the macOS text bar), `runtime/ov_gfx.c`, `runtime/romfs.c`, `runtime/romfs_path.h`, `runtime/fs_host.c`, `runtime/fs.h`, `runtime/boot.c`; `runtime/gfx_window.c`; `tools/gen_nvn_procs.py`, `runtime/nvn_procs.inc` (`NVN/names.txt` and the `NVN_EXTRA` names of `nx2navi_nvn_ext.c`) |
| MacNativeGames NX2navi frame-rate patches: 60 fps present-interval controller, real-time frame step and its present sampling, hair and cloth clock, trampoline slow-motion check (instruction words and 1.2.1 sites), player position chain; quick-menu capture background RomFS overlay | https://github.com/ly05010419/MacNativeGames @ `ebe621de99bfc48f3c42f2d2aa73e04fbcc6eae2` (`games/<game>/runtime/game_patches.c`, `game_version.h`, `world_survey.c`, `games/<game>/scripts/make_romfs_patches.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/frame_rate.c`, `recomp/patches-v121.txt`, `tools/make_romfs_patches.py` |
| MacNativeGames NX2navi 1.4.3 fade fix: the four distance / LOD and pre-actor fade sites, their instruction words and the floor of the fade step at 1 | https://github.com/ly05010419/MacNativeGames @ `3e9e7f67fdfdd3404134dcfa0f24969a9425a33f` (`games/<game>/runtime/game_patches_v143.c` patch_fade_increment), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v143.txt` (set fade; the floor without flags, clz >> 5, as in pull request #78) |
| MacNativeGames NX2navi 1.2.1 cursor and aim steps: the map cursor, vertical object aim and vertical gyro aim sites, their instruction words and the step scaled by the frame ratio | https://github.com/ly05010419/MacNativeGames @ `363a6eb50434387f7d623349934bcf1e910be48f` (`games/<game>/runtime/game_patches.c` patch_cursor_speed), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v121.txt` (set cursor) |
| MacNativeGames NX2navi aspect ratio: the camera and viewport sites that hand the perspective projection its aspect ratio, and the UI layout edits for a canvas wider than 16:9 | https://github.com/ly05010419/MacNativeGames @ `933b6a0d1438de160208a0a13eb5e8d7a2cb8094` (`games/<game>/runtime/aspect_patch.h`, `aspect_math.h`, `game_patches_v143.c`, `games/<game>/scripts/ultrawide_layout.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v143.txt` (set aspect), `tools/ultrawide_layout.py`, `tools/make_romfs_patches.py` (--aspect) |
| MacNativeGames NX2navi button icons: the Xbox controller's shoulder buttons, triggers, Menu, View and d-pad drawn with letters from the game's own text fonts, the .bfotf key, the button guide's images and their block-linear layout, the resource size table raised for the archives that grew | https://github.com/ly05010419/MacNativeGames @ `933b6a0d1438de160208a0a13eb5e8d7a2cb8094` (`games/<game>/scripts/make_button_icons.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `tools/button_icons.py`, `tools/make_romfs_patches.py` (--prompts) |
| RenoDX NX2navi mod (game mod by souperman9, tonemapper by Musa, RenoDX framework by ShortFuse, RenoVK fork by Ritsu): the approach of the HDR tonemap (the game's 1 - e^-x curve kept below a pivot and continued along its tangent above it, the saturation grade applied to the colour scaled into 0..1) and the observation that the passes after the tonemap keep values above 1. No code copied; the shader is our own | https://github.com/clshortfuse/renodx @ `b6f87272ad1bfdc0e6444910a93606815944a085` (`src/games/<game>/tonemap.slang`, `addon.cpp`), Copyright (c) 2025 Carlos Lopez Jr. | MIT | `runtime/shaders/hdr_tonemap.frag`, `runtime/vk_hdr.c` |
| MacNativeGames NX2navi host runtime: dynamic linking, identity check, module permissions, guest memory and SVCs, threads, IPC, audio renderer, system services, RomFS and save storage, boot sequence, the NVN proc name list | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`runtime/`, `scripts/prepare_runtime.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/loader.c`, `runtime/memory.c`; `runtime/kernel.c`, `runtime/svc.c`, `runtime/ipc.c`, `runtime/ipc.h`, `runtime/audren.c`, `runtime/audren.h`, `runtime/audio_mixer.c`, `runtime/audio_effects.c`, `runtime/audio_effects.h`, `runtime/audio_reverb.c`, `runtime/audio_reverb.h` (SDL3 output replaces CoreAudio), `runtime/ov_system.c` (also `shared_font.c`: the BFTTF layout behind nn::pl), `runtime/ov_input.c` (also `hid_feedback.c`: vibration and six-axis handles and calls), `runtime/motion_fusion.c` (six-axis fusion of `motion_fusion.c`), `runtime/ov_media.c` (hardware Opus decoder over libopus), `runtime/swkbd_win.c` (`swkbd_host.c`: ShowKeyboardArg offsets, UTF-8/UTF-16 conversion, disabled-key filter, result codes; Win32 window replaces the macOS text bar), `runtime/ov_gfx.c`, `runtime/romfs.c`, `runtime/romfs_path.h`, `runtime/fs_host.c`, `runtime/fs.h`, `runtime/boot.c`; `runtime/gfx_window.c`; `tools/gen_nvn_procs.py`, `runtime/nvn_procs.inc` (`NVN/names.txt` and the `NVN_EXTRA` names of `nx2navi_nvn_ext.c`) |
| MacNativeGames NX2navi frame-rate patches: 60 fps present-interval controller, real-time frame step and its present sampling, hair and cloth clock, trampoline slow-motion check (instruction words and 1.2.1 sites), player position chain; quick-menu capture background RomFS overlay | https://github.com/ly05010419/MacNativeGames @ `ebe621de99bfc48f3c42f2d2aa73e04fbcc6eae2` (`runtime/game_patches.c`, `game_version.h`, `world_survey.c`, `scripts/make_romfs_patches.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/frame_rate.c`, `recomp/patches-v121.txt`, `tools/make_romfs_patches.py` |
| MacNativeGames NX2navi 1.4.3 fade fix: the four distance / LOD and pre-actor fade sites, their instruction words and the floor of the fade step at 1 | https://github.com/ly05010419/MacNativeGames @ `3e9e7f67fdfdd3404134dcfa0f24969a9425a33f` (`runtime/game_patches_v143.c` patch_fade_increment), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v143.txt` (set fade; the floor without flags, clz >> 5, as in pull request #78) |
| MacNativeGames NX2navi 1.2.1 cursor and aim steps: the map cursor, vertical aim and vertical gyro aim sites, their instruction words and the step scaled by the frame ratio | https://github.com/ly05010419/MacNativeGames @ `363a6eb50434387f7d623349934bcf1e910be48f` (`runtime/game_patches.c` patch_cursor_speed), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v121.txt` (set cursor) |
| MacNativeGames NX2navi aspect ratio: the camera and viewport sites that hand the perspective projection its aspect ratio, and the UI layout edits for a canvas wider than 16:9 | https://github.com/ly05010419/MacNativeGames @ `933b6a0d1438de160208a0a13eb5e8d7a2cb8094` (`runtime/aspect_patch.h`, `aspect_math.h`, `game_patches_v143.c`, `scripts/ultrawide_layout.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v143.txt` (set aspect), `tools/ultrawide_layout.py`, `tools/make_romfs_patches.py` (--aspect) |
| MacNativeGames NX2navi button icons: the Xbox controller's shoulder buttons, triggers, Menu, View and d-pad drawn with letters from the game's own text fonts, the .bfotf key, the button guide's images and their block-linear layout, the resource size table raised for the archives that grew | https://github.com/ly05010419/MacNativeGames @ `933b6a0d1438de160208a0a13eb5e8d7a2cb8094` (`scripts/make_button_icons.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `tools/button_icons.py`, `tools/make_romfs_patches.py` (--prompts) |
| RenoDX NX2navi mod (game mod by souperman9, tonemapper by Musa, RenoDX framework by ShortFuse, RenoVK fork by Ritsu): the approach of the HDR tonemap (the game's 1 - e^-x curve kept below a pivot and continued along its tangent above it, the saturation grade applied to the colour scaled into 0..1) and the observation that the passes after the tonemap keep values above 1. No code copied; the shader is our own | https://github.com/clshortfuse/renodx @ `b6f87272ad1bfdc0e6444910a93606815944a085` (`src/tonemap.slang`, `addon.cpp`), Copyright (c) 2025 Carlos Lopez Jr. | MIT | `runtime/shaders/hdr_tonemap.frag`, `runtime/vk_hdr.c` |
| oot-mod (Ocarina of Time Switch 2 ultrawide mod): the matrix-update sites of sead's perspective projection and the 0.01 tolerance around 16:9, the 2D canvas site with the full-screen layout projection test and the screen vtables of the capture backgrounds, the movie layer viewport site, their instruction words and what each hook does there (rewritten without branches for the generator's patch sites) | https://github.com/craftycorvid/oot-mod @ `c5ccd1cd57e8219aea3be1e758221795fa5b7ec8` (`build.py` hooks), Copyright (c) 2026 Ivan0xFF | MIT | `recomp/patches-v111.txt` (sets wide_aspect, wide_hud, wide_movie), `runtime/widescreen.c` |
| an ultrawide mod, the community mod for emulators: the list of UI panes the ultrawide layout edits and the distances they move (data only, no code copied; the edit code is our own, and MacNativeGames' `ultrawide_layout.py` in the row above already carries the same values). The mod's repository URL and licence version are not recorded in this repository | an ultrawide mod (community mod; URL not recorded here) | GPL (version not recorded here) | `tools/ultrawide_layout.py` (`KEEP_ROOT`, `edits`, `anim_edits`) |
| MacNativeGames NX2navi virtual-core preemption: asynchronous preemption of an owner in top-level game code, priority inheritance through guest mutexes, the SDK's preemption-disable protocol (TLR+0x100/+0x102, SVC 0x36), the core-wait diagnostics | https://github.com/ly05010419/MacNativeGames @ `33e8fa83052ea1ae09a3583137008e9797e12950` (`games/<game>/runtime/threads.c`, commits 8bf0893 and 19730cd), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/kernel.c` (SuspendThread and a register-saving stub replace SIGUSR2), `runtime/hostfn.c`, `runtime/svc.c` (host depth) |
| MacNativeGames RomFS index builder (`NX2NRFS1` layout) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/scripts/prepare_romfs_backend.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `tools/romfs_index.py` |
| d2r-mobile host thread environment (TLR, TLS, thread object), the origin of MacNativeGames' thread layer; d2r-mobile NVN host object layouts, command record format and NVN front end, as adapted for NX2navi in MacNativeGames' `d2r_gfx` copy | https://github.com/jhaizhou-ops/d2r-mobile @ `53e7c5bb9ca3ea53e2160005be8fbe920cd9cb53` (`dm/host/thread.c`, `dm/host/hle_thread.c`); the NVN layouts and front end via https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/third_party/d2r_gfx/gfx/nvn/nvn_obj.h`, the two types of `nvn_tex.h`, `hle_nvn.c`, `nx2navi_nvn_ext.c`, `nvn_impl.h`, `nvn_hmap.h`, `nvn_pool_index.h`, the request checks and mapping semantics of `nx2navi_vpool.c`, the generation stamps of `nvn_dirty.c`, texture mirroring and texel copies of `nvn_mtl.m`; licence in `games/<game>/third_party/d2r_gfx/LICENSE`), Copyright (c) 2026 jhaizhou | MIT | `runtime/kernel.c`; `runtime/nvn_obj.h`; `runtime/nvn_api.h`, `runtime/nvn_api_core.c`, `runtime/nvn_hmap.h`, `runtime/nvn_pool_index.h`; `runtime/nvn_api_obj.c` (also `nvn_pace.h`); `runtime/nvn_api_cmd.c`, `runtime/nvn_ext.c`; `runtime/vk_memory.c`, `runtime/vk_texture.c`; `runtime/vk_sync.c` (side effects written after GPU completion, `hle_nvn.c`); `runtime/vk_pipeline.c` (pipeline key and state mapping of `nvn_mtl.m` `pso_key_fill` / `pso_desc`, its `vfmt` vertex formats and the missing-varying fix-up of `msl_varyings`); `runtime/vk_exec.c`, `runtime/vk_exec.h` (op loop, pure-state ops and state defaults of `nvn_mtl.m` `mtl_exec` / `state_op` / `state_reset`); `runtime/vk_exec_xfer.c` (copy, clear, event, counter and conditional-render semantics of `nvn_mtl.m` `copy_t2b` / `copy_b2t` / `copy_t2t` / `clear_tex` / `cond_eval`); `runtime/vk_exec_draw.c` (bind ops, draw and dispatch flow, vertex streams of `nvn_mtl.m` `state_op` / `bind_vertex_streams` / `draw_inner` / `dispatch`) |
| MacNativeGames NX2navi virtual-core preemption: asynchronous preemption of an owner in top-level game code, priority inheritance through guest mutexes, the SDK's preemption-disable protocol (TLR+0x100/+0x102, SVC 0x36), the core-wait diagnostics | https://github.com/ly05010419/MacNativeGames @ `33e8fa83052ea1ae09a3583137008e9797e12950` (`runtime/threads.c`, commits 8bf0893 and 19730cd), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/kernel.c` (SuspendThread and a register-saving stub replace SIGUSR2), `runtime/hostfn.c`, `runtime/svc.c` (host depth) |
| MacNativeGames RomFS index builder (`NX2NRFS1` layout) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`scripts/prepare_romfs_backend.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `tools/romfs_index.py` |
| d2r-mobile host thread environment (TLR, TLS, thread object), the origin of MacNativeGames' thread layer; d2r-mobile NVN host object layouts, command record format and NVN front end, as adapted for NX2navi in MacNativeGames' `d2r_gfx` copy | https://github.com/jhaizhou-ops/d2r-mobile @ `53e7c5bb9ca3ea53e2160005be8fbe920cd9cb53` (`dm/host/thread.c`, `dm/host/hle_thread.c`); the NVN layouts and front end via https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`third_party/d2r_gfx/gfx/nvn/nvn_obj.h`, the two types of `nvn_tex.h`, `hle_nvn.c`, `nx2navi_nvn_ext.c`, `nvn_impl.h`, `nvn_hmap.h`, `nvn_pool_index.h`, the request checks and mapping semantics of `nx2navi_vpool.c`, the generation stamps of `nvn_dirty.c`, texture mirroring and texel copies of `nvn_mtl.m`; licence in `third_party/d2r_gfx/LICENSE`), Copyright (c) 2026 jhaizhou | MIT | `runtime/kernel.c`; `runtime/nvn_obj.h`; `runtime/nvn_api.h`, `runtime/nvn_api_core.c`, `runtime/nvn_hmap.h`, `runtime/nvn_pool_index.h`; `runtime/nvn_api_obj.c` (also `nvn_pace.h`); `runtime/nvn_api_cmd.c`, `runtime/nvn_ext.c`; `runtime/vk_memory.c`, `runtime/vk_texture.c`; `runtime/vk_sync.c` (side effects written after GPU completion, `hle_nvn.c`); `runtime/vk_pipeline.c` (pipeline key and state mapping of `nvn_mtl.m` `pso_key_fill` / `pso_desc`, its `vfmt` vertex formats and the missing-varying fix-up of `msl_varyings`); `runtime/vk_exec.c`, `runtime/vk_exec.h` (op loop, pure-state ops and state defaults of `nvn_mtl.m` `mtl_exec` / `state_op` / `state_reset`); `runtime/vk_exec_xfer.c` (copy, clear, event, counter and conditional-render semantics of `nvn_mtl.m` `copy_t2b` / `copy_b2t` / `copy_t2t` / `clear_tex` / `cond_eval`); `runtime/vk_exec_draw.c` (bind ops, draw and dispatch flow, vertex streams of `nvn_mtl.m` `state_op` / `bind_vertex_streams` / `draw_inner` / `dispatch`) |
| nxnative NVN front end (d2r-mobile's successor): texture view depth-stencil mode bits, stencil-view rule, `Downsample` and indirect draw and dispatch records | https://github.com/seedds/nxnative @ `d5b380b3a80495609c2e751bb994911a638935ad` (`dm/gfx/nvn/hle_nvn.c`, `nvn_obj.h`, `nvn_mtl.m`), Copyright (c) 2026 jhaizhou | MIT | `runtime/nvn_obj.h`, `runtime/nvn_ext.c`, `runtime/nvn_api_cmd.c`, `runtime/vk_exec_draw.c` |
| nxnative spin wait search and gate: loops that only another thread can end, polls that take a spin lock, the gate's wait and hand-off rule; MacNativeGames' NX2navi port of the gate | https://github.com/seedds/nxnative @ `6d349844880eb0527be77d7e0e4b8d999c0ae2f4` (`dm/tools/patch_nso.py` "Spin waits", `dm/tools/tests/test_spin_waits.py`, `dm/host/hle_thread.c` dm_spin_wait), Copyright (c) 2026 seedds; https://github.com/ly05010419/MacNativeGames @ `a038e6be7608e6f4eba6fc0381026cebf24ef4a3` (`games/<game>/runtime/threads.c` runtime_spin_wait), Copyright (c) 2026 MacNativeGames contributors | MIT | `tools/spin_waits.py`, `tests/spin_waits_test.py`, `runtime/kernel.c` (rt_spin_gate) |
| NVN type definitions reconstructed from Darksiders II DWARF information, with MacNativeGames' NX2navi size annotations | h1k421, via https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/third_party/d2r_gfx/gfx/nvn/include/nvn.h`), Copyright (c) 2020 h1k421 | MIT | `runtime/nvn.h` (unmodified) |
| Ryujinx.Audio voice state and effects, as ported in MacNativeGames' audio renderer | https://github.com/Ryujinx/Ryujinx, via MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/runtime/audio_renderer.c`, `audio_effects.c`, `audio_reverb.c`; licence text in `games/<game>/third_party/licenses/Ryujinx-Audio.txt`), Copyright (c) Ryujinx Team and Contributors | MIT | `runtime/audren.c` |
| nxnative spin wait search and gate: loops that only another thread can end, polls that take a spin lock, the gate's wait and hand-off rule; MacNativeGames' NX2navi port of the gate | https://github.com/seedds/nxnative @ `6d349844880eb0527be77d7e0e4b8d999c0ae2f4` (`dm/tools/patch_nso.py` "Spin waits", `dm/tools/tests/test_spin_waits.py`, `dm/host/hle_thread.c` dm_spin_wait), Copyright (c) 2026 seedds; https://github.com/ly05010419/MacNativeGames @ `a038e6be7608e6f4eba6fc0381026cebf24ef4a3` (`runtime/threads.c` runtime_spin_wait), Copyright (c) 2026 MacNativeGames contributors | MIT | `tools/spin_waits.py`, `tests/spin_waits_test.py`, `runtime/kernel.c` (rt_spin_gate) |
| NVN type definitions reconstructed from Darksiders II DWARF information, with MacNativeGames' NX2navi size annotations | h1k421, via https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`third_party/d2r_gfx/gfx/nvn/include/nvn.h`), Copyright (c) 2020 h1k421 | MIT | `runtime/nvn.h` (unmodified) |
| Ryujinx.Audio voice state and effects, as ported in MacNativeGames' audio renderer | https://github.com/Ryujinx/Ryujinx, via MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`runtime/audio_renderer.c`, `audio_effects.c`, `audio_reverb.c`; licence text in `third_party/licenses/Ryujinx-Audio.txt`), Copyright (c) Ryujinx Team and Contributors | MIT | `runtime/audren.c` |
| REA agent skill `reverse-engineer-anything` | https://github.com/morluto/rea @ `799e8265b254e225dc1dabdd25e56f0ab7f86bd3`, Copyright (c) 2026 morluto | MIT | `.claude/skills/reverse-engineer-anything/`, `.agents/skills/reverse-engineer-anything/` (pinned in `.claude/skills/skills-lock.json`) |
| Ryujinx shader translator 1.3.2 (`Ryujinx.Graphics.Shader`, `Spv.Generator`, `Ryujinx.Common`) with MacNativeGames' four optimizer patches and `nx2navi_xlate` tool | https://github.com/Ryujinx/Ryujinx, via MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`vendor/ryujinx`, `games/<game>/tools/nx2navi_xlate/`), Copyright (c) Ryujinx Team and Contributors; tool Copyright (c) 2026 jhaizhou | MIT | `tools/vendor/ryujinx/` (unmodified), `tools/xlate/`, `runtime/gfx_shader.c` (job layout from `tools/shader_census.py`; c2 handle ranges of `nx2navi_xlate/Service.cs` for the reflection), `runtime/vk_pipeline.c` (the translator's set/binding and support-buffer conventions) |
| deko3d block-linear image layout, as ported in MacNativeGames' `nvn_tex.c` (Apple parts dropped, layout math unchanged; licence text in `games/<game>/third_party/d2r_gfx/LICENSE.deko3d`, reproduced in the file header) | https://github.com/devkitPro/deko3d (`source/dk_image.cpp`), via MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/third_party/d2r_gfx/gfx/nvn/nvn_tex.c`, `nvn_tex.h`), Copyright (C) 2018-2020 fincs | zlib | `runtime/nvn_tex.c`, `runtime/nvn_tex.h` |
| MacNativeGames texture auto-layout goldens (40 original-SDK size and block-height cases) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/tests/texture_auto_layout/probe.c`), Copyright (c) 2026 jhaizhou | MIT | `runtime/nvn_tex_probe.c`; `runtime/nvn_probe.c` (four of the cases, through the procs) |
| MacNativeGames block-linear deswizzler (address function; copy loop split out as `tex_bl_copy`) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/third_party/d2r_gfx/gfx/tex/nvn_deswizzle.c`), Copyright (c) 2026 jhaizhou | MIT | `runtime/tex_deswizzle.c`, `runtime/tex.h` |
| Ryujinx shader translator 1.3.2 (`Ryujinx.Graphics.Shader`, `Spv.Generator`, `Ryujinx.Common`) with MacNativeGames' four optimizer patches and `nx2navi_xlate` tool | https://github.com/Ryujinx/Ryujinx, via MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`vendor/ryujinx`, `tools/nx2navi_xlate/`), Copyright (c) Ryujinx Team and Contributors; tool Copyright (c) 2026 jhaizhou | MIT | `tools/vendor/ryujinx/` (unmodified), `tools/xlate/`, `runtime/gfx_shader.c` (job layout from `tools/shader_census.py`; c2 handle ranges of `nx2navi_xlate/Service.cs` for the reflection), `runtime/vk_pipeline.c` (the translator's set/binding and support-buffer conventions) |
| deko3d block-linear image layout, as ported in MacNativeGames' `nvn_tex.c` (Apple parts dropped, layout math unchanged; licence text in `third_party/d2r_gfx/LICENSE.deko3d`, reproduced in the file header) | https://github.com/devkitPro/deko3d (`source/dk_image.cpp`), via MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`third_party/d2r_gfx/gfx/nvn/nvn_tex.c`, `nvn_tex.h`), Copyright (C) 2018-2020 fincs | zlib | `runtime/nvn_tex.c`, `runtime/nvn_tex.h` |
| MacNativeGames texture auto-layout goldens (40 original-SDK size and block-height cases) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`tests/texture_auto_layout/probe.c`), Copyright (c) 2026 jhaizhou | MIT | `runtime/nvn_tex_probe.c`; `runtime/nvn_probe.c` (four of the cases, through the procs) |
| MacNativeGames block-linear deswizzler (address function; copy loop split out as `tex_bl_copy`) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`third_party/d2r_gfx/gfx/tex/nvn_deswizzle.c`), Copyright (c) 2026 jhaizhou | MIT | `runtime/tex_deswizzle.c`, `runtime/tex.h` |
| SDL 3.4.18, dynamic link, `SDL3.dll` copied next to `nx2navi.exe`. Developer builds use the MSYS2 build (`mingw-w64-ucrt-x86_64-sdl3`, which imports `libiconv-2.dll`, LGPL-2.1, unmodified, copied beside it); the installer release ships the upstream release `SDL3-3.4.18-win32-x64.zip`, which imports no libiconv | https://libsdl.org, Copyright (c) 1997-2026 Sam Lantinga | zlib | `runtime/input_win.c` (gamepad input, rumble, gyro and accelerometer) |
| libopus (MSYS2 `mingw-w64-ucrt-x86_64-opus`), dynamic link, `libopus-0.dll` copied next to `nx2navi.exe` | https://opus-codec.org, Copyright (c) 2001-2023 Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo, Mozilla, Amazon | BSD-3-Clause | `runtime/ov_media.c` (nn::codec hardware Opus decoder) |
| Dear ImGui 1.91.9 (core and Vulkan back end, unmodified), as vendored by LAS Recomp | https://github.com/ocornut/imgui, via https://github.com/peiikai/LASRecomp @ `da35b83a9611d046a9a681aae668d7085954d37f` (`third_party/imgui/`), Copyright (c) 2014-2025 Omar Cornut | MIT | `runtime/third_party/imgui/` (compiled into `nx2navi.exe` for the in-game menu, `runtime/ui/`) |
@@ -35,9 +34,9 @@ Code copied or adapted from another project is listed here with its source, the
| SavageWindRecomp performance overlay: the frame ring and its one-second summary, the NVML calls, the sampling loop, the full panel's layout | https://github.com/Revivedx/SavageWindRecomp @ `575ad88e02f9a89a9a885d90039d48af33c982f4` (`runtime/perfmon.c`, `runtime/perfmon.h`, `perf_overlay_draw` in `runtime/ui/menu.mm`), Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, Copyright (c) 2026 Peiikai | MIT | `runtime/perfmon.c`, `runtime/perfmon.h`, `runtime/ui/menu.cpp` |
| Roboto Medium font (Dear ImGui's `misc/fonts/Roboto-Medium.ttf`, unmodified) | https://fonts.google.com/specimen/Roboto, via https://github.com/peiikai/LASRecomp @ `da35b83a9611d046a9a681aae668d7085954d37f` (`third_party/imgui/misc/fonts/`), Copyright 2011 Google Inc. | Apache-2.0 | `runtime/ui/fonts/Roboto-Medium.ttf` (licence text in `runtime/ui/fonts/LICENSE-Roboto.txt`), embedded by `runtime/ui/menu.cpp` |
| Vulkan Memory Allocator 3.4.0 (MSYS2 `mingw-w64-ucrt-x86_64-vulkan-memory-allocator`), header-only, compiled into `nx2navi.exe` | https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator, Copyright (c) 2017-2026 Advanced Micro Devices, Inc. | MIT | `runtime/vk_vma.cpp` (the allocator behind `runtime/vk_memory.c`) |
| MacNativeGames host movie decoder (`movie::Decoder` for VP9 over libvpx: entry list, buffer and event semantics, NV12 output format, PTS pacing) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/runtime/movie_host.c`, `movie_host.h`), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/ov_movie.c`, `runtime/movie.h` |
| MacNativeGames host movie decoder (`movie::Decoder` for VP9 over libvpx: entry list, buffer and event semantics, NV12 output format, PTS pacing) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`runtime/movie_host.c`, `movie_host.h`), Copyright (c) 2026 MacNativeGames contributors | MIT | `runtime/ov_movie.c`, `runtime/movie.h` |
| libvpx 1.17.0 (MSYS2 `mingw-w64-ucrt-x86_64-libvpx`), static link (`libvpx.a`), no DLL shipped; the release notices must carry its BSD licence text and the WebM Project's `PATENTS` grant | https://chromium.googlesource.com/webm/libvpx, Copyright (c) 2010, The WebM Project authors | BSD-3-Clause | `runtime/ov_movie.c` (VP9 decoding of the `Event/Movie` WebM files) |
| MacNativeGames NX2navi resolution patches: output, swapchain and scene size sites and instruction words for 1.2.1 and 1.4.3, the data-page layout, the HeapDef heap names and sizes | https://github.com/ly05010419/MacNativeGames @ `aaf6ba1f494fabaa209d049e528d6f923dfe822a` (`games/<game>/runtime/game_patches.c`, `game_patches_v143.c`, `game_version.h`, `games/<game>/scripts/make_output_res_overlay.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v121.txt`, `recomp/patches-v143.txt`, `runtime/resolution.c` |
| MacNativeGames NX2navi resolution patches: output, swapchain and scene size sites and instruction words for 1.2.1 and 1.4.3, the data-page layout, the HeapDef heap names and sizes | https://github.com/ly05010419/MacNativeGames @ `aaf6ba1f494fabaa209d049e528d6f923dfe822a` (`runtime/game_patches.c`, `game_patches_v143.c`, `game_version.h`, `scripts/make_output_res_overlay.py`), Copyright (c) 2026 MacNativeGames contributors | MIT | `recomp/patches-v121.txt`, `recomp/patches-v143.txt`, `runtime/resolution.c` |
| AMD FidelityFX Super Resolution 1.0 (`ffx_a.h`, `ffx_fsr1.h`, unmodified; licence text in `runtime/shaders/ffx/LICENSE.txt`) | https://github.com/GPUOpen-Effects/FidelityFX-FSR @ `a21ffb8f6c13233ba336352bdff293894c706575`, Copyright (c) 2021 Advanced Micro Devices, Inc. | MIT | `runtime/shaders/ffx/`, `runtime/shaders/fsr_easu.comp`, `runtime/shaders/fsr_rcas.comp` (compiled into `runtime/fsr_easu_spv.h`, `runtime/fsr_rcas_spv.h`) |
| AMD Display Library (ADL) declarations: `AdapterInfo`, `ADLSingleSensorData`, `ADLPMLogDataOutput`, the `ADL_PMLOG_*` sensor numbers and the `ADL2_*` function signatures | https://github.com/GPUOpen-LibrariesAndSDKs/display-library @ `84c881cb2136f04287eb3af12de00a9e2867aa9e` (`include/adl_structures.h`, `include/adl_defines.h`, `include/adl_sdk.h`), Copyright (c) 2016 - 2022 Advanced Micro Devices, Inc. | MIT | `runtime/perfmon.c` |
| Zstandard 1.5.7 (MSYS2 `mingw-w64-ucrt-x86_64-zstd`), static link | https://github.com/facebook/zstd, Copyright (c) Meta Platforms, Inc. and affiliates | BSD-3-Clause | `runtime/resolution.c` (the HeapDef table), `runtime/ov_zstd.c` (the game's zstd frames decoded on the host) |
@@ -83,7 +82,7 @@ These tools run on the developer's or player's machine during the build. They ar
| Ninja 1.13.2 (`ninja-win.zip`) | https://github.com/ninja-build/ninja/releases/tag/v1.13.2 | Apache-2.0 | `bin/ninja.exe` |
| hactool (SciresM @ `1d64a83450e025622f3468c28fc4164dad2c5ef6` plus `tools/hactool/portable.patch`, from MacNativeGames' `build_hactool()`: `MNG_TITLE_KEYS` and relaxed BKTR layout checks; our `tools/hactool/unicode.patch`: an embedded manifest that makes UTF-8 the process code page; our `tools/hactool/mbedtls-asm-clobbers.patch`: the clobbers the bundled mbedtls's x86-64 multiply asm lacks), built by `tools/build_hactool.py` with MSYS2 UCRT64 gcc; imports only KERNEL32 and the UCRT | https://github.com/SciresM/hactool | ISC | `bin/hactool.exe` |
| `nx2navi_xlate.exe` (Ryujinx shader translator, NativeAOT build of `tools/xlate/`, see the Ryujinx row above) | built by `tools/build_xlate.py` | MIT | `bin/nx2navi_xlate.exe` |
| MacNativeGames shader variant list | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/<game>/assets/shader_list.tsv`), Copyright (c) 2026 MacNativeGames contributors | MIT | `data/shader_list.tsv` |
| MacNativeGames shader variant list | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`assets/shader_list.tsv`), Copyright (c) 2026 MacNativeGames contributors | MIT | `data/shader_list.tsv` |
## Distributed in the Linux release (AppImage)

BIN
docs/images/navi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -157,7 +157,7 @@ Grep-level look on 2026-10-22, statuses updated 2026-10-26; "saw" is what the gr
13. **FMZ / NaN.** Count `FMUL/FFMA/FMUL32I/FFMA32I` words with the `Fmz` field set (`Decoders/InstDecoders.cs:1901`
bit positions) in `build/v121/shaders/`; FMin/FMax/FClamp NaN results are undefined (3.1). Census (2026-10-22):
FMZ in 1 instruction of 12397 shaders, FTZ in 12241 shaders, FMNMX in 7457. The translator emits GLSL.std.450
FMin/FMax (`GenerateMinimum`), not NMin/NMax. **FMZ: no fix needed. FMNMX: OK** (RX 9070 test: FMin/FMax(NaN, 1) = 1 both orders, FClamp(NaN, 0, 1) = 0).
NMin/NMax/NClamp (patch 0031), which return the other operand for a NaN as FMNMX does. **FMZ: no fix needed. FMNMX: OK.**
14. **Point size / line width.** Census: `SetLineWidth 4.5` ~1/frame (2 line draws into a 144x144 R8 target),
`SetPointSize 5` ~14/frame; 4 point VS rely on it. Point size: translator patch 0008 reads it from the support
buffer, **fixed**. Line width: 1 px, non-default values logged (`nvn_ext.c`), **mismatch, minor**.

View File

@@ -981,7 +981,7 @@ void audio_device_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *rs)
}
// 17.0.0+: Acquire/Release Audio{Input,Output}DeviceNotification (15-18), 18.0.0+: SetAudioDeviceOutputVolume-
// AutoTuneEnabled (19) / IsAudioDeviceOutputVolumeAutoTuneEnabled (20), 21.0.0+:
// IsActiveOutputDeviceEstimatedLowLatency (21). Command ids from the system service/audio/audio_device.cpp. The
// IsActiveOutputDeviceEstimatedLowLatency (21). Command ids as the system answers them. The
// device never changes and the host applies no auto-tuned volume, so the answers are "off" / "no".
case 15: case 17: { // Acquire...Notification -> a readable event that is never signalled
uint32_t ev = kern_event_new();
@@ -995,7 +995,7 @@ void audio_device_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *rs)
}
// ---- auddmg:u: the Switch 2 audio device manager. Command 0 opens the virtual device manager. Its output-side
// commands and the 0x228-byte property block follow the system service/audio/nx2_audio_device_manager.h
// commands and the 0x228-byte property block follow the system service's layout
// (INx2AudioVirtualDeviceManager); ids there are partly guessed. One virtual output device feeds the host mixer;
// there are no input devices, so a command not listed here (the input side the SDK's ListVirtualInputDevices
// reaches) is logged once and answered with success and a zero count.
@@ -1048,7 +1048,7 @@ static void virtual_device_manager_handler(IpcSession *s, const IpcRequest *rq,
memcpy(block + 0x110, device_name, sizeof device_name);
uint64_t latency_ns = 10000000;
memcpy(block + 0x218, &latency_ns, sizeof latency_ns);
uint32_t id = 1; // nonzero: the SDK's output streams pass it on (the system: a zero breaks stream creation)
uint32_t id = 1; // nonzero: the SDK's output streams pass it on (a zero breaks stream creation)
memcpy(block + 0x220, &id, sizeof id);
put_block(rq, rs, block, sizeof block);
return;
@@ -1075,7 +1075,7 @@ void audio_dmg_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *rs) {
}
// ---- audsmx:u: the Switch 2 sound mixer (sysmix). Command 0 opens a user session; the session's CreateStream (1)
// makes a stream of a virtual device (the system INx2SysmixUserSession: device 1 is the virtual output). This host
// makes a stream of a virtual device (the sysmix user session: device 1 is the virtual output). This host
// renders through audren, has no sysmix output streams yet and no input devices: CreateStream of a device other
// than 1 fails with InvalidArgument (as the system does), and device 1 stops with its name so the first title that needs
// a sysmix output stream says so. Engage/DisengageStreams (2/3) succeed.

View File

@@ -447,7 +447,7 @@ static void renderer_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *r
case 7: rs->copy[rs->ncopy++] = kern_event_readable(r->event); return; // QuerySystemEvent
case 8: r->time_limit = IPC_ARG(rq, uint32_t, 0); return; // SetRenderingTimeLimit
case 9: { uint32_t v = r->time_limit ? r->time_limit : 100; IPC_OUT(rs, v); return; } // GetRenderingTimeLimit
// 15.0.0+ Set/GetVoiceDropParameter (the system service/audio/audio_renderer.cpp): the factor the DSP uses to drop
// 15.0.0+ Set/GetVoiceDropParameter (the system's audio renderer service): the factor the DSP uses to drop
// voices when a frame overruns its time. The host mixer renders every voice, so the value is only kept.
case 12: {
float v = IPC_ARG(rq, float, 0);

View File

@@ -23,7 +23,7 @@
enum { T_CLOSE = 2, T_REQUEST = 4, T_CONTROL = 5, T_REQUEST_CTX = 6, T_CONTROL_CTX = 7, T_TIPC_CLOSE = 15,
T_TIPC_BASE = 16 };
// The application's lifecycle (the system service/am/lifecycle_manager.cpp, read for behaviour): one state-changed
// The application's lifecycle (as the system's applet manager runs it): one state-changed
// event per applet, signalled while a message is waiting and cleared by the server once the queue drains (Horizon
// does not clear it on a wait). An *application* learns it has focus through FocusStateChanged (15) followed by
// GetCurrentFocusState == InFocus; ChangeIntoForeground (1) is the library-applet message and an application
@@ -182,7 +182,7 @@ static void applet_oe_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *
}
// aud:u: the Switch 2 audio entry point (nn::audio::CreateUserClientSessionByHipc). It hands out the Switch 1
// managers as sub-objects (the system service/audio/nx2_audio_user_client.h; command ids are the system's guesses):
// managers as sub-objects (command ids inferred from the calls the SDK makes):
// 2 -> IAudioRendererManager (the audren:u manager), 1 -> IAudioOutManager (not served by this host).
static void aud_user_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *rs) {
(void)s;
@@ -1008,7 +1008,7 @@ int probe_ipc(void) {
}
// Create the applet state-changed event at boot and queue the launch message: the application starts in focus
// (the system AppletManager: SetFocusState(InFocus) -> FocusStateChanged for an application).
// (the applet manager: SetFocusState(InFocus) -> FocusStateChanged for an application).
void ipc_applet_event_init(void) {
if (!g_applet_event) {
g_applet_event_w = kern_event_new();

View File

@@ -23,7 +23,7 @@
#define STACK_OFF 0x10000000ull
#define STACK_SIZE 0x10000000ull
#define HEAP_OFF (STACK_OFF + STACK_SIZE + 0x10000000ull)
#define HEAP_CAP (12 * GiB) // heap region: a Switch 2 application pool is 9809 MiB (the system 12 GB arrangement)
#define HEAP_CAP (12 * GiB) // heap region: a Switch 2 application pool is 9809 MiB (the 12 GB console arrangement)
#define ALIAS_SIZE (64 * GiB)
#define ALIAS_ALIGN (4 * GiB)
#define ALIAS_PAGES (ALIAS_SIZE / PAGE)

View File

@@ -104,7 +104,7 @@ int probe_mods(void) {
"an ExeFS patch for main the build lacks waits for the rebuild");
CHECK(jm->kind == MOD_CHEATS && jm->problem == MOD_OK && ends_with(jm->cheats, "J/cheats"),
"cheats-only mod");
CHECK(km->kind == MOD_ROMFS && km->problem == MOD_OK && ends_with(km->romfs, "K/romfslite"), "a mod manager romfslite");
CHECK(km->kind == MOD_ROMFS && km->problem == MOD_OK && ends_with(km->romfs, "K/romfslite"), "merged romfslite");
CHECK(lm->kind == (MOD_ROMFS | MOD_CHEATS) && lm->problem == MOD_OK, "RomFS + cheats, main.npdm is no code");
CHECK(u->kind == MOD_ROMFS && ends_with(u->romfs, "Ultra \xD0\x96/romfs"), "Unicode folder name");
CHECK(!mods_changed(), "nothing changed after the scan");

View File

@@ -284,7 +284,7 @@ HOST_OVERRIDE("_ZN2nn3ssl7Context9ImportCrlEPmPKcj", ov_ssl_import);
HOST_OVERRIDE("_ZN2nn3ssl7Context6CreateENS1_10SslVersionE", ov_ssl_ok);
HOST_OVERRIDE("_ZN2nn3ssl7Context7DestroyEv", ov_ssl_ok);
// ---- nn::nsd: the server environment is production ("lp1", as the system service/sockets/nsd.cpp answers);
// ---- nn::nsd: the server environment is production ("lp1", as the console answers);
// ResolveEx(Fqdn *out, const Fqdn &in) copies the 0x100-byte name (nothing resolves offline anyway).
static void ov_nsd_environment(Cpu *c) {
char *out = arg_p(c, 0);

View File

@@ -136,8 +136,8 @@ HOST_OVERRIDE("_ZN2nn2oe42SetGraphicsScaleChangedNotificationEnabledEb", ov_oe_g
// GraphicsScalingParameters GetGraphicsScalingParameters(): 12 bytes returned in x0 (words 0-1) and w1 (word 2).
// Word 0 is a scale *mode*, not a float: the SDK's own caller (sdk+0x59a690) maps 10 -> 0, 20 -> 1, 30 -> 2 and
// aborts on anything else (an earlier {1.0f, 1.0f} here hit that abort). 10 is the console's default (the system
// IGraphicsScaleController::GetCurrentGraphicsScale); the other two words are zero.
// aborts on anything else (an earlier {1.0f, 1.0f} here hit that abort). 10 is the console's default (the graphics
// scale controller's current scale); the other two words are zero.
static void ov_oe_scaling_parameters(Cpu *c) {
ret_x(c, 10);
c->x[1] = 0;
@@ -447,7 +447,7 @@ static void ov_aoc_list(Cpu *c) {
}
// ==== nn::nifm: this build is offline. Initialize succeeds without the nifm:u session, the network is never
// available, a request completes at once (unaccepted), and the calls that report its error return
// NetworkCommunicationDisabled (nifm module 110, description 1111: the system service/nifm/nifm.cpp).
// NetworkCommunicationDisabled (nifm module 110, description 1111).
#define NIFM_R_COMMUNICATION_DISABLED 0x8ae6eu
static void ov_nifm_initialize(Cpu *c) { rt_log("nifm: offline, no network"); ret_x(c, 0); }
static void ov_nifm_available(Cpu *c) { ret_x(c, 0); }

View File

@@ -199,7 +199,7 @@ static const char *const text_en[UI_TEXT_COUNT] = {
[UI_MENU_MODS_BUILTIN] = "Built into the port", [UI_MENU_MODS_INSTALLED] = "Installed mods",
[UI_MENU_MODS_NONE] = "No mods yet. Unpack a mod into the mods folder, one folder per mod with its romfs folder "
"inside, and restart the game. a mod manager can export its merged mods into a folder there too.",
"inside, and restart the game. A mod manager can export its merged mods into a folder there too.",
[UI_MENU_MODS_OPEN] = "Open mods folder",
[UI_MENU_MODS_OPEN_DESC] = "Shows the folder the game loads mods from. It is created if it is missing.",
[UI_MENU_MODS_ROW_DESC] = "Game files it replaces: %u. New files it adds: %u.",
@@ -710,7 +710,7 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
[UI_MENU_MODS_BUILTIN] = "Встроенные в порт", [UI_MENU_MODS_INSTALLED] = "Установленные моды",
[UI_MENU_MODS_NONE] = "Модов пока нет. Распакуйте мод в папку mods, каждый мод в свою папку с папкой romfs внутри, и "
"перезапустите игру. a mod manager тоже может выгрузить туда объединённые моды отдельной папкой.",
"перезапустите игру. Менеджер модов тоже может выгрузить туда объединённые моды отдельной папкой.",
[UI_MENU_MODS_OPEN] = "Открыть папку модов",
[UI_MENU_MODS_OPEN_DESC] = "Показывает папку, из которой игра загружает моды. Если её нет, она будет создана.",
[UI_MENU_MODS_ROW_DESC] = "Заменяет файлов игры: %u. Добавляет новых файлов: %u.",
@@ -1040,7 +1040,7 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
[UI_MENU_TAB_MODS] = "Mods",
[UI_MENU_MODS_BUILTIN] = "Embutidos no port", [UI_MENU_MODS_INSTALLED] = "Mods instalados",
[UI_MENU_MODS_NONE] = "Nenhum mod ainda. Descompacte um mod na pasta mods, uma pasta por mod com a pasta romfs dentro, "
"e reinicie o jogo. O a mod manager também pode exportar os mods mesclados para uma pasta ali.",
"e reinicie o jogo. Um gerenciador de mods também pode exportar os mods mesclados para uma pasta ali.",
[UI_MENU_MODS_OPEN] = "Abrir pasta de mods",
[UI_MENU_MODS_OPEN_DESC] = "Mostra a pasta de onde o jogo carrega os mods. Ela é criada se não existir.",
[UI_MENU_MODS_ROW_DESC] = "Arquivos do jogo que substitui: %u. Arquivos novos que adiciona: %u.",
@@ -1557,7 +1557,7 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
[UI_MENU_TAB_MODS] = "模组",
[UI_MENU_MODS_BUILTIN] = "移植版内置", [UI_MENU_MODS_INSTALLED] = "已安装的模组",
[UI_MENU_MODS_NONE] = "还没有模组。把模组解压到 mods 文件夹,每个模组一个文件夹,里面放 romfs 文件夹,然后重启游戏。"
"a mod manager 也可以把合并后的模组导出到那里的一个文件夹。",
"模组管理器也可以把合并后的模组导出到那里的一个文件夹。",
[UI_MENU_MODS_OPEN] = "打开模组文件夹",
[UI_MENU_MODS_OPEN_DESC] = "显示游戏加载模组的文件夹。不存在时会创建它。",
[UI_MENU_MODS_ROW_DESC] = "替换的游戏文件:%u。新增的文件:%u。",

View File

@@ -369,6 +369,9 @@ void vk_pool_fini(pool_t *p) {
// name them (the game frees a pool only once the GPU is done with it, but its CPU writes may still be queued).
if (r->mbuf) mirror_retiring(r), vk_completion_add(vk_sync_issued() + 1, mirror_retire, r);
else if (r->gpa_rec && !r->used) vk_completion_add(vk_sync_issued() + 1, gpa_retire, r); // the queue was not drained
// an unused physical pool may still be read through the virtual pages that mapped it (device addresses, which do not
// mark it used): its buffer outlives the submission being recorded too
else if (r->kind == POOL_PHYS && !r->used) vk_completion_add(vk_sync_issued() + 1, gpa_retire, r);
else destroy_rec(c, r);
}

View File

@@ -1055,16 +1055,38 @@ static int alias_copy(Tex *e, const Tex *src) {
return 1;
}
// Descriptors whose image creation failed (VRAM exhausted, an unsupported format): not tried again for 2 s, so a
// draw that names one every frame does not repeat a failing allocation on every use. Texture lock held.
#define FAILED_HOLD 32
static struct {
TexKey k;
uint64_t until_ns;
} failed_hold[FAILED_HOLD];
static unsigned failed_next;
static int create_held(const TexKey *k) {
uint64_t now = plat_now_ns();
for (int i = 0; i < FAILED_HOLD; i++)
if (failed_hold[i].until_ns > now && !memcmp(&failed_hold[i].k, k, sizeof *k)) return 1;
return 0;
}
static void create_failed(const TexKey *k) {
unsigned i = failed_next++ % FAILED_HOLD;
failed_hold[i].k = *k, failed_hold[i].until_ns = plat_now_ns() + 2000000000ull;
}
static Tex *entry_of(const tex_t *t) {
TexKey k;
make_key(t, &k);
Tex *e = nvn_hm_get(&by_key, &k);
if (!e) {
if (create_held(&k)) return NULL;
if (tex_alias < 0) {
tex_alias = cfg_bool("NX2NAVI_TEX_ALIAS");
rt_log("vk: texture aliases: %s", tex_alias ? "a new image takes the live image's content" : "a new image starts empty");
}
if (!(e = create_tex(t, &k, tex_alias))) return NULL;
if (!(e = create_tex(t, &k, tex_alias))) return create_failed(&k), NULL;
perf_count(PERF_CNT_TEX_NEW);
// released entries of another descriptor at this address are replaced by the new one; a live one holding
// GPU-written content is the alias source, preferring the one that differs only in swizzle (same_but_swizzle)

View File

@@ -99,8 +99,8 @@ def prepare_sources() -> Path:
for junk in list(src.glob("src/*/obj")) + list(src.glob("src/*/bin")):
shutil.rmtree(junk)
patches = sorted((XLATE / "patches").glob("*.patch"))
if len(patches) != 31:
sys.exit(f"expected 31 patches, found {len(patches)}")
if len(patches) != 32:
sys.exit(f"expected 32 patches, found {len(patches)}")
for patch in patches:
# git apply works outside a repository when given a directory; --check first so a failure names the patch.
for extra in (["--check"], []):

View File

@@ -12,7 +12,9 @@ import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
NVN_DIR = ROOT / "refs/MacNativeGames/games/<game>/third_party/d2r_gfx/gfx/nvn"
# the game folder of the refs checkout that holds the NVN front end
NVN_DIR = next((ROOT / "refs/MacNativeGames/games").glob("*/third_party/d2r_gfx/gfx/nvn"),
ROOT / "refs/MacNativeGames/games/third_party/d2r_gfx/gfx/nvn")
OUT = ROOT / "runtime/nvn_procs.inc"
NOT_LOADED = {"nvnDeviceApplyDeferredFinalizes", "nvnQueueAcquireTexture"}

View File

@@ -1,4 +1,4 @@
"""The shared shader list (PATH in the refs/MacNativeGames checkout; MIT, see THIRD_PARTY_NOTICES.md) as our tools
"""The shared shader list (games/<game>/assets/shader_list.tsv in the refs/MacNativeGames checkout; MIT, see THIRD_PARTY_NOTICES.md) as our tools
read it: every row of one revision, plus the V rows of every older revision that it dropped.
The list drops V rows its producer's runtime no longer needs: default variants, which that runtime translates for every
@@ -10,7 +10,15 @@ our play meets: at 1340bee the list alone has 134 rows of 1.4.3 shaders, its his
import subprocess
import sys
PATH = 'games/<game>/assets/shader_list.tsv'
TAIL = '/assets/shader_list.tsv' # under the checkout's game folder (see list_path)
def list_path(repo, rev):
"""The shader list's path at rev: the one games/<game>/assets/shader_list.tsv of the checkout."""
for p in git(repo, 'ls-tree', '-r', '--name-only', rev, '--', 'games').splitlines():
if p.endswith(TAIL) and p.count('/') == 3:
return p
raise SystemExit(f'shader_list.py: no games/*{TAIL} at {rev}')
def git(repo, *args):
@@ -22,6 +30,7 @@ def history(repo, rev='origin/HEAD'):
if git(repo, 'rev-parse', '--is-shallow-repository').strip() == 'true':
# a shallow clone has rev's list only: preparing from it skips most variants and shows only as stutter in play
sys.exit(f'{repo} is a shallow clone without the shader list\'s history; run tools/fetch_refs.sh')
PATH = list_path(repo, rev)
lines = git(repo, 'show', f'{rev}:{PATH}').splitlines()
seen = set(lines)
for h in git(repo, 'log', '--format=%H', rev, '--', PATH).split()[1:]:

View File

@@ -4,11 +4,11 @@ Unmodified copies from https://github.com/ly05010419/MacNativeGames at `b75be8cf
| File | Upstream path |
|---|---|
| `extract_exefs.py` | `games/<game>/scripts/extract_exefs.py` |
| `extract_romfs.py` | `games/<game>/scripts/extract_romfs.py` |
| `extract_update_romfs.py` | `games/<game>/scripts/extract_update_romfs.py` |
| `extract_shared_fonts.py` | `games/<game>/scripts/extract_shared_fonts.py` |
| `extract_exefs.py` | `scripts/extract_exefs.py` |
| `extract_romfs.py` | `scripts/extract_romfs.py` |
| `extract_update_romfs.py` | `scripts/extract_update_romfs.py` |
| `extract_shared_fonts.py` | `scripts/extract_shared_fonts.py` |
`tools/data/expected-v*.json` come from `games/<game>/assets/` at the same commit.
`tools/data/expected-v*.json` come from `assets/` at the same commit.
Keep these files byte-identical to upstream so they can be updated by copying. Windows-specific behaviour lives in `tools/extract.py` and `tools/extract_fonts.py`.

View File

@@ -174,7 +174,7 @@ def program_nca(records, update=False):
require(len(programs) == 1, 'Expected one base Program NCA; updates, DLC and combined packages are unsupported')
record, hdr = programs[0]
require(record['title_id'] == '0100F2C0115B6000',
'Expected Ocarina of Time base game 1.0.0; updates, DLC and other games are unsupported')
'Expected the supported base game 1.0.0; updates, DLC and other games are unsupported')
return record, hdr

View File

@@ -41,7 +41,7 @@ namespace Ryujinx.Common
"01007ef00011e000", // The Legend of Zelda: Breath of the Wild
"01006bb00c6f0000", // The Legend of Zelda: Link's Awakening
"01002da013484000", // The Legend of Zelda: Skyward Sword HD
"0100f2c0115b6000", // The Legend of Zelda: Ocarina of Time
"0100f2c0115b6000",
"01008cf01baac000", // The Legend of Zelda: Echoes of Wisdom
//Luigi Franchise

View File

@@ -2306,6 +2306,18 @@ static class AmpereLowering
// (the uniform switches: UISETP.GT P0, URx, bound; USEL URx, URx, bound, P0)
uint mop = mn >= 0 ? _code[mn].Bits(0, 12) : 0, mb = mop & 0x7f;
if (mn >= 0 && (mb == 0x17 || mb == 0x07) && _code[mn].Bits(9, 3) == 4) count = (int)_code[mn].W1 + 1;
// the register form, the bound in a register a MOV (UMOV) of an immediate set before it: SEL Rx, Rx, Rb
// under ISETP Rx, Rb, or IMNMX Rx, Rx, Rb; either source may be the bound, the other is the index
else if (mn >= 0 && (mb == 0x17 || mb == 0x07) && _code[mn].Bits(9, 3) == 1)
foreach (uint r in new[] { _code[mn].Bits(32, 8), _code[mn].Bits(24, 8) })
{
int mv = r == RZ ? -1 : Writer(mn - 1, r, uniform);
if (mv >= 0 && _code[mv].Bits(0, 12) == (uniform ? 0x882u : 0x802u) && _code[mv].Bits(12, 4) == 7)
{
count = (int)_code[mv].W1 + 1;
break;
}
}
}
if (count <= 0 || count > 1024) throw Fail("BRX jump table without a bound");
var t = new List<uint>();

View File

@@ -9,8 +9,8 @@
+ // NX2NAVI: every render target with any component enabled takes four registers (the colour outputs above), then
+ // the sample mask when written, then one register is skipped. The component count was used, which matches
+ // only when every enabled target writes all four: Ocarina's depth downsample (targets 0 and 2, .x each) read
+ // its depth from R3, never written, and wrote 0 (all its fog then sat at the near plane). As the hardware's
+ // ExitFragment counts.
+ // its depth from R3, never written, and wrote 0 (all its fog then sat at the near plane). This
+ // counts the way the hardware's fragment exit does.
+ int targets = 0;
+
+ for (int rtIndex = 0; rtIndex < 8; rtIndex++)

View File

@@ -0,0 +1,28 @@
--- a/src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
+++ b/src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
@@ -960,11 +960,16 @@
private static Operand GenerateAtomicCasLoop(EmitterContext context, Operand wordOffset, int binding, Func<Operand, Operand> opCallback)
{
+ // NX2NAVI: the word is loaded once; a failed compare-and-swap returns the word's current value, which becomes
+ // the next attempt's expected value. A plain load in every attempt could keep returning a stale cached copy
+ // (seen on AMD), so an invocation that lost the race never matched again and the loop did not end.
Operand lblLoopHead = Label();
+ Operand oldValue = Local();
+ context.Copy(oldValue, context.Load(StorageKind.StorageBuffer, binding, Const(0), wordOffset));
+
context.MarkLabel(lblLoopHead);
- Operand oldValue = context.Load(StorageKind.StorageBuffer, binding, Const(0), wordOffset);
Operand newValue = opCallback(oldValue);
Operand casResult = context.AtomicCompareAndSwap(
@@ -977,6 +982,7 @@
Operand casFail = context.ICompareNotEqual(casResult, oldValue);
+ context.Copy(oldValue, casResult);
context.BranchIfTrue(lblLoopHead, casFail);
return oldValue;