Difference between revisions of "BREFF and BREFT (File Format)"
Jump to navigation
Jump to search
(9+ different breff/breft pairs will cause a crash) |
(Update/Cleanup) |
||
Line 17: | Line 17: | ||
| 0x08 || 0x04 || UInt32 || '''Length of the file''' in bytes. | | 0x08 || 0x04 || UInt32 || '''Length of the file''' in bytes. | ||
|- | |- | ||
− | | 0x0C || 0x02 || UInt16 || ''' | + | | 0x0C || 0x02 || UInt16 || '''Size of the header''' (usually 0x10). |
|- | |- | ||
− | | 0x0E || 0x02 || UInt16 || '''Number of | + | | 0x0E || 0x02 || UInt16 || '''Number of blocks'''. Always 1 for all files in [[Mario Kart Wii|MKW]]. |
− | |||
− | |||
|} | |} | ||
− | == | + | == Block Header == |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 34: | Line 30: | ||
|- | |- | ||
| 0x04 || 0x04 || UInt32 || Length of section in bytes. The magic and this value are not included. | | 0x04 || 0x04 || UInt32 || Length of section in bytes. The magic and this value are not included. | ||
+ | |} | ||
+ | |||
+ | == Project Header == | ||
+ | {| class="wikitable" | ||
|- | |- | ||
− | + | ! Offset !! Size !! Type !! Description | |
|- | |- | ||
− | | | + | | 0x00 || 0x04 || UInt32 || Section header size. |
|- | |- | ||
− | | | + | | 0x04 || 0x04 || UInt32 || Pointer to previous project. Always 0. |
|- | |- | ||
− | | | + | | 0x08 || 0x04 || UInt32 || Pointer to next project. Always 0. |
|- | |- | ||
− | | | + | | 0x0C || 0x02 || UInt16 || '''L''' = Length of NULL-terminated string. |
|- | |- | ||
− | | | + | | 0x0E || 0x02 || UInt16 || {{Unknown-left|Padding.}} |
|- | |- | ||
− | | 0x18 | + | | 0x18 || '''L''' || String || NULL-terminated ASCII name of project. |
|- | |- | ||
− | |||
|} | |} | ||
− | + | == Subfile Table == | |
− | == Subfile | + | This section is located right after [[#Project Header|Project Header]]. |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Offset !! Size !! Type !! Description | ! Offset !! Size !! Type !! Description | ||
|- | |- | ||
− | | 0x00 || 0x04 || UInt32 || Size of | + | | 0x00 || 0x04 || UInt32 || Size of the table. |
|- | |- | ||
− | | 0x04 || 0x02 || UInt16 || | + | | 0x04 || 0x02 || UInt16 || Entry number. |
|- | |- | ||
− | | 0x06 || 0x02 || UInt16 || {{Unknown-left| | + | | 0x06 || 0x02 || UInt16 || {{Unknown-left|Padding.}} |
|- | |- | ||
| 0x08 || colspan=3 {{Unknown|Start of first subfile item}} | | 0x08 || colspan=3 {{Unknown|Start of first subfile item}} | ||
+ | |- | ||
|} | |} | ||
− | == Subfile Item == | + | === Subfile Table Item === |
− | + | Items are placed one after another and they are not aligned. | |
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Offset !! Size !! Type !! Description | ! Offset !! Size !! Type !! Description | ||
|- | |- | ||
− | | 0x00 || 0x02 || UInt16 || '''L''' = Length of name | + | | 0x00 || 0x02 || UInt16 || '''L''' = Length of NULL-terminated name. |
|- | |- | ||
− | | 0x02 || '''L''' || String || ASCII name of object | + | | 0x02 || '''L''' || String || NULL-terminated ASCII name of object. |
|- | |- | ||
− | | 0x02 + '''L''' || 0x04 || UInt32 || Offset of data, relative to the beginning of the | + | | 0x02 + '''L''' || 0x04 || UInt32 || Offset of data, relative to the beginning of the table. |
|- | |- | ||
| 0x06 + '''L''' || 0x04 || UInt32 || Size of data in bytes. Add 0x20 for BREFT files. | | 0x06 + '''L''' || 0x04 || UInt32 || Size of data in bytes. Add 0x20 for BREFT files. | ||
|- | |- | ||
− | |||
|} | |} | ||
− | |||
= Content = | = Content = | ||
The Subfile Item List points to the specific data for BREFF or BREFT. Continue reading [[BREFF (File Format)]] or [[BREFT (File Format)]]. | The Subfile Item List points to the specific data for BREFF or BREFT. Continue reading [[BREFF (File Format)]] or [[BREFT (File Format)]]. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:File Format/Wii]] | [[Category:File Format/Wii]] |
Revision as of 12:04, 3 June 2023
BREFF and BREFT appears always as pair and always in a subdirectory of ./effect/. BREFF contains the control information and BREFT the graphic and texture data. A track can have up to 8 different effects, adding more will cause the game to crash.
File Format
File Header
The file begins with the header of 0x10 bytes. The structure is the same as for BRRES files:
Offset | Size | Type | Description |
---|---|---|---|
0x00 | 0x04 | String | File identifier: String "REFF" for BREFF or "REFT" for BREFT in ASCII. |
0x04 | 0x02 | 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 | 0x02 | UInt16 | Version number of file format. Value 9 for all files in MKW. |
0x08 | 0x04 | UInt32 | Length of the file in bytes. |
0x0C | 0x02 | UInt16 | Size of the header (usually 0x10). |
0x0E | 0x02 | UInt16 | Number of blocks. Always 1 for all files in MKW. |
Block Header
Offset | Size | Type | Description |
---|---|---|---|
0x00 | 0x04 | String | File identifier: String REFF for BREFF or REFT for BREFT in ASCII. |
0x04 | 0x04 | UInt32 | Length of section in bytes. The magic and this value are not included. |
Project Header
Offset | Size | Type | Description |
---|---|---|---|
0x00 | 0x04 | UInt32 | Section header size. |
0x04 | 0x04 | UInt32 | Pointer to previous project. Always 0. |
0x08 | 0x04 | UInt32 | Pointer to next project. Always 0. |
0x0C | 0x02 | UInt16 | L = Length of NULL-terminated string. |
0x0E | 0x02 | UInt16 | Padding. |
0x18 | L | String | NULL-terminated ASCII name of project. |
Subfile Table
This section is located right after Project Header.
Offset | Size | Type | Description |
---|---|---|---|
0x00 | 0x04 | UInt32 | Size of the table. |
0x04 | 0x02 | UInt16 | Entry number. |
0x06 | 0x02 | UInt16 | Padding. |
0x08 | Start of first subfile item |
Subfile Table Item
Items are placed one after another and they are not aligned.
Offset | Size | Type | Description |
---|---|---|---|
0x00 | 0x02 | UInt16 | L = Length of NULL-terminated name. |
0x02 | L | String | NULL-terminated ASCII name of object. |
0x02 + L | 0x04 | UInt32 | Offset of data, relative to the beginning of the table. |
0x06 + L | 0x04 | UInt32 | Size of data in bytes. Add 0x20 for BREFT files. |
Content
The Subfile Item List points to the specific data for BREFF or BREFT. Continue reading BREFF (File Format) or BREFT (File Format).