Prev: 54553 Up: Map Next: 54626
54570: Animate Wave Start Sprites
Used by the routine at Animate_Wave_Start_Sequence.
Advances the wave start sprite animation by one frame. Renders each of the three sprite state entries via Draw_Clipped_Wide_Sprite, scrolls its Y-position down by 6 pixels and advances its X-position by its stored velocity. After 14 frames the closing sprite is drawn and the animation restarts via Initialise_Wave_Start_Sprites.
Animate_Wave_Start_Sprites 54570 LD HL,54541 Point to the first sprite state entry in Intro_Sprite_State.
54573 LD B,3 Set the sprite entry loop counter to 3.
54575 LD A,(50481) Load Wave_Sprite_Frame_Counter into the animation frame counter.
54578 EXX Stash the frame counter in the shadow register.
54579 LD B,A
54580 EXX
Animate_Wave_Start_Sprites_Loop 54581 PUSH HL Stash the sprite state pointer and loop counter on the stack.
54582 PUSH BC
54583 CALL Draw_Clipped_Wide_Sprite Render this sprite via Draw_Clipped_Wide_Sprite.
54586 POP BC Restore the loop counter and state pointer from the stack.
54587 POP HL
54588 INC HL Advance past the sprite identifier byte.
54589 LD A,(HL) Scroll the Y-position down by 6 pixels.
54590 ADD A,6
54592 LD (HL),A
54593 INC HL Apply the X velocity to the X-position.
54594 LD A,(HL)
54595 INC HL
54596 ADD A,(HL)
54597 DEC HL
54598 LD (HL),A
54599 INC HL Advance to the next sprite state entry.
54600 INC HL
54601 DJNZ Animate_Wave_Start_Sprites_Loop Repeat for the next sprite entry.
54603 LD A,(50481) Decrement the animation frame counter.
54606 DEC A
54607 LD (50481),A
54610 CP 1 Return if the animation is still running.
54612 RET NZ
Final frame: draw the closing sprite with bright white and restart.
54613 EXX Set the closing sprite attribute to bright white.
54614 LD B,71
54616 EXX
54617 LD HL,50387 Call Draw_Entity_Sprite using Intro_Closing_Sprite.
54620 CALL Draw_Entity_Sprite
54623 JP Initialise_Wave_Start_Sprites Reinitialise the animation and restart.
Prev: 54553 Up: Map Next: 54626