Product specifications
If we are using the other option which is to set up three identical pattern libraries within
the pattern generator table and to have a dynamically changing screen (Pattern name
table), the routine will operate on the pattern name table and will return characters as
results. This section of code is listed in Option 2.
The relationship between both of these options and the sprites are shown in the
diagram below.
^(Illus 11 – Option 1 sprite to background mapping)
^(Illus 12 – Option 2 sprite to background mapping)
Each code option makes use of offset values to test underneath points within the
sprite relative to the top left hand corner of the sprite. Simply by changing the values
of these offsets it is possible to detect on new areas of the sprite. Also by adding or
deleting new calls within the DOT routine it is possible to detect on more or less points
within any sprite.
Both code sections listed in options 1 and 2 make use of the 1 byte variables SPRP1
to SPRP12, and the 2 byte variables CENLTL, CENLTR, CENLBL and CENLBR.
As shown in the diagram below SPRP1 to SPRP12 are actually points within a sprite
pattern area, and will contain the contents of the pattern name or generator table
bytes which map underneath them.
The variables CENLTL, CENLTR, CENLBL and CENLBR, will contain the pattern
name or generator table addresses of the bytes held in SPRP5, SPRP8 and SPRP9
respectively.
^(Illus 13 – Diagram of sprite points on sprite)
In the case of option 1, DOT will set SPRP1 to SPRP12 to 1,s or 0,s dependent on
whether a bit is set or no set underneath the sprite at the corresponding point on
screen.
In the case of option 2, DOT will set SPRP1 to SPRP12 to the character value
underneath the sprite at the corresponding point on screen.
Option 1
The code for option 1 is identical to the code for option 2 with two major differences.
1. The routine DOTSUB is different and is listed below. It does not return
character values in SPRP1 to SPRP12 but returns bit set or not set indicated by
either 1 or 0. It does not operate on the pattern name table but uses the pattern
generator table, the start address of which is held in a two byte location
SAPATG.