Prev: B752 Up: Map Next: B897
B833: Check Special Shot
Used by the routine at FireWeapons.
Used when the extra key is pressed. If there is no special shot at B832 and the ship has part 07 and is moving slowly in both directions, launches one. If there is one already, goes to DetonateSpecialShot.
CheckSpecialShot B833 LD A,($B832) The special-shot flag.
B836 AND A Jump to DetonateSpecialShot if A is not zero.
B837 JR NZ,DetonateSpecialShot
B839 LD A,($5C37) The controls.
B83C BIT 5,A Return if bit 5 of A is clear.
B83E RET Z
B83F LD A,($F5F4) The seventh part, which makes a special shot.
B842 AND A Return if A is zero.
B843 RET Z
B844 LD HL,($C8FE) Fetch the word at C8FE into HL.
B847 LD A,H A=H.
B848 LD H,L H=L.
B849 LD L,A L=A.
B84A CALL ZeroSmallSpeed Call ZeroSmallSpeed.
B84D LD A,H A=H.
B84E OR L Set the bits of A that are set in L.
B84F RET NZ Return if the zero flag is clear.
B850 LD HL,($C900) Fetch the word at C900 into HL.
B853 LD A,H A=H.
B854 LD H,L H=L.
B855 LD L,A L=A.
B856 CALL ZeroSmallSpeed Call ZeroSmallSpeed.
B859 LD A,H A=H.
B85A OR L Set the bits of A that are set in L.
B85B RET NZ Return if the zero flag is clear.
B85C LD A,($B730) The weapon toggle.
B85F XOR %00000100 Flip the bits of A that are set in 04.
B861 LD ($B730),A Update the weapon toggle.
B864 CALL LaunchShot Call LaunchShot.
B867 LD A,($B730) The weapon toggle.
B86A AND %00000001 Keep the bits of A that are set in 01.
B86C LD ($B730),A Update the weapon toggle.
B86F RET Return.
This entry point is used by the routine at CheckObjectHitByShot.
FindShot B870 LD IY,$B37A The shot slots.
B874 LD DE,$0018 DE=18.
B877 LD B,$03 B=03.
CheckSpecialShot_Loop B879 BIT 7,(IY+$16) Jump to CheckSpecialShot_Next if bit 7 of offset 16 of IY is set.
B87D JR NZ,CheckSpecialShot_Next
B87F BIT 7,(IY+$15) Return if bit 7 of offset 15 of IY is set.
B883 RET NZ
CheckSpecialShot_Next B884 ADD IY,DE IY gains DE.
B886 DJNZ CheckSpecialShot_Loop Decrease B and jump to CheckSpecialShot_Loop until none remain.
B888 RET Return.
DetonateSpecialShot B889 LD A,($5C37) The controls.
B88C BIT 5,A Return if bit 5 of A is set.
B88E RET NZ
B88F CALL FindShot Call FindShot.
B892 SET 7,(IY+$10) Set bit 7 of offset 10 of IY.
B896 RET Return.
Prev: B752 Up: Map Next: B897