Prev: 46896 Up: Map Next: 46930
46897: Fire Weapons
Used by the routine at DrawShipTop.
Checks the controls for the fire key. The extra key is dealt with by CheckSpecialShot first. When fire is pressed, and the six frames since the last shot have passed, a shot is launched.
FireWeapons 46897 CALL CheckSpecialShot Call CheckSpecialShot.
46900 LD A,(23609) The frames before the next shot.
46903 AND A Jump to FireWeapons_Fire if A is zero.
46904 JR Z,FireWeapons_Fire
46906 DEC A Step A back.
46907 LD (23609),A One fewer frame before the next shot.
46910 RET Return.
FireWeapons_Fire 46911 LD A,(23607) The controls.
46914 BIT 4,A Return if bit 4 of A is clear.
46916 RET Z
46917 LD A,6 A=6.
46919 LD (23609),A Six frames before the next shot.
46922 LD A,(46896) The weapon toggle.
46925 XOR %00000001 Flip the bits of A that are set in 1.
46927 LD (46896),A Update the weapon toggle.
Continue on to LaunchShot.
Prev: 46896 Up: Map Next: 46930