Difference between revisions of "BRRES (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
(Constructed format documentation.)
Line 5: Line 5:
  
 
= Format =
 
= Format =
BRRES Files are similar to [[SZS (File Format)|SZS Files]]. They contain multiple files, here is the format described.
+
BRRES Files are similar to [[SZS (File Format)|SZS Files]]. They contain multiple sections, sometimes refered to as files. The format has been used in many games by Nintendo. This article describes [[Mario Kart Wii]] BRRES files.
 
== Header ==
 
== Header ==
The header is a 0x10 structure. It is as follows:
+
The file begins with the header. It is a 0x10 structure. It is as follows:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 16: Line 16:
 
| 0x00
 
| 0x00
 
| char[4]
 
| char[4]
| 'BRES' in ASCII; File identifier
+
| 'BRES' in ASCII; File identifier.
 
|-
 
|-
 
| 0x04
 
| 0x04
| int
+
| short
| '''Unknown'''
+
| Byte order mark. 0xFEFF is the big endian byte order, 0xFFFE is little endian.
 +
|-
 +
| 0x06
 +
| short
 +
| Padding.
 
|-
 
|-
 
| 0x08
 
| 0x08
Line 28: Line 32:
 
| 0x0C
 
| 0x0C
 
| short
 
| short
| Start of the beginning of the rootdata (0x0010)
+
| Offset to root section relative to start. (0x0010)
 
|-
 
|-
 
| 0x0E
 
| 0x0E
 
| short
 
| short
| Amount of files (+1?)
+
| Number of sections (including root).
 
|-
 
|-
 
|}
 
|}
 
+
== Sections ==
== Root ==
+
=== Root ===
The root of the brres file contains all pointers to files and filenames
+
The root section of the brres file contains all pointers to files and filenames
The header of the root is 0x10 in length
+
The header of the root is 0x8 in length.
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 51: Line 55:
 
| 0x04
 
| 0x04
 
| int
 
| int
| Length of rootdata
+
| Length of section in bytes.
 +
|-
 +
|}
 +
This header is then followed by a [[BRRES Index Group (File Format)|BRRES Index Group]]. The entries in this group are the folders of this brres file, and point to more [[BRRES Index Group (File Format)|BRRES Index Group]]s within the root section. These then point to the actual sections of the BRRES file.
 +
===Others===
 +
Other BRRES sections tend to be within specific folders, as set out by the root section. The identifiers of these sections, as well as the normal folder and a description are listed below.
 +
BRRES Files contain only a few file formats, they are:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Identifier
 +
! Folder
 +
! Description
 +
|-
 +
| [[MDL0 (File Format)|MDL0]]
 +
| 3DModels(NW4R)
 +
| Model files.
 +
|-
 +
| [[TEX0 (File Format)|TEX0]]
 +
| Textures(NW4R)
 +
| Texture files.
 +
|-
 +
| [[SRT0 (File Format)|SRT0]]
 +
| AnmTexSrt(NW4R)
 +
| Texture movement animations.
 
|-
 
|-
| 0x08
+
| [[CHR0 (File Format)|CHR0]]
| int
+
| AnmChr(NW4R)
| '''Unknown'''
+
| Model movement animations.
 +
|-
 +
| [[PAT0 (File Format)|PAT0]]
 +
| AnmTexPat(NW4R)
 +
| Texture swapping animations.
 +
|-
 +
| [[CLR0 (File Format)|CLR0]]
 +
| AnmClr(NW4R)
 +
| Colour changing animations.
 +
|-
 +
| '''Not seen'''
 +
| Palettes(NW4R)
 +
| '''Known to exist from main.dol'''
 +
|-
 +
| '''Not seen'''
 +
| AnmVis(NW4R)
 +
| '''Known to exist from main.dol'''
 +
|-
 +
| '''Not seen'''
 +
| AnmShp(NW4R)
 +
| '''Known to exist from main.dol'''
 +
|-
 +
| '''Not seen'''
 +
| AnmScn(NW4R)
 +
| '''Known to exist from main.dol'''
 +
|-
 +
| '''Not seen'''
 +
| LightSet(NW4R)
 +
| '''Known to exist from main.dol'''
 +
|-
 +
| '''Not seen'''
 +
| AmbLights(NW4R)
 +
| '''Known to exist from main.dol'''
 +
|-
 +
| '''Not seen'''
 +
| Lights(NW4R)
 +
| '''Known to exist from main.dol'''
 
|-
 
|-
| 0x0C
+
| '''Not seen'''
| int
+
| Fogs(NW4R)
| Amount of folders
+
| '''Known to exist from main.dol'''
 
|-
 
|-
 +
| '''Not seen'''
 +
| Cameras(NW4R)
 +
| '''Known to exist from main.dol'''
 
|}
 
|}
 
+
== String Table ==
=Included Files=
+
At the end of the BRRES file is a string table. This is a series of 4-byte length prefixed strings, padded to start at four byte offsets. Various sections point to this table, which is how all text in BRRES files is stored.
BRRES Files contain only a few file formats, they are:
 
* MDL0 - Model Files
 
* TEX0 - Texture Files
 
* SRT0 - Animation Files
 
 
 
 
[[Category: File Format]]
 
[[Category: File Format]]

Revision as of 17:33, 16 March 2011

BRRES Files are used to make objects. They contain models, textures and animations

Known editors:

Format

BRRES Files are similar to SZS Files. They contain multiple sections, sometimes refered to as files. The format has been used in many games by Nintendo. This article describes Mario Kart Wii BRRES files.

Header

The file begins with the header. It is a 0x10 structure. It is as follows:

Offset Type Description
0x00 char[4] 'BRES' in ASCII; File identifier.
0x04 short Byte order mark. 0xFEFF is the big endian byte order, 0xFFFE is little endian.
0x06 short Padding.
0x08 int Length of the file in bytes.
0x0C short Offset to root section relative to start. (0x0010)
0x0E short Number of sections (including root).

Sections

Root

The root section of the brres file contains all pointers to files and filenames The header of the root is 0x8 in length.

Offset Type Description
0x00 char[4] 'root' in ASCII
0x04 int Length of section in bytes.

This header is then followed by a BRRES Index Group. The entries in this group are the folders of this brres file, and point to more BRRES Index Groups within the root section. These then point to the actual sections of the BRRES file.

Others

Other BRRES sections tend to be within specific folders, as set out by the root section. The identifiers of these sections, as well as the normal folder and a description are listed below. BRRES Files contain only a few file formats, they are:

Identifier Folder Description
MDL0 3DModels(NW4R) Model files.
TEX0 Textures(NW4R) Texture files.
SRT0 AnmTexSrt(NW4R) Texture movement animations.
CHR0 AnmChr(NW4R) Model movement animations.
PAT0 AnmTexPat(NW4R) Texture swapping animations.
CLR0 AnmClr(NW4R) Colour changing animations.
Not seen Palettes(NW4R) Known to exist from main.dol
Not seen AnmVis(NW4R) Known to exist from main.dol
Not seen AnmShp(NW4R) Known to exist from main.dol
Not seen AnmScn(NW4R) Known to exist from main.dol
Not seen LightSet(NW4R) Known to exist from main.dol
Not seen AmbLights(NW4R) Known to exist from main.dol
Not seen Lights(NW4R) Known to exist from main.dol
Not seen Fogs(NW4R) Known to exist from main.dol
Not seen Cameras(NW4R) Known to exist from main.dol

String Table

At the end of the BRRES file is a string table. This is a series of 4-byte length prefixed strings, padded to start at four byte offsets. Various sections point to this table, which is how all text in BRRES files is stored.