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

3.7 KiB

1# Game profile of AI: THE SOMNIUM FILES - nirvanA Initiative (Switch, update 1.0.2 = v131072). Plays on the Mac and on the iPhone
2# Format: see dm/games/README.md
3# Unity 2020.3.30f1 (IL2CPP) with FMOD, SDK 13.3.5; subsdk0 is the movie module, which plays the game's movies through Unity's video player (960x540 NV12 frames).
4# The shaders are Shader objects in the Addressables bundles of StreamingAssets/aa (they carry type trees) and in Data/Resources, and 147 ComputeShader kernels, which Unity 2020.3 keys by
5# keyword set (shader_split.py unity_compute, variantMap); 6 geometry shaders (a wireframe effect, Unity's VR blit) do not build
6# Controller only: docked (the game draws 1280x720 by its own choice and crops the 1920x1080 window to it), with the 3D pad layout, as the investigation moves its cursor with the left stick
7# and the view with the right one. It presents at interval 1 (60 fps)
8# ---- Identity ----
9title_id0100713016CCC000
10program_id0100713016CCC000
11# ---- App ----
12# 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)
13nameAI: THE SOMNIUM FILES - nirvanA Initiative
14ipaAiTheSomniumFilesNirvanaInitiative.ipa
15app_categorypublic.app-category.adventure-games
16# the right stick moves the view in the investigation
17pad_layoutfull
18# ---- Versions ----
19buildv1310721.0.2main=8a5289dc71707ceb6f391288fb064e7fsubsdk0=d0f13015e5badf2243d60a2bc9b978ddsdk=3644a6760469451cabc99f00c540acc2
20packagev131072
21shader_versionsv131072
22# ---- Files ----
23# load order as on Horizon: main, subsdk*, sdk (subsdk0 = NintendoSDK_movie)
24modulesmain subsdk0 sdk
25romfs_markerData/StreamingAssets/aa/settings.json
26zip_store.assets:.bundle:.dat:.json:.resource:.ress:.metallib
27# ---- Memory ----
28# The NPDM declares 16 MB of system resource, so IsVirtualAddressMemoryEnabled is true: nninitStartup (main+0x493300) hands application pool − used memory to StandardAllocator as virtual address memory
29# and never calls SetMemoryHeapSize, as Patrick's Parabox (the same Unity 2020.3.30f1). The node area cut for this sdk build (dm/tools/sdk_patches.py) shrinks the AddressRegionManager's node area to 62 MB.
30# With the hardware pool (3.2 GB) StandardAllocator's 1 GB-aligned region and Unity's own regions used the alias region up to +4.26 GB of 4.38 in the first 5 s (the NSP script's heap check).
31# So Ace Attorney Investigations Collection's layout: a 1 GB pool and the 5 GB block (256 MB in front + 4.375 GB alias region + 256 MB stack region + 128 MB heap region).
32# Measured on the Mac over 15 minutes from boot through a new game into the first investigation (probes on VammManager::AllocateAddressRegion's success path sdk+0x37c2a0 and
33# FreeAddressRegion sdk+0x37caf8, commits from the DM_SVC map log): StandardAllocator takes 960 MB at +64 MB and commits 0.29 GB of it; Unity's allocator (main+0x484024) holds about
34# 1.10 GB in 170 regions (16.25 MB and 2.25 MB blocks, created and freed as scenes load), 1.03 GB of it mapped; 2.1 GB of regions live in all, 1.26 GB mapped, 1.96 GB resident.
35# The highest region end climbs (+3.77 GB after 7 minutes) while the live total stays flat: the SDK places each region at the bottom of the highest gap that fits (sdk+0x37c2d0 walks
36# the gaps from the top down), so new regions go above the highest live one until the top is used and only then into the holes below
37sys_resource0x1000000
38mem_reserve0x140000000
39mem_alias0x118000000
40mem_stack0x10000000
41app_pool0x40000000
42# ---- Shader split (shader_split.py; Unity Shader objects, read by unityfs.py) ----
43shader_groups/Data/=data
44shader_noteAI: THE SOMNIUM FILES - nirvanA Initiative shaders