Shadows for VIC sprite position registers
The contents of these locations are copied into the VIC chip sprite position registers (53248-53264/$D000-$D010) during each pass through the BASIC IRQ routine [$A84D]. As long as the BASIC IRQ routine is active, the VIC registers cannot be changed directly. Instead, you should store the desired register value in the corresponding shadow location. All locations in this range are initialized to 0/$00 during the BASIC cold-start sequence. The values here can be set using the MOVSPR statement. The MOVSPR routine [$6CC6] sets the value here directly when a static sprite position is specified. When a mov- ing sprite is specified, the movement information is stored in the table at 4478-4565/$117E-$llD5 and the values here are updated during each pass through the BASIC IRQ routine [$A84D]. The locations are used as follows:
Location Register Function
4566/$llD6 53248/$D0O0 Sprite 0 horizontal position 4567/$llD7 53249/$D001 Sprite 0 vertical position 4568/$llD8 53250/$D002 Sprite 1 horizontal position 4569/$llD9 53251/$D003 Sprite 1 vertical position 4570/$1 IDA 53252/$D004 Sprite 2 horizontal position 4571/S11DB 53253/$D005 Sprite 2 vertical position 4572/$llDC 53254/$D006 Sprite 3 horizontal position 4573/$llDD 53255/$D007 Sprite 3 vertical position 4574/$llDE 53256/$D008 Sprite 4 horizontal position 4575/$llDF 53257/$D009 Sprite 4 vertical position 4576/$llE0 53258/$D00A Sprite 5 horizontal position 4577/$llEl 53259/$D00B Sprite 5 vertical position 4578/$llE2 53260/$D00C Sprite 6 horizontal position 4579/$llE3 53261/$D0OD Sprite 6 vertical position 458O/$11E4 53262/$D00E Sprite 7 horizontal position 4581/$11E5 53263/$D00F Sprite 7 vertical position
4582/S11E6 53264/$D010 Most significant bits of horizontal position
4478-4565 $117E-$11D5
4478-4565 $ 117E-$ 1 IDS SPRITE-DATA
Sprite movement control data
The MOVSPR statement has an option to set sprites in motion at a given angle and speed. These locations hold data concern- ing sprite motion. For moving sprites, the values here will be used to generate position values that will be copied to the shadow registers at 4566-4582/$llD6-$llE6. The locations are used as follows:
Sprite 0 4478/$117E 4479/$117F 4480/S1180 Speed Speed countdown Direction
Horizontal increment (low) 4481/$1181 (high) 4482/$1182 (low) 4483/$1183 (high) 4484/S1184 (low) 4485/$1185 (high) 4486/$1186 (low) 4487/$1187 Vertical increment Horizontal position Vertical position Speed Speed countdown Direction Horizontal increment Vertical increment Horizontal position Vertical position (high) 4488/$1188 Sprite 4 4522/$! 1AA 4523/$ 11AB 4524/$ 11 AC (low) 4525/$ 11 AD (high) 4526/$llAE (low) 4527/$llAF (high) 4528/S11B0 (low) 4529/$llBl (high) 453O/$11B2 (low) 4531/S11B3 (high) 4532/S11B4 Sprite 1 4489/J1189 4490/I118A 4491/$118B 4492/$118C 4493/$118D 4494/$118E 4495/$118F 4496/$1190 4497/S1191 4498/$1192 4499/S1193 Sprite 5 4533/$llB5 4534/S11B6 4535/$]1B7 4536/$11B8 4537/$11B9 4538/$ 11BA 4539/S11BB 4540/$11BC 4541/$11BD 4542/$llBE 4543/$llBF Sprite 2 4500/$1194 4501/$1195 4502/$1196 4503/$1197 4504/$1198 4505/$1199 4506/$119A 4507/S119B 4508/$119C 4509/$119D 4510/$119E Sprite 6 4544/$llC0 4545/$llO 4546/$11C2 4547/S11C3 4548/$llC4 4549/$llC5 455O/$11C6 4551/$11C7 4552/$HC8 4553/$llC9 4554/$llCA Sprite 3 4511/$119F 4512/$11AO 4513/$11A1 4514/$11AZ 4515/$11A3 4516/S11A4 4517/S11A5 4518/$11A6 4519/$11A7 4520/$11 A3 4521/$11A9 Sprite 7 4555/$llCB 4556/$llCC 4557/S11CD 4558/$llCE 4559/$llCF 4560/$11 DO 4561/$I1D1 4562/$IlD2 4563/$llD3 4564/$llD4 4565/$ 11D5
In addition to using the MOVSPR routine, the values here can be set directly to set a sprite in motion. (The correspond- ing sprite must be enabled before the motion values have any effect.) The speed value (0-15) determines how many times per IRQ interrupt the horizontal and vertical increment values will be applied to the horizontal and vertical position values. If the speed value is 0/$00, the corresponding sprite will not be moved. The speed value is copied to the countdown value during each interrupt. The direction value can have one of the following values:
Direction value Sprite motion
0 x increasing, y decreasing 1 x increasing, y increasing 2 x decreasing, y increasing 3 x decreasing, y decreasing 158 $11D6-$11E6 4566-4582
All locations in this range are initialized to 0/$00 during the BASIC cold-start sequence. The warm-start sequence per- forms the less dramatic initialization step of resetting all the speed locations to 0/$00, which stops all sprite motion.
4566-4582 $11D6-$11E6 VIC-SAVE
Shadows for VIC sprite position registers
The contents of these locations are copied into the VIC chip sprite position registers (53248-53264/$D000-$D010) during each pass through the BASIC IRQ routine [$A84D]. As long as the BASIC IRQ routine is active, the VIC registers cannot be changed directly. Instead, you should store the desired register value in the corresponding shadow location. All locations in this range are initialized to 0/$00 during the BASIC cold-start sequence. The values here can be set using the MOVSPR statement. The MOVSPR routine [$6CC6] sets the value here directly when a static sprite position is specified. When a mov- ing sprite is specified, the movement information is stored in the table at 4478-4565/$117E-$llD5 and the values here are updated during each pass through the BASIC IRQ routine [$A84D]. The locations are used as follows:
Location Register Function
4566/$llD6 53248/$D0O0 Sprite 0 horizontal position 4567/$llD7 53249/$D001 Sprite 0 vertical position 4568/$llD8 53250/$D002 Sprite 1 horizontal position 4569/$llD9 53251/$D003 Sprite 1 vertical position 4570/$1 IDA 53252/$D004 Sprite 2 horizontal position 4571/S11DB 53253/$D005 Sprite 2 vertical position 4572/$llDC 53254/$D006 Sprite 3 horizontal position 4573/$llDD 53255/$D007 Sprite 3 vertical position 4574/$llDE 53256/$D008 Sprite 4 horizontal position 4575/$llDF 53257/$D009 Sprite 4 vertical position 4576/$llE0 53258/$D00A Sprite 5 horizontal position 4577/$llEl 53259/$D00B Sprite 5 vertical position 4578/$llE2 53260/$D00C Sprite 6 horizontal position 4579/$llE3 53261/$D0OD Sprite 6 vertical position 458O/$11E4 53262/$D00E Sprite 7 horizontal position 4581/$11E5 53263/$D00F Sprite 7 vertical position
4582/S11E6 53264/$D010 Most significant bits of horizontal position
4583-4584
$11E7-$11E8
4583-4584 $11E7-$11E8
Shadows for VIC sprite-collision registers
During any pass through the BASIC IRQ routine [$A84D] where either or both of the sprite-collision latch flags {bits 1-2 of 53273/$D019) are found to be set to % 1 , the contents of the corresponding VIC chip sprite-collision register will be re- corded in these locations. For sprite-foreground collisions (in- dicated when bit 1 of the flag is set), any bits in the register at 53279/$D01F which are set to %1 will also be set to %1 in lo- cation 4584/$llE8. Likewise, for sprite-sprite collisions (indi- cated when bit 2 of the flag is set), the %1 bits in the register at 53278/$D01E will be recorded in location 4583/$llE7. Thus, these locations will accumulate collision readings until they are cleared, rather than simply holding the most recent collision values. The routine for the BASIC function BUMP [$837C] returns values based on the contents of these loca- tions, rather than on the actual register contents. BUMP(l) re- turns the sprite-sprite collision value in 4583/$llE7, and BUMP(2) returns the sprite-foreground collision value in 4584/$llE8. Either location will be reset to 0/$00 after being read by BUMP. Both locations are also initialized to 0/$00 during the BASIC cold-start sequence.
4585-4586 $1lE9-$11EA
Shadow for VIC light pen registers
During any pass through the BASIC IRQ routine [$A84D] where the light pen latch flag (bit 3 of 53273/$D019) is found to be set to % 1 , the contents of the VIC chip light pen regis- ters at 53267-53268/$D013-$D014 will be copied into these locations. The routine for the BASIC function PEN [$82AE] re- turns values based on the contents of these locations, rather than on the actual register contents. PEN(O) returns the value in 4585/S11E9, multiplied by 2. PEN(l) returns the value in 4586/S11EA. Either location will be reset to 0/$00 after being read by PEN. Both of these locations are also initialized to 0/$00 during the BASIC cold-start sequence.