Shaders - shader_split.py (new): scan RomFS and main for every BNSH and agl BAHS container (bfsha, particle effects, layouts, agl/gsys packs, main): 12,811 shaders, map + compute facts from the control section - key = sha256(control + code): many shaders share a control section - NVN 55 binding layout: bound textures at 0x20 + 8*slot, images 0x120 - bindless textures read from uniform buffers (tex_ubo / samp_ubo) - GL depth mode: translator remaps z' = z/2 + w/2 in vertex shaders - compute code areas carry a 0x30 header (magic 0x12345679) Replay - 8-bit index buffers widened to 16-bit - texture swizzle through Metal swizzled views - non-packaged textures shared by storage (fixes a ~13 MB/frame leak from transient render targets rebuilt every frame) - view_t packed to 16 bytes (SDK 16 NVNtextureView; fixes a stack smash) - TBDR optimizations off by default until they know bindless readers Host - alias region 2.875 GB for the 1.75 GB VirtualAddressMemory reservation - ideal core -2 resolves to the process default core - shared font served with a BFTTF "decoded" header - crash reports scan the stack and dump the popped frame Docs: docs/agents (guides for porting other titles), AGENTS.md
1.0 KiB
1.0 KiB
Notes for agents
- This repository ports Super Mario Bros. Wonder (Switch, base game v0) to Apple platforms by running the game's own code natively. Start with README.md for status and build steps.
- To analyse or port another Switch title, follow docs/agents: extraction, binary survey, host bring-up failure catalogue, graphics specifics, debugging recipes.
- Game files, keys and anything extracted from them live in the user's workspace (
~/smbw-work), never in this repository. Do not print key values. - Code comments are bilingual (Chinese line, then English line); red log lines start with
【红】. Keep both conventions. - After changing anything on the shader translation chain (
dm/gfx/tools/dmsh_*,Program.cs,shader_map.tsv,shader_facts.tsv), rundmsh_chain.py --header, rebuild the shaders, regeneratec1_full.tsv, and rebuild the host: the host only loads libraries of its own chain version. - Commit only when asked, with
git -c user.name=seedds -c user.email=ext6@xcra.ai commit.