BRCTR (File Format)
The BRCTR (Binary Revolution ConTRol) filetype applies specific settings for BRLYT files and makes possible the use of BRLAN animation files in Mario Kart Wii's User Interface elements, such as buttons, backgrounds and layouts. This kind of file is always found into the UI directory from the game's filesystem, and specifically into U8 files. They're located into ctrl folders.
File Format
File Header
The file starts with a header that is 0x14 byte long.
Offset | Type | Description |
---|---|---|
0x00 | String | File magic. Always bctr in ASCII. |
0x04 | UInt16 | Probably number of Sub-Headers. Always 00 02. |
0x06 | UInt16 | Offset to the BRLYT name (relative to the start of the Name Table). |
0x08 | UInt16 | Offset to the BMG name (relative to the start of the Name Table). 0 if not used. |
0x0A | UInt16 | Offset to the BRLYT name of the icon source (relative to the start of the Name Table). 0 if not used. |
0x0C | UInt16 | Offset to Sub-Header 1. |
0x0E | UInt16 | Offset to Sub-Header 2. |
0x10 | UInt16 | Offset to Name Table. |
0x12 | UInt16 | Unknown. |
Sub-Header 1
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Offset to start of section 1 (relative to the start of this header). |
0x02 | UInt16 | Number of section 1 entries. |
0x04 | UInt16 | Offset to start of section 2 (relative to the start of this header). |
0x06 | UInt16 | Number of section 2 entries. |
Section 1
Section 1 configure a BRLYT group with animations.
Offset | Type | Description |
---|---|---|
0x02 | UInt16 | BRLAN internal name offsets (0 = no name). |
0x00 | UInt16 | BRLYT group name offset (0 = no name). Unknown if this only can be a group. |
0x04 | UInt16 | This value refers to a section 2 ID. |
0x06 | UInt16 | Number of section 2 entries to use. |
Section 2
Section 2 stores data about BRLAN animations.
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | BRLAN internal name offsets (0 = no name). |
0x02 | UInt16 | BRLAN file name offsets (0 = no name). Links to the filename of the BRLAN. |
0x04 | UInt16 | BRLAN internal name offset. Of not 00 00, it links to a BRLAN. Unknown usage, could be next animation. |
0x06 | UInt16 | Name offset. |
0x08 | Float | Unknown. |
Sub-Header 2
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Offset to start of section 3 (relative to the start of this header). |
0x02 | UInt16 | Number of section 3 entries. |
0x04 | UInt16 | Offset to start of section 4 (relative to the start of this header). |
0x06 | UInt16 | Number of section 4 entries. |
0x08 | UInt16 | Offset to start of section 5 (relative to the start of this header). |
0x0A | UInt16 | Number of section 5 entries. |
Section 3
This is the section that is best known. It contains float data specifying where to set the final position of a BRLYT pane, in 4:3 and 16:9 aspect ratios.
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Name offset. |
0x02 | UInt16 | Alpha channel (0xFF = opaque, 0x00 = transparent). |
0x04 | UInt16 | 0 = don't use animation, 1 = use animation. |
0x06 | UInt16 | Padding. |
0x08 | Float | Delay time for the animation. When going back, the delay works inverse. |
0x0C | Float | Translation X (4:3). |
0x10 | Float | Translation Y (4:3). |
0x14 | Float | Translation Z (4:3). |
0x18 | Float | Scale X (4:3). |
0x1C | Float | Scale Y (4:3). |
0x20 | Float | Translation X (16:9). |
0x24 | Float | Translation Y (16:9). |
0x28 | Float | Translation Z (16:9). |
0x2C | Float | Scale X (16:9). |
0x30 | Float | Scale Y (16:9). |
0x34 | UInt16 | This value refers to a section 4 ID. |
0x36 | UInt16 | Number of section 4 entries to use. |
0x38 | UInt16 | This value refers to a section 5 ID. |
0x3A | UInt16 | Number of section 5 entries to use. |
Section 4
This section refers to a message ID found in BMG files.
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | BRLYT text pane name offset. Links to the BRLYT text pane to use with the message (0 if used in all text panes => links to no name). |
0x02 | UInt16 | Name offset. |
0x04 | UInt32 | Message ID. |
Section 5
This section consists of two name offsets to the Name Table. Each entry in this section sets the texture source of a material inside the BRLYT, this source is the name of a pane in the linked icon BRLYT.
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Material name. |
0x02 | UInt16 | Texture name. |
Name Table
At the end of the file, there is a section with null-termined strings. All name offsets in a BRCTR file is relative to the start of the name table. The first byte is always 00, because of the offsets in the sections that doesn't have a name should be zero. It contains references to BRLYT pane names, functions found in StaticR.rel, BRLAN files and BRLAN pat1 names, which probably establish a link between them (they're configured in the previous sections) to load correctly in the game. The amount is not stored, so null-terminated strings should be read until the end of the file.
Tools
The following tools can handle BRCTR files:
- Wexos's Toolbox, by Wexos