Difference between revisions of "Old Mohawk archive format"

From A look inside The Link @ wiki
Jump to: navigation, search
(adding details of the "old" Mohawk archive format, which is clearly the predecessor to the regular ones)
 
m (minor cleanup)
 
Line 3: Line 3:
 
The files are have the extension <tt>.ibm</tt> or <tt>.mac</tt>, being PC and Mac versions, respectively. The biggest difference between these two are endianness, but there are some other minor differences as well. Throughout this, I will use the same wording as the [[Mohawk archive format|regular archive format]] to show where the differences are. The Name Table is always missing here, but it looks like they left room for it, hence the u0 in each type table entry.
 
The files are have the extension <tt>.ibm</tt> or <tt>.mac</tt>, being PC and Mac versions, respectively. The biggest difference between these two are endianness, but there are some other minor differences as well. Throughout this, I will use the same wording as the [[Mohawk archive format|regular archive format]] to show where the differences are. The Name Table is always missing here, but it looks like they left room for it, hence the u0 in each type table entry.
  
= Windows Format =
+
= Windows Format (.ibm) =
 
All values are in Little Endian format. Including the FourCC's! This is important so that it matches up.
 
All values are in Little Endian format. Including the FourCC's! This is important so that it matches up.
  
Line 24: Line 24:
 
Entry (one for each type):
 
Entry (one for each type):
 
{| class="structure"
 
{| class="structure"
|4 bytes||resource type (BMAP, WAV (with a space), VRSN etc.)
+
|4 bytes||resource type ([[Other Games#BMAP|BMAP]], [[Other Games#WAV|WAV ]] (with a space), [[Other Games#VRSN|VRSN]] etc.)
 
|-
 
|-
 
|unsigned short||offset in Resource Dir of the Resource Table for this type
 
|unsigned short||offset in Resource Dir of the Resource Table for this type
Line 52: Line 52:
 
This circumvents having the file table, as it stores the offset and length here. u0 appears to always be 0.
 
This circumvents having the file table, as it stores the offset and length here. u0 appears to always be 0.
  
= Macintosh Format =
+
= Macintosh Format (.mac) =
 
All values are in Big Endian format.
 
All values are in Big Endian format.
  
Line 73: Line 73:
 
Entry (one for each type):
 
Entry (one for each type):
 
{| class="structure"
 
{| class="structure"
|4 bytes||resource type (BMAP, WAV (with a space), VRSN etc.)
+
|4 bytes||resource type ([[Other Games#BMAP|BMAP]], [[Other Games#WAV|WAV ]] (with a space), [[Other Games#VRSN|VRSN]] etc.)
 
|-
 
|-
 
|unsigned long||offset in Resource Dir of the Resource Table for this type
 
|unsigned long||offset in Resource Dir of the Resource Table for this type

Latest revision as of 21:45, 10 September 2009

Some of the very old Mohawk games do not use exactly the same format as the rest of the Mohawk games. However, it's really the same thing minus the MHWK headers and the resource table/file table merging. In fact, many of the games using the older format were just ported directly into Mohawk files later with only minor changes.

The files are have the extension .ibm or .mac, being PC and Mac versions, respectively. The biggest difference between these two are endianness, but there are some other minor differences as well. Throughout this, I will use the same wording as the regular archive format to show where the differences are. The Name Table is always missing here, but it looks like they left room for it, hence the u0 in each type table entry.

Windows Format (.ibm)

All values are in Little Endian format. Including the FourCC's! This is important so that it matches up.

Header

unsigned long absolute offset of the Resource Dir
unsigned short size of Resource Dir (analogous to the size of the File table)

The offset of the resource directory seems to be always 6.

Type Table

At the beginning of the Resource Dir is the Type table.

unsigned short number of resource types in this file

Entry (one for each type):

4 bytes resource type (BMAP, WAV (with a space), VRSN etc.)
unsigned short offset in Resource Dir of the Resource Table for this type
unsigned short u0

The offset is the offset within the Resource Dir, not the absolute offset. u0 appears to always be 0.

Resource Table

Header:

unsigned short number of resources for this type (number of table entries)

Entry:

unsigned short resource ID
unsigned long absolute offset of resource data block
unsigned short resource data size
unsigned long u0

This circumvents having the file table, as it stores the offset and length here. u0 appears to always be 0.

Macintosh Format (.mac)

All values are in Big Endian format.

Header

unsigned long absolute offset of the Resource Dir
unsigned short size of Resource Dir (analogous to the size of the File table)

The offset of the resource directory seems to be always 6.

Type Table

At the beginning of the Resource Dir is the Type table.

unsigned short number of resource types in this file

Entry (one for each type):

4 bytes resource type (BMAP, WAV (with a space), VRSN etc.)
unsigned long offset in Resource Dir of the Resource Table for this type
unsigned long u0

The offset is the offset within the Resource Dir, not the absolute offset. u0 appears to always be 0.

Resource Table

Header:

unsigned short number of resources for this type (number of table entries)

Entry:

unsigned short resource ID
unsigned long absolute offset of resource data block
byte resource data size, bits 23-16
unsigned short resource data size, bits 15-0
unsigned long u0
byte u1

This circumvents having the file table, as it stores the offset and length here. u0 and u1 appear to always be 0. u1 is probably for alignment.