Tsunami RLB

From XentaxWiki
Revision as of 19:33, 12 August 2016 by imported>Multimedia Mike (Document the resource types)
Jump to navigation Jump to search

RLB

RLB files are resource archives used in various games from Tsunami. There are several variations in the format reflecting the evolution of the format since it was used in a progression of games from the same publisher. Much of this information was gleaned from studying the source code of the ScummVM project.

Structure

RLB files are comprised of a series of resource blocks starting with a signature of 'TMI-'. Each resource block starts with the following 6-byte data structure:

bytes 0-3  'TMI-' signature
byte 4     resource type
byte 5     number of entries in this resource block

Each entry in the resource begins with the following 12-byte structure:

bytes 0-1   resource ID
bytes 2-3   compressed size
bytes 4-5   uncompressed size
byte 6      high nibbles of the compressed and uncompressed sizes
byte 7      type (bits 7-5)
bytes 8-11  payload offset

Byte 6 contains the high 4 bits of the uncompressed size in bits 7-4 and the high 4 bits of the compressed size in bits 3-0. Thus, the largest size which can be specified is 220 = 1,048,576 bytes.

The high 3 bits of byte 7 are interpreted by ScummVM as 'type' and the field is expected to be either 0 (uncompressed) or 1 (compressed).

The payload offset specifies the offset relative to the beginning of the resource block (beginning of the 'TMI-' signature).

Resource Types

These are the RLB resource types known to ScummVM:

  • 0: library
  • 1: strip
  • 2: image
  • 3: palette
  • 4: visage
  • 5: sound
  • 6: message
  • 7: font
  • 8: pointer
  • 9: bank
  • 10: sound driver
  • 11: priority
  • 12: control
  • 13: walk regions
  • 14: bitmap
  • 15: save
  • 16: sequence

Further, Return to Ringworld uses types 17 through 31, but ScummVM does not name them.

Compression Format

(implemented in ScummVM; to be documented)

Message Resources

Font Resources

Strip Resources