Prev: 46930 Up: Map Next: 47255
47155: Check Special Shot
Used by the routine at FireWeapons.
Used when the extra key is pressed. If there is no special shot at 47154 and the ship has part 7 and is moving slowly in both directions, launches one. If there is one already, goes to DetonateSpecialShot.
CheckSpecialShot 47155 LD A,(47154) The special-shot flag.
47158 AND A Jump to DetonateSpecialShot if A is not zero.
47159 JR NZ,DetonateSpecialShot
47161 LD A,(23607) The controls.
47164 BIT 5,A Return if bit 5 of A is clear.
47166 RET Z
47167 LD A,(62964) The seventh part, which makes a special shot.
47170 AND A Return if A is zero.
47171 RET Z
47172 LD HL,(51454) Fetch the word at 51454 into HL.
47175 LD A,H A=H.
47176 LD H,L H=L.
47177 LD L,A L=A.
47178 CALL ZeroSmallSpeed Call ZeroSmallSpeed.
47181 LD A,H A=H.
47182 OR L Set the bits of A that are set in L.
47183 RET NZ Return if the zero flag is clear.
47184 LD HL,(51456) Fetch the word at 51456 into HL.
47187 LD A,H A=H.
47188 LD H,L H=L.
47189 LD L,A L=A.
47190 CALL ZeroSmallSpeed Call ZeroSmallSpeed.
47193 LD A,H A=H.
47194 OR L Set the bits of A that are set in L.
47195 RET NZ Return if the zero flag is clear.
47196 LD A,(46896) The weapon toggle.
47199 XOR %00000100 Flip the bits of A that are set in 4.
47201 LD (46896),A Update the weapon toggle.
47204 CALL LaunchShot Call LaunchShot.
47207 LD A,(46896) The weapon toggle.
47210 AND %00000001 Keep the bits of A that are set in 1.
47212 LD (46896),A Update the weapon toggle.
47215 RET Return.
This entry point is used by the routine at CheckObjectHitByShot.
FindShot 47216 LD IY,45946 The shot slots.
47220 LD DE,24 DE=24.
47223 LD B,3 B=3.
CheckSpecialShot_Loop 47225 BIT 7,(IY+22) Jump to CheckSpecialShot_Next if bit 7 of offset 22 of IY is set.
47229 JR NZ,CheckSpecialShot_Next
47231 BIT 7,(IY+21) Return if bit 7 of offset 21 of IY is set.
47235 RET NZ
CheckSpecialShot_Next 47236 ADD IY,DE IY gains DE.
47238 DJNZ CheckSpecialShot_Loop Decrease B and jump to CheckSpecialShot_Loop until none remain.
47240 RET Return.
DetonateSpecialShot 47241 LD A,(23607) The controls.
47244 BIT 5,A Return if bit 5 of A is set.
47246 RET NZ
47247 CALL FindShot Call FindShot.
47250 SET 7,(IY+16) Set bit 7 of offset 16 of IY.
47254 RET Return.
Prev: 46930 Up: Map Next: 47255