BRCTR (File Format)

From Custom Mario Kart
(Redirected from BRCTR)
Jump to navigation Jump to search

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 Number of Sub-Headers. Always 2.
0x06 UInt16 Offset to the main 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).
0x0A UInt16 Offset to the picture source BRLYT name (relative to the start of the Name Table).
0x0C UInt16 Offset to the Animation Sub-Header.
0x0E UInt16 Offset to Layout Sub-Header.
0x10 UInt16 Offset to Name Table.
0x12 UInt16 Padding.

Animation Sub-Header

Offset Type Description
0x00 UInt16 Offset to the first Group (relative to the start of this header).
0x02 UInt16 Number of Groups.
0x04 UInt16 Offset to the first Animation (relative to the start of this header).
0x06 UInt16 Number of Animations.

Group

Offset Type Description
0x00 UInt16 Offset to the Group name (relative to the start of the Name Table).
0x02 UInt16 Offset to the BRLYT group pane name (relative to the start of the Name Table).
0x04 UInt16 Index of the first Animation.
0x06 UInt16 Number of Animations.

Animation

Offset Type Description
0x00 UInt16 Offset to the Animation name (relative to the start of the Name Table).
0x02 UInt16 Offset to the BRLAN name (relative to the start of the Name Table).
0x04 UInt16 Offset to the BRLAN name of the next animation (relative to the start of the Name Table).
0x06 Bool16 Whether the Animation is reversed.
0x08 Float Speed of the Animation.

Layout Sub-Header

Offset Type Description
0x00 UInt16 Offset to the first Variant (relative to the start of this header).
0x02 UInt16 Number of Variants.
0x04 UInt16 Offset to the first Message (relative to the start of this header).
0x06 UInt16 Number of Messages.
0x08 UInt16 Offset to the first Picture (relative to the start of this header).
0x0A UInt16 Number of Pictures.

Variant

Offset Type Description
0x00 UInt16 Offset to the Variant name (relative to the start of the Name Table).
0x02 UInt16 Transparency.
0x04 Bool16 Whether the Variant is animated.
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 Index of the first Message.
0x36 UInt16 Number of Messages.
0x38 UInt16 Index of the first Picture.
0x3A UInt16 Number of Pictures.

Message

Offset Type Description
0x00 UInt16 Offset to the BRLYT pane name (relative to the start of the Name Table).
0x02 UInt16 Offset to the Message name (relative to the start of the Name Table).
0x04 UInt32 BMG Message ID.

Picture

Offset Type Description
0x00 UInt16 Offset to the destination BRLYT pane name (relative to the start of the Name Table), which must be contained in the main BRLYT.
0x02 UInt16 Offset to the source BRLYT pane name (relative to the start of the Name Table), which must be contained in the picture source BRLYT.

Name Table

At the end of the file, there is a section with null-terminated strings. The first string is always an empty one, such that unused fields can use an offset of zero.

Tools

The following tools can handle BRCTR files: