AVF: Difference between revisions
(fill information from ScummVM code) |
(update info) |
||
Line 3: | Line 3: | ||
* Samples: [http://samples.mplayerhq.hu/game-formats/avf/ http://samples.mplayerhq.hu/game-formats/avf/] | * Samples: [http://samples.mplayerhq.hu/game-formats/avf/ http://samples.mplayerhq.hu/game-formats/avf/] | ||
AVF is | AVF is a multimedia format used in the games like [https://www.mobygames.com/game/windows/vampire-diaries The Vampire Diaries] (old 8-bit format) and [http://www.mobygames.com/game/windows/nancy-drew-stay-tuned-for-danger Nancy Drew: Stay Tuned For Danger] (new 15-bit format). It may be used in other games in the ''Nancy Drew'' series. | ||
=== Header === | === Header === | ||
Line 25: | Line 25: | ||
2 bytes - width | 2 bytes - width | ||
2 bytes - height | 2 bytes - height | ||
1 byte - depth | 1 byte - depth (8 for old format, 16 for new format) | ||
4 bytes - frame time | 4 bytes - frame time | ||
1 byte - compression (should be 2) | 1 byte - compression (should be 2; compression 0 is for unpacked data) | ||
1 byte (version 1.0 only) - unknown | 1 byte (version 1.0 only) - unknown | ||
Old format uses 8-bit format with an external palette, new format uses RGB555 video. Additionally old format is stored bottom-up while new format is top to bottom. | |||
=== Table of contents entries format === | === Table of contents entries format === | ||
Line 49: | Line 51: | ||
Compression type 2 means that frame data is first compressed with LZSS scheme that groups flags into bytes and has spaces as the window fill value. | Compression type 2 means that frame data is first compressed with LZSS scheme that groups flags into bytes and has spaces as the window fill value. | ||
Type 0 is raw data. Types 1 and 2 employ additional RLE-based compression (or can be empty frames). | Type 0 is raw data (old format frames are always raw data). Types 1 and 2 employ additional RLE-based compression (or can be empty frames). | ||
The compression method works by issuing one-byte commands for skipping or writing | The compression method works by issuing one-byte commands for skipping or writing 16-bit pixels: | ||
* 0x20 - read 32-bit <code>skip</code> value and 32-bit <code>length</code> value, skip <code>skip | * 0x20 - read 32-bit <code>skip</code> value and 32-bit <code>length</code> value, skip <code>skip</code> pixels and read <code>length</code> new 16-bit pixels | ||
* 0x40 - read a pixel | * 0x40 - read a pixel (2 bytes), 32-bit <code>skip</code> value and 32-bit <code>length</code> value, skip <code>skip</code> pixels and output new pixel <code>length</code> times | ||
* 0x80 - read 8-bit <code>length</code> value, read 32-bit number of skip+put operations, read <code>length | * 0x80 - read 8-bit <code>length</code> value, read 32-bit number of skip+put operations, read <code>length</code> new pixels into buffer, and then for the number of skip+put operations read 32-bit <code>skip</code> value, skip <code>skip</code> pixels and output <code>length</code> pixels from the buffer | ||
[[Category:Game Formats]] | [[Category:Game Formats]] | ||
Revision as of 06:17, 21 July 2021
- Company: Her Interactive
- Extension: AVF
- Samples: http://samples.mplayerhq.hu/game-formats/avf/
AVF is a multimedia format used in the games like The Vampire Diaries (old 8-bit format) and Nancy Drew: Stay Tuned For Danger (new 15-bit format). It may be used in other games in the Nancy Drew series.
Header
Old format:
3 bytes - "ALG" 7 bytes - unknown 2 bytes - major version 2 bytes - minor version
New format:
15 bytes - "AVF WayneSikes" 2 bytes - major version 2 bytes - minor version 1 byte - unknown
Known versions are 1.0 and 2.0.
Common header:
2 bytes - number of frames 2 bytes - width 2 bytes - height 1 byte - depth (8 for old format, 16 for new format) 4 bytes - frame time 1 byte - compression (should be 2; compression 0 is for unpacked data) 1 byte (version 1.0 only) - unknown
Old format uses 8-bit format with an external palette, new format uses RGB555 video. Additionally old format is stored bottom-up while new format is top to bottom.
Table of contents entries format
Table of contents entry for version 1.0:
9 bytes - name 4 bytes - index 4 bytes - unknown 4 bytes - offset 4 bytes - compressed size
Table of contents entry for version 2.0:
2 bytes - index 4 bytes - offset 4 bytes - compressed size 4 bytes - uncompressed size 1 byte - type 4 bytes - unknown
Frame compression
Compression type 2 means that frame data is first compressed with LZSS scheme that groups flags into bytes and has spaces as the window fill value.
Type 0 is raw data (old format frames are always raw data). Types 1 and 2 employ additional RLE-based compression (or can be empty frames).
The compression method works by issuing one-byte commands for skipping or writing 16-bit pixels:
- 0x20 - read 32-bit
skip
value and 32-bitlength
value, skipskip
pixels and readlength
new 16-bit pixels - 0x40 - read a pixel (2 bytes), 32-bit
skip
value and 32-bitlength
value, skipskip
pixels and output new pixellength
times - 0x80 - read 8-bit
length
value, read 32-bit number of skip+put operations, readlength
new pixels into buffer, and then for the number of skip+put operations read 32-bitskip
value, skipskip
pixels and outputlength
pixels from the buffer