-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathblitz_dat.bt
39 lines (35 loc) · 983 Bytes
/
blitz_dat.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Blitz, DAT format
// Template created by Mark "hogsy" Sowden <[email protected]>
/**
* -------------------------------------------------------------
* Disclaimer:
* I primarily did this for Titan A.E., so that was my
* primary reference, but this looks correct for some others
* I checked such as Chicken Run and Action Man Destruction X.
* -------------------------------------------------------------
*
* This format is heavily oriented around streaming from
* a PSX CD, which has sectors sized at 2,048 bytes each -
* so to get the file offset, it's the following...
* 16384 + (block * 2048)
*/
struct
{
int32_t magic;// '78563412'
int32_t numFiles;
struct
{
int32_t hash;
int32_t block;
int32_t length;
} files[ numFiles ];
} header;
local int i = 0;
struct Data( int &i )
{
FSeek( 16384 + ( header.files[ i ].block * 2048 ) );
char chunk[ header.files[ i ].length ];
i++;
};
struct Data data[ 0 ];
ArrayResize( data, header.numFiles, i );