- README: presented as Switch games running natively on Apple platforms, with Mario as the one supported game. A games table (Mario playable, Fire Emblem Engage surveyed), component status, game profiles and how to add a game, the NSP script, generic step-by-step build commands (profile, workspace and version as variables), and a Mario section for the per-game notes (1.2.1). - AGENTS.md: profiles, DM_GAME / GAME, workspaces, build-ID gating, the chain rule per profile. - docs/agents: one repository with one profile per title; survey mode in 02-survey, including the compressed NACP title area. - dm/gfx README (+ zh-CN): table paths in the profile.
2.8 KiB
Notes for agents
-
This repository runs Nintendo Switch games natively on Apple platforms: the game's own code runs, rewritten only where Apple's kernel requires it. One game is supported so far: Super Mario Bros. Wonder (base game v0 and update 1.2.1, profile
smbw). Start with README.md for status and build steps. -
Each game's constants and shader tables form a game profile in
dm/games/<id>/:game.tsvplus the tables anddmsh_chain.h. Mario's profile issmbw. Tools pick the profile withDM_GAME;make -C dm/hostandbuild_ipa.shpick it withGAME. All default tosmbw. Put per-game values in the profile, not in code (dm/games/README.md). -
Per-build knowledge is keyed by the NSO build ID: rewriter cuts in
dm/tools/patch_nso.py, the profile'sbuildrows (the builds the NSP script accepts, and their display versions), and host behaviour that uses fixed module addresses checksmodule_t.build_id(fromfixups.tsv;dm_main_build(),DM_D2R_BUILDfor code inherited from D2R). When a new game build appears, carry addresses over withdm/tools/nso_fnmap.pyand check them by disassembly; never let fixed addresses run on a build they were not found in. -
To analyse or port another Switch title, first run
dm/ios/tools/build_ipa_from_nsp.pyon its NSP folder. With no matching profile, it writes a survey to<NSP folder>/<title ID>_survey/survey.md. Then follow docs/agents (extraction, binary survey, host bring-up failure catalogue, graphics specifics, debugging recipes) and add a profile. -
Game files, keys and anything extracted from them live in the user's workspace (
~/<id>-work, Mario~/smbw-work) or in the NSP folder's<id>_build/, 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, run the chain procedure for each affected profile. The chain covers
dm/gfx/tools/dmsh_*,Program.cs, the profile'sshader_map.tsv/shader_facts.tsv/shader_pairs.tsv, and itsnvn_*/shader_*keys. The procedure:- Run
dmsh_chain.py --header, which writes the profile'sdmsh_chain.h. - Rebuild the shaders (Mac and, with
IOSOUT, iOS). - Regenerate the profile's
c1_full.tsv. - Rebuild the host.
The host only loads libraries of its own chain version. The translator is
dm/gfx/tools/dmsh_xlate_bin, which matchesdmsh_chain.lock; a freshdotnet publishdoes not. - Run
-
iOS builds are unsigned IPAs that the user sideloads and tests; diagnostics come back as the app's
Documents/log.txt. Do not sign or install builds on the user's devices. -
Commit only when asked, with
git -c user.name=seedds -c user.email=ext6@xcra.ai commit.