Compile eligible shader-pair bases on the Mac with metal-tt, package one archive per selected iPhone GPU, and use a matching bundle before falling back to on-device preparation. Carry the profile depth mode through packing and include the pulling libraries required by the bundled bases. Integrate PR #226 with four confirmed fixes: validate archive container bounds before invoking Metal; require at least one actual successful bundle probe; hash consumed library bytes into offline cache keys; and emit device remainder lists for constant-only plans instead of aborting packaging. Keep game measurements in the game note and document the general findings. Validation on current main: 52 real Metal bundle checks, 57 archive checks, 79 prewarm checks on each pipeline path, 73 Python regressions covering offline tools, packaging, documentation and chain checks, and compilation of all 133 iOS source files. No new iPhone gameplay validation. The archive guard validates container structure, not private Metal payloads. Co-authored-by: v0lumehi <aljic.zijad@gmail.com>
7.1 KiB
7.1 KiB
The Great Ace Attorney Chronicles (010036E00FB20000)
Base game 1.0.0 (v0), with its DLC 010036E00FB21001. SDK 10.4.1. Capcom's MT Framework on NVN. Modules main, subsdk0 (the SDK's movie module, NintendoSDK_movie, whose extractor runs natively while the host decodes the H.264 movies with VideoToolbox) and sdk; subsdk0 and sdk are the same builds as Advance Wars 1+2: Re-Boot Camp's (0100300012F2A000). Plays on the iPhone; 30 fps, as the game paces itself.
What it needs
| Setting | Where | Why |
|---|---|---|
tex_flush_upload on, tex_dirty_upload on |
game.tsv |
the CPU copies every texture into a CPU-cached pool after creating it and never flushes; with tex_flush_upload alone the screen stayed black. See Rendering |
4 GB layout: mem_reserve 0x100000000, mem_alias 0x10000000, mem_stack 0x10000000, app_pool 0xCD500000 |
game.tsv |
the NPDM declares no system resource (META +0x14 = 0): nninitStartup sets a heap of the pool − 64 MB (3.14 GB); main's bss is 9.2 MB |
| Node area cut 1 GB → 62 MB, 1 GB alignment → 32 MB | dm/tools/sdk_patches.py, sdk build d9add76f… |
applies to this build by its ID; made for Advance Wars 1+2: Re-Boot Camp, which shares it. This game has no virtual address memory and never makes an address region |
pad_layout not set (the default simple, 2D) |
game.tsv |
the gamepad starts in the 2D layout (the player-facing README lists it among the games that do) |
depth_mode zero |
game.tsv |
the game sets the near = 0 depth mode, so the pipeline bases made before it runs (the NSP script's Mac prebuild, and a pipeline archive made offline for the iPhone when one is built with DM_PSO_GPUS) take its vertex shaders' main0_z entries (the host itself follows the mode the game sets) |
Rendering
- Upper-left window origin, depth mode near = 0, a 1920x1080 RGBA8 swapchain; the game asks for present interval 1 and paces itself at 30 fps. Mario's binding layout (combined textures at
0x20 + 8 × slot, slots 0–2). - Resolved: black screen at boot, with the draws of a dialog box in the pass dump (sampling 256x256 and 1024x256 textures of format 0x4d). No texture had been uploaded from guest memory (
packaged textures: first uploads 0), andDM_NVN_TEXINFO=1024x256showed storage that already held data at first use (226,555 of 262,144 bytes non-zero): no packaged layout, block-linear, in a 1000 MBCPU_CACHED | GPU_CACHED | COMPRESSIBLEpool (flags 0xa4). A log of the pool flushes, texture creations and file reads (temporary lines underDM_NVN_LOG) showed how they are filled: every.texis read into staging buffers (512 KBReadFiles, none into the pool), and the CPU copies the texels into the texture's storage afternvnTextureInitialize, with nonvnMemoryPoolFlushMappedRangeover them and noWriteTexels; only the four linear 1024x64 text textures are flushed, every frame.mainhas no cache maintenance instruction at all, so there is no flush for the host to take as the signal. Withtex_dirty_uploada registered texture whose pages the CPU writes after creation is uploaded at its first use (as for FINAL FANTASY TACTICS - The Ivalice Chronicles, 010038B015560000).
Services
- Resolved: the first boot crashed in
oe::DisableAlbumImageTakenNotification(a null read atsdk+0x338070, the first call innnMain,main+0x6b188c: the SDK asks am through the applet proxy the host never made). - The import list against the hooks (
nso_syms.py, thenmain's undefinednn::symbols noHLE_FORCEnames) gave the rest before they were met:oe::IsInStoreDemoModeEnabled(no);vi::ListDisplays(one display, "Default"; the game lists 10 into a stack buffer and does not read them,main+0x808f08);fs::RenameDirectory(asRenameFile);account::StoreSaveDataThumbnailImage/DeleteSaveDataThumbnailImage(nothing kept);- the
ec::ShowShop…overloads without anApplicationId(the calling application's own pages); friends::StartFacedFriendRequest/StartSendingFriendRequest(fail);ngc::ProfanityFilter::MaskProfanityWordsInText(int *, char *, uint32_t),SetMaskModeandFinalize, which this game calls by name rather than through the vtable.
- The touch-screen states (
GetTouchScreenState<16>) were already hooked by a macro the import table does not see. - Two NVN calls were red stubs:
nvnDeviceSetIntermediateShaderCacheandnvnCommandBufferDiscardColor(a discarded target is undefined, so keeping its content is correct). After that it ran its frame loop at 30 fps; the black screen it showed was its textures (above). - Add-on content: index 1 (
DLC.dlcp); the game reports it found and added to Special Contents.
Files and shaders
- Everything is under
nativeNXx64/: 447 ARC archives (*.arc, 17,910 files; version 7, one zlib stream per file) of models (.mod/.mrl), textures (.tex), scripts and messages (.gmd), beside loose.textextures, Opus / ADPCM sound and 24 H.264.mp4movies (shader_split.pymtarc_members; 01).romfs_markerisnativeNXx64/sa/NX_64/root.arc. - Shaders: 460 (230 vertex, 230 pixel) in the engine's one shader package,
sc\NX_64\root(SPK\0, type hash0x02358e1a) innativeNXx64/sa/NX_64/root.arc(shader_split.pymtspk_shaders). All build and every binding decodes. The package's own vertex / pixel combinations are not read, so the vertex shaders are paired with the single-stage cover.CustomShaderPackage.mfx(MFX\0, the effect descriptions) holds no shader code, and neithermainnor any other ARC entry does.
Status on the Mac
- The first-boot notices (the DLC found, auto-save), the title and its Options, a new game of The Great Ace Attorney: Adventures, the opening movie, the first episode's opening scenes and its trial, at 30 fps with sound and saves; about 1.1 GB resident, flat over 14 minutes (1.07 GB in the first episode's holding cell).
Mac routes
DM_KEYS="f700:A*1000/24"(A every 24 frames) goes through the notices, the title and a new game into the opening movie; the first episode's dialogue starts at about frame 6,000 and its trial at about 20,000.
Found on this game
General host changes first needed here; each applies to every game:
- CPU-written textures with no flush (
tex_dirty_upload): CPU writes with no flush, caught by page protection, key in dm/games/README.md. - The MT Framework ARC and SPK readers (
mtarc_members,mtspk_shaders): SPK shader package in an MT Framework ARC. - SDK 10 calls found from the import list,
nvnDeviceSetIntermediateShaderCacheandnvnCommandBufferDiscardColor: services.md, NVN calls that were red stubs.