Repository navigation
A player's own system data and Mii database from DM_SYSTEM_DIR: Switch Sports Resort draws Mii heads and lists the console's Miis - #2274
Closed
FifteenPen wants to merge 1 commit into
Closed
FifteenPen wants to merge 1 commit into
FifteenPen wants to merge 1 commit into
Conversation
…em data archives from sysdata/<id>/, the Miis of MiiDatabase.dat (system save 8000000000000030) listed before the defaults
FifteenPen
added a commit
to FifteenPen/nxnative
that referenced
this pull request
Nov 11, 2026
seedds#2273 (black outfits in menus); Miis with seedds#2274 and the player's own files; golf's far ground right with the seedds#2040 series
2 tasks done
Contributor
Author
|
Something like this PR is needed forSwitch Sports Resort to be meaningfully playable. Without it, the boxing mode features players with no arms. Stand-in textures could be made and used, potentially! |
seedds
added a commit
that referenced
this pull request
Nov 13, 2026
…_DIR (PR #2274) A player can supply their own console's files in one folder for every game (the Mac launcher sets ~/Library/Application Support/nxnative/system, the iOS app Documents/system): - sysdata/<id>/: a system data archive's RomFS files, mounted read-only ahead of the MiiModel stand-in (Switch Sports Resort's 0400000000000849 Mii heads; the Switch's 0100000000000802 alike); - save/8000000000000030/MiiDatabase.dat: the mii service's database, read once and never written; its Miis are listed before the six defaults. Without them nothing changes. The player guide says where the files go. Co-authored-by: FifteenPen <354289956+FifteenPen@users.noreply.github.com>
Owner
|
Landed with changes as 51492a9, with you credited as co-author. Thank you: the design is unchanged (the player's own system data and Mii database in What changed on the way in:
The next commit, 2812675, builds on yours for #2361:
Your path with real console files wasn't run here, because I have none, so it rests on your Switch Sports Resort run and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Switch 2 games that show Miis need two things from the console, and the host ships support for neither:
0400000000000849, mounted asMiiResource:. Nintendo Switch Sports Resort (04008E001F098000, v65536) logs[RED] fs mount system data MiiResource: the host has no 0400000000000849and draws no Mii heads and the boxing mini-game draws no hands/arms, making it unplayable.This lets a player supply their own console's copies. They are firmware content and personal data, so they stay on the player's Mac and are never part of an app or the repository.
DM_SYSTEM_DIRis one folder of the console's own files, for every game. The Mac launcher sets~/Library/Application Support/nxnative/systemand the iOS appDocuments/system:sysdata/<id, 16 hex digits>/: a system data archive's RomFS files.MountSystemDatamounts the folder read-only (hle_fs.csysdata_own), ahead of the existing MiiModel stand-in. Without it nothing changes, and the[RED]line now names the folder to use.save/8000000000000030/MiiDatabase.dat: the mii service's database.hle_mii.creads it once atDatabase::Initialize:NFDB, then 100StoreDataof 0x44 bytes, the version (1) at +0x1a94, the count at +0x1a95, and a CRC-16/CCITT (polynomial 0x1021, initial 0) of the bytes before it at +0x1a96, big-endian.StoreData(seven words of bit fields, the nickname and the create ID) becomes the 0x58-byteCharInfothe SDK returns (mii_from_store; the stored eyebrow y is 3 below the CharInfo's).Getlists them before the six default Miis (source 0, then 1),GetCountcounts them,GetIndexandUpdateLatestfind them by create ID, andIsFullDatabaseis true at 100.Where the Switch 2 keeps them. I read these from the Switch 2's mii service, system program
0400000000000039:8000000000000030asmii(MountSystemSaveData("mii", 0, 0x8000000000000030)) and readsmii:/MiiDatabase.dat.0x4244464e), version byte at +0x1a94 and CRC-16 (0x1021) as above. That is the same database as the Switch's.mii_migration(system save8000000100000030, Miis transferred from a Switch) andMiiImage:/database.dat(Mii pictures). This PR reads neither.The
StoreDatabit layout is the Switch's, as documented by the open-source Mii implementations. The code here is written from the layout, not taken from them.Why the Switch's archive cannot stand in. Switch Sports reads
ShapeMid.dat/ShapeHigh.datandOunceTexture{Low,Mid,High}{Linear,SRGB}.datfromMiiResource::NXTexture*files. It picks the texture file from a table by a flag (main+0x1cdeb50), and its Mii setup (main+0x320040) only ever clears that flag, so it always reads theOunceTexture*files.0100000000000802) cannot take the Switch 2 archive's place either.Checked
t_mii(new host test, address and undefined-behaviour sanitizers):Initialize,GetCount,Get(the database's Miis first, source 0, then the defaults),GetIndexandUpdateLatestanswer from a database in a folder given asDM_SYSTEM_DIR.make -C dm/host/tests run) passes; the host builds; the launcher and the iOS app compile.test_docs.py,test_env_switches.pyand the symptom index pass.0400000000000849(its eight files) and a one-Mii database in place, the log showsfs mount system data MiiResource: 0400000000000849 from …andmii: 1 Miis of the console's database. The Mii is listed first on Select User, and Mii heads draw there, on Customize and in a golf round. That run was on a tree with this change plus the game's other open PRs; the game does not boot on main alone.Not checked
Format/Import, do not reach the file.The game's profile is in #2107.