LST File Format

LST is an archive format that can contain multiple type of information.

Header is 6 bytes. The first two bytes are the file ID, hex 20 43. This is then followed by 4 bytes that tell the number of items in the archive. The items that follow are always continuous, so all data for one item is in one block.

Each item is identified with a 2 byte value. It only has two valid values: 0 tells the item is unused and you should continue to the next item, 1 tells the item exists and a 2 byte Type ID follows.

Type ID has following valid values:

  • 0x01 = WAV or XMIDI
  • 0x02 = RLE Compressed Bitmap
  • 0x03 = Font
  • 0x04 = Player Colored Bitmap
  • 0x05 = Palette
  • 0x07 = Shadow Bitmap
  • 0x0E = Uncompressed Bitmap

WAV or XMIDI (01)

The first 4 bytes tell the length of the data.

  • WAV files are 8-bit mono 11025 Hz PCM files without WAV header.
  • XMIDI files can be identified by FORM at the start of the data.

RLE Compressed Bitmap (02)

SizeData
2 bytesZero point X
2 bytesZero point Y
4 bytesUnknown (always 0 = hex 00 00 00 00)
2 bytesWidth
2 bytesHeight
2 bytesPalette ID (always 1 = hex 01 00)
4 bytesLength of data

Data begins with the start positions of each line in the bitmap. This is a 2 byte value and there is Height amount of them. The actual RLE compressed data follows and this always ends with a hex FF.

Font (03)

Contains 224 Player Colored Bitmaps for each valid letter (characters 32 - 255). The header before all bitmaps is only 2 bytes and tells the X and Y spacing of the font (one byte each). This is then followed by all the bitmaps.

Player Colored Bitmap (04)

SizeData
2 bytesZero point X
2 bytesZero point Y
4 bytesUnknown (always 0 = hex 00 00 00 00)
2 bytesWidth
2 bytesHeight
2 bytesPalette ID (always 1 = hex 01 00)
4 bytesLength of data

Data begins with the start positions of each line in the bitmap. This is a 2 byte value and there is Height amount of them. The actual data is compressed using a custom algorithm.

Start valueEnd valueDescription
0x010x3FNumber of transparent pixels No data
0x410x7FNumber of uncompressed pixels Length = Value - 0x40 Data * Length follows
0x810xBFNumber of player colored pixels Length = Value - 0x80 Data * Length follows
0xC10xFFNumber of compressed pixels Length = Value - 0xC0 Data * 1 follows
0x00Invalid, unused
0x40Invalid, unused
0x80Invalid, unused
0xC0Invalid, unused

Palette (05)

Contains 256 colors in RGB order. The first 2 bytes = Palette ID (always 1 = hex 01 00), followed by 768 bytes of palette data.

Shadow Bitmap (07)

SizeData
2 bytesZero point X
2 bytesZero point Y
4 bytesUnknown (always 0 = hex 00 00 00 00)
2 bytesWidth
2 bytesHeight
2 bytesPalette ID (always 1 = hex 01 00)
4 bytesLength of data

Data begins with the start positions of each line in the bitmap. This is a 2 byte value and there is Height amount of them. The actual data is compressed using a custom algorithm.

The compression swaps between semitransparent and fully transparent mode, basically the bitmap is a 1-bit monochrome image.

Start valueEnd valueDescription
0x000xFEMode 1: Number of shadow pixels Mode 2: Number of transparent pixels
0xFFEnd of line

Uncompressed Bitmap (0E)

The only bitmap type to have a footer as well as a header.

SizeData
2 bytesPalette ID (always 1 = hex 01 00)
4 bytesLength of data

Data

A raw paletted 8-bit bitmap, pixel-by-pixel.

SideData
2 bytesZero point X
2 bytesZero point Y
2 bytesWidth
2 bytesHeight
8 bytesUnknown (always hex 00 00 02 01 06 70 00 F4)

Comments