Pelrock cutscene

From MultimediaWiki
Jump to navigation Jump to search
  • Game: Alfred Pelrock
  • File: ESCENAX.SSN
  • Decoder: github.com/scummvm/scummvm/blob/master/engines/pelrock/video.cpp

This is a cutscene format used in one Spanish game. Data is organised into chunks with size being multiple of 20480 bytes (ten sectors), video data only (audio and subtitles being stored in other files), with optional RLE compression and frames being transmitted as a XOR difference from the previous frame (initial frame is assumed to be zero).

Video has fixed dimensions of 640x400.

Chunk starts with 9-byte header: 32-bit little-endian number of 20480-byte blocks in the chunk, 32-bit size, and 1-byte chunk type:

  • 1 -- RLE-compressed frame
  • 2 -- raw frame updates
  • 3 -- end of video
  • 4 -- palette
  • 6 -- delay (wait 20ms)

RLE compression

RLE data starts with 32-bit data length and is coded in the same way as PCX (if top two bits are set, low six bits are the run length of the next byte value, otherwise the current byte is a literal pixel value).

Raw updates

In this case frame data is stored in packets that start immediately after 32-bit data length. Packet header: 32-bit destination offset plus one-byte copy length (zero means end of updates). E.g. first packets of full frame will look like "copy to offset 0 input 255 bytes, (255 bytes); copy to offset 255 input 255 bytes, (255 bytes); ...".