The Caesar .VAS battle animation format
The two animations on the battle screen, LOSE0001 and WINS0001, are not videos. Each frame is a list of byte runs to XOR onto the four planes of a .VPX picture, so the animation accumulates over whatever the screen already shows.
Used by Caesar
Layout
The player loads the whole file and, for each frame in turn, reads that frame's 32-bit offset from a table near the start. For each of the four planes it selects the plane and XORs that plane's block onto the screen, stepping to the next block by the block's own length. Each frame is drawn onto both display pages.
The file
The rest of the first 0x14 bytes is not used by the player.
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| +0x02 | 2 | u16 | frame count + 1 | One more than the number of frames. |
| +0x14 | 4 × frames | u32[] | frame offsets | One 32-bit offset per frame, into the file. LOSE0001.VAS has 21 frames, WINS0001.VAS 20. |
A frame: four plane blocks, back to back
The plane is the same 16,000-byte quarter a .VPX block decodes to: pixel 4i + p is byte i of plane p.
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| +0 | 2 | u16 | block length | From the start of this block to the start of the next. |
| +2 | 2 | u16 | plane size | Always 16000. |
| +4 | 4 | bytes | skipped | The decoder steps over these. |
| +8 | runs | u16[] | runs | Each a word w. If bit 15 is set, XOR the next (w & 0x7FFF) + 1 bytes of the file onto the plane. Otherwise skip (w & 0x7FFF) + 1 bytes of the plane. Runs continue until their counts reach the plane size. |