Difference between revisions of "MDL0 (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
(Updated with information from SZS Modifier, CTools, Brawl and Dolphin. Incomplete.)
Line 1: Line 1:
 
{{under-construction}}
 
{{under-construction}}
  
This are the results of a first analyze  of the binary file
+
This page describes the [[Mario Kart Wii]] '''MDL0''' file format, as found within [[BRRES (File Format)|BRRES files]].
  
 
== File Format ==
 
== File Format ==
=== MDL0 Header ===
+
=== File Header ===
  
 
{| class="wikitable"
 
{| class="wikitable"
! offset !! size !! description
+
! Offset !! Size !! Description
 
|-
 
|-
| 0x00 || 4 || magic "MDL0"
+
| 0x00 || 4 || Magic "MDL0"
 
|-
 
|-
| 0x04 || 4 || size of MDL0 file
+
| 0x04 || 4 || Length of MDL0 file
 
|-
 
|-
| 0x08 || 4 || highest used index
+
| 0x08 || 4 || Section Count - 3
 
|-
 
|-
| 0x0c || 4 || bit field: bit=0: index used / bit=1: index unused
+
| 0x0c || 4 || BRRES File Offset
 
|-
 
|-
| 0x10 || 16*4 || 16* offset of directory
+
| 0x10 || 4 * Section Count || Section Offsets
 
|-
 
|-
| 0x50 || 16*4 || ???
 
|-
 
| 0x90 || 16*4 || ??? (values 0..15)
 
 
|}
 
|}
 
+
All offsets are relative to the start of the header.<br />
=== Directory ===
+
The Section Count is stored as 3 less than it should be. <br />
 +
The section offsets point to [[BRRES Index Group (File Format)|BRRES Index Group]] strctures for the directories, which in turn point to the actual data sections within the MDL0 file. <br />
 +
The meaning of each section is defined by number as below.
  
 
{| class="wikitable"
 
{| class="wikitable"
! offset !! size !! description
+
! Section !! description
 +
|-
 +
| 0 || Draw lists
 +
|-
 +
| 1 || Bones
 +
|-
 +
| 2 || Verticies
 +
|-
 +
| 3 || Normals
 +
|-
 +
| 4 || Colors
 +
|-
 +
| 5 || Texture Coordinates
 +
|-
 +
| 6 || '''Not Seen'''
 
|-
 
|-
| 0x00 || 4 || size of directory
+
| 7 || '''Not Seen'''
 
|-
 
|-
| 0x04 || 4 || number of directory entries
+
| 8 || Materials
 
|-
 
|-
| 0x08 || 4 || ???
+
| 9 || Shaders
 
|-
 
|-
| 0x0c || 4 || ???
+
| 10 || Polygons
 
|-
 
|-
| 0x10 || 4 || ???
+
| 11 || Texture Links
 
|-
 
|-
| 0x14 || 4 || ???
+
| 12 || '''Not Seen in [[Mario Kart Wii]]'''
 +
|-
 +
| 13 || '''Not Seen in [[Mario Kart Wii]]'''
 
|-
 
|-
| 0x18 || N*16 || file list
 
 
|}
 
|}
 
+
=== MDL0 Header ===
=== File List ===
+
Following the section offsets is the MDL0 header structure.
  
 
{| class="wikitable"
 
{| class="wikitable"
! offset !! size !! description
+
! Offset !! Size !! Description
 +
|-
 +
| 0x00 || 4 || Header Length (0x40)
 +
|-
 +
| 0x04 || 4 || File Header Offset
 +
|-
 +
| 0x08 || 4 || '''Unknown'''
 
|-
 
|-
| 0x00 || 4 || ???
+
| 0x0C || 4 || '''Unknown'''
 
|-
 
|-
| 0x04 || 4 || ???
+
| 0x10 || 4 || Vertex Count
 
|-
 
|-
| 0x08 || 4 || name offset into string pool, relative to [[BRRES]] file start
+
| 0x14 || 4 || Face Count
 +
|-
 +
| 0x18 || 4 || '''Unknown'''
 +
|-
 +
| 0x1C || 4 || Bone Count
 +
|-
 +
| 0x20 || 4 || '''Unknown''' (0x01000000)
 +
|-
 +
| 0x24 || 4 || Bone Table Offset
 +
|-
 +
| 0x28 || 12 || Minimum (float3)
 +
|-
 +
| 0x34 || 12 || Maximum (float3)
 
|-
 
|-
| 0x0c || 4 || ???
 
 
|}
 
|}
 
+
All offsets are relative to the start of the header.<br />
  
 
[[category:File Format]]
 
[[category:File Format]]

Revision as of 22:58, 30 April 2011

Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

This page describes the Mario Kart Wii MDL0 file format, as found within BRRES files.

File Format

File Header

Offset Size Description
0x00 4 Magic "MDL0"
0x04 4 Length of MDL0 file
0x08 4 Section Count - 3
0x0c 4 BRRES File Offset
0x10 4 * Section Count Section Offsets

All offsets are relative to the start of the header.
The Section Count is stored as 3 less than it should be.
The section offsets point to BRRES Index Group strctures for the directories, which in turn point to the actual data sections within the MDL0 file.
The meaning of each section is defined by number as below.

Section description
0 Draw lists
1 Bones
2 Verticies
3 Normals
4 Colors
5 Texture Coordinates
6 Not Seen
7 Not Seen
8 Materials
9 Shaders
10 Polygons
11 Texture Links
12 Not Seen in Mario Kart Wii
13 Not Seen in Mario Kart Wii

MDL0 Header

Following the section offsets is the MDL0 header structure.

Offset Size Description
0x00 4 Header Length (0x40)
0x04 4 File Header Offset
0x08 4 Unknown
0x0C 4 Unknown
0x10 4 Vertex Count
0x14 4 Face Count
0x18 4 Unknown
0x1C 4 Bone Count
0x20 4 Unknown (0x01000000)
0x24 4 Bone Table Offset
0x28 12 Minimum (float3)
0x34 12 Maximum (float3)

All offsets are relative to the start of the header.