Contents

Technical Documentation - File Formats - Animation Script (ANIMATE.SCR)

Overview

This document explains the structure of the animate.scr file found in Chaos Strikes Back for Atari ST.
The file is made of big endian words (2 bytes). It is a sequence of instructions.
Each instruction is a word.
Each instruction has a fixed number of parameters which are also words.

Instructions

The ANIMATE.FTL program recognizes the following instructions:

Instruction 1 (0 parameters): Stop: 0001
Instruction 2 (0 parameters): Stop: 0002
Stop playing animation. Both instructions have exactly the same effect. Used at the end of the animation script file.
Instruction 3 (3 parameters): Load item: 0003 XXXX YYYY ZZZZ
XXXX: Index of item in ANIMATE.DAT
YYYY: Memory slot to put the item inside
ZZZZ: Item type. Image (0000), Palette (0001) or Sound (0002)
Instruction 4 (1 parameters): Unload item: 0004 XXXX
XXXX: Memory slot to unload
Instruction 5 (3 parameters): Expand graphic from source slot into destination slot: 0005 XXXX YYYY ZZZZ
XXXX: Source memory slot index containing the graphic to expand
YYYY: Destination memory slot index
ZZZZ: Memory slot containing X,Y coordinates to display image
Instruction 6 (4 parameters): Blit bitmap from source slot to destination slot: 0006 WWWW XXXX YYYY ZZZZ
WWWW: Source memory slot index
XXXX: Destination memory slot index
YYYY: Memory slot containing X,Y coordinates to display image
ZZZZ: Memory slot containing box to select the part of source image to blit
Instruction 7 (1 parameters): Set palette: 0007 XXXX
XXXX: Memory slot containing the color palette
Instruction 8 (2 parameters): Fade to palette: 0008 XXXX YYYY
XXXX: Memory slot containing the color palette
YYYY: Number of vertical blanks to wait for between each step of the palette fading
Instruction 9 (0 parameters): Set vertical blank counter to 0: 0009
This instruction is not used. It is bugged as it does not reset the appropriate variable.
Instruction 10 (1 parameters): Wait for X vertical blanks: 000A XXXX
XXXX: Number of vertical blanks to wait for
Instruction 11 (1 parameters): Wait until X vertical blanks since beginning: 000B XXXX
XXXX: Number until XXXX vertical blanks have occured since the beginning of the animation
Instruction 12 (2 parameters): Play sound: 000C XXXX YYYY
XXXX: Memory slot containing the sound to play
YYYY: Period
Instruction 13 (0 parameters): Wait until key pressed: 000D
Instruction 14 (2 parameters): Wait for vertical blank and set screen and palette. 000E XXXX YYYY
XXXX: Memory slot index containing address to use as screen content
YYYY: Memory slot index containing palette to set. If value is FFFF then no palette is set.
Instruction 15 (0 parameters): Wait for 1 vertical blank: 000F
Instruction 16 (1 parameters): FOR. Store current script address: 0010 XXXX
XXXX: Destination memory slot index
Instruction 17 (1 parameters): Decrement loop counter: 0011 XXXX
XXXX: Memory slot index containing loop counter
Instruction 18 (2 parameters): NEXT. Goto stored script address if loop counter > 0: 0012 XXXX YYYY
XXXX: Memory slot index containing loop counter
YYYY: Memory slot index containing script address to restore
Instruction 19 (2 parameters): Set loop counter: 0013 XXXX YYYY
XXXX: Memory slot index
YYYY: Counter value (Number of times to repeat)
Instruction 20 (3 parameters): Set 2 parameters: 0014 XXXX (YYYY) * 2
Instruction 21 (4 parameters): Set 3 parameters: 0015 XXXX (YYYY) * 3
Instruction 22 (5 parameters): Set 4 parameters: 0016 XXXX (YYYY) * 4
Instruction 23 (6 parameters): Set 5 parameters: 0017 XXXX (YYYY) * 5
Instruction 24 (7 parameters): Set 6 parameters: 0018 XXXX (YYYY) * 6
Instruction 25 (8 parameters): Set 7 parameters: 0019 XXXX (YYYY) * 7
Instruction 26 (9 parameters): Set 8 parameters: 001A XXXX (YYYY) * 8
Instruction 27 (10 parameters): Set 9 parameters: 001B XXXX (YYYY) * 9
Instruction 28 (11 parameters): Set 10 parameters: 001C XXXX (YYYY) * 10
These instructions are not used. They set integer values in the specified memory slot
XXXX: memory slot
Instruction 29 (2 parameters): Copy image memory slot: 001D XXXX YYYY
XXXX: Source memory slot index
YYYY: Destination memory slot index. Memory is allocated to store an image of the same dimensions as the one in the source slot. The source image is not copied into the destination slot, only its dimensions.
Instruction 30 (3 parameters): Set Display Coordinates of top left corner of image: 001E XXXX YYYY ZZZZ
XXXX: Memory slot index
YYYY: X coordinate from left of screen
ZZZZ: Y coordinate from top of screen

File content

This section show the entire content of the Animate.scr file found in Chaos Strikes Back for Atari ST with commands separated and commented.

Conventions:
p00 = P4B1 item 0000 in ANIMATE.DAT file
i30 = IMG1 item 0030 in ANIMATE.DAT file
s85 = SND1 item 0085 in ANIMATE.DAT file

LOAD ALL ITEMS IN MEMORY
0003 0000 0005 0001         0000 p00 (used for i30)
0003 0001 0006 0001         0001 p01 (i30)
0003 0008 000D 0001         0008 p08 (i30)
0003 0012 0017 0001         0012 p18 (i30)
0003 001E 0023 0000         001E i30
0003 001F 0024 0000         001F i31
0003 0002 0007 0001         0002 p02 (i31)
0003 0009 000E 0001         0009 p09 (i31)
0003 0020 0025 0000         0020 i32
0003 0003 0008 0001         0003 p03 (i32)
0003 000A 000F 0001         000A p10 (i32)
0003 000B 0010 0001         000B p11 (i32)
0003 000C 0011 0001         000C p12 (i32)
0003 000D 0012 0001         000D p13 (i32)
0003 0021 0026 0000         0021 i33
0003 0004 0009 0001         0004 p04 (i33)
0003 000E 0013 0001         000E p14 (i33)
0003 000F 0014 0001         000F p15 (i33)
0003 0010 0015 0001         0010 p16 (i33)
0003 0011 0016 0001         0011 p17 (i33)
0003 0022 0027 0000         0022 i34
0003 0005 000A 0001         0005 p05 (i34 i36)
0003 0023 0028 0000         0023 i35
0003 0024 0029 0000         0024 i36
0003 0006 000B 0001         0006 p06 (i35 i36)
0003 0007 000C 0001         0007 p07 (i36)
0003 004C 0051 0000         004C i76
0003 004D 0052 0000         004D i77
0003 004E 0053 0000         004E i78
0003 004F 0054 0000         004F i79
0003 0050 0055 0000         0050 i80
0003 0051 0056 0000         0051 i81
0003 0052 0057 0000         0052 i82
0003 0053 0058 0000         0053 i83
0003 0054 0059 0000         0054 i84
0003 0055 005A 0002         0055 s85
0003 0056 005B 0002         0056 s86
0003 0015 001A 0001         0015 p21 (i75)
0003 004B 0050 0000         004B i75 credits

RELOAD some items (the first 5 items)
0003 0000 0005 0001
0003 0001 0006 0001
0003 0008 000D 0001
0003 0012 0017 0001
0003 001E 0023 0000


0008 0002 0001              Fade to palette
0005 0023 0000 0000         Expand graphic
0008 0005 0001              Fade to palette
000A 0012                   Wait for X vertical blanks
0013 0067 0004              Set loop counter to 4
0010 0067                   FOR
0008 0017 0001              Fade to palette
000A 0005                   Wait for X vertical blanks
0008 0005 0001              Fade to palette
000A 0005                   Wait for X vertical blanks
0011 0067                   Decrement loop counter
0012 0067 0067              NEXT
0008 0006 0001              Fade to palette
0013 0067 0005              Set loop counter to 5
0010 0067                   FOR
0008 000D 0001              Fade to palette
000A 0005                   Wait for X vertical blanks
0008 0006 0001              Fade to palette
000A 0005                   Wait for X vertical blanks
0011 0067                   Decrement loop counter
0012 0067 0067              NEXT

UNLOAD
0004 0005
0004 0006
0004 000D
0004 0017
0004 0023

RELOAD
0003 001F 0024 0000
0003 0002 0007 0001
0003 0009 000E 0001

0008 0002 0001              Fade to palette
0005 0024 0000 0000         Expand graphic
0008 0007 0001              Fade to palette
0013 0067 000A              Set loop counter to 10
0010 0067                   FOR
0008 000E 0001              Fade to palette
000A 0005                   Wait for X vertical blanks
0008 0007 0001              Fade to palette
000A 0005                   Wait for X vertical blanks
0011 0067                   Decrement loop counter
0012 0067 0067              NEXT

UNLOAD
0004 0024
0004 0007
0004 000E

RELOAD
0003 0020 0025 0000
0003 0003 0008 0001
0003 000A 000F 0001
0003 000B 0010 0001
0003 000C 0011 0001
0003 000D 0012 0001

0008 0002 0001              Fade to palette
0005 0025 0000 0000         Expand graphic
0008 0008 0001              Fade to palette
0013 0067 0004              Set loop counter to 4
0010 0067                   FOR
000A 0004                   Wait for X vertical blanks
0008 000F 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0010 0001              Fade to palette
000A 0001                   Wait for X vertical blanks
0008 0011 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0012 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0011 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0010 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 000F 0001              Fade to palette
000A 0002                   Wait for X vertical blanks
0008 0008 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0011 0067                   Decrement loop counter
0012 0067 0067              NEXT

UNLOAD
0004 0025
0004 0008
0004 000F
0004 0010
0004 0011
0004 0012

RELOAD
0003 0021 0026 0000
0003 0004 0009 0001
0003 000E 0013 0001
0003 000F 0014 0001
0003 0010 0015 0001
0003 0011 0016 0001

0008 0002 0001              Fade to palette
0005 0026 0000 0000         Expand graphic
0008 0009 0001              Fade to palette
0013 0067 0002              Set loop counter to 2
0010 0067                   FOR
000A 0004                   Wait for X vertical blanks
0008 0013 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0014 0001              Fade to palette
000A 0001                   Wait for X vertical blanks
0008 0015 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0016 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0015 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0014 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0008 0013 0001              Fade to palette
000A 0002                   Wait for X vertical blanks
0008 0009 0001              Fade to palette
000A 0004                   Wait for X vertical blanks
0011 0067                   Decrement loop counter
0012 0067 0067              NEXT

UNLOAD
0004 0026
0004 0009
0004 0013
0004 0014
0004 0015
0004 0016

RELOAD
0003 0022 0027 0000
0003 0005 000A 0001

0008 0002 0001              Fade to palette
0005 0027 0000 0000         Expand graphic
0008 000A 0001              Fade to palette
000A 008C                   Wait for X vertical blanks

RELOAD
0003 0022 0027 0000
0003 0005 000A 0001
0003 0023 0028 0000
0003 0024 0029 0000
0003 0006 000B 0001
0003 0007 000C 0001

0008 0002 0001              Fade to palette
0005 0028 0000 0000         Expand graphic
0005 0029 0001 0000         Expand graphic
0008 000B 0001              Fade to palette
000A 0050                   Wait for X vertical blanks

000E 0001 000C              Wait for vertical blank and set screen and palette

UNLOAD
0004 0028
0004 0029
0004 000B
0004 000C

RELOAD SOME ITEMS ?? Useless ??
0003 004C 0051 0000
0003 004D 0052 0000
0003 004E 0053 0000
0003 004F 0054 0000
0003 0050 0055 0000
0003 0051 0056 0000
0003 0052 0057 0000
0003 0053 0058 0000
0003 0054 0059 0000

COPY IMAGE MEMORY SLOT
001D 0051 005D
001D 0052 005E
001D 0053 005F
001D 0054 0060
001D 0055 0061
001D 0056 0062
001D 0057 0063
001D 0058 0064
001D 0059 0065

RELOAD
0003 0055 005A 0002
0003 0056 005B 0002

Expand graphic from source slot into destination slot
0005 0051 005D 0000
0005 0052 005E 0000
0005 0053 005F 0000
0005 0054 0060 0000
0005 0055 0061 0000
0005 0056 0062 0000
0005 0057 0063 0000
0005 0058 0064 0000
0005 0059 0065 0000

SET DISPLAY COORDINATES OF TOP LEFT CORNER OF IMAGE
001E 005D 002B 0089         X = 43, Y = 137
001E 005E 002A 0089         X = 42, Y = 137
001E 005F 002A 0089
001E 0060 002A 0089
001E 0061 002A 0089
001E 0062 002A 0089
001E 0063 002A 0089
001E 0064 002A 0089
001E 0065 002A 0089

0006 005D 0001 0001 005D    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 005E 0001 0001 005E    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 005F 0001 0001 005F    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0060 0001 0001 0060    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0061 0001 0001 0061    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0062 0001 0001 0062    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 005F 0001 0001 0063    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 005D 0001 0001 005D    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 005E 0001 0001 005E    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 005F 0001 0001 0060    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0060 0001 0001 0060    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0061 0001 0001 0061    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0060 0001 0001 0060    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0061 0001 0001 0063    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
000C 005B 0070              Play sound 5B
0006 0064 0001 0001 0064    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
000C 005A 0070              Play sound 5A
0006 0065 0001 0001 0065    Blit bitmap from source slot to destination slot
000A 003C                   Wait for X vertical blanks
0006 0062 0001 0001 0063    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks
0006 0061 0001 0001 0063    Blit bitmap from source slot to destination slot
000A 0014                   Wait for X vertical blanks

UNLOAD
0004 005D
0004 005E
0004 005F
0004 0060
0004 0061
0004 0062
0004 0063
0004 0064
0004 0065
0004 0051
0004 0052
0004 0053
0004 0054
0004 0055
0004 0056
0004 0057
0004 0058
0004 0059

000A 00C8                   Wait for X vertical blanks
0003 0015 001A 0001
0003 004B 0050 0000
0008 0002 0001              Fade to palette
000E 0000 FFFF              Wait for vertical blank and set screen and palette
0005 0050 0000 0000         Expand graphic
0008 001A 0001              Fade to palette
000A 0258                   Wait for X vertical blanks

UNLOAD
0004 005A
0004 005B
0004 0050
0004 001A

0001

Animation player for Amiga

Tool-AmigaAnimationPlayer.7z Tool-AmigaAnimationPlayer.7z
This archive contains an Amiga program named anim.dat (and its assembly source code) written by Meynaf. This program can play back the introduction animation found in the Atari ST version of Chaos Strikes Back. To use it, you need a configuration similar to an A1200 (OS 3.0, 68020+). Just copy the two files ANIMATE.DAT and ANIMATE.SCR from the Atari ST utility disk in the same folder and run the program.

Powered by Drupal   Valid XHTML 1.0 Strict