Prev: 37631 Up: Map Next: 37736
37676: Processes The Remaining Time String
Buffer for processing text output.
Time_Buffer 37676 DEFM " 30",0 Guessing at the length.
37682 DEFS 4 Maybe unused?
This entry point is used by the routine at Print_Time.
Process_Print_Time 37686 PUSH DE Push DE containing the screen position for printing onto the stack for later.
37687 LD IX,37676 Point IX at the first character of the time display buffer at Time_Buffer.
37691 CALL Process_Time Call Process_Time.
37694 PUSH IX IX points to one byte off the end of the time buffer, write 0 as a terminator for the print routine.
37696 POP HL
37697 LD A,0
37699 LD (HL),A
37700 POP HL Fetch the screen position off the stack and store it in HL.
The time isn't printed as "00005" so this routine replaces the zeroes with spaces in the time print buffer.
37701 LD DE,37676 Store Time_Buffer in DE.
Time_Zero_To_Spaces 37704 LD A,(DE) Grab the next character from the time buffer.
37705 CP 48 If it is not ASCII "0" then jump to Time_Check_Last.
37707 JP NZ,Time_Check_Last
37710 LD A,32 Write ASCII "space" (32) to the time buffer location.
37712 LD (DE),A
37713 INC DE Move onto the next character.
37714 JP Time_Zero_To_Spaces Jump back to Time_Zero_To_Spaces.
If time has run out, show at least an ASCII "0".
Time_Check_Last 37717 LD DE,37680 Point to the last digit of the time buffer 37680.
37720 LD A,(DE) If it is not an ASCII "space" (32) then jump to Print_Time_Screen.
37721 CP 32
37723 JP NZ,Print_Time_Screen
37726 LD A,48 Time has run out, so write ASCII "0" to this last character.
37728 LD (DE),A
Send the time buffer to Print_String.
Print_Time_Screen 37729 LD DE,37676 Point to Time_Buffer and call Print_String.
37732 CALL Print_String
37735 RET Return.
Prev: 37631 Up: Map Next: 37736