![]() |
Routines |
| Prev: 26011 | Up: Map | Next: 26125 |
|
Used by the routine at Run_Game_Frame.
|
||||
| DrawNestChicks | 26090 | LD HL,57482 | HL=57482 (sprite buffer position for the first chick). | |
| 26093 | LD B,3 | Set a chick counter in B for 3 chicks. | ||
| DrawNestChicks_Loop | 26095 | PUSH BC | Stash the chick counter on the stack. | |
| 26096 | PUSH HL | Stash the screen position on the stack. | ||
| 26097 | LD HL,42851 | HL=Graphics_ChickFrame_01 (base address of the chick animation frames). | ||
| 26100 | LD BC,8 | BC=8 (bytes per frame). | ||
|
Use the rotating bit pattern at ChickAnimationStates to select which animation frame to use for this chick. The pattern is rotated each time, so each chick picks up a different bit and animates independently.
|
||||
| 26103 | LD A,(24500) | Update *ChickAnimationStates by rotating the frame selection bits. | ||
| 26106 | RRCA | |||
| 26107 | LD (24500),A | |||
| 26110 | JR C,DrawNestChicks_DrawFrame | Jump to DrawNestChicks_DrawFrame if carry is set (use first frame at Graphics_ChickFrame_01). | ||
| 26112 | ADD HL,BC | HL+=BC (use second frame at Graphics_ChickFrame_02). | ||
| DrawNestChicks_DrawFrame | 26113 | EX DE,HL | Transfer the frame graphic address to DE. | |
| 26114 | POP HL | Restore the screen position from the stack. | ||
| 26115 | PUSH HL | Keep a copy of the screen position on the stack. | ||
| 26116 | CALL Handler_DrawWorm_Frame | Call Handler_DrawWorm_Frame to draw the chick frame to the screen. | ||
| 26119 | POP HL | Restore the screen position and chick counter from the stack. | ||
| 26120 | POP BC | |||
| 26121 | INC L | Move one character column to the right for the next chick. | ||
| 26122 | DJNZ DrawNestChicks_Loop | Decrease the chick counter by one and loop back to DrawNestChicks_Loop until all 3 chicks are drawn. | ||
| 26124 | RET | Return. | ||
| Prev: 26011 | Up: Map | Next: 26125 |