Files
seedds f4f0a85d6e patch_nso.py split into the general rewriter and per-build patch files (GitHub issue #63): every game's bring-up edited the one file, so PRs for unrelated games conflicted. dm/tools/patch_nso.py (1,711 → about 1,100 lines) keeps the general passes and the driver; the instruction encoders move unchanged to dm/tools/nso_asm.py; a game's own patches (CUTS, OBS and the frame-step stubs, now FRAME_STEP = {build ID: stub(ctx)}) move verbatim with their comments to dm/games/<id>/patches.py (16 profiles: Tears of the Kingdom, Breath of the Wild, Age of Calamity and Paper Mario: The Thousand-Year Door with their stubs), and the cuts of Nintendo's sdk module builds, 6 of the 15 shipped by 2 to 4 games, to dm/tools/sdk_patches.py. The rewriter loads every patch file, whatever the game, and applies those of a module's build ID at the points it did before (cuts before the scan, gates after the rewrite, stubs after the gates); a build ID claimed twice stops it, and its command line needs no DM_GAME. build_src.sha256 lists the rewriter's files and every patch file (the same for every module). NSP script: the rewrite step's reuse key counts nso_asm.py and only the patch files that name one of the game's builds (patch_files), profile_files leaves patches.py out (only the rewrite step reads it), and a derived profile gets none. dm/tools/tests/test_patches.py: no build claimed twice, the entries' forms, a game's file names only its own profile's non-sdk builds, sdk_patches.py only sdk builds some profile ships, and the reuse key's patch files. Checked byte-identical: every extracted module on the game drive (131 builds) rewritten with the previous and the new rewriter gives the same outputs but build_src.sha256, 28 of the 30 patched builds among them (all four frame-step mains), and 7 fail alike (rtld, and New Super Mario Bros. U Deluxe's, which no profile rewrites); the other two (Super Mario Bros. Wonder's mains and Absolum's, no game files here) by their CUTS / OBS data, equal to the previous tables. AGENTS.md, docs, dm/games/README.md, the profiles' comments and the host comments that named a game's cut in patch_nso.py now name its patches.py or sdk_patches.py
2026-10-23 23:36:21 +08:00

2.8 KiB

1# Game profile of Hollow Knight: Silksong (Switch, update 1.0.30000 = v655360). Plays on the Mac and on the iPhone
2# Format: see dm/games/README.md
3# Unity 6000.0.50f1 (IL2CPP) with FMOD, SDK 20.5.8; subsdk0 is the movie module, which plays the 27 MP4 cinematics (H.264 and AAC; Intro_Cinematic.mp4 after a new file).
4# Nearly everything is in 2,068 Addressables bundles (StreamingAssets/aa/Switch), whose Shader objects carry type trees (the bundles report engine version 0.0.0), so unityfs.py reads them
5# without a written-out layout. The host needed nn::hid::GetDebugPadStates, which Unity 6 polls every frame (hle_hid.c).
6# Docked (1920x1080; 1280x720 with present interval 2 while a cinematic plays) with the 2D pad layout: A binds, B jumps, Y attacks
7# ---- Identity ----
8title_id010013C00E930000
9program_id010013C00E930000
10# ---- App ----
11# 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)
12nameHollow Knight: Silksong
13ipaHollowKnightSilksong.ipa
14app_categorypublic.app-category.games
15# ---- Versions ----
16buildv6553601.0.30000main=fc9ea4ccc955d5799f37752b2d730b31subsdk0=c89c804fc3b26757661a70fc125aa923sdk=e01950c58e17b080c90494784ea1dd29
17packagev655360
18shader_versionsv655360
19# ---- Files ----
20# load order as on Horizon: main, subsdk*, sdk (subsdk0 = NintendoSDK_movie)
21modulesmain subsdk0 sdk
22romfs_markerData/globalgamemanagers
23zip_store.assets:.bin:.bundle:.dat:.mp4:.ress:.metallib
24# ---- Memory ----
25# The NPDM declares 16 MB of system resource, so IsVirtualAddressMemoryEnabled is true. Unity 6's nninitStartup (main+0x118cb70) only queries the memory info and sets the TLS allocator:
26# no heap and no StandardAllocator; Unity takes its memory itself through nn::os::AllocateAddressRegion and AllocateMemoryPages in the alias region. The 5 GB block of the other Unity games
27# with virtual address memory (256 MB in front + 4.375 GB alias region + 256 MB stack region + 128 MB heap region), with the node area cut for this sdk build (dm/tools/sdk_patches.py). Measured on the
28# Mac: the alias region's high-water mark +2.26 GB in the first room of play (+3.00 GB before the cut), 1.51 GB mapped, resident 2.1 GB and 1.25 GB of GPU memory, flat for 100 s of play.
29# The pool is the hardware's (3.2 GB): Unity only reads it through QueryMemoryInfo, and nothing maps against it
30sys_resource0x1000000
31mem_reserve0x140000000
32mem_alias0x118000000
33mem_stack0x10000000
34app_pool0xCD500000
35# ---- Shader split (shader_split.py; Unity Shader and ComputeShader objects, read by unityfs.py) ----
36# everything is under Data/: the player's serialized files and the StreamingAssets bundles
37shader_groups/Data/=data
38shader_noteHollow Knight: Silksong shaders