![]() |
Routines |
| Prev: D519 | Up: Map | Next: D562 |
|
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 06 pixels and advances its X-position by its stored velocity. After 0E frames the closing sprite is drawn and the animation restarts via Initialise_Wave_Start_Sprites.
|
||||
| Animate_Wave_Start_Sprites | D52A | LD HL,$D50D | Point to the first sprite state entry in Intro_Sprite_State. | |
| D52D | LD B,$03 | Set the sprite entry loop counter to 03. | ||
| D52F | LD A,($C531) | Load Wave_Sprite_Frame_Counter into the animation frame counter. | ||
| D532 | EXX | Stash the frame counter in the shadow register. | ||
| D533 | LD B,A | |||
| D534 | EXX | |||
| Animate_Wave_Start_Sprites_Loop | D535 | PUSH HL | Stash the sprite state pointer and loop counter on the stack. | |
| D536 | PUSH BC | |||
| D537 | CALL Draw_Clipped_Wide_Sprite | Render this sprite via Draw_Clipped_Wide_Sprite. | ||
| D53A | POP BC | Restore the loop counter and state pointer from the stack. | ||
| D53B | POP HL | |||
| D53C | INC HL | Advance past the sprite identifier byte. | ||
| D53D | LD A,(HL) | Scroll the Y-position down by 06 pixels. | ||
| D53E | ADD A,$06 | |||
| D540 | LD (HL),A | |||
| D541 | INC HL | Apply the X velocity to the X-position. | ||
| D542 | LD A,(HL) | |||
| D543 | INC HL | |||
| D544 | ADD A,(HL) | |||
| D545 | DEC HL | |||
| D546 | LD (HL),A | |||
| D547 | INC HL | Advance to the next sprite state entry. | ||
| D548 | INC HL | |||
| D549 | DJNZ Animate_Wave_Start_Sprites_Loop | Repeat for the next sprite entry. | ||
| D54B | LD A,($C531) | Decrement the animation frame counter. | ||
| D54E | DEC A | |||
| D54F | LD ($C531),A | |||
| D552 | CP $01 | Return if the animation is still running. | ||
| D554 | RET NZ | |||
|
Final frame: draw the closing sprite with bright white and restart.
|
||||
| D555 | EXX | Set the closing sprite attribute to bright white. | ||
| D556 | LD B,$47 | |||
| D558 | EXX | |||
| D559 | LD HL,$C4D3 | Call Draw_Entity_Sprite using Intro_Closing_Sprite. | ||
| D55C | CALL Draw_Entity_Sprite | |||
| D55F | JP Initialise_Wave_Start_Sprites | Reinitialise the animation and restart. | ||
| Prev: D519 | Up: Map | Next: D562 |