Digital Integration Q3

From MultimediaWiki
Jump to navigation Jump to search

This is a format used in Hind.

File header:

 4 bytes - "ANIM"
 2 bytes - number of frames
 2 bytes - width
 2 bytes - height
 2 bytes - unknown

Frame data starts with flags byte and 32-bit size.

Flags meaning in the order they are checked:

  • 0x20 - explicit palette size present, read 32-bit value for it (otherwise use 768)
  • 0x01 - palette plus raw frame data
  • 0x10 - 8x8 tiled compression
  • 0x02 - masked update (first a bit mask for the whole frame is transmitted followed by updated pixel values)

Tiled compression works by sending an opcode for each 8x8 tile:

  • 0 - fill tile with single colour
  • 1 - read two colours and 64-bit pattern telling which colour to use for each tile element
  • 2 - similar but with four colours and two bits per pixel in mask
  • 3 - eight colours and three bits
  • 4 - 16 colours/4 bits
  • 5 - leave tile unchanged
  • 6 - masked update: read 8-bit rows update mask, for the updated tile rows read 8-bit pixel update mask and pixel values for the updated positions
  • 7 - masked update but with simple 64-bit mask before updated pixels