Prev: C6D0 Up: Map Next: C78F
C6D2: Erase and redraw the lift jet under the ship
Used by the routines at draw_rocket, draw_trail and play.
The add-on fitted when +$0B of the player's record (score) is set (which also raises the top vertical speed top_climb to 4, build_ship_sprite, and lets the ship climb above map row 5, read_controls) is drawn under the ship on even passes: graphic $12, or $11 while thrusting (control bit 3). It is drawn mirrored and not in turn (bit 6 of +3 flips each time), so it seems to spin. While the finished rocket lifts off it is drawn at the rocket's height. With the ship dying (death byte 10 or more) it is only erased, which is why the death sequence (play) calls this once at its start. Its 2x2 attribute patch is white. It ran in the build's every-add-on session, all but the lift-off branch: the launch session had no lift jet.
Stage 0 took this for the death sequence; it is not: the death sequence calls it to take the jet off the screen.
lift_jet C6D2 LD A,(addon_five) Not fitted: return.
C6D5 AND A
C6D6 RET Z
C6D7 LD IX,lift_jet_record Its record (lift_jet_record); nothing to erase yet.
C6DB LD HL,$0000
C6DE LD (scratch_count),HL
C6E1 LD (direct_old_line),HL
C6E4 BIT 7,(IX+$03) Drawn last pass: set up the erase, mirrored if it was.
C6E8 JR Z,lift_jet_0
C6EA CALL sprite_graphic_width
C6ED LD (scratch_count),A
C6F0 LD HL,($C790)
C6F3 LD IY,direct_erase_four
C6F7 BIT 6,(IX+$03)
C6FB JR Z,lift_jet_0
C6FD LD IY,mirrored_erase_four
C701 LD B,$F9
lift_jet_0 C703 RES 7,(IX+$03) Not drawn now.
C707 EXX
C708 LD A,(lift_jet_skip) Skipped this pass (lift_jet_skip).
C70B AND A
C70C JR NZ,lift_jet_5
C70E LD (IX+$00),$12 Graphic $12; dying or docking, just erase.
C712 LD A,(death_count)
C715 CP $0A
C717 JR NC,lift_jet_5
C719 LD A,(controls_now) Thrusting: graphic $11.
C71C AND $08
C71E JR Z,lift_jet_1
C720 LD (IX+$00),$11
lift_jet_1 C724 CALL sprite_graphic_width Its height; drawn, and mirrored if it was not last time.
C727 LD (ground_cell),A
C72A LD A,(IX+$03)
C72D XOR $40
C72F OR $80
C731 LD (IX+$03),A
C734 LD A,(launch_state) The rocket lifting off: at the rocket's height, graphic $11.
C737 AND A
C738 JR Z,lift_jet_2
C73A LD A,($96B2)
C73D ADD A,$13
C73F LD H,A
C740 LD (IX+$00),$11
C744 JR lift_jet_3
lift_jet_2 C746 LD A,(ship_line) Otherwise $1D rows below the ship's screen row (ship_line), 8 less for graphic $12.
C749 ADD A,$1D
C74B LD H,A
C74C LD A,(IX+$00)
C74F CP $11
C751 JR Z,lift_jet_3
C753 LD A,H
C754 SUB $08
C756 LD H,A
lift_jet_3 C757 LD L,$68 x $68, or $80 with the mirrored drawer.
C759 BIT 6,(IX+$03)
C75D LD IX,direct_draw_four
C761 JR Z,lift_jet_4
C763 LD IX,mirrored_draw_four
C767 LD B,$F9
C769 LD L,$80
lift_jet_4 C76B LD ($C793),HL Its place and screen address, kept for the next erase.
C76E CALL pixel_to_screen
C771 LD ($C790),HL
lift_jet_5 C774 CALL draw_direct_pair Erase and draw; the skip flag is used up.
C777 XOR A
C778 LD (lift_jet_skip),A
C77B LD A,($C792) Drawn: a white 2x2 patch 7 rows above it at x $70.
C77E AND $80
C780 RET Z
C781 LD HL,($C793)
C784 LD A,H
C785 SUB $07
C787 LD H,A
C788 LD L,$70
C78A LD A,$07
C78C JP side_jet_4
Prev: C6D0 Up: Map Next: C78F