Prev: F31E Up: Map Next: F38F
F349: Handler: Time Bar
Used by the routine at D352.
Handler_TimeBar F349 LD B,$28 B=28.
F34B LD HL,$D83A HL=Time.
F34E RES 5,(HL) Reset bits 5 and 6 of *HL.
F350 RES 6,(HL)
F352 LD HL,($D85B) HL=*TimeBar_CurrentPosition.
UpdateTimeBar_Loop F355 LD C,$04 Set a pixel counter in C for the height of each segment.
F357 PUSH HL Stash the current screen position on the stack.
Handler_TimeBar_0 F358 SCF Set the carry flag (prepare for the right rotation).
F359 RR (HL) Rotate *HL right one position.
F35B JP C,Handler_TimeBar_2 If the carry flag is set after the rotation, move to the next column - jump to Handler_TimeBar_2.
F35E INC H Increment H by one.
F35F DEC C Decrease the pixel counter by one.
F360 JP NZ,Handler_TimeBar_0 Jump to Handler_TimeBar_0 until the full height of the bar has been drawn.
F363 LD A,B H=B+1E.
F364 ADD A,$1E
F366 LD H,A
F367 LD L,$14 L=14.
F369 LD A,$05 A=05.
Handler_TimeBar_1 F36B XOR %00010000 Flip bit 4.
F36D OUT ($FE),A Send to the speaker.
F36F LD D,H Load the pitch delay counter into D.
TimeBar_PitchDelay F370 DEC D Decrease the pitch delay counter by one.
F371 JP NZ,TimeBar_PitchDelay Jump back to TimeBar_PitchDelay until the pitch delay counter is zero.
F374 DEC L Decrease L by one.
F375 JP NZ,Handler_TimeBar_1 Jump to Handler_TimeBar_1 until L is zero.
F378 POP HL Restore HL from the stack.
F379 DJNZ UpdateTimeBar_Loop Decrease counter by one and loop back to UpdateTimeBar_Loop until counter is zero.
F37B RET Return.
Handler_TimeBar_2 F37C POP HL Restore HL from the stack.
F37D LD A,($D85E) A=*TimeBar_Length.
F380 CP $14 Return if A is greater than or equal to 14.
F382 RET P
F383 INC A Increment A by one.
F384 LD ($D85E),A Write A to *TimeBar_Length.
F387 INC HL Increment HL by one.
F388 LD ($D85B),HL Write HL to *TimeBar_CurrentPosition.
F38B PUSH HL Stash HL on the stack.
F38C JP Handler_TimeBar_0 Jump to Handler_TimeBar_0.
Prev: F31E Up: Map Next: F38F