NXL

From MultimediaWiki
Jump to navigation Jump to search

NXL is a format used for cutscenes in The Lawnmower Man game. The format is big-endian, uses chunks padded to 64 bytes and stores raw video and audio.

NXL files comprise a series of chunk headers with optional payload following. The first chunk should be of type 1.

Known chunk types:

  • 1 -- file header (no other payload)
  • 3 -- video frame
  • 4 -- audio frame
  • 5 -- something, probably signals a required delay
  • 255 -- end of file marker

Header chunk

 1 byte  - should be 1 (chunk type)
 1 byte  - should be 1 (file version)
 2 bytes - padding
 4 bytes - chunk size (should be 64)
 4 bytes - should be zero (chunk number)
 4 bytes - unknown
 4 bytes - should be "NXL1"
 2 bytes - video width
 2 bytes - video height
 2 bytes - number of video planes
 4 bytes - unknown
 4 bytes - maximum video chunk size?
 4 bytes - audio sampling rate?
 2 bytes - some audio parameter?
 24 bytes - padding

Audio chunk

 1 byte  - should be 4
 3 bytes - padding
 4 bytes - chunk size
 4 bytes - chunk number
 4 bytes - unknown
 2 bytes - sampling rate
 2 bytes - actual audio payload size
 16 bytes - unknown
 28 bytes - padding

Audio is raw 8-bit unsigned PCM.

Video chunk

 1 byte  - should be 3
 3 bytes - padding
 4 bytes - chunk size
 4 bytes - chunk number
 4 bytes - unknown
 2 bytes - current frame width
 2 bytes - current frame height
 2 bytes - current frame left offset
 2 bytes - current frame top offset
 1 byte  - scaling mode (0 - none, 1 - double horizontal, 2 - double vertical, 3 - scale 2x)
 1 byte  - frame flags (bit 0 seems to signal delta frame, bit 1 also signals something)
 2 bytes - number of colours?
 4 bytes - actual video payload size
 32 bytes - padding

Video payload starts with VGA palette (usually for 16 colours) followed by raw video data in planar format. I.e. for each line palette indices are split in bits for each position, those are packed together (MSB first) with LSB of the index stored first. E.g. entries 4 3 0 1 ... will be stored as 0101... | 0100... | 1000... | 0000...