Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 53 additions & 40 deletions libctru/include/3ds/mii.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
*/
#pragma once

#define MII_NAME_LEN 10+1 ///< 10-character NULL-terminated UTF-16 mii name

typedef u16 MiiScreenName[MII_NAME_LEN];

#include <3ds/types.h>

/// Shared Mii struct
/// Shared Base Mii struct
typedef struct
{
u8 magic; ///< Always 3?
u8 version; ///< Always 3

/// Mii options
struct
Expand All @@ -20,6 +24,7 @@ typedef struct
bool is_private_name : 1; ///< Private name?
u8 region_lock : 2; ///< Region lock (0=no lock, 1=JPN, 2=USA, 3=EUR)
u8 char_set : 2; ///< Character set (0=JPN+USA+EUR, 1=CHN, 2=KOR, 3=TWN)
u8 _pad : 2;
} mii_options;

/// Mii position in Mii selector or Mii maker
Expand All @@ -34,6 +39,7 @@ typedef struct
{
u8 unknown0 : 4; ///< Mabye padding (always seems to be 0)?
u8 origin_console : 3; ///< Console that the Mii was created on (1=WII, 2=DSI, 3=3DS)
u8 _pad : 1;
} console_identity;

u64 system_id; ///< Identifies the system that the Mii was created on (Determines pants)
Expand All @@ -47,8 +53,9 @@ typedef struct
u16 bday_month : 4; ///< Month of Mii's birthday
u16 bday_day : 5; ///< Day of Mii's birthday
u16 shirt_color : 4; ///< Color of Mii's shirt
bool favorite : 1; ///< Whether the Mii is one of your 10 favorite Mii's
} mii_details;
u16 favorite : 1; ///< Whether the Mii is one of your 10 favorite Mii's
u16 _pad : 1;
} CTR_PACKED mii_details;

u16 mii_name[10]; ///< Name of Mii (Encoded using UTF16)
u8 height; ///< How tall the Mii is
Expand All @@ -57,59 +64,63 @@ typedef struct
/// Face style
struct
{
bool disable_sharing : 1; ///< Whether or not Sharing of the Mii is allowed
u8 shape : 4; ///< Face shape
u8 skinColor : 3; ///< Color of skin
} face_style;
u16 disable_sharing : 1; ///< Whether or not Sharing of the Mii is allowed
u16 shape : 4; ///< Face shape
u16 skinColor : 3; ///< Color of skin
} CTR_PACKED face_style;

/// Face details
struct
{
u8 wrinkles : 4;
u8 makeup : 4;
} face_details;
u16 wrinkles : 4;
u16 makeup : 4;
} CTR_PACKED face_details;

u8 hair_style;

/// Hair details
struct
{
u8 color : 3;
bool flip : 1;
} hair_details;
u16 color : 3;
u16 flip : 1;
u16 _pad : 4;
} CTR_PACKED hair_details;

/// Eye details
struct
{
u32 style : 6;
u32 color : 3;
u32 scale : 4;
u32 yscale : 3;
u32 rotation : 5;
u32 xspacing : 4;
u32 yposition : 5;
} eye_details;
u16 style : 6;
u16 color : 3;
u16 scale : 4;
u16 yscale : 3;
u16 rotation : 5;
u16 xspacing : 4;
u16 yposition : 5;
u16 _pad : 2;
} CTR_PACKED eye_details;

/// Eyebrow details
struct
{
u32 style : 5;
u32 color : 3;
u32 scale : 4;
u32 yscale : 3;
u32 pad : 1;
u32 rotation : 5;
u32 xspacing : 4;
u32 yposition : 5;
} eyebrow_details;
u16 style : 5;
u16 color : 3;
u16 scale : 4;
u16 yscale : 3;
u16 _pad : 1;
u16 rotation : 4;
u16 xspacing : 4;
u16 yposition : 5;
u16 _pad2 : 3;
} CTR_PACKED eyebrow_details;

/// Nose details
struct
{
u16 style : 5;
u16 scale : 4;
u16 yposition : 5;
} nose_details;
u16 _pad : 2;
} CTR_PACKED nose_details;

/// Mouth details
struct
Expand All @@ -118,15 +129,15 @@ typedef struct
u16 color : 3;
u16 scale : 4;
u16 yscale : 3;
} mouth_details;
} CTR_PACKED mouth_details;

/// Mustache details
struct
{
u16 mouth_yposition : 5;
u16 mustach_style : 3;
u16 pad : 2;
} mustache_details;
u16 mustache_style : 3;
u16 _pad : 8;
} CTR_PACKED mustache_details;

/// Beard details
struct
Expand All @@ -135,7 +146,8 @@ typedef struct
u16 color : 3;
u16 scale : 4;
u16 ypos : 5;
} beard_details;
u16 _pad : 1;
} CTR_PACKED beard_details;

/// Glasses details
struct
Expand All @@ -144,16 +156,17 @@ typedef struct
u16 color : 3;
u16 scale : 4;
u16 ypos : 5;
} glasses_details;
} CTR_PACKED glasses_details;

/// Mole details
struct
{
bool enable : 1;
u16 scale : 5;
u16 scale : 4;
u16 xpos : 5;
u16 ypos : 5;
} mole_details;
u16 _pad : 1;
} CTR_PACKED mole_details;

u16 author_name[10]; ///< Name of Mii's author (Encoded using UTF16)
} CTR_PACKED MiiData;
Loading