Shows a 24-hour clock in large digits on a yellow screen. Each digit is drawn by enlarging the ROM character set, with a round UDG dot standing in for every lit pixel. You enter the starting time as HHMM, and the display then advances one minute at a time while a small counter ticks off the seconds below it. Every quarter hour it plays a chime, one phrase at quarter past, two at half past, three at quarter to and four on the hour, and it changes the border to a random color.
Program Analysis
Program Structure
Lines 20–30 define UDG a as a filled circle. Line 1030 converts the HHMM input into minutes since midnight in M. Lines 1045–1120 split M into four digits and draw them at columns 0, 7, 16 and 23, with a colon made of two dots at column 15. The minute loop at 1130–1140 counts 0 to 54 with PAUSE 57 per step, followed by PAUSE 21. This is timed so that the counting, the pauses and the redraw add up to about a minute. M wraps at 1440.
Big Digits
The subroutine at 1500 reads the digit’s bitmap straight from the ROM character set, starting at 15745 (the “0” pattern at 15744, skipping its blank top row). For six rows it tests the top bit of each byte, prints CHR$ 144 (the dot) or a space, and doubles the byte to shift the next bit up, for seven columns. The result is a 7×6 block of characters. OVER 1: PRINT TAB T; moves to the next row without wiping the digit next to it, because spaces printed with OVER 1 leave the screen unchanged.
Chimes
When M is a multiple of 15, the subroutine at 2000 plays four-note phrases (pitches 12, 8, 10, 3 and 3, 10, 12, 8), which follow the Westminster quarter pattern. It stops after the number of phrases matching the minutes value in S, then sets BORDER RND*7.
Potential Issues
- Timing depends on PAUSE and BASIC execution speed, so the clock will drift. The seconds counter shows 0–54, not 0–59.
- The time input is not checked, so minutes of 60 or more are accepted.
- The tape header has no autostart line, so the program has to be started with RUN after loading, even though line 10 suggests it was meant to be saved with LINE 1.
Source Code
10 REM SAVE "DIGITCLOCK" LINE 1
20 RESTORE : FOR i=0 TO 7: READ a: POKE USR "a"+i,a: NEXT i
30 DATA 60,126,255,255,255,255,126,60
1000 BORDER 6: PAPER 6: INK 9: CLS
1010 INPUT "Input Time ";TIME
1030 LET m=INT (TIME/100)*60+time-INT (TIME/100)*100
1045 LET T=0
1050 LET D=INT ((INT (M/60))/10)
1055 GO SUB 1500
1060 LET T=7
1065 LET D=(INT (M/60))-10*D
1070 GO SUB 1500
1080 PRINT AT 11,15;"a";AT 8,15;"a"
1085 LET T=16
1090 LET D=INT (60*(M/60-INT (M/60))/10+.05)
1091 LET S=10*D
1095 GO SUB 1500
1100 LET T=23
1110 LET D=M-INT (M/10)*10
1115 LET S=S+D
1120 GO SUB 1500
1125 IF M/15=INT (M/15) THEN GO SUB 2000
1130 FOR I=0 TO 54: PRINT AT 17,15;I
1135 PAUSE 57
1140 NEXT I: PRINT AT 17,15;" ": PAUSE 21
1150 LET M=M+1
1160 IF M=1440 THEN LET M=0
1170 GO TO 1045
1500 LET N=15745+D*8
1510 PRINT AT 7,T;: FOR N=N TO N+5
1520 LET X=PEEK N: FOR L=1 TO 7
1530 LET C=32: IF X<128 THEN GO TO 1560
1540 LET C=144: LET X=X-128
1560 LET X=X*2
1570 PRINT CHR$ C;
1580 NEXT L
1585 OVER 1: PRINT TAB T;: OVER 0
1590 NEXT N
1600 RETURN
2000 BEEP .5,12: BEEP .5,8: BEEP .5,10: BEEP 1,3: IF S=15 THEN GO TO 2005
2001 BEEP .5,3: BEEP .5,10: BEEP .5,12: BEEP 1,8: IF S=30 THEN GO TO 2005
2002 BEEP .5,12: BEEP .5,8: BEEP .5,10: BEEP 1,3: IF S=45 THEN GO TO 2005
2003 BEEP .5,3: BEEP .5,10: BEEP .5,12: BEEP 1,8
2005 BORDER RND*7
2010 RETURNNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
