Repository navigation
Description
The need
Mario Golf: Super Rush (0100C9C00E25C000, 4.0.0, #814) has a story mode, Golf Adventure, that is played as a Mii. With the host as it is, the mode cannot start, and with that fixed the player is a body with nothing on its neck:
- The mode returns to its save slots at every press. The console's database is empty, so the game opens the Mii editor to make a Mii (
nn::mii::AppendMii), the host answers "cancelled", and the game goes back to the slot screen (mii: AppendMii (the host has no Mii editor: cancelled)once per press). - The Mii has no head, as
hle_mii.csays of the stand-in ("It builds, and draws nothing"). In Mario Kart 8 Deluxe that is a detail of a demo race; here it is the player's character in every scene.
Before offering code I'd like to know whether you want any of this, and in what form, since the present answers ("a console with no Mii of its own", an empty stand-in) are deliberate.
What I tried
On secretlemur28/nxnative@golf-tess (dm/host/hle_mii.c; commits d5885d02 for AppendMii, 7c10dcd4 and 8d864f34 for the head):
AppendMiimakes a Mii. It adds one default Mii to the console's database for the run and returns its index, instead of cancelling (DM_MII_APPEND=0cancels as before).GetCount,GetandGetIndexthen answer for it. Golf shows its own "Select a Mii" screen with that Mii, asks "Play using this Mii?", and the mode starts; the game keeps the CharInfo in its own save.- A plain head in the MiiModel stand-in. The 12 facelines are one ellipsoid (positions as 4 halves, normals as signed 10:10:10:2, texture coordinates as 2 halves: that reading of attributes 1 and 2 drew a lit, skin-coloured head at once), sized so the game's cap sits on it.
- A drawn face. The 12 mask shapes are the front of that ellipsoid, and the texture file gets one eye, one eyebrow and one mouth for all 62 / 24 / 37 entries: 64x64
R8_G8_B8_A8, block-linear, written withnvn_swizzle. From Golf's loader the entry's format byte indexes R8, R8_G8, R8_G8_B8_A8, BC4, BC5, BC7, ASTC 4x4 (main+0x132c9c, tablemain+0x304b54), so no compression is needed. An eye's dark part is its blue channel, green its white.
It is not a Mii's own face: every Mii gets the same head and features, there is no nose, hair, hat or nose-line texture, and nothing here comes from the firmware's files. DM_MII_HEAD=0 leaves the stand-in as it is today.
Result in Golf: the mode starts, plays through its opening, the village and the driving-range lesson, and the character has a head with eyes, eyebrows and a smile under its cap.
What I have not checked, and what it could change elsewhere
- Only Golf was run. Mario Kart 8 Deluxe builds twelve Mii heads for its title screen's demo race from the same stand-in: with a plain head in it those drivers would show generic heads where they show none today. I do not have the game here to look.
- A game that calls
AppendMiiand expects the player to have chosen a Mii gets a default one without being asked. - The head's size and the mask's texture coordinates were fitted by eye to Golf's cap and camera, not to the real model's proportions.
Questions
- Is a default Mii from
AppendMiiacceptable as the default behaviour, or would you rather it be a setting, a per-game profile key, or stay cancelled? - Is a host-drawn stand-in head (and face) something you want in the host at all? If so: on by default, or behind a switch or profile key?
- Would you prefer a different route for games that need real Miis, for example reading the MiiModel system data from files the player supplies from their own console, with the stand-in only as the fallback?
I can cut whichever parts you want into separate PRs (the AppendMii change is a few lines; the head and the face are about 120 lines in hle_mii.c).
Activity