home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Avalon 8
/
Avalon_08_1996-02_Avalon.d64
/
clock
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
3KB
|
59 lines
3 x$=chr$(34)
4 q$=x$+"string"+x$
5 sys4096
10 poke53280,6:poke53281,0:gosub2030
30 print" [212]his program will continually display
40 [153]" an accurate 24-hour digital clock in"
50 [153]" the border just below the bottom of
60 print" the normal screen. [212]he display is in
70 [153]" the normal syshours:mins:secsopen format with
80 print" [158][193][205][159]/[158][208][205][159] being indicated by a small box
90 [153]" to the right of the time.
100 gosub 2000
110 print" [212]he program is stored in memory at"
120 print" [158]$[195]000-$[195]280[159] ([158]49152-49792[159]). [217]ou can use
130 [153]" these commands to change the clock:"
150 [153]" sys(NULL)(NULL)(NULL) 49152open"
160 [153]" str$isplay the clock at the bottom of the
170 print" screen. [212]his is necessary if you have
180 [153]" pressed run/stop-restore."
190 [141]2000
200 [153]"sys (NULL)(NULL)(NULL) 49152,"q$
210 [153]"open (NULL)ets the clock to the time specified
220 print" in [158]"q$"[159]. [212]he format is the same as
230 [153]" is used to set (NULL)right$$, that is syshhmmssopen. right$n
240 print" addition, if the first character in
250 [153]" the string is an sys@open, then the time will
260 print" be displayed in reverse video."
270 gosub2000
300 print"[158] [211][217][211] 49152,colour"
310 print"[159] [195]hanges the colour of the clock. [212]he
320 [153]" colour given in the (NULL)(NULL)(NULL) command is a
330 print" standard colour code from 0-15."
340 print" [158][206][207][212][197]:[159] [212]he last two commands can be
350 [153]" combined into a single command like:
360 print" [158][211][217][211] 49152,"x$"@043000"x$",6[159]."
390 gosub 2000
400 print" [215]hen the clock is running, [212][201]$ is no
410 [153]" no longer accurate since the program
420 print" makes use of raster interrupts. [193]lso,
430 [153]" sprites 0,1 and 2 are used to display
440 print" the clock so these should not be used."
450 print" [198]inally, the sprite data is stored in
460 [153]" memory from 832-1023 so this area is
470 print" not available for machine-code etc."
480 gosub 2000
490 print " [208]lease enter the correct time below."
500 print"sys49152,"x$:print"[145][145][145][145][158]"
510 fort=631to640:poket,29:next:poke198,10
600 end
1900 gosub2000
1990 end
2000 poke214,22:print:print" [208]ress [158][211][208][193][195][197][159] to continue"
2010 geta$:ifa$<>""then2010
2020 geta$:ifa$<>" "then2020
2025 :
2030 print"[147][153] [212]he [195]ommodore 64 [201]nvisible [195]lock"
2040 print " by[158] [197]dward [195]arroll 1986[159]"
2050 return