Prev: F112 Up: Map Next: F1FF
F1BD: Colour the player's ship
Used by the routine at draw_ship_image.
Called once a pass by draw_ship. Works out the ship's attribute and paints it over the ship with the colour patch at ship_colour_patch (6 cells wide, as many deep as the ship's height in ship_height needs): white ($47) as a rule, yellow ($46) when the ore count at ore has reached 18, and while the hit-immunity timer shield_timer runs, cyan ($45) -- flashing between cyan and the usual colour every 8 passes (bit 3 of the pass counter pass_counter) in its last 32. A change of colour from the last one used (kept in the patch's third byte) makes a short sound through sound_ship_colour.
The ore count ore goes up (to 18 at most) at load_ore while the rocket part carried (rocket_part_carried) is part 6, the one that needs 18 ore.
colour_ship F1BD LD B,$47 White, or yellow with 18 ore aboard
F1BF LD A,(ore)
F1C2 CP $12
F1C4 JR NZ,colour_ship_0
F1C6 LD B,$46
colour_ship_0 F1C8 LD C,B C keeps it
F1C9 LD A,(shield_timer) Is the hit-immunity timer running?
F1CC AND A
F1CD JR Z,colour_ship_1
F1CF LD B,$45 Cyan; steady while the timer is 32 or more
F1D1 CP $20
F1D3 JR NC,colour_ship_1
F1D5 LD A,(pass_counter) In its last 32, the usual colour every other 8 passes
F1D8 AND $08
F1DA JR Z,colour_ship_1
F1DC LD B,C
colour_ship_1 F1DD LD A,($F201) A sound if the colour has changed
F1E0 CP B
F1E1 PUSH BC
F1E2 CALL NZ,sound_ship_colour
F1E5 POP BC
F1E6 LD HL,(ship_screen_x) Where the ship is on the screen
F1E9 LD A,(ship_height) Its height in character rows, rounded up
F1EC ADD A,$07
F1EE SRL A
F1F0 SRL A
F1F2 SRL A
F1F4 LD C,A
F1F5 LD ($F200),BC Into the patch: depth and attribute
F1F9 LD DE,ship_colour_patch Paint it
F1FC JP fill_attributes
Prev: F112 Up: Map Next: F1FF