AMOS AMAL Bank format
AMOS AMAL banks are one of the standard AMOS file formats.
AMAL is the AMOS Animation Language. Complex AMAL programs can be written in the AMAL Editor and then referenced from AMOS programs, which saves space in comparison to writing the AMAL program by building up a string variable in AMOS source code. The AMAL command "PLay" can use pre-recorded animation movements with up to 2000 steps each, which again is more efficient than writing the steps in text.
All multi-byte integers are in big-endian format.
The format is divided into sections, a movements section and a programs sections. The format typically starts with a Standard AMOS bank header, which may be truncated or damaged depending on how it was ripped:
|0||4 bytes||AmBk ID (0x416D426B)|
|4||2 bytes||bank number (should be 4)|
|8||4 bytes||bank length, only in bits 27-0|
|12||8 bytes||bank type (should be "Amal ")|
It's followed immediately by the offset to the "programs" section:
|0||4 bytes||Offset from here to the "programs" section|
Which is then followed by the "movements" section:
|0||2 bytes||number of movements (n)|
|2||n * 2 bytes||offsets from the start of this section, divided by 2, to the list of steps for each movement - or zero if no movement defined|
|2 + n * 2||n * 2 bytes||length (in bytes) of each movement|
|2 + n * 4||n * 8 bytes||8-character ASCII names for each movement (padded with spaces)|
|2 + n * 12||?||Lists of steps, as pointed to by the offsets.
Each list of steps has this format:
Steps are a sequence of bytes. Each byte will be one of the following values:
The sequence always starts and ends with a zero byte, so movements can be played backwards and forwards.
The programs section, as reached by the offset given at the start of the bank, has this format:
|0||2 bytes||number of programs (n)|
|4||n * 2 bytes||word-pointers (offsets from the start of this section, divided by 2) to each program, or zero if no program defined|
|4 + n * 2||?||The programs pointed to by the offsets.
Each program has this format: