Movie decoder (hle_movie.c, every game), both found on the opening movie (Movie/Cutscene01.mp4, H.264 and AAC through movie::Extractor):
- AAC decoders offer at most 32 outputs (MD_NOUT_AAC; Vorbis keeps 64, video 16). The game's movie player keeps the outputs it holds in a ring of 32 entries per track (main+0xe93d4c: 0x200 bytes) and pushes with no bounds check (main+0xe94140), so with 64 the 33rd AAC output wrote its index (0x3f) and time over the next heap block, and the game crashed in sead::ExpHeap's free a second into the movie, at the same address every boot. The console's AAC decoder cannot offer more than 32, or the game would overflow there too; Monster Train 2 peaked at 30 held.
- An AAC decoder's GetOutputBufferSize is one frame (1024 samples per channel, 2048 with SBR), what each output holds. The player sizes its own AudioOut buffers by it, decodes into them and appends each whole, advancing its audio clock by size / 4 samples (main+0xe92a74); with the 128 KB Vorbis bound every 4 KB AAC frame played as 0.68 s, the clock crawled and the movie froze on its first second. Vorbis keeps the bound (its packets vary in length).
Advanced blend modes (hle_nvn.c, nvn_obj.h, nvn_mtl.m, every game): the blend state keeps the mode, the premultiplied-source flag and the overlap (with their getters), and the pipeline blends the Porter-Duff modes (ZERO, SRC, DST, SRC/DST_OVER, _IN, _OUT, _ATOP, XOR, the PLUS modes) with the fixed-function factors they amount to under uncorrelated overlap (adv_blend); the others keep the state's functions with a red line naming the mode. The game's levels set SRC_OVER on one blend state, which the host used to ignore.
DM_PROBE_POLL takes a value filter (=<value>): every change is logged, the threads are snapshotted and dumped only at changes to that value. That is how the ring overflow was caught: DM_PROBE_WATCH on the heap link made the movie's file reads into the same page fail.
Profile: the provisional profile's guesses held (no system resource, a 3.14 GB heap in the 4 GB layout, modules main subsdk0 sdk), plus render_cond on (the game skips clears under render conditions; without it every level was black behind its HUD). 12,691 shaders (BNSH / BAHS in the zstd RomFS and main), all translated. Pad only (main imports no touch screen), the default 2D layout. A prewarm list recorded on the Mac from a fresh save over the route above (550 lines; with it nothing was built on demand). Checked: the NSP script packs it from the NSPs with the profile in dm/games; the graphics run list and the 49 tool tests pass; after rebasing on 6d34984 (spin waits) the game boots into level 1-1 as before. README (gallery, a Mac picture of level 1-1; 2D layout), AGENTS.md (57 -> 58) and docs/development.md, docs/agents 03 / 04 / 05 say so
2.8 KiB
2.8 KiB
| 1 | # Game profile of Mario vs. Donkey Kong (Switch, update 1.0.1 = v65536 over the cartridge base game v0). Plays on the Mac (the opening movie, the title, file select, the first cutscene, level 1-1 with its switches and spring, the pause menu, level select and the save, at 60 fps with sound) | |||||
|---|---|---|---|---|---|---|
| 2 | # Format: see dm/games/README.md | |||||
| 3 | # Nintendo's sead / agl / gsys engine on SDK 15.3.0 with NVN, the SDK's movie library (subsdk0) for its H.264 / AAC cutscenes (Movie/*.mp4 through movie::Extractor), and an AudioOut of its own for their sound. | |||||
| 4 | # The shaders are BNSH / BAHS in RomFS (zstd .zs files) and main, as in the other EPD-style games. Input is the pad only (main imports no touch screen); the provisional profile's guesses held, | |||||
| 5 | # with render_cond added and two host changes in the movie decoder (hle_movie.c: at most 32 audio outputs, one AAC frame per output) | |||||
| 6 | # ---- Identity ---- | |||||
| 7 | title_id | 0100B99019412000 | ||||
| 8 | program_id | 0100B99019412000 | ||||
| 9 | # ---- App ---- | |||||
| 10 | # Game name: only a label for profile listings and the Mac window title; the iOS app name is the game name in the base NSP, and the bundle ID comes from the base game title ID (build_ipa.sh / NSP script) | |||||
| 11 | name | Mario vs. Donkey Kong | ||||
| 12 | ipa | MarioVsDonkeyKong.ipa | ||||
| 13 | app_category | public.app-category.games | ||||
| 14 | # ---- Versions ---- | |||||
| 15 | # the base game is a cartridge dump (.xci); only the merged 1.0.1 copy is extracted | |||||
| 16 | build | v65536 | 1.0.1 | main=43ae51ee9766867da5f1272ca0d3d8a6 | subsdk0=34577ede441d6dddaa1af845b7869356 | sdk=d5a1029a57d8cd4fdf4eacad87b0cfd0 |
| 17 | package | v65536 | ||||
| 18 | shader_versions | v65536 | ||||
| 19 | # ---- Files ---- | |||||
| 20 | # subsdk0 is the SDK's movie library (NintendoSDK_movie 15.3.0), which main imports from | |||||
| 21 | modules | main subsdk0 sdk | ||||
| 22 | romfs_marker | Model/World08_Textures.bfres.zs | ||||
| 23 | zip_store | .bwav:.mp4:.xtx:.zs:.metallib | ||||
| 24 | # ---- Memory ---- | |||||
| 25 | # The NPDM declares no system resource, so the game has no virtual address memory: it sets a heap of the application pool − used memory (3.14 GB) and allocates from it. | |||||
| 26 | # The block is 256 MB in front + 256 MB alias region + 256 MB stack region + 3.25 GB heap region | |||||
| 27 | mem_reserve | 0x100000000 | ||||
| 28 | mem_alias | 0x10000000 | ||||
| 29 | mem_stack | 0x10000000 | ||||
| 30 | app_pool | 0xCD500000 | ||||
| 31 | # the NPDM declares no system resource: IsVirtualAddressMemoryEnabled is false, as on Horizon | |||||
| 32 | sys_resource | 0x0 | ||||
| 33 | # ---- Graphics ---- | |||||
| 34 | # the game skips clears under render conditions (SetRenderEnableConditional): without evaluating them every level was black behind its HUD | |||||
| 35 | render_cond | on | ||||
| 36 | # ---- Shader split (shader_split.py; BNSH / BAHS) ---- | |||||
| 37 | shader_groups | /Model/=model /Pack/=pack /Sequence/=sequence /Banc/=banc /Scene/=scene /Effect/=effect /Sound/=sound /Layout/=layout /Tex/=tex /ViewPlaneIntroSequence/=viewplaneintrose /Env/=env /AI/=ai /Mals/=mals /Lib/=lib /Movie/=movie /RSDB/=rsdb /CameraSequence/=camerasequence /UI/=ui /Lua/=lua /System/=system /Component/=component /Font/=font /GameData/=gamedata /GameParameter/=gameparameter | ||||
| 38 | shader_note | Mario vs. Donkey Kong shaders |