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