Product specifications

An alternate solution which works quite well is to use a descending loop counter and
then display a new pattern in the animation sequence each time the counter reaches
zero. The pattern numbers to be displayed are held within a table marked by a
delimiter such as £FF (Hex), 255 (Decimal). This will allow the animation routine to
detect the end of the animation sequence and wrap around to the start of the table to
perform the sequence again without constraining it to a fixed number of display
patterns between the start of the sequence and the end.
Shown below is a very simple sequence for a growing square consisting of four
animation stages.
^(Illus 9 – Diagram of simple animation sequence).
The assembler code which will perform this animation is listed below.
The assumptions made are:
1. That VDP write only register 1 has been set up to enable 8 times 8 bit
sprites with zero magnification (See section 2.2 register 1).
2. That these patterns have already been loaded into the sprite generator table
into pattern positions 0,1,2 and 3.
3. That the sprite display has already been taken care of by other routes (See the
previous section ‘Setting up the sprite attribute table’)
4. That the sprite attribute table is located at VRAM address £1C00 (Hex).
5. That we are using the first sprite control block in the sprite attribute table and
therefore displaying sprite 0.
6. The routines will be making use of the VDP I/O routines described in section
1.1
This animation sequence can be altered to give an oscillating square with ease
without affecting the routine in any way merely by changing the contents of the table
ASTFS0 from 0,1,2,3,255 to 0,1,2,3,2,1,255
^(Illus 9a – Diagram of extended simple animation seq.)
;
;ANIMAT- ANIMATE SPRITE 0 – SEQUENCE IS GROWING SQUARE
; USES SPRITE PATTERNS 0,1,2 AND 3
; 8 TIMES 8 BIT SPRITE
;
; NO REGISTER SET UP REQUIRED ON ENTRY
;
; NO REGISTERS AFFECTED ON EXIT
;
; THE ROUTINE MAKES USE OF A DESCENDING LOOP COUNTER
; CALLED ALCFS0
; ANIMATION LOOP COUNTER FOR SPRITE 0
;