Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions dm/games/010015100B514000/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ Game-specific findings; the general host changes they led to are listed under [F

## Found on this game

- **Resolved: raw companion title/menu holds 30 fps with GPU time to spare**: [Acquire fences keep pacing out of frame-cost samples](../../../docs/reference/frame-rate.md#acquire-fences-keep-pacing-out-of-frame-cost-samples), measured 29.7 → 59.9 fps with the game's own interval controller.

- [Offline pipeline archive missing for the device GPU](../../../docs/reference/shaders.md#offline-pipeline-archive-missing-for-the-device-gpu): archive targets can follow profile metadata while iOS Metal 4 remains opt-in; [the probe above](#offline-pipeline-archive-probe) records the build evidence and open device checks.
General host changes first needed here; each applies to every game:

- **Resolved: `Ver. ?` on the title screen of a build packed from an update-only NUP**: [A game packed from a NUP or a dump shows "Ver. ?" for a build its profile registers](../../../docs/reference/packing.md#a-game-packed-from-a-nup-or-a-dump-shows-ver--for-a-build-its-profile-registers). One Mac boot before and after.

- **SDK 21 movie startup after New Game**: [Virtual output properties and the event/no-flags overload](../../../docs/reference/audio.md#sdk-21-virtual-output-properties-and-the-eventno-flags-overload).

- **Resolved: raw companion shader build failures**: [Metal parser nesting](../../../docs/reference/shaders.md#metals-parser-rejects-deeply-nested-control-flow) and [BAHS control data mistaken for descriptors](../../../docs/reference/shaders.md#a-control-sections-words-read-as-a-bahs-entry).
- **Resolved: Mac launcher metadata matches native defaults**: [A Mac front end's default settings change Metal execution paths](../../../docs/reference/packing.md#a-mac-front-ends-default-settings-change-metal-execution-paths), found by metadata generation and source inspection; no gameplay measurement.
- [A capture refused after a change to the reflection structs](../../../docs/reference/nvn-objects.md#a-capture-refused-after-a-change-to-the-reflection-structs).
- **zstd files inside a RomFS image** (`shader_split.py` `unzs`): [The zstd command given a path inside the image](../../../docs/reference/packing.md#the-zstd-command-given-a-path-inside-the-image).
Expand All @@ -123,3 +129,15 @@ General host changes first needed here; each applies to every game:
- dm/games/README.md says the heap check turns "Wonder's 1.44 GB" request into a 0xc0000000 alias region; 03 says it asks for 1.47 GB, and the profile's alias region is 0xB8000000.
- Several addresses in 02 and 03 (`main+0x1070910`, `main+0x107dbc0`, `main+0x4da5c`, `main+0xb8dec`, `main+0xcfd24`, `main+0x36ceff0`) do not name their build; the present-interval ones are from 1.2.1.
- 2 agl post-effect compute shaders do not translate.

## Raw Switch 2 companion

**Bring-up, separate from the tested Switch 1 builds above.** The unpacked 1.2.1 update can contain Switch 2 program `040015100B514001` (main build `ec47e6f8846d2a7b6892e2682845c725`) in `updates/327680/program1/`, with the original program's files beside it and DLC `010015100B515001` under nested base/update snapshots. The dump builder selects this complete Switch 2 companion by default; `--program 0` explicitly selects the primary. The companion mounts its own RomFS as `content`, the primary's as `conorig` (`DM_ROMFS_PROGRAM_0`, [indexed game files](../../../docs/reference/services.md#raw-switch-2-companion-fonts-and-indexed-game-files)) and the raw DLC as `aocup` (index 1). Unknown companion builds receive their own provisional profile outside the repository; this build needs `render_cond on` in it (below). Mac only: iOS indexed RomFS bundling is not implemented.

**New Game / Continue crash: resource heap slack.** Without it, a fresh save crashes about 3 s into New Game with `BufferInitialize: pool has no storage` and `CRASH sig=11 … h_nvnMemoryPoolGetFlags` ([#1580](https://github.com/seedds/nxnative/issues/1580)). The resource loader (`main+0x130460`) sizes each resource's ExpHeap as resource-size-table value + max(alignment, 0x20) + 8 (`main+0x1304e8..0x130514`, then `main+0x131e00`; constructor `main+0x2464d0`, vtable `main+0x394f220`). `Model/NpcCommonerA.bfres` gets `0x8d03c8` bytes; its combined MatBlock + DisplayList request `0x5424` (`main+0x1ff04c` / `+0x1ff068`) rounds to a `0x6000` GPU chunk (`main+0x287048`), leaving `0x3a8` for a `0x418` descriptor. [`patches.py`](patches.py) registers one cut for this build, `main+0x130514` `adds w0,w8,#8` → `adds w0,w8,#4,lsl #12` (+16 KB per resource heap), the allowance the Switch 1 builds carried before their command records were compacted. With the original DLC and no resource-size-table overlay, a fresh save plays the Flower Kingdom opening (its NPCs, Yoshi, the castle scene) and a copied save continues into a course. The native NVN2 byte accounting asked for in #1580 remains open; this is a heap allowance, not that correction.

**Overworld blue tint: `render_cond on`.** With the key off, ignored conditional clears wipe the half-resolution depth and occlusion targets between their full-screen draws; the occlusion mask goes black, flowerbeds turn saturated blue, nearby pipes dark blue. Frame-3300 pass dumps with the key on show equal timestamp counters skipping those repeated clears, and the map shows lavender flowerbeds, white pipes and its bright lighting ([conditional rendering](../../../docs/reference/rendering.md#conditional-rendering-evaluated-at-replay)).

**Course lighting pulsing with `DM_NVN_ENC_THREAD=1`.** With `render_cond` on, a timestamp report's 16-byte record was written in the submission's completion handler; with Metal encoding on its own thread that landed after the game had already set the counter word to 1 for a later frame's conditional clear, so the next check read `0 / 0` and skipped that frame's lighting blocks (24 of 90 course frames had four blocks skipped, the block count alternating 22 / 18). The counter word (always 0) is now stored at replay, in order with the game's writes, and the completion handler adds only the time (`nvn_mtl.m` `OP_REPORT_COUNTER`, `post_run`): 1 of 90 frames with one block, a steady 21 blocks a frame. Without the encode thread the pattern did not occur before or after.

**Title and shaders.** A 25-second native boot with isolated saves mounted `content`, `conorig` and `aocup` and reached frame 600; a diagnostic shader build rendered the Switch 2 Edition / Bellabel Park 1.2.1 title with L + R glyphs and the Start/Assist Mode menu. The full Mac shader build produces all 30,630 valid shaders with no failures: two compute shaders formerly blocked by [Metal's parser nesting limit](../../../docs/reference/shaders.md#metals-parser-rejects-deeply-nested-control-flow) build, and the apparent unsupported Ampere instruction came from [control metadata mistaken for a BAHS descriptor](../../../docs/reference/shaders.md#a-control-sections-words-read-as-a-bahs-entry) (three false descriptors now excluded). Individual Bellabel Park modes and long play are not verified.
23 changes: 23 additions & 0 deletions dm/games/010015100B514000/patches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Super Mario Bros. Wonder (010015100B514000): the rewriter's patches of this game's own builds, keyed by NSO build ID
# (dm/tools/patch_nso.py, "Registered patches"). SDK cuts live in dm/tools/sdk_patches.py.
CUTS = {
# Nintendo Switch 2 Edition, Program 1 (040015100B514001) main, display version 1.2.1.
# Resource heap slack, as the Switch 1 builds once carried (README, Memory, "Removed workaround"; issue #1580).
# The resource loader (main+0x130460) sizes each resource's sead::ExpHeap as the resource-size-table value
# + max(alignment, 0x20) + 8 (main+0x1304e8..0x130514) and passes it to the heap's create (main+0x131e00).
# On the host, Model/NpcCommonerA.bfres (heap 0x8d03c8) runs short: the model's combined MatBlock + DisplayList
# request 0x5424 (main+0x1ff04c / +0x1ff068) rounds to a 0x6000 GPU chunk (main+0x287048), leaving 0x3a8 for
# a 0x418 descriptor, and the game then initializes a buffer on a null memory pool (crash in
# nvnMemoryPoolGetFlags). The native NVN2 command sizes that would keep the request at or below 0x5000 are
# not known (#1580). Every resource heap gets 16 KB more instead: adds w0,w8,#8 -> adds w0,w8,#4,lsl #12
# (+0x4000 in place of +8). The b.eq that follows still sees the flags of the same adds.
'ec47e6f8846d2a7b6892e2682845c725': [
(0x130514, '00210031', '00114031', 'resource heap size: adds w0,w8,#8 -> adds w0,w8,#0x4000 (ExpHeap size +16 KB - 8)'),
],
}

BINDING = [
{'what': 'resource heap size +16 KB (ExpHeap create size, main+0x130514)', 'now': 'build', 'goal': 'host', 'purpose': 'memory',
'why': "the shortfall comes from the host's NVN2 command-memory accounting (#1580); a correct host representation would make the cut unnecessary for every build",
'blocked': 'the native NVN2 sizes of a recorded indexed draw are not established (#1580)'},
]
Loading
Loading