libctru  v1.6.0
mii.h
Go to the documentation of this file.
1 /**
2  * @file mii.h
3  * @brief Shared Mii struct.
4  *
5  * @see https://www.3dbrew.org/wiki/Mii#Mii_format
6  */
7 #pragma once
8 
9 #include <3ds/types.h>
10 
11 /// Shared Mii struct
12 typedef struct
13 {
14  u8 magic; ///< Always 3?
15 
16  /// Mii options
17  struct
18  {
19  bool allow_copying : 1; ///< True if copying is allowed
20  bool is_private_name : 1; ///< Private name?
21  u8 region_lock : 2; ///< Region lock (0=no lock, 1=JPN, 2=USA, 3=EUR)
22  u8 char_set : 2; ///< Character set (0=JPN+USA+EUR, 1=CHN, 2=KOR, 3=TWN)
23  } mii_options;
24 
25  /// Mii position in Mii selector or Mii maker
26  struct
27  {
28  u8 page_index : 4; ///< Page index of Mii
29  u8 slot_index : 4; ///< Slot offset of Mii on its Page
30  } mii_pos;
31 
32  /// Console Identity
33  struct
34  {
35  u8 unknown0 : 4; ///< Mabye padding (always seems to be 0)?
36  u8 origin_console : 3; ///< Console that the Mii was created on (1=WII, 2=DSI, 3=3DS)
37  } console_identity;
38 
39  u64 system_id; ///< Identifies the system that the Mii was created on (Determines pants)
40  u32 mii_id; ///< ID of Mii
41  u8 mac[6]; ///< Creator's system's full MAC address
42  u8 pad[2]; ///< Padding
43 
44  /// Mii details
45  struct {
46  bool sex : 1; ///< Sex of Mii (False=Male, True=Female)
47  u16 bday_month : 4; ///< Month of Mii's birthday
48  u16 bday_day : 5; ///< Day of Mii's birthday
49  u16 shirt_color : 4; ///< Color of Mii's shirt
50  bool favorite : 1; ///< Whether the Mii is one of your 10 favorite Mii's
51  } mii_details;
52 
53  u16 mii_name[10]; ///< Name of Mii (Encoded using UTF16)
54  u8 height; ///< How tall the Mii is
55  u8 width; ///< How wide the Mii is
56 
57  /// Face style
58  struct
59  {
60  bool disable_sharing : 1; ///< Whether or not Sharing of the Mii is allowed
61  u8 shape : 4; ///< Face shape
62  u8 skinColor : 3; ///< Color of skin
63  } face_style;
64 
65  /// Face details
66  struct
67  {
68  u8 wrinkles : 4;
69  u8 makeup : 4;
70  } face_details;
71 
72  u8 hair_style;
73 
74  /// Hair details
75  struct
76  {
77  u8 color : 3;
78  bool flip : 1;
79  } hair_details;
80 
81  /// Eye details
82  struct
83  {
84  u32 style : 6;
85  u32 color : 3;
86  u32 scale : 4;
87  u32 yscale : 3;
88  u32 rotation : 5;
89  u32 xspacing : 4;
90  u32 yposition : 5;
91  } eye_details;
92 
93  /// Eyebrow details
94  struct
95  {
96  u32 style : 5;
97  u32 color : 3;
98  u32 scale : 4;
99  u32 yscale : 3;
100  u32 pad : 1;
101  u32 rotation : 5;
102  u32 xspacing : 4;
103  u32 yposition : 5;
104  } eyebrow_details;
105 
106  /// Nose details
107  struct
108  {
109  u16 style : 5;
110  u16 scale : 4;
111  u16 yposition : 5;
112  } nose_details;
113 
114  /// Mouth details
115  struct
116  {
117  u16 style : 6;
118  u16 color : 3;
119  u16 scale : 4;
120  u16 yscale : 3;
121  } mouth_details;
122 
123  /// Mustache details
124  struct
125  {
126  u16 mouth_yposition : 5;
127  u16 mustach_style : 3;
128  u16 pad : 2;
129  } mustache_details;
130 
131  /// Beard details
132  struct
133  {
134  u16 style : 3;
135  u16 color : 3;
136  u16 scale : 4;
137  u16 ypos : 5;
138  } beard_details;
139 
140  /// Glasses details
141  struct
142  {
143  u16 style : 4;
144  u16 color : 3;
145  u16 scale : 4;
146  u16 ypos : 5;
147  } glasses_details;
148 
149  /// Mole details
150  struct
151  {
152  bool enable : 1;
153  u16 scale : 5;
154  u16 xpos : 5;
155  u16 ypos : 5;
156  } mole_details;
157 
158  u16 author_name[10]; ///< Name of Mii's author (Encoded using UTF16)
159 } PACKED MiiData;
u16 shirt_color
Color of Mii's shirt.
Definition: mii.h:49
#define PACKED
Packs a struct (and other types?) so it won't include padding bytes.
Definition: types.h:52
Various system types.
u16 bday_day
Day of Mii's birthday.
Definition: mii.h:48
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
bool sex
Sex of Mii (False=Male, True=Female)
Definition: mii.h:46
u16 bday_month
Month of Mii's birthday.
Definition: mii.h:47
u32 mii_id
ID of Mii.
Definition: mii.h:40
u8 slot_index
Slot offset of Mii on its Page.
Definition: mii.h:29
bool allow_copying
True if copying is allowed.
Definition: mii.h:19
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
bool favorite
Whether the Mii is one of your 10 favorite Mii's.
Definition: mii.h:50
Shared Mii struct.
Definition: mii.h:12
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
u8 page_index
Page index of Mii.
Definition: mii.h:28
bool disable_sharing
Whether or not Sharing of the Mii is allowed.
Definition: mii.h:60
u8 char_set
Character set (0=JPN+USA+EUR, 1=CHN, 2=KOR, 3=TWN)
Definition: mii.h:22
u8 skinColor
Color of skin.
Definition: mii.h:62
u8 width
How wide the Mii is.
Definition: mii.h:55
u8 shape
Face shape.
Definition: mii.h:61
bool is_private_name
Private name?
Definition: mii.h:20
u8 origin_console
Console that the Mii was created on (1=WII, 2=DSI, 3=3DS)
Definition: mii.h:36
u64 system_id
Identifies the system that the Mii was created on (Determines pants)
Definition: mii.h:39
u8 height
How tall the Mii is.
Definition: mii.h:54
u8 region_lock
Region lock (0=no lock, 1=JPN, 2=USA, 3=EUR)
Definition: mii.h:21
u8 magic
Always 3?
Definition: mii.h:14
u8 unknown0
Mabye padding (always seems to be 0)?
Definition: mii.h:35