Difference between revisions of "SCI/Specifications/Resource files/SCI0 resources"
(Merging of the SCI documentation) |
(No difference)
|
Latest revision as of 07:44, 5 January 2009
SCI0 resources
resource.map
The SCI0 map file format is pretty simple: It consists of 6-byte entries, terminated by a six-tuple of 0xff values. The first 2 bytes, interpreted as little endian 16 bit integer, encode resource type (high 5 bits) and number (low 11 bits). The next 4 bytes are a 32 bit LE integer that contains the resource file number in the high 6 bits, and the absolute offset within the file in the low 26 bits. SCI0 performs a linear search to find the resource; however, multiple entries may match the search, since resources may be present more than once (the inverse mapping is not injective).
Early SCI01 (namely certain VGA games not using the later SCI1 resource.map format) uses a slight variation on this, which is almost identical: The first two bytes are unchanged, but the latter four only use the most significant 4 bits for storing the file number, and (consequently) 28 bits for the file offset.
resource.<nr>
SCI0 resource entries start with a four-tuple of little endian 16 bit words, which we will call (id, comp_size, decomp_size, method). id has the usual SCI0 semantics (high 5 are the resource type, low 11 are its number). comp_size and decomp_size are the size of the compressed and the decompressed resource, respectively.
The compressed size actually starts counting at the record position of decomp_size, so it counts four bytes in addition to the actual content. method, finally, is the compression method used to store the data.