Prev: F2CE Up: Map Next: F349
F31E: Draw Time Bar
Used by the routine at StartGame.
time-bar-animation
Draw_TimeBar F31E LD HL,$50E1 Set the location of where to start drawing the time bar in HL (50E1 in the screen buffer).
F321 LD B,$14 Set a counter in B for the total length.
Draw_TimeBar_Loop F323 LD C,$04 Set a pixel counter in C for the height of each segment.
F325 PUSH HL Stash the current screen position on the stack.
Draw_TimeBarColumn F326 SCF Set the carry flag (prepare for the right rotation).
F327 RR (HL) Rotate *HL right one position.
F329 JP C,TimeBarNextColumn If the carry flag is set after the rotation, move to the next column - jump to TimeBarNextColumn.
F32C INC H Increment H by one.
F32D DEC C Decrease the pixel counter by one.
F32E JP NZ,Draw_TimeBarColumn Jump back to Draw_TimeBarColumn until the full height of the bar has been drawn.
F331 POP HL Restore the screen position from the stack.
F332 JP Draw_TimeBar_Loop Keep jumping back to Draw_TimeBar_Loop.
TimeBarNextColumn F335 POP HL Restore the screen position from the stack.
F336 INC HL Increment the screen position by one.
Wait for the next frame.
F337 HALT Halt operation (suspend CPU until the next interrupt).
F338 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.
F33A DEC HL Decrease the screen position by one and write it to *TimeBar_CurrentPosition.
F33B LD ($D85B),HL
F33E LD A,$01 Set *TimeBar_Active to 01 to make it active.
F340 LD ($D85D),A
F343 LD A,$14 Set *TimeBar_Length to 14 for the length in character blocks.
F345 LD ($D85E),A
F348 RET Return.
Prev: F2CE Up: Map Next: F349