CMDL (Metroid Prime): Difference between revisions

Jump to navigation Jump to search
no edit summary
>Aruki
>Aruki
No edit summary
Line 7: Line 7:
== Format ==
== Format ==


CMDL files are split up into a number of 32-byte aligned ''sections''. Every section both starts and ends on a 32-byte boundary. These are used to separate different parts of the file; different types of sections typically indicate different sets of data. The header declares the section count and the size of each one; using these is the only way to navigate the file.
CMDL files are split up into a number of 32-byte aligned ''data sections''. Every data section both starts and ends on a 32-byte boundary. These are used to separate different parts of the file; different data sections typically indicate different sets of data. The header declares the data section count and the size of each one; using these is the only way to navigate the file.


=== Header ===
=== Header ===
Line 13: Line 13:
{| class="wikitable"
{| class="wikitable"
! Offset
! Offset
! Size
! Type
! Description
! Count
! Name
! Notes
|-
|-
| 0x0
| 0x0
| 4
| u32
| '''Magic'''; always 0xDEADBABE
| 1
| '''Magic'''
| Always <code>0xDEADBABE</code>.
|-
|-
| 0x4
| 0x4
| 4
| u32
| '''Version'''; see below
| 1
| '''Version'''
| See [[CMDL (File Format)|hub article]] for a list of possible version numbers.
|-
|-
| 0x8
| 0x8
| 4
| u32
| '''Flags'''; see below
| 1
| '''Flags'''
| [[#Flags|See below]]
|-
|-
| 0xC
| 0xC
| 0x18
| float
| '''Axis-aligned bounding box'''
| 6
| '''Model Axis-Aligned Bounding Box'''
|
|-
|-
| 0x24
| 0x24
| 4
| u32
| '''Section count''' (SC)
| 1
| '''Data Section Count'''
| Count of data sections in the file.
|-
|-
| 0x28
| 0x28
| 4
| u32
| '''Material set count'''
| 1
| '''Material Set Count'''
| Count of material sets in the model. There will be one materials section per set in the file.
|-
|-
| 0x2C
| 0x2C
| 4 &times; SC
| u32
| '''Section sizes'''
| ''Data Section Count''
|}
| '''Data Section Sizes'''
 
|  
Following the end of the header, the file is padded to 32 bytes before the first section starts.
 
==== Version ====
 
{| class="wikitable"
! Version
! Game
|-
| 2
| Metroid Prime
|-
| 3
| Metroid Prime 2 Demo
|-
| 4
| Metroid Prime 2
|-
|-
| 5
| colspan=5 {{unknown|End of header; pad to 32 bytes before section data begins}}
| Metroid Prime 3
|}
|}


Anonymous user

Navigation menu