An all-in-one routine
This machine code routine differs from
most published utilities since it is table driven. This means that a
large number of parameters can be defined at the setting-up stage, and
accessed automatically when the M/C code is called. Only two numbers
are passed through the USR function - the Player identification number
and a number between 1 and 15 to indicate the direction of movement
required. Joystick reading and screen limits for movement are all
controlled by the M/C routine. Also all 16 collision registers are
scanned, and a number returned to address 1791.
This means that very little BASIC is
needed in the main program loop so the routine runs quite quickly. The
routine is liberally filled with REM statements, which need not be
typed in, to explain each stage of initialisation.
This routine was passed on to us as
being 'for PAGE 6' but had no details of the author. If the author
would like to get in touch we will ensure that full credit is given.
STRUCTURE OF THE TABLE WHICH DRIVES
THE PLAYER MOVEMENT ROUTINES
T+0 |
player's current
vertical position on screen |
T+1 |
players current
horizontal position on screen |
T+2 |
player's base address,
low byte |
T+3 |
player's base address,
high byte |
T+4 |
address of appropriate
horizontal position register, low byte |
T+5 |
address of appropriate
horizontal position register, high byte |
T+6 |
height of
player-number of image lines |
T+7 |
right hand screen
limit of player movement |
T+8 |
left hand screen limit
of player movement |
T+9 |
bottom screen limit of
player movement |
T+10 |
top screen limit of
player movement |
|
|
|
top