Changes

487 bytes removed ,  18:25, 10 August 2009
m
Robot: Cosmetic changes
Line 1: Line 1: −
[[Category:Software]]
  −
   
''This guide is outdated, the current Mii header is actually RNOD''
 
''This guide is outdated, the current Mii header is actually RNOD''
   Line 9: Line 7:     
=== Overall format ===
 
=== Overall format ===
The Mii data is stored on the Wiimote in two blocks. Each block is composed of 750 bytes of Mii data, followed by a 2 byte CRC. If the data in the first block does not match the CRC for that block, the second block is used instead. At that point, if the CRC of the second block does not match its data, no Mii data will be available.
+
The Mii data is stored on the Wiimote in two blocks. Each block is composed of 750 bytes of Mii data, followed by a 2 byte CRC. If the data in the first block does not match the CRC for that block, the second block is used instead. At that point, if the CRC of the second block does not match its data, no Mii data will be available.
    
The blocks are 752 bytes in length (0x2f0 bytes), and are stored consecutively starting at address 0x0fca in the Wiimote memory.
 
The blocks are 752 bytes in length (0x2f0 bytes), and are stored consecutively starting at address 0x0fca in the Wiimote memory.
Line 19: Line 17:  
=== Block format ===
 
=== Block format ===
   −
At the beginning of each block, there is a 4-byte value ('RNCD') which may be a Mii software version number, as it is the same across multiple Wiis and multiple Wiimotes. After these 4 bytes, there are 2 bytes which determine which slots are Mii parade slots. Left shift 0x0001 by the slot number to set it as Mii parade (hidden when viewed on the Wiimote). If a slot is empty, or filled by a non-parade Mii, its parade slot bit will be set to 0.
+
At the beginning of each block, there is a 4-byte value ('RNCD') which may be a Mii software version number, as it is the same across multiple Wiis and multiple Wiimotes. After these 4 bytes, there are 2 bytes which determine which slots are Mii parade slots. Left shift 0x0001 by the slot number to set it as Mii parade (hidden when viewed on the Wiimote). If a slot is empty, or filled by a non-parade Mii, its parade slot bit will be set to 0.  
    
The last two bytes of the block are a [http://www.joegeluso.com/software/articles/ccitt.htm CRC-16 CCITT] of the previous 750 bytes (polynomial 0x1021, starting value 0x0000). [http://marcansoft.com/transf/fixcrc.c C code to update CRC]
 
The last two bytes of the block are a [http://www.joegeluso.com/software/articles/ccitt.htm CRC-16 CCITT] of the previous 750 bytes (polynomial 0x1021, starting value 0x0000). [http://marcansoft.com/transf/fixcrc.c C code to update CRC]
Line 52: Line 50:     
=== Mii format ===
 
=== Mii format ===
Strings are apparently stored in Unicode format (UTF-16), big-endian. Miis with Japanese Unicode characters in their names work (and are displayed correctly) on US Wii hardware.  
+
Strings are apparently stored in Unicode format (UTF-16), big-endian. Miis with Japanese Unicode characters in their names work (and are displayed correctly) on US Wii hardware.  
    
Data Validation in the Mii Channel:
 
Data Validation in the Mii Channel:
Line 58: Line 56:  
Setting invalid facial features, or colors over the limit (with the exception of Favorite color) in any fields appears to invalidate that Mii, and it does not show up when the Wiimote slots are viewed on the Wii (though all other Miis on the Wiimote do show up).
 
Setting invalid facial features, or colors over the limit (with the exception of Favorite color) in any fields appears to invalidate that Mii, and it does not show up when the Wiimote slots are viewed on the Wii (though all other Miis on the Wiimote do show up).
   −
Weight and height seem to be clamped to 0x7F. Setting these bytes of 0xFF does not result in a super tall or fat Mii, but one exactly the same as if 0x7F were set. When the Mii is edited on the Wii then saved back to the controller, these bytes are back to 0x7F.
+
Weight and height seem to be clamped to 0x7F. Setting these bytes of 0xFF does not result in a super tall or fat Mii, but one exactly the same as if 0x7F were set. When the Mii is edited on the Wii then saved back to the controller, these bytes are back to 0x7F.
   −
Hair type, eyebrow type, eye type, lip type and nose type use a pre-determined set of valid entries which are not sequential with the order in which they are displayed. They do, however, use the expected range of values from 0 to n - 1.
+
Hair type, eyebrow type, eye type, lip type and nose type use a pre-determined set of valid entries which are not sequential with the order in which they are displayed. They do, however, use the expected range of values from 0 to n - 1.
    
The Mii ID is a unique identifier for the Mii but also determines whether the mii is 'special' (with gold pants) or not. [http://www.davidhawley.co.uk/special-miis-gold-pants-and-creating.aspx More on special Miis].  
 
The Mii ID is a unique identifier for the Mii but also determines whether the mii is 'special' (with gold pants) or not. [http://www.davidhawley.co.uk/special-miis-gold-pants-and-creating.aspx More on special Miis].  
Line 71: Line 69:     
<source lang="c">
 
<source lang="c">
typedef unsigned char u8;
+
typedef unsigned char u8;
 
typedef unsigned short u16;
 
typedef unsigned short u16;
typedef unsigned int   u32;
+
typedef unsigned int u32;
    
#define MII_NAME_LENGTH 10
 
#define MII_NAME_LENGTH 10
Line 81: Line 79:  
{
 
{
 
// addr: 0x00 & 0x01
 
// addr: 0x00 & 0x01
u16 invalid:1;           // doesn't seem to have any effect?
+
u16 invalid:1; // doesn't seem to have any effect?
 
u16 isGirl:1;
 
u16 isGirl:1;
 
u16 month:4;
 
u16 month:4;
 
u16 day:5;
 
u16 day:5;
u16 favColor:4;   // 0 - 11 (changing to 1111, along with setting the preceeding bit  
+
u16 favColor:4; // 0 - 11 (changing to 1111, along with setting the preceeding bit  
 
                         // results in a grey shirt, some values over 11 will crash the Wii  
 
                         // results in a grey shirt, some values over 11 will crash the Wii  
                  // when trying to change the favorite color).
+
// when trying to change the favorite color).
 
u16 isFavorite:1;
 
u16 isFavorite:1;
   Line 94: Line 92:     
// addr: 0x16
 
// addr: 0x16
u8 height;                 // 0 - 127
+
u8 height; // 0 - 127
    
// addr: 0x17
 
// addr: 0x17
u8 weight;                 // 0 - 127
+
u8 weight; // 0 - 127
    
// addr: 0x18 - 0x1B
 
// addr: 0x18 - 0x1B
Line 106: Line 104:     
// addr: 0x1C through 0x1F
 
// addr: 0x1C through 0x1F
u8 systemID0;           // Checksum8 of first 3 bytes of mac addr
+
u8 systemID0; // Checksum8 of first 3 bytes of mac addr
u8 systemID1;           // mac addr 3rd-to-last byte
+
u8 systemID1; // mac addr 3rd-to-last byte
u8 systemID2;           // mac addr 2nd-to-last byte
+
u8 systemID2; // mac addr 2nd-to-last byte
u8 systemID3;           // mac addr last byte
+
u8 systemID3; // mac addr last byte
    
// addr: 0x20 & 0x21
 
// addr: 0x20 & 0x21
u16 faceShape:3;           // 0 - 7
+
u16 faceShape:3; // 0 - 7
u16 skinColor:3;           // 0 - 5
+
u16 skinColor:3; // 0 - 5
u16 facialFeature:4;       // 0 - 11
+
u16 facialFeature:4; // 0 - 11
u16 unknown:3;             // Mii appears unaffected by changes to this data  
+
u16 unknown:3; // Mii appears unaffected by changes to this data  
u16 mingleOff:1;           // 0 = Mingle, 1 = Don't Mingle
+
u16 mingleOff:1; // 0 = Mingle, 1 = Don't Mingle
u16 unknown:2;             // Mii appears unaffected by changes to this data
+
u16 unknown:2; // Mii appears unaffected by changes to this data
    
// addr: 0x22 & 0x23
 
// addr: 0x22 & 0x23
u16 hairType:7;           // 0 - 71, Value is non-sequential with regard to page, row and column
+
u16 hairType:7; // 0 - 71, Value is non-sequential with regard to page, row and column
u16 hairColor:3;           // 0 - 7
+
u16 hairColor:3; // 0 - 7
u16 hairPart:1;           // 0 = Normal, 1 = Reversed
+
u16 hairPart:1; // 0 = Normal, 1 = Reversed
 
u16 unknown:5;
 
u16 unknown:5;
    
// addr: 0x24 through 0x27
 
// addr: 0x24 through 0x27
u32 eyebrowType:5;         // 0 - 23, Value is non-sequential with regard to page, row and column
+
u32 eyebrowType:5; // 0 - 23, Value is non-sequential with regard to page, row and column
 
u32 unknown:1;
 
u32 unknown:1;
u32 eyebrowRotation:4;     // 0 - 11, Default value varies based on eyebrow type
+
u32 eyebrowRotation:4; // 0 - 11, Default value varies based on eyebrow type
 
u32 unknown:6;
 
u32 unknown:6;
u32 eyebrowColor:3;       // 0 - 7
+
u32 eyebrowColor:3; // 0 - 7
u32 eyebrowSize:4;   // 0 - 8, Default = 4
+
u32 eyebrowSize:4; // 0 - 8, Default = 4
u32 eyebrowVertPos:5;     // 3 - 18, Default = 10
+
u32 eyebrowVertPos:5; // 3 - 18, Default = 10
 
u32 eyebrowHorizSpacing:4; // 0 - 12, Default = 2
 
u32 eyebrowHorizSpacing:4; // 0 - 12, Default = 2
    
// addr: 0x28 through 0x2B
 
// addr: 0x28 through 0x2B
u32 eyeType:6;             // 0 - 47, Value is non-sequential with regard to page, row and column
+
u32 eyeType:6; // 0 - 47, Value is non-sequential with regard to page, row and column
 
u32 unknown:2;
 
u32 unknown:2;
u32 eyeRotation:3;         // 0 - 7, Default value varies based on eye type
+
u32 eyeRotation:3; // 0 - 7, Default value varies based on eye type
u32 eyeVertPos:5;         // 0 - 18, Default = 12
+
u32 eyeVertPos:5; // 0 - 18, Default = 12
u32 eyeColor:3;           // 0 - 5
+
u32 eyeColor:3; // 0 - 5
 
u32 unknown:1;
 
u32 unknown:1;
u32 eyeSize:3;             // 0 - 7, Default = 4
+
u32 eyeSize:3; // 0 - 7, Default = 4
u32 eyeHorizSpacing:4;     // 0 - 12, Default = 2
+
u32 eyeHorizSpacing:4; // 0 - 12, Default = 2
 
u32 unknown:5;
 
u32 unknown:5;
    
// addr: 0x2C & 0x2D
 
// addr: 0x2C & 0x2D
u16 noseType:4;           // 0 - 11, Value is non-sequential with regard to row and column
+
u16 noseType:4; // 0 - 11, Value is non-sequential with regard to row and column
u16 noseSize:4;           // 0 - 8, Default = 4
+
u16 noseSize:4; // 0 - 8, Default = 4
u16 noseVertPos:5;         // 0 - 18, Default = 9
+
u16 noseVertPos:5; // 0 - 18, Default = 9
 
u16 unknown:3;
 
u16 unknown:3;
    
// addr: 0x2E & 2F
 
// addr: 0x2E & 2F
u16 lipType:5;             // 0 - 23, Value is non-sequential with regard to page, row and column
+
u16 lipType:5; // 0 - 23, Value is non-sequential with regard to page, row and column
u16 lipColor:2;           // 0 - 2
+
u16 lipColor:2; // 0 - 2
u16 lipSize:4;             // 0 - 8, Default = 4
+
u16 lipSize:4; // 0 - 8, Default = 4
u16 lipVertPos:5;         // 0 - 18, Default = 13
+
u16 lipVertPos:5; // 0 - 18, Default = 13
    
// addr: 0x30 & 0x31
 
// addr: 0x30 & 0x31
u16 glassesType:4;         // 0 - 8
+
u16 glassesType:4; // 0 - 8
u16 glassesColor:3;       // 0 - 5
+
u16 glassesColor:3; // 0 - 5
u16 unknown:1;             // when turned on mii does not appear (use not known)
+
u16 unknown:1; // when turned on mii does not appear (use not known)
u16 glassesSize:3;         // 0 - 7, Default = 4
+
u16 glassesSize:3; // 0 - 7, Default = 4
u16 glassesVertPos:5;     // 0 - 20, Default = 10
+
u16 glassesVertPos:5; // 0 - 20, Default = 10
    
// addr: 0x32 & 33
 
// addr: 0x32 & 33
u16 mustacheType:2;       // 0 - 3
+
u16 mustacheType:2; // 0 - 3
u16 beardType:2;           // 0 - 3
+
u16 beardType:2; // 0 - 3
u16 facialHairColor:3;     // 0 - 7
+
u16 facialHairColor:3; // 0 - 7
u16 mustacheSize:4;       // 0 - 8, Default = 4
+
u16 mustacheSize:4; // 0 - 8, Default = 4
u16 mustacheVertPos:5;     // 0 - 16, Default = 10
+
u16 mustacheVertPos:5; // 0 - 16, Default = 10
    
// addr: 0x34 & 0x35
 
// addr: 0x34 & 0x35
u16 moleOn:1;             // 0 = No Mole, 1 = Has Mole
+
u16 moleOn:1; // 0 = No Mole, 1 = Has Mole
u16 moleSize:4;           // 0 - 8, Default = 4
+
u16 moleSize:4; // 0 - 8, Default = 4
u16 moleVertPos:5;         // 0 - 30, Default = 20
+
u16 moleVertPos:5; // 0 - 30, Default = 20
u16 moleHorizPos:5;       // 0 - 16, Default = 2
+
u16 moleHorizPos:5; // 0 - 16, Default = 2
u16 unknown:1;            
+
u16 unknown:1;  
    
// addr: 0x36 through 0x49
 
// addr: 0x36 through 0x49
Line 183: Line 181:  
} MII_DATA_STRUCT;
 
} MII_DATA_STRUCT;
 
</source>
 
</source>
 +
 +
[[Category:Software]]
1,189

edits