CAM files are archives employed by the sequel of Deadlock and possibly other games created by the same studio.
These archives can store multiple file formats. Also, the known instances are not compressed.
CAM files contain a header that declares the formats of files and offset tables that define where the file data can be found within the archive.
Header (magic number) is a constant 8 byte long string
Offset (hex) | Size (bits) | Type | Name | Constant Value |
---|---|---|---|---|
0 | 64 | Constant Length ANSI String | magic number | "CYLBPC " |
Some attributes after the magic number are currently unknown.
After these attributes, a format count is presented.
Offset (hex) | Size (bits) | Type | Name
----|----|---- |---- |----
0C| 32 | Unsigned Integer | Format Count
Then the formats are declared.
For the first format, the specification would be:
Offset (hex) | Size (bits) | Type | Name
----|----|---- |---- |----
14| 32 | Constant Length ANSI String | Format Name
18| 32 | Unsigned Integer | Format Count
After the format definitions, records of file offsets and lengths are defined.
Each record is 224 bytes long (7 elements of unsigned 32 bit integers).
Size (bits) | Signed | Type | Name |
---|---|---|---|
32 | No | Integer | Index |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | No | Integer | Offset |
32 | No | Integer | Length |
Structures in C are discouraged since compilers add padding to align the structures, which would probably break the compatibility with non aligned sequences found in CAM files.
/** spriteinfo structure,
* Each line represents 32 bit of data.**/
typedef
struct filerecord
{
uint32_t index;
uint32_t padding1;
uint32_t padding2;
uint32_t padding3;
uint32_t padding4;
uint32_t offset;
uint32_t length;
} spriteinfo_t;
Platform | Name | Sequel | Version | Size (bytes)
------ | ----| ---- |-------|------- | -----
Windows | dl2sound.cam | DL2 | any (incl. demo) | 20365014