Prev: C4ED Up: Map Next: C6C2
C5FF: Erase and redraw the side jet behind the ship
Used by the routines at check_pause_in_play and draw_trail.
Reached from draw_trail on odd passes, and called by check_pause_in_play during the pause. The add-on fitted when +$0A of the player's record (score) is set (which also raises the top speed across, top_speed, to 4: build_ship_sprite) flickers behind the ship while it is steered left or right: graphics $0E-$10 through the sequence side_jet_frames, with the record side_jet_record and a 2x2 colour patch whose colour cycles through jet_colours. It ran in the build's every-add-on session, but never mirrored: the erase and the draw for steering left are read only.
The end, from the colour patch on, is also used by lift_jet.
side_jet C5FF LD A,(addon_four) Not fitted: return.
C602 AND A
C603 RET Z
C604 LD IX,side_jet_record Its record (side_jet_record). Not drawn last pass: nothing to erase, and nothing to do unless steering left or right.
C608 LD HL,$0000
C60B LD (scratch_count),HL
C60E BIT 7,(IX+$03)
C612 JR NZ,side_jet_0
C614 LD A,(controls_now)
C617 AND $03
C619 RET Z
C61A JR side_jet_1
side_jet_0 C61C CALL sprite_graphic_width Set up the erase from its last frame and place, mirrored if it was.
C61F LD (scratch_count),A
C622 LD HL,($C6C3)
C625 LD IY,direct_erase_two
C629 BIT 6,(IX+$03)
C62D JR Z,side_jet_1
C62F LD IY,mirrored_erase_two
C633 LD B,$F9
side_jet_1 C635 EXX Not drawn now; not steering: just erase.
C636 LD (IX+$03),$00
C63A LD A,(controls_now)
C63D AND $03
C63F JP Z,side_jet_3
C642 LD A,(death_count) Dying or docking: just erase.
C645 CP $0A
C647 JR NC,side_jet_3
C649 LD A,(IX+$06) Next frame of the flicker: a count of 0-7 through side_jet_frames gives graphic $0E, $0F or $10.
C64C INC A
C64D AND $07
C64F LD (IX+$06),A
C652 LD HL,side_jet_frames
C655 CALL add_a_to_hl
C658 LD A,(HL)
C659 ADD A,$0E
C65B LD (IX+$00),A
C65E CALL sprite_graphic_width Its height; drawn now.
C661 LD (ground_cell),A
C664 LD (IX+$03),$80
C668 LD IX,direct_draw_two Behind the ship, 8 rows below its screen row: x $50 steering right; steering left x $98, mirrored (bit 6), with the mirrored drawer.
C66C LD A,(ship_line)
C66F ADD A,$08
C671 LD H,A
C672 LD L,$50
C674 LD A,(controls_now)
C677 BIT 1,A
C679 JR Z,side_jet_2
C67B LD L,$98
C67D LD B,$F9
C67F LD A,$C0
C681 LD ($C6C5),A
C684 LD IX,mirrored_draw_two
side_jet_2 C688 LD ($C6C6),HL
C68B CALL pixel_to_screen Its screen address, kept for the next erase.
C68E LD ($C6C3),HL
side_jet_3 C691 CALL draw_direct_pair Erase and draw.
C694 LD A,($C6C5) Drawn: a colour patch over it chosen by the flicker count.
C697 AND $80
C699 RET Z
C69A LD HL,($C6C6)
C69D LD A,L
C69E AND $F0
C6A0 LD L,A
C6A1 LD A,H
C6A2 SUB $04
C6A4 LD H,A
C6A5 LD A,($C6C8)
This entry point is used by the routine at lift_jet.
side_jet_4 C6A8 EX DE,HL The patch for fill_attributes, two cells by two, its colour from jet_colours (lift_jet comes in here).
C6A9 LD HL,$0202
C6AC LD (colour_patch),HL
C6AF LD HL,jet_colours
C6B2 AND $07
C6B4 CALL add_a_to_hl
C6B7 LD A,(HL)
C6B8 EX DE,HL
C6B9 LD ($AF03),A
C6BC LD DE,colour_patch
C6BF JP fill_attributes
Prev: C4ED Up: Map Next: C6C2