CFO

From MultimediaWiki
Jump to navigation Jump to search

This is a format employing FLIC compression in a custom container supporting engine commands. It is used in Chewy: Esc from F5 game.

Container header

 4 bytes - CFO\0
 4 bytes - zero
 2 bytes - number of frames
 2 bytes - width
 2 bytes - height
 
 4 bytes - frame delay
 4 bytes - frame data start

Frame types

 4 bytes - frame size
 2 bytes - frame type

Known frame types:

  • 0xF1FA - FLIC-compressed video frame
  • 0xFAF1 - custom commands

Custom commands frame format

Frame data consists of 2-byte number of commands and actual commands that start with 4-byte size and 2-byte type.

Known commands:

  • 0x00 - fade in (unused)
  • 0x01 - fade out (unused), has 2-byte delay value
  • 0x02 - load music
  • 0x03 - load raw audio
  • 0x04 - load sound effect, has 2-byte effect ID and actual audio data
  • 0x05 - play music (from command data)
  • 0x06 - play sequence (unused)
  • 0x07 - play pattern (unused)
  • 0x08 - stop music
  • 0x09 - wait until music ends
  • 0x0A - set music volume, has 2-byte volume in percent in command data
  • 0x0B - set loop mode
  • 0x0C - play raw audio
  • 0x0D - play sound effect using provided ID, channel, volume and repeat flag (all in 2-byte variables)
  • 0x0E - set sound volume, has 2-byte volume in percent in command data
  • 0x0F - set channel volume, has 2-byte channel number and 2-byte channel volume
  • 0x10 - free sound effect, has 2-byte sound effect ID
  • 0x11 - music fade in (unused)
  • 0x12 - music fade out
  • 0x13 - set balance, has 2-byte channel ID and balance value
  • 0x14 - set speed (unused)
  • 0x15 - clear screen

Music is its own MOD-like TFM format.