Old Mohawk archive format

From A look inside The Link @ wiki
Revision as of 18:53, 10 September 2009 by Clone2727 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

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

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.