Difference between revisions of "BRLYT (File Format)"
m (→mat1) |
|||
Line 6: | Line 6: | ||
The file starts with a header that is 0x10 bytes long: | The file starts with a header that is 0x10 bytes long: | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 14: | Line 14: | ||
| 0x04 || UInt16 || {{BOM}} | | 0x04 || UInt16 || {{BOM}} | ||
|- | |- | ||
− | | 0x06 || UInt16 || '''Version number''' of the file format. | + | | 0x06 || UInt16 || '''Version number''' of the file format. Only seen as 00 0A. |
|- | |- | ||
| 0x08 || UInt32 || Length of the file in bytes. | | 0x08 || UInt32 || Length of the file in bytes. | ||
Line 25: | Line 25: | ||
|} | |} | ||
− | + | After the header follows the sections. BRLYT files constist of many different sections. The section can be identified by checking the first four bytes; it is a magic that identifies the section. | |
− | BRLYT files constist of many different sections. The section can be identified by checking the first four bytes; it is a magic that identifies the section. | ||
− | + | == lyt1 == | |
− | The ''lyt1'' sections comes after the header and defines the main layout. | + | The ''lyt1'' sections comes directly after the header and defines the main layout. |
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 43: | Line 42: | ||
| 0x09 || Byte[3] || {{Unknown-left|Padding?}} | | 0x09 || Byte[3] || {{Unknown-left|Padding?}} | ||
|- | |- | ||
− | | 0x0C || Float || Width. | + | | 0x0C || Float || Width of the layout. |
|- | |- | ||
− | | 0x10 || Float || Height. | + | | 0x10 || Float || Height of the layout. |
|} | |} | ||
+ | |||
+ | == usd1 == | ||
+ | The ''usd1'' section stores user data info defined by the user. The section occurs when a [[#Panes|pane]] has user data stored and then it comes after that section. The section starts with a header as follows: | ||
+ | |||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | ! Offset !! Type !! Information | ||
+ | |- | ||
+ | | 0x00 || String || '''Section magic'''. Always ''usd1'' in ASCII. | ||
+ | |- | ||
+ | | 0x04 || UInt32 || Section size. | ||
+ | |- | ||
+ | | 0x08 || UInt16 || Number of user data entries. | ||
+ | |- | ||
+ | | 0x0A || UInt16 || {{Unknown-left|'''Unknown'''. Always 00 00.}} | ||
+ | |} | ||
+ | |||
+ | ; Entries | ||
+ | An entry can store a string, multiple Int32s or multiple floats. All these entries comes after the header, and then the actual data is stored. Each entry is a structure as follows: | ||
+ | |||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | ! Offset !! Type !! Description | ||
+ | |- | ||
+ | | 0x00 || UInt32 || '''Name offset'''. Points to a null-termined string which is the name of this entry. Relative to the start of this entry. | ||
+ | |- | ||
+ | | 0x04 || UInt32 || '''Data offset'''. Points to the data of this entry. Relative to the start of this entry. | ||
+ | |- | ||
+ | | 0x08 || UInt16 || '''Number of entries''' or '''length''' if the string if the data is a string. | ||
+ | |- | ||
+ | | 0x0A || Byte || Type. 0 = String, 1 = Int32, 2 = Float | ||
+ | |- | ||
+ | | 0x0B || Byte || {{Unknown-left|'''Unknown'''. Always 00 00.}} | ||
+ | |} | ||
+ | |||
+ | == Resources == | ||
+ | These sections contains info about resources. They are always specified after the [[#lyt|lyt section]] in the order as follows. If a section is not needed (it doesn't contain any entries), then the section is not written to the file. | ||
=== txl1 === | === txl1 === | ||
− | The ''txl1'' sections stores TPL filenames. The section starts with a header: | + | The ''txl1'' sections stores [[TPL]] filenames. The section starts with a header: |
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 59: | Line 95: | ||
| 0x04 || UInt32 || Section size. | | 0x04 || UInt32 || Section size. | ||
|- | |- | ||
− | | 0x08 || UInt16 || Number of TPL filenames. | + | | 0x08 || UInt16 || Number of [[TPL]] filenames. |
|- | |- | ||
− | | 0x0A || UInt16 || {{Unknown-left|'''Unknown'''.}} | + | | 0x0A || UInt16 || {{Unknown-left|'''Unknown'''. Always 00 00.}} |
|} | |} | ||
After this section header comes the offsets to the strings. Each entry has the following structure. | After this section header comes the offsets to the strings. Each entry has the following structure. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 78: | Line 114: | ||
The ''mat1'' section holds data about materials used in the layout. The section starts with a header: | The ''mat1'' section holds data about materials used in the layout. The section starts with a header: | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 88: | Line 124: | ||
| 0x08 || UInt16 || '''N'''= Number of '''materials'''. | | 0x08 || UInt16 || '''N'''= Number of '''materials'''. | ||
|- | |- | ||
− | | 0x0A || UInt16 || {{Unknown-left|'''Unknown'''.}} | + | | 0x0A || UInt16 || {{Unknown-left|'''Unknown'''. Always 00 00.}} |
|- | |- | ||
| 0x0C || UInt32['''N'''] || Offsets to the '''materials'''. Relative to the start of this section. | | 0x0C || UInt32['''N'''] || Offsets to the '''materials'''. Relative to the start of this section. | ||
Line 95: | Line 131: | ||
Each material is the following structure: | Each material is the following structure: | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 121: | Line 157: | ||
The ''fnl1'' section is a list of fonts. | The ''fnl1'' section is a list of fonts. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 131: | Line 167: | ||
| 0x08 || UInt16 || '''N''' = Number of '''fonts'''. | | 0x08 || UInt16 || '''N''' = Number of '''fonts'''. | ||
|- | |- | ||
− | | 0x0A || UInt16 || {{Unknown-left|'''Unknown'''.}} | + | | 0x0A || UInt16 || {{Unknown-left|'''Unknown'''. Always 00 00.}} |
|} | |} | ||
After this section header comes the offsets to the strings. Each entry has the following structure. | After this section header comes the offsets to the strings. Each entry has the following structure. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 145: | Line 181: | ||
|} | |} | ||
+ | == Panes == | ||
=== pan1 === | === pan1 === | ||
− | The ''pan1'' section contains information about a pane | + | The ''pan1'' section contains information about a null pane. All panes should children to a null pane. In [[Mario Kart Wii]] this pane is always called "RootPane". The null doesn't show up in game, but it can be animated so that all children to it are also animated. |
+ | All other panes uses the same structure, but after this more data comes. The section has the following structure: | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 156: | Line 194: | ||
| 0x04 || UInt32 || Section size. | | 0x04 || UInt32 || Section size. | ||
|- | |- | ||
− | | 0x08 || Byte || | + | | 0x08 || Byte || Flag. |
|- | |- | ||
− | | 0x09 || Byte || | + | | 0x09 || Byte || Flag. |
|- | |- | ||
| 0x0A || Byte || Alpha. | | 0x0A || Byte || Alpha. | ||
Line 166: | Line 204: | ||
| 0x0C || String || '''Pane name'''. The length is always 0x10, unused bytes are set to 00. | | 0x0C || String || '''Pane name'''. The length is always 0x10, unused bytes are set to 00. | ||
|- | |- | ||
− | | 0x1C || String || User | + | | 0x1C || String || User information, stored as a string. |
|- | |- | ||
| 0x24 || Float[3] || Translation. | | 0x24 || Float[3] || Translation. | ||
Line 174: | Line 212: | ||
| 0x3C || Float[2] || Scale. | | 0x3C || Float[2] || Scale. | ||
|- | |- | ||
− | | 0x44 || Float || Width. | + | | 0x44 || Float || Width of the pane. |
|- | |- | ||
− | | 0x48 || Float || Height. | + | | 0x48 || Float || Height of the pane. |
|} | |} | ||
=== pas1 === | === pas1 === | ||
− | The ''pas1'' section is used as start of pane children data, after this section other panes can be defined. [[#pae1|pae1]] ends it. | + | The ''pas1'' section is used as start of pane children data, after this section other panes can be defined as children. [[#pae1|pae1]] ends it. |
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 194: | Line 232: | ||
The ''pae1'' section is used to end pane children. [[#pas1|pas1]] starts it. | The ''pae1'' section is used to end pane children. [[#pas1|pas1]] starts it. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 203: | Line 241: | ||
|} | |} | ||
− | === | + | === pic1 === |
− | The '' | + | The ''pic1'' section defines a simple image pane. |
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
− | | 0x00 || String || '''Section magic'''. Always '' | + | | 0x00 || String || '''Section magic'''. Always ''pic1'' in ASCII. |
|- | |- | ||
| 0x04 || UInt32 || Section size. | | 0x04 || UInt32 || Section size. | ||
|- | |- | ||
− | | 0x08 || String || ''' | + | | 0x08 || Byte || Flag. |
+ | |- | ||
+ | | 0x09 || Byte || Flag. | ||
+ | |- | ||
+ | | 0x0A || Byte || Alpha. | ||
+ | |- | ||
+ | | 0x0B || Byte || Padding. | ||
+ | |- | ||
+ | | 0x0C || String || '''Pane name'''. The length is always 0x10, unused bytes are set to 00. | ||
+ | |- | ||
+ | | 0x1C || String || User information, stored as a string. | ||
+ | |- | ||
+ | | 0x24 || Float[3] || Translation. | ||
+ | |- | ||
+ | | 0x30 || Float[3] || Rotation. | ||
+ | |- | ||
+ | | 0x3C || Float[2] || Scale. | ||
+ | |- | ||
+ | | 0x44 || Float || Width of the pane. | ||
+ | |- | ||
+ | | 0x48 || Float || Height of the pane. | ||
+ | |- | ||
+ | | 0x4C || Byte[4] || '''Top left''' vertex color of the pane in RGBA format. | ||
+ | |- | ||
+ | | 0x50 || Byte[4] || '''Top right''' vertex color of the pane in RGBA format. | ||
+ | |- | ||
+ | | 0x54 || Byte[4] || '''Bottom left''' vertex color of the pane in RGBA format. | ||
+ | |- | ||
+ | | 0x58 || Byte[4] || '''Bottom right''' vertex color of the pane in RGBA format. | ||
|- | |- | ||
− | | | + | | 0x5C || UInt16 || [[#mat1|Material index]]. |
|- | |- | ||
− | | | + | | 0x5E || Byte || Number of [[#UV coordinate set|UV sets]]. |
|- | |- | ||
− | | | + | | 0x5F || Byte || {{Unknown-left|'''Unknown'''.}} |
|} | |} | ||
− | === | + | After that the [[#UV coordinate set|UV sets]] are specified. |
− | The '' | + | |
+ | === bnd1 === | ||
+ | The ''bnd1'' section specifies a boundary pane. The pane has an unknown purpose and the structure is the same as a [[#pan1|pan1 pane]]. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
− | | 0x00 || String || '''Section magic'''. Always '' | + | | 0x00 || String || '''Section magic'''. Always ''bnd1'' in ASCII. |
|- | |- | ||
| 0x04 || UInt32 || Section size. | | 0x04 || UInt32 || Section size. | ||
|- | |- | ||
− | | 0x08 || Byte || | + | | 0x08 || Byte || Flag. |
|- | |- | ||
− | | 0x09 || Byte || | + | | 0x09 || Byte || Flag. |
|- | |- | ||
− | | 0x0A || Byte || | + | | 0x0A || Byte || Alpha. |
|- | |- | ||
− | | 0x0B || Byte || | + | | 0x0B || Byte || Padding. |
|- | |- | ||
− | | 0x0C || String || ''' | + | | 0x0C || String || '''Pane name'''. The length is always 0x10, unused bytes are set to 00. |
|- | |- | ||
− | | | + | | 0x1C || String || User information, stored as a string. |
|- | |- | ||
− | | | + | | 0x24 || Float[3] || Translation. |
|- | |- | ||
− | | | + | | 0x30 || Float[3] || Rotation. |
|- | |- | ||
− | | 0x3C || Float[2] || | + | | 0x3C || Float[2] || Scale. |
|- | |- | ||
− | | 0x44 || Float || Width. | + | | 0x44 || Float || Width of the pane. |
|- | |- | ||
− | | 0x48 || Float || Height. | + | | 0x48 || Float || Height of the pane. |
|} | |} | ||
=== txt1 === | === txt1 === | ||
− | '' | + | The ''txt1'' section contains information about a textbox pane. It also stores the text but in [[Mario Kart Wii]] it's useless because the text is loaded from a [[BMG]] file instead. |
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x00 || String || '''Section magic'''. Always ''txt1'' in ASCII. | | 0x00 || String || '''Section magic'''. Always ''txt1'' in ASCII. | ||
+ | |- | ||
+ | | 0x04 || UInt32 || Section size. | ||
+ | |- | ||
+ | | 0x08 || Byte || Flag. | ||
+ | |- | ||
+ | | 0x09 || Byte || Flag. | ||
+ | |- | ||
+ | | 0x0A || Byte || Alpha. | ||
+ | |- | ||
+ | | 0x0B || Byte || Padding. | ||
+ | |- | ||
+ | | 0x0C || String || '''Pane name'''. The length is always 0x10, unused bytes are set to 00. | ||
+ | |- | ||
+ | | 0x1C || String || User information, stored as a string. | ||
+ | |- | ||
+ | | 0x24 || Float[3] || Translation. | ||
+ | |- | ||
+ | | 0x30 || Float[3] || Rotation. | ||
+ | |- | ||
+ | | 0x3C || Float[2] || Scale. | ||
+ | |- | ||
+ | | 0x44 || Float || Width of the pane. | ||
+ | |- | ||
+ | | 0x48 || Float || Height of the pane. | ||
+ | |- | ||
+ | | 0x4C || UInt16 || Number of characters. | ||
+ | |- | ||
+ | | 0x4E || UInt16 || {{Unknown-left|'''Unknown'''.}} | ||
+ | |- | ||
+ | | 0x50 || UInt16 || [[#mat1|Material index]]. | ||
+ | |- | ||
+ | | 0x52 || UInt16 || [[#fnl1|Font index]]. | ||
+ | |- | ||
+ | | 0x54 || Byte || Flag | ||
+ | |- | ||
+ | | 0x55 || Byte[3] || {{Unknown-left|'''Unknown'''.}} | ||
+ | |- | ||
+ | | 0x58 || UInt32 || '''T''' = '''Text offset'''. Relative to the start of this section. | ||
+ | |- | ||
+ | | 0x5C || Byte[4] || Top color in RGBA format. | ||
+ | |- | ||
+ | | 0x60 || Byte[4] || Bottom color in RGBA format. | ||
+ | |- | ||
+ | | 0x64 || Float || Size X. | ||
+ | |- | ||
+ | | 0x68 || Float || Size Y. | ||
+ | |- | ||
+ | | 0x6C || Float || Character size. | ||
+ | |- | ||
+ | | 0x70 || Float || Line size. | ||
+ | |- | ||
+ | | '''T''' || String || Null-termined string of the text in UTF-16. | ||
+ | |} | ||
+ | |||
+ | === wnd1 === | ||
+ | The ''wnd1'' describes a window pane. A window pane is a more advanced image pane. It is unknown exactly how the window pane works. | ||
+ | |||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | ! Offset !! Type !! Description | ||
+ | |- | ||
+ | | 0x00 || String || '''Section magic'''. Always ''wnd1'' in ASCII. | ||
+ | |- | ||
+ | | 0x04 || UInt32 || Section size. | ||
+ | |- | ||
+ | | 0x08 || Byte || Flag. | ||
+ | |- | ||
+ | | 0x09 || Byte || Flag. | ||
+ | |- | ||
+ | | 0x0A || Byte || Alpha. | ||
+ | |- | ||
+ | | 0x0B || Byte || Padding. | ||
+ | |- | ||
+ | | 0x0C || String || '''Pane name'''. The length is always 0x10, unused bytes are set to 00. | ||
+ | |- | ||
+ | | 0x1C || String || User information, stored as a string. | ||
+ | |- | ||
+ | | 0x24 || Float[3] || Translation. | ||
+ | |- | ||
+ | | 0x30 || Float[3] || Rotation. | ||
+ | |- | ||
+ | | 0x3C || Float[2] || Scale. | ||
+ | |- | ||
+ | | 0x44 || Float || Width of the pane. | ||
+ | |- | ||
+ | | 0x48 || Float || Height of the pane. | ||
+ | |- | ||
+ | | 0x4C || Float || Coordinate 1. | ||
+ | |- | ||
+ | | 0x50 || Float || Coordinate 2. | ||
+ | |- | ||
+ | | 0x54 || Float || Coordinate 3. | ||
+ | |- | ||
+ | | 0x58 || Float || Coordinate 4. | ||
+ | |- | ||
+ | | 0x5C || Byte || Number of frames. | ||
+ | |- | ||
+ | | 0x5D || Byte[3] || {{Unknown-left|'''Unknown'''.}} | ||
+ | |- | ||
+ | | 0x60 || UInt32 || {{Unknown-left|'''Unknown'''. Probably an offset. Only seen as 0x68.}} | ||
+ | |- | ||
+ | | 0x64 || UInt32 || '''Window material offsets''' offset. Points to offsets which points to the window materials. Relative to the start of this section. | ||
+ | |- | ||
+ | | 0x68 || Byte[4] || '''Top left''' vertex color in RGBA format. | ||
+ | |- | ||
+ | | 0x6C || Byte[4] || '''Top right''' vertex color in RGBA format. | ||
+ | |- | ||
+ | | 0x70 || Byte[4] || '''Bottom left''' vertex color in RGBA format. | ||
+ | |- | ||
+ | | 0x74 || Byte[4] || '''Bottom right''' vertex color in RGBA format. | ||
+ | |- | ||
+ | | 0x78 || UInt16 || [[#mat1|Material index]]. | ||
+ | |- | ||
+ | | 0x7A || Byte || Number of [[#UV coordinate set|UV sets]]. | ||
+ | |- | ||
+ | | 0x7B || Byte || {{Unknown-left|'''Unknown'''.}} | ||
|} | |} | ||
− | === | + | After that the [[#UV coordinate set|UV sets]] are specified. Then the window material offsets are specified and after that the window materials. |
− | '' | + | |
+ | ; Window material | ||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | ! Offset !! Type !! Description | ||
+ | |- | ||
+ | | 0x00 || UInt16 || [[#mat1|Material index]]. | ||
+ | |- | ||
+ | | 0x02 || Byte || Index. | ||
+ | |- | ||
+ | | 0x03 || Byte || {{Unknown-left|'''Unknown'''.}} | ||
+ | |} | ||
+ | |||
+ | == Groups == | ||
+ | === grp1 === | ||
+ | The ''grp1'' section defines a group. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
− | | 0x00 || String || '''Section magic'''. Always '' | + | | 0x00 || String || '''Section magic'''. Always ''grp1'' in ASCII. |
+ | |- | ||
+ | | 0x04 || UInt32 || Section size. | ||
+ | |- | ||
+ | | 0x08 || String || '''Group name'''. The length is always 0x10 bytes long, unused characters are set to 00. | ||
+ | |- | ||
+ | | 0x18 || UInt16 || '''N''' = Number of entries. | ||
+ | |- | ||
+ | | 0x1A || UInt16 || {{Unknown-left|'''Unknown'''.}} | ||
+ | |- | ||
+ | | 0x1C || String['''N''']|| An array of entries in this group. The length of each string is always 0x10, unused characters are set to 00. | ||
|} | |} | ||
Line 280: | Line 489: | ||
The ''grs1'' section defines a group of groups. [[#gre1|gre1]] ends the group of groups. | The ''grs1'' section defines a group of groups. [[#gre1|gre1]] ends the group of groups. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 290: | Line 499: | ||
The ''gre1'' section ends a group of groups. [[#grs1|grs1]] starts the group of groups. | The ''gre1'' section ends a group of groups. [[#grs1|grs1]] starts the group of groups. | ||
− | {| class="wikitable" | + | {|class="wikitable" |
|- | |- | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x00 || String || '''Section magic'''. Always ''gre1'' in ASCII. | | 0x00 || String || '''Section magic'''. Always ''gre1'' in ASCII. | ||
+ | |} | ||
+ | |||
+ | == Common data structures == | ||
+ | === UV coordinate set === | ||
+ | Specifies the UV coordinates for an image. Each entry is a 0x20 byte structure as follows: | ||
+ | |||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | ! Offset !! Type !! Description | ||
+ | |- | ||
+ | | 0x00 || Float[2] || '''Top left''' U and V coordinate. | ||
+ | |- | ||
+ | | 0x08 || Float[2] || '''Top right''' U and V coordinate. | ||
+ | |- | ||
+ | | 0x10 || Float[2] || '''Bottom left''' U and V coordinate. | ||
+ | |- | ||
+ | | 0x18 || Float[2] || '''Bottom right''' U and V coordinate. | ||
|} | |} | ||
Revision as of 11:52, 11 April 2017
BRLYT files (Binary Revolution LaYouT) are the files used as layout in the Wii system. They manage how the UI TPL images show in the game, with specified flags such as material settings, colors, positions, size, rotations and more. BRLYT files are used with BRLAN animations, BRFNT fonts and also with BRCTR files in Mario Kart Wii. They are always found into blyt folders.
File Format
Header
The file starts with a header that is 0x10 bytes long:
Offset | Type | Description |
---|---|---|
0x00 | String | File magic. Always RLYT in ASCII. |
0x04 | UInt16 | Byte order mark (BOM): The value is always 0xFEFF. If value 0xFFFE is read, then the false endian is used. Mario Kart Wii uses nearly always big endian (bytes 0xFE,0xFF). |
0x06 | UInt16 | Version number of the file format. Only seen as 00 0A. |
0x08 | UInt32 | Length of the file in bytes. |
0x0C | UInt16 | Length of this header in bytes. |
0x0E | UInt16 | Number of sections. |
0x10 | End of file header |
After the header follows the sections. BRLYT files constist of many different sections. The section can be identified by checking the first four bytes; it is a magic that identifies the section.
lyt1
The lyt1 sections comes directly after the header and defines the main layout.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always lyt1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | Byte | Is Centered. |
0x09 | Byte[3] | Padding? |
0x0C | Float | Width of the layout. |
0x10 | Float | Height of the layout. |
usd1
The usd1 section stores user data info defined by the user. The section occurs when a pane has user data stored and then it comes after that section. The section starts with a header as follows:
Offset | Type | Information |
---|---|---|
0x00 | String | Section magic. Always usd1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | UInt16 | Number of user data entries. |
0x0A | UInt16 | Unknown. Always 00 00. |
- Entries
An entry can store a string, multiple Int32s or multiple floats. All these entries comes after the header, and then the actual data is stored. Each entry is a structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | Name offset. Points to a null-termined string which is the name of this entry. Relative to the start of this entry. |
0x04 | UInt32 | Data offset. Points to the data of this entry. Relative to the start of this entry. |
0x08 | UInt16 | Number of entries or length if the string if the data is a string. |
0x0A | Byte | Type. 0 = String, 1 = Int32, 2 = Float |
0x0B | Byte | Unknown. Always 00 00. |
Resources
These sections contains info about resources. They are always specified after the lyt section in the order as follows. If a section is not needed (it doesn't contain any entries), then the section is not written to the file.
txl1
The txl1 sections stores TPL filenames. The section starts with a header:
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always txl1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | UInt16 | Number of TPL filenames. |
0x0A | UInt16 | Unknown. Always 00 00. |
After this section header comes the offsets to the strings. Each entry has the following structure.
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | Offset to a TPL filename which is stored as a null-termined string. Relative to the start of the txl1 section. |
0x04 | UInt32 | Padding. |
mat1
The mat1 section holds data about materials used in the layout. The section starts with a header:
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always mat1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | UInt16 | N= Number of materials. |
0x0A | UInt16 | Unknown. Always 00 00. |
0x0C | UInt32[N] | Offsets to the materials. Relative to the start of this section. |
Each material is the following structure:
Offset | Type | Description |
---|---|---|
0x00 | String | Material name. The length is always 0x14, unused bytes are set to 00. |
0x14 | Int16[4] | Fore Color in RGBA format. |
0x1C | Int16[4] | Back Color in RGBA format. |
0x24 | Int16[4] | Color Register 3 in RGBA format. |
0x2C | Byte[4] | TEV Color 1 in RGBA format. |
0x30 | Byte[4] | TEV Color 2 in RGBA format. |
0x34 | Byte[4] | TEV Color 3 in RGBA format. |
0x38 | Byte[4] | TEV Color 4 in RGBA format. |
0x3C | UInt32 | Flags that set which material structures that come after this structure. |
fnl1
The fnl1 section is a list of fonts.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always fnl1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | UInt16 | N = Number of fonts. |
0x0A | UInt16 | Unknown. Always 00 00. |
After this section header comes the offsets to the strings. Each entry has the following structure.
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | Offset to a font filename which is stored as a null-termined string. Relative to the start of the fnl1 section. |
0x04 | UInt32 | Padding. |
Panes
pan1
The pan1 section contains information about a null pane. All panes should children to a null pane. In Mario Kart Wii this pane is always called "RootPane". The null doesn't show up in game, but it can be animated so that all children to it are also animated. All other panes uses the same structure, but after this more data comes. The section has the following structure:
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always pan1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | Byte | Flag. |
0x09 | Byte | Flag. |
0x0A | Byte | Alpha. |
0x0B | Byte | Padding. |
0x0C | String | Pane name. The length is always 0x10, unused bytes are set to 00. |
0x1C | String | User information, stored as a string. |
0x24 | Float[3] | Translation. |
0x30 | Float[3] | Rotation. |
0x3C | Float[2] | Scale. |
0x44 | Float | Width of the pane. |
0x48 | Float | Height of the pane. |
pas1
The pas1 section is used as start of pane children data, after this section other panes can be defined as children. pae1 ends it.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always pas1 in ASCII. |
0x04 | UInt32 | Section size. |
pae1
The pae1 section is used to end pane children. pas1 starts it.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always pae1 in ASCII. |
0x04 | UInt32 | Section size. |
pic1
The pic1 section defines a simple image pane.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always pic1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | Byte | Flag. |
0x09 | Byte | Flag. |
0x0A | Byte | Alpha. |
0x0B | Byte | Padding. |
0x0C | String | Pane name. The length is always 0x10, unused bytes are set to 00. |
0x1C | String | User information, stored as a string. |
0x24 | Float[3] | Translation. |
0x30 | Float[3] | Rotation. |
0x3C | Float[2] | Scale. |
0x44 | Float | Width of the pane. |
0x48 | Float | Height of the pane. |
0x4C | Byte[4] | Top left vertex color of the pane in RGBA format. |
0x50 | Byte[4] | Top right vertex color of the pane in RGBA format. |
0x54 | Byte[4] | Bottom left vertex color of the pane in RGBA format. |
0x58 | Byte[4] | Bottom right vertex color of the pane in RGBA format. |
0x5C | UInt16 | Material index. |
0x5E | Byte | Number of UV sets. |
0x5F | Byte | Unknown. |
After that the UV sets are specified.
bnd1
The bnd1 section specifies a boundary pane. The pane has an unknown purpose and the structure is the same as a pan1 pane.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always bnd1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | Byte | Flag. |
0x09 | Byte | Flag. |
0x0A | Byte | Alpha. |
0x0B | Byte | Padding. |
0x0C | String | Pane name. The length is always 0x10, unused bytes are set to 00. |
0x1C | String | User information, stored as a string. |
0x24 | Float[3] | Translation. |
0x30 | Float[3] | Rotation. |
0x3C | Float[2] | Scale. |
0x44 | Float | Width of the pane. |
0x48 | Float | Height of the pane. |
txt1
The txt1 section contains information about a textbox pane. It also stores the text but in Mario Kart Wii it's useless because the text is loaded from a BMG file instead.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always txt1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | Byte | Flag. |
0x09 | Byte | Flag. |
0x0A | Byte | Alpha. |
0x0B | Byte | Padding. |
0x0C | String | Pane name. The length is always 0x10, unused bytes are set to 00. |
0x1C | String | User information, stored as a string. |
0x24 | Float[3] | Translation. |
0x30 | Float[3] | Rotation. |
0x3C | Float[2] | Scale. |
0x44 | Float | Width of the pane. |
0x48 | Float | Height of the pane. |
0x4C | UInt16 | Number of characters. |
0x4E | UInt16 | Unknown. |
0x50 | UInt16 | Material index. |
0x52 | UInt16 | Font index. |
0x54 | Byte | Flag |
0x55 | Byte[3] | Unknown. |
0x58 | UInt32 | T = Text offset. Relative to the start of this section. |
0x5C | Byte[4] | Top color in RGBA format. |
0x60 | Byte[4] | Bottom color in RGBA format. |
0x64 | Float | Size X. |
0x68 | Float | Size Y. |
0x6C | Float | Character size. |
0x70 | Float | Line size. |
T | String | Null-termined string of the text in UTF-16. |
wnd1
The wnd1 describes a window pane. A window pane is a more advanced image pane. It is unknown exactly how the window pane works.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always wnd1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | Byte | Flag. |
0x09 | Byte | Flag. |
0x0A | Byte | Alpha. |
0x0B | Byte | Padding. |
0x0C | String | Pane name. The length is always 0x10, unused bytes are set to 00. |
0x1C | String | User information, stored as a string. |
0x24 | Float[3] | Translation. |
0x30 | Float[3] | Rotation. |
0x3C | Float[2] | Scale. |
0x44 | Float | Width of the pane. |
0x48 | Float | Height of the pane. |
0x4C | Float | Coordinate 1. |
0x50 | Float | Coordinate 2. |
0x54 | Float | Coordinate 3. |
0x58 | Float | Coordinate 4. |
0x5C | Byte | Number of frames. |
0x5D | Byte[3] | Unknown. |
0x60 | UInt32 | Unknown. Probably an offset. Only seen as 0x68. |
0x64 | UInt32 | Window material offsets offset. Points to offsets which points to the window materials. Relative to the start of this section. |
0x68 | Byte[4] | Top left vertex color in RGBA format. |
0x6C | Byte[4] | Top right vertex color in RGBA format. |
0x70 | Byte[4] | Bottom left vertex color in RGBA format. |
0x74 | Byte[4] | Bottom right vertex color in RGBA format. |
0x78 | UInt16 | Material index. |
0x7A | Byte | Number of UV sets. |
0x7B | Byte | Unknown. |
After that the UV sets are specified. Then the window material offsets are specified and after that the window materials.
- Window material
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Material index. |
0x02 | Byte | Index. |
0x03 | Byte | Unknown. |
Groups
grp1
The grp1 section defines a group.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always grp1 in ASCII. |
0x04 | UInt32 | Section size. |
0x08 | String | Group name. The length is always 0x10 bytes long, unused characters are set to 00. |
0x18 | UInt16 | N = Number of entries. |
0x1A | UInt16 | Unknown. |
0x1C | String[N] | An array of entries in this group. The length of each string is always 0x10, unused characters are set to 00. |
grs1
The grs1 section defines a group of groups. gre1 ends the group of groups.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always grs1 in ASCII. |
gre1
The gre1 section ends a group of groups. grs1 starts the group of groups.
Offset | Type | Description |
---|---|---|
0x00 | String | Section magic. Always gre1 in ASCII. |
Common data structures
UV coordinate set
Specifies the UV coordinates for an image. Each entry is a 0x20 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[2] | Top left U and V coordinate. |
0x08 | Float[2] | Top right U and V coordinate. |
0x10 | Float[2] | Bottom left U and V coordinate. |
0x18 | Float[2] | Bottom right U and V coordinate. |
Tools
The following tools can handle BRLYT files: