Product specifications

The diagram below shows exactly how the four control bytes within each control block
of the sprite attribute table are arranged.
^ (Illus 5 – Sprite attribute table control block)
The first two bytes control the Y an X positions of the sprite onscreen.
The first byte indicates the vertical distance from the top of the screen in pixels, and is
defined such that a value of –1 (ie £FF Hex), places the sprite at the top of the screen
touching the backdrop area. A value of 0 will place the sprite one pixel below the top
of the screen. A value of 1 will place the sprite one pixel below that and so on.
The second byte indicates the horizontal distance in pixels, from the left hand side of
the screen, with a value of zero placing the sprite tight against the left hand border.
An important point is that all positioning of sprites on screen is determined from the
upper left corner of any sprite, therefore it we use a 16 by 16 sprite as an example
positioning the sprite at location 10,10 (Y/X):
^ (Illus 6 – 16 * 16 sprite pattern).
The third byte contains an 8 bit number (or name), which points to the sprite pattern
held in the pattern generator table. The fourth byte of the sprite attribute table is
concerned mainly with colour.
When the sprite pattern is defined in the pattern generator table, the 1,s of the pattern
assume the colour held in the lower 4 bits of this byte. The 0,s within the sprite pattern
are automatically set to transparent.
Byte four also performs one other function which is sometimes useful. Bit C is the
Early Clock Bit. when it is set to zero it does nothing, but when it is set to one will shift
the horizontal position of a sprite to the left by 32 pixels and allow a sprite to bleed in
off the left hand side of the backdrop rather than the normal default right.
All of the control byte within each control block of the sprite attribute table can be
altered dynamically during the running of your program code. This means that within
each control block you can:
1. Animate any of the sprites by changing the third byte
2. Create colour scintillating sprites by changing the fourth byte
3. Create moving sprites by updating the Y/X coords in control bytes one and
two
As the information of sprite control is held in VRAM on pre-defined boundaries, you
can create sprite impact routines with ease because for any sprite you can always
refer to a fixed address independently of your program. It is also very easy to create
sprite to background mapping routines because there is a straight forward and simple
direct relationship between them.
The code and techniques which will perform the above mentioned two tasks are
described in depth in section 4.4.