Prev: 62158 Up: Map Next: 62281
62238: Draw Time Bar
Used by the routine at StartGame.
time-bar-animation
Draw_TimeBar 62238 LD HL,20705 Set the location of where to start drawing the time bar in HL (20705 in the screen buffer).
62241 LD B,20 Set a counter in B for the total length.
Draw_TimeBar_Loop 62243 LD C,4 Set a pixel counter in C for the height of each segment.
62245 PUSH HL Stash the current screen position on the stack.
Draw_TimeBarColumn 62246 SCF Set the carry flag (prepare for the right rotation).
62247 RR (HL) Rotate *HL right one position.
62249 JP C,TimeBarNextColumn If the carry flag is set after the rotation, move to the next column - jump to TimeBarNextColumn.
62252 INC H Increment H by one.
62253 DEC C Decrease the pixel counter by one.
62254 JP NZ,Draw_TimeBarColumn Jump back to Draw_TimeBarColumn until the full height of the bar has been drawn.
62257 POP HL Restore the screen position from the stack.
62258 JP Draw_TimeBar_Loop Keep jumping back to Draw_TimeBar_Loop.
TimeBarNextColumn 62261 POP HL Restore the screen position from the stack.
62262 INC HL Increment the screen position by one.
Wait for the next frame.
62263 HALT Halt operation (suspend CPU until the next interrupt).
62264 DJNZ Draw_TimeBar_Loop Decrease the length counter by one and loop back to Draw_TimeBar_Loop until the entire time bar has been drawn.
Set up the time bar being active and counting down in the game.
62266 DEC HL Decrease the screen position by one and write it to *TimeBar_CurrentPosition.
62267 LD (55387),HL
62270 LD A,1 Set *TimeBar_Active to 1 to make it active.
62272 LD (55389),A
62275 LD A,20 Set *TimeBar_Length to 20 for the length in character blocks.
62277 LD (55390),A
62280 RET Return.
Prev: 62158 Up: Map Next: 62281