Fork me on GitHub
Prev: 724C Up: Map Next: 728B
7259: Render helicopter rotor sprite
Draws the rotor sprite at the helicopter's position (rows 0-1 only, 2 pixels tall). The blade animation emerges from alternating this render with the body render (render_ship_or_helicopter): the body sprite's top 2 rows contain blade pixels in one position; the rotor sprite contains the same rows vertically swapped (the other blade position). Each pass erases its area with all_ff before drawing, so the two blade positions alternate every tick. Uses left-facing (sprite_helicopter_rotor_left) or right-facing (sprite_helicopter_rotor_right) rotor sprite.
render_helicopter_rotor 7259 LD HL,($5F60) Load current_slot_ptr, extract [D, B, C] from current slot.
725C DEC HL
725D LD D,(HL)
725E DEC HL
725F LD B,(HL)
7260 DEC HL
7261 LD C,(HL)
7262 LD HL,$8AB8 Load left rotor sprite sprite_helicopter_rotor_left. If right-facing (bit 6 clear), load sprite_helicopter_rotor_right.
7265 BIT 6,D
7267 CALL Z,ld_sprite_helicopter_rotor_right
726A LD ($8B0C),BC Set both coordinates to BC so erase and draw target the same position. Push rotor sprite; call ld_enemy_sprites (result discarded).
726E LD ($8B0A),BC
7272 PUSH HL
7273 CALL ld_enemy_sprites
7276 LD HL,$82C5 render_sprite_ptr = all_ff (all $FF): clears the 2 blade rows, removing the body sprite's blade pixels drawn on the previous tick. Pop rotor sprite.
7279 LD ($8B0E),HL
727C POP HL
727D LD DE,$020E Render rotor with height=2, targeting only the 2 blade rows at the top of the body sprite area.
7280 LD BC,$0004
7283 LD A,$02
7285 CALL render_object
7288 JP operate_viewport_slots
Prev: 724C Up: Map Next: 728B