Repository navigation
Conversation
…pp (experimental) Ocarina of Time (0400486024DEC000, SDK 22.2.8, NVN2 231.40) on the TotK runtime (GAME_OOT + GAME_NS2). build_app.py makes a Mac app from your own dump; no game content is included. See games/oot/README.md and docs/ns2-port.md. - Translator (games/oot/prebuilt, for this game only): Ampere front end from seedds/nxnative (MIT), guarded deferred writes, per-type texture tables, task and mesh stages, one raw pool lookup per invocation. - Memory: pools stay unwired, textures made only for IDs shaders really read. - Frame rate: game barriers, overlapping dispatches, mesh draws in the pass, incremental type view sweep, view lookup cache. - Game time follows the measured frame time at main+0x6e6cc4, 60 fps cap. - build_app.py: this game's table entry, base-only dumps, optional fonts; ns2_shader_corpus.py reads the game's Zstandard dictionaries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tiHubFpduDtd8tQGw7wEA
Ocarina of Time's output size (layer render targets and the NVN crop) is DisplayConfig's base size, written only by setBaseSize at main+0x1087f40. Two verified veneers redirect it to a host-chosen size: one at setBaseSize's entry, one in the per-frame cfg update at main+0x6502f8 that calls setBaseSize when the request changes, so the engine's own resize path (the one dock/undock uses) re-creates the targets and the 3D scene follows the output every frame. Both original words are checked, as is the padding after the frame-step stub and the loader's parameter page. The Resolution row in the settings panel, the "resolution WxH" input command and TOTK_OUTPUT_RES now work for Ocarina of Time: 16:9, both sides multiples of 8, from 640x360 up to the game's own 2560x1440 swapchain. The default stays the shipped 2048x1152 and TOTK_OUTPUT_RES=0 skips the patch. Aspect stays 16:9. TOTK_OOT_DISPLAY_LOG=1 logs request vs. what setBaseSize was given (off by default). runtime_output_size_valid is shared by the panel's choices and Custom input; Bananza's and Pokopia's acceptance rule is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… process Ocarina of Time opens nn::hid when the ocarina first runs (main+0x329541c -> sdk+0x10be854). The runtime had no handler for it, so sm answered "service hid not implemented" and stopped the process. Input, rumble and motion already reach the game through the SDK hooks in hid_feedback.c, so the service only answers: every command returns success with a zeroed reply, which nn::hid::Initialize and its style-set / handle queries accept. The first 12 commands are logged, so a call that really needs data can be recognised. Tested on bd3e70e from a Hateno save, including the ocarina, on an M3 Max (48 GB): the process no longer stops, and the rest of the session was stable.
|
Follow-up with a fix for a crash found while testing this branch: playing the ocarina stops the process. OoT opens Opened Kolkka#2: a Tested on |
|
Another OoT fix from testing, separate from the hid service (Kolkka#2): The Fix: use an empty PR: Kolkka#3 Tested on M3 Max 48 GB with the Hyrule Castle save: before, 1,878 |
feat(oot): live output resolution up to the game's 2560x1440 swapchain
fix(oot): serve the nn::hid service, so the ocarina does not stop the process
OoT: use a null fragment for depth-only mesh pipelines
From nxnative (seedds/nxnative, MIT), up to 028a2631. Mesh stage (MeshStage.cs): - all vertex blocks come before the primitive blocks, with the point size ahead of the position and the topology from the control section (3ccb7da0) - index bytes are reserved for whole primitive blocks, so lanes of a max_p 126 mesh no longer write past the stage memory (d365496d) - position is invariant; mesh libraries compile with preserveInvariance (e5f1adee) Translator (patch 0012, SharedStore.cs): - LDSM is fenced by subgroup barriers (16776913) - a pixel shader's depth follows four registers per enabled target (473c9026) - 64 and 128-bit raw global loads are one vector load (04419bc2) - shared memory byte and half-word stores are one Metal store (ffebfd59) - MUFU.SIN/COS, ATOMS.INC/DEC/CAS, ALU carries and modifiers, half pairs and directed I2F/F2F rounding as Ampere computes them (b5948342, 1a410e6e, b97f0dc6, 9dc81953, 645d3029) The prebuilt translator is rebuilt and the development shader cache namespace is bumped. Every shader changes, so the first load after this freezes while Metal compiles them. Kokiri Forest from a loaded save, one run each, shaders already built: 48-50 fps with this change, 37-38 fps with the mesh changes alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tiHucPmA6R8Fqbf1Y85ny
|
Voice acting was missing for a RomFS-path reason, not audio decoding. OoT requests voice lines as Fix proposed against It collapses repeated separators before the RomFS index lookup and adds a |
|
The other two mesh-replay fixes are now proposed against
One correction from testing: OoT reads the first index from word 1, not NVN2's word 3. Word 3 removed the grass and made distant vertices tear, so the PR defaults to word 1 and keeps the NVN2 |
Conflicts kept from both sides: the Makefile's dav1d flags and input_prompts.m, the type-view drop and image_view release in the texture registry, the pool binding kinds in the reflection, and a new development shader cache name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tiHucPmA6R8Fqbf1Y85ny
OoT requests voice lines as content://Voice/Resource//Stream/... . The RomFS validator rejected the empty interior component, so every voice stream open returned not-found while music and effects (single slash) worked. Collapse repeated separators before index lookup and cover the Resource//Stream form in probe-fs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tiHucPmA6R8Fqbf1Y85ny
driver_bank_fill already writes these tables at 0x670 and 0x770. drv_fillable did not know them, so drv_scan logged reads of them as unfilled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tiHucPmA6R8Fqbf1Y85ny
…ink input prompts The voice-path fix accepted empty components in romfs_path_valid_relative itself. That broke tests/test_romfs_paths.c (rom:/dir//file is expected to fail) and the add-on content lookup, which did not collapse. The validator is strict again. romfs_path_relative_collapsed collapses repeated separators and then validates, and both RomFS and add-on content requests use it. New test cases cover voice paths, "." and ".." after a double slash, and overflow. docs/audio-troubleshooting.md is updated to match. The OoT link line needs runtime/input_prompts.m, which origin/main added to the other games' lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tiHucPmA6R8Fqbf1Y85ny
|
Closing as 33a36ea is merged |
What
The Legend of Zelda: Ocarina of Time (
0400486024DEC000, SDK 22.2.8, NVN2 231.40) as a build ofgames/totk(GAME_OOT+GAME_NS2), like Donkey Kong Bananza and Pokémon Pokopia.build_app.pymakes a Mac app from your own dump. No game content is included.Status on a 16 GB Apple silicon Mac
Known limits
TOTK_NDSR_BYPASS=0runs it), so the picture is softer than the console's.CONTRIBUTING.mdasks for a correct picture before a fast one: this is a known gap.(0,1,0)over 30% of the screen). Whether the console shows them is not known.TOTK_GAME_SPEEDscales it.Main changes
Packaging
build_app.py: this game's entry in the Switch 2 table, a dump with no update, optional system fonts (no run has asked for them; a request stops the runtime).ns2_shader_corpus.pyreads the game's Zstandard dictionaries (Pack/ZsDic.pack.zs) andLayout2Shader/.games/oot/prebuilt/macos-arm64/totk_xlate(8 MB, frompublish_native.sh): this game's own translator.games/totk/prebuiltis unchanged, so other games keep theirs.Game time
main+0x6e6cc4, so below 60 fps it ran slow. It is now the measured frame time, averaged over 5 frames as on Tears of the Kingdom. The same 3 s walk ends in about the same place at 51 fps and at a 30 fps cap (compared by eye). The host caps at 60 fps by its own clock.Translator (
tools/totk_xlate)patches/0009: guarded Ampere deferred writes. Glyph quads had lost their y coordinate, so all menu text was missing.patches/0010: Ampere front end synced from seedds/nxnative (MIT)339d9f23. Part of this touches shared lowering, not only Ampere.patches/0011: a raw memory access remembers the pool table entry it chose last (after nxnative0f510fd5).Pools.cs: per-type texture tables, aseenbitmap of what shaders read,[[early_fragment_tests]]where safe.Hmma.cs,MeshStage.cs,patches/0008: HMMA lowering, task and mesh stages.Host: memory
pool_holds). The application pool is 9 GB.Host: frame rate
barrier_game), compute dispatches with no barrier between them overlap (after cheemu21/kid-with-sword-remake, MIT), task and mesh draws stay in the open pass (147 to 98 passes a frame).Host: bring-up
wired_guard_checkfromgames/mkwon for this game only.docs/ns2-port.mdandgames/oot/README.mdhave the details.For reviewers
CONTRIBUTING.mdgives each game its own folder. This follows Bananza and Pokopia ingames/totk, asdocs/ns2-port.mdintends, so it changes shared files.GAME_OOTor reached only by Ampere shaders. Bananza and Pokopia now link-ldav1d.zbicpackage (Kinnay, GPLv2).build_app.pyinstalls it with pip for this game's build only. It is not in the repository or the app, but please confirm this is acceptable.1.0.0is assumed, as the dump has no update. The game files were not checked for it.How it was tested
build_app.pyfrom a dump folder to a working app: 44 minutes for the last full pass, on a 16 GB Mac. The self-check passed.python -m unittest discover -s testsfrom a clean checkout of this commit: 1,537 tests, OK (6 skipped). The other CI steps were not run locally.