Repository navigation
Protocol Mii Plaza
StreetPass Mii Plaza is title 00020800. Its message body describes the sender: their Mii, a greeting, their profile, the software they are showing, and the people they met recently. This page gives the body layout. ctrpass reads and edits it through its built-in Mii Plaza plugin, a layout file. Bytes no field covers are kept unchanged when ctrpass edits a body.
All integers are little-endian. Text is UTF-16LE, zero-terminated inside its slot.
Implemented in: the built-in layout file crates/ctrpass/titles/mii-plaza.toml, read by plugin::layout; Mii handling in title.
| Setting | Value |
|---|---|
| Title ID | 00020800 |
| Send mode | 0: the Plaza sends and receives in the same exchange |
| Container flags | 3 |
| Body size |
0x7280 bytes |
| Older body size |
0x60f0 bytes, from the original release; the plugin does not read it |
| Info text on new messages | "A visitor arrived" |
| Offset | Size | Field |
|---|---|---|
0x0000 |
8 | Featured software title ID |
0x0010 |
4 | Region lockout |
0x0014 |
16 | Age ratings |
0x0030 |
0x200 × 16 |
Featured software names, one slot per language |
0x2030 |
4 | Icon kind |
0x2034 |
4 | Icon link; the receiver fills in its own value |
0x2038 |
0x480 |
Small icon, 24 × 24 RGB565 tiled |
0x24b8 |
0x1200 |
Large icon, 48 × 48 RGB565 tiled |
0x36b8 |
4 | Presence word |
0x36bc |
0x18 + 0x70
|
Mii box: header, then the wrapped Mii |
0x375c |
4 | Address code (country and region) |
0x3760 |
0x40 × 16 |
Country name, one slot per language |
0x3b60 |
0x40 × 16 |
Region name, one slot per language |
0x3f60 |
10 | Profile |
0x3f70 |
0x22 |
Greeting, up to 16 units |
0x3f92 |
10 × 16 | Recent history: Mii ID and MAC |
0x4032 |
0x22 × 16 |
Recent history: Mii names |
0x4252 |
0x22 × 16 |
Recent history: creator names |
0x4482 |
1 | Cache count |
0x4484 |
10 × 32 | Older history: Mii ID and MAC |
0x614c |
1 | Speech bubble |
Each of the 16 language slots is 0x200 bytes:
| Offset in slot | Size | Field |
|---|---|---|
0x000 |
0x80 |
Short name, up to 63 units |
0x080 |
0x100 |
Long name, up to 127 units |
0x180 |
0x80 |
Publisher, up to 63 units |
Language slots, in order: Japanese, English, French, German, Italian, Spanish, Chinese (simplified), Korean, Dutch, Portuguese, Russian, Chinese (traditional), then four unused slots. ctrpass writes the same text into every slot and reads the English slot.
Country and region names use the same 16 slots, 0x40 bytes each, up to 31 units.
| Offset in box | Size | Field |
|---|---|---|
0x00 |
4 | Magic CFPB or CFPN
|
0x04 |
4 | 1 in a new body |
0x14 |
2 | 1 in a new body |
0x18 |
0x70 |
Wrapped Mii record (see Mii Records) |
The difference between CFPB and CFPN is not known. ctrpass writes CFPB in new bodies and reads both.
| Offset | Size | Field | Largest value |
|---|---|---|---|
| 0 | 4 | StreetPass hits | 999999 |
| 4 | 2 | Plaza population | 3000 |
| 6 | 1 | Hat | 203 |
| 7 | 1 | Pet | 2 |
| 8 | 1 | Dream | 19 |
| 9 | 1 | Hobby | 27 |
Hats 69, 75, 168 and 169 are reset to none by a receiving Plaza.
ctrpass keeps the history unchanged and does not show it. Each history entry is 10 bytes: a 4-byte Mii ID and a 6-byte MAC. An entry with Mii ID 0 is empty. The 16 recent entries also have a name and creator name in the two parallel arrays, 0x22 bytes per entry. The 32 older entries have no names. Recent entries are most recent first.
The current Plaza writes 0x100. The original release wrote 1.
| Field | Rule |
|---|---|
| Featured title ID | 0 and ffffffffffffffff are refused |
| Icon kind | Above 2 is refused |
| Mii box | Missing magic means no Mii; reported as "the body holds no Mii" |
| Profile fields, speech bubble | Above the largest values in the table; bubble at most 5 |
| Hat | 69, 75, 168, 169 are reset to none |
| Mii | Any issue listed on Mii Records |
A new body made by ctrpass, from the plugin's fill and create entries:
- starts as
0x7280zero bytes; - writes the Mii box header (
CFPB, 1 at+0x04, 1 at+0x14); - sets the presence word to
0x100; - sets the featured title ID to
0004000000000000, an application-category ID with no title of its own; - sets the region lockout to
0x7fffffff; - draws standard 24 × 24 and 48 × 48 icons and zeroes the icon link;
- wraps a new Mii named
ctrpasswith the identity's Mii ID, creator MAC, face shape and gender; - sets the hat, dream and hobby from the identity, and every featured software name to
ctrpass.
The new body is then signed into a container with the title's signing key. The container gets a 40 × 40 icon extension header and an info text extension header.
Each title ctrpass can build is described by a plugin as a list of fields. A front end can build a form or a command line from the list without code of its own for the title. Each field has a key, a label, a kind and limits:
| Kind | Value form |
|---|---|
| Text | String of at most max UTF-16 units, without the forbidden characters |
| Number | Whole number in a range, optionally with excluded values, shown in decimal or hex |
| Image | Square image of a given size, as hex of its tiled RGB565 bytes |
| Bytes | Exactly len bytes, as hex |
| Mii | A 0x60 byte Mii record, as hex; ctrpass decrypts and protects it |
The Mii Plaza fields:
| Key | Kind | Limits |
|---|---|---|
name, creator
|
Text | 10 units, no % or \
|
greeting |
Text | 16 units |
hits |
Number | 0-999999 |
population |
Number | 0-3000 |
hat |
Number | 0-203, not 69, 75, 168, 169 |
pet |
Number | 0-2 |
dream |
Number | 0-19 |
hobby |
Number | 0-27 |
bubble |
Number | 0-5 |
country, region
|
Text | 31 units, written to every language |
featured |
Number, hex | 1 to fffffffffffffffe
|
short, publisher
|
Text | 63 units, every language |
long |
Text | 127 units, every language |
icon |
Image | 48 × 48; also scaled to 24 × 24 for the small icon unless small_icon is given |
small_icon |
Image | 24 × 24 |
mii |
Mii |
0x60, a Mii record to start from; a 0x5c byte stored record is also taken |
mii_id |
Number, hex | 32 bits |
creator_mac |
Bytes | 6 |
address, region_lockout, presence
|
Number, hex | 32 bits |
icon_kind |
Number | 0-2 |
Writing a body changes only the fields given. Every change to an icon zeroes the icon link. Reading or changing the Mii needs the slot 0x31 key (see Keys).
A plugin file for title 00020800 in the plugin folder replaces the built-in one.
How to set up
- Overview and requirements
- Choosing a Wi-Fi adapter
- Building and installing
- Making the key file
- Desktop app
- Command line
- Messages and emulators
- Troubleshooting
Plugins
Protocol
- Overview
- Discovery
- Link setup
- Frames and CCMP
- YY transport
- Exchange flow
- Exchange objects
- CEC messages
- CEC message boxes
- Mii records
- Mii Plaza
- Keys
ctrpass library
Linux