home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Software
/
CALENDAR-CLOCK
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
4KB
|
117 lines
0 LI$="........................................":DN$=""
1 POKE53281,0:POKE53280,0:POKE646,1:GOSUB108
2 INPUT"YEAR";CY:INPUT"MONTH";MO:INPUT"DAY";DA:
3 PRINTCHR$(142):XE=54272:GOTO10
4 FORL=0TO24:POKEXE+L,0:NEXT:K=T1:IFK+T2>30THENK=1
5 POKEXE+1,117:POKEXE+5,12:POKEXE+15,12:POKEXE+24,15
6 FORL=1TOK:POKEXE+4,21:TY=TI+120
7 IFTI<TYTHEN7
8 POKEXE+4,20:NEXT:RETURN
9 RETURN
10 DIMH$(12):FORL=1TO15:A$=".[157]":V$=V$+A$:NEXT:GOSUB77
11 AM$(0)="[209]AM PM":AM$(1)=" AM [209]PM"
12 Y=CY:D=DA
13 INPUT"DAY OF WEEK SUNDAY=1 1[157][157][157]";DW
14 XA=165:XF=56331:XG=240:XH=15
15 MO$="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC":XK=2:XF=56331:XI=16
16 MP$="UARRUACH IL E Y USTTEMOBEEMBEMB"
17 MQ$="Y RY BERR ER ER "
18 DM$="312831303130313130313031":S$=""
19 DATA 060,102,110,118,102,102,060,024,024,056,024,024,024,126,060,102,006
20 DATA 012,048,096,126,060,102,006,028,006,102,060,006,014,030,102,127,006
21 DATA 006,126,096,124,006,006,102,060,060,102,096,124,102,102,060,126,102
22 DATA 012,024,024,024,024,060,102,102,060,102,102,060,060,102,102,062,006
23 DATA 102,060
24 PRINT"[147]MAKING BIG DIGITS...STANDBY":GOSUB32
25 GOSUB54:GOTO40
26 IFPEEK(XF-3)<>0THEN26
27 DW=DW+1:IFDW>7THENDW=1
28 D=D+1:IFD<=DMTHEN31
29 D=1:MO=MO+1:IFMO<=12THEN31
30 MO=1:D=1:Y=Y+1
31 GOSUB55:GOSUB64:RETURN
32 C1$="[157][157][157][157][157][157][157][157]"
33 C2$=" [146]"
34 C$="[145][145][145][145][145][145][145][145]":FORL=0TO9:FORM=0TO6:READA:G$="":FORF=0TO7:B=A/XK
35 IFB=INT(A/XK)THENG$=" "+G$:GOTO37
36 G$=C2$+G$
37 PRINTG$"[145]";:A=INT(A/XK):PRINT"[157][157][157][157][157][157][157][157]":NEXT
38 H$(L)=H$(L)+G$+C1$:NEXT:PRINT"";:H$(L)=H$(L)+C$:GOSUB115:NEXT:PRINT"[147]"
39 RETURN
40 GOSUB64:GOTO42
41 GOTO91
42 PRINT""
43 H=PEEK(XF):M=PEEK(XF-1):T=PEEK(XF-3)
44 T1=((XIANDH)/XI)*10+((XHANDH))
45 T2=((XGANDM)/XI)*10+((XHANDM))
46 IFT2<=59THEN48
47 IFT1>12THENT1=1
48 A(2)=(T1-(INT(T1/10)*10)):A(1)=INT(T1/10):A(4)=(T2-(INT(T2/10)*10))
49 A(3)=INT(T2/10):TM=(T2=30ORT2=0)
50 IFT1=12THENIFT2=00THENIFP1=0THENIFPEEK(XF)=18THENTI$="000000":FL=0:GOSUB26
51 PRINT"";:FORL=0TO3:PRINT""TAB(L*8)H$(A(L+1));:NEXT:IFTMTHENGOSUB4
52 AX=(ABS(VAL(LEFT$(TI$,2))>11)):PRINT""TAB(33)AM$(AX)""
53 GOTO91
54 POKE646,1
55 GOSUB103
56 LD=0:IF(YAND3)THEN58
57 LD=1:IFY/100=INT(Y/100)THENIFY/400<>INT(Y/400)THENLD=0
58 MR$=MID$(MO$,MO*3-2,3)
59 MR$=MR$+MID$(MP$,MO*3-2,3)
60 MR$=MR$+MID$(MQ$,MO*3-2,3)
61 DM=VAL(MID$(DM$,MO*2-1,2)):IFDM=28THENDM=DM+LD
62 GOSUB103:IFDO>=7THENDO=0
63 RETURN
64 POKE646,1:PRINT"[147]";TAB(3)MR$;TAB(31);Y:PRINT
65 PRINT" SUN MON TUE WED THU FRI SAT":PRINT
66 FORL=1TODM:IFL=DTHENPRINT"";:DA=DO
67 DO=DO+1:IFL>9THEN69
68 PRINTTAB(5*(DO)-2+1)L;:GOTO70
69 PRINTTAB(5*(DO)-3+1)L;
70 IFDO=>7THENPRINT:PRINT:DO=0
71 PRINT"[146]";:NEXT:PRINT:PRINTLI$DN$LI$DN$TAB(0)V$DN$TAB(39)V$DN$"":RETURN
72 C$=RIGHT$(STR$(100+PEEK(171)),2):REM MONTH
73 B$=RIGHT$(STR$(100+PEEK(170)),2):REM DATE
74 A$=RIGHT$(STR$(100+PEEK(172)),2):REM YEAR
75 RETURN
76 PRINTH$(10-(LEFT$(TI$,2)>"12"))
77 PRINT"[147]":A$(1)=" [157] [157] [157] [157][157] "
78 A$(2)=" [157] [157][157][157] [157][157][157] [157] "
79 A$(3)=" [157] [157][157][157] [157] [157][157][157] "
80 A$(4)=" [157][157][157] [157][157][157] [157] [157] "
81 A$(6)=" [157][157][157] [157] [157][157][157] [157][157][157] "
82 A$(5)=" [157][157][157] [157] [157] [157][157][157] "
83 A$(7)=" [157] [157] [157] [157] "
84 A$(8)=" [157][157][157] [157][157][157] [157][157][157] [157][157][157] "
85 A$(9)=" [157][157][157] [157][157][157] [157][157][157] [157][157][157] "
86 A$(0)=" [157][157][157] [157][157][157] [157][157][157] [157][157][157] "
87 A$(10)="[146] [157][157][157] [157][157][157] [157][157][157] [157][157][157] "
88 C$="[145][145][145][145]":E$="":F$=C$+E$
89 CC$=A$(10)+F$:RETURN
90 XH=15:XF=56331:REM XI=240
91 IFPEEK(XF-3)<>0THEN91
92 SS=PEEK(XF-2):P1=((XGANDSS)/XI)*10+(XHANDSS)
93 IFVF=0THENVF=1:GOTO96
94 FL=0
95 IFINT(P1/10)=INT(P2/10)THEN97
96 PRINT""SPC(33)CC$;""SPC(33)A$(INT(P1/10))F$;"[146]";
97 IFP1=0THENFL=1
98 PRINT""SPC(37)CC$;
99 PRINT""SPC(37)""A$(P1-(INT(P1/10)*10));"[146]";:IFFL=1THEN42
100 IFAL$=""THEN102
101 PRINT""TAB(33)AM$(AX)""
102 P2=P1:GOTO91
103 B=DW:X=D:REM IFX=1THENDO=DW:RETURN
104 X=X-1
105 B=B-1:IFB=0THENB=7
106 IFX>0THEN104
107 DO=B:RETURN
108 INPUT" ENTER 24-HOUR TIME (HHMMSS) 235959[157][157][157][157][157][157][157][157]";TI$:PRINT"[147]"
109 FORI=1TO3:T(I)=10*VAL(MID$(TI$,I+I-1,1))+VAL(MID$(TI$,I+I,1)):NEXT
110 T(4)=3:IFT(1)>23ORT(2)>59ORT(3)>59THEN108
111 F=0:IFT(1)>12THENF=128:T(1)=T(1)-12
112 FORI=1TO3:H=INT(T(I)/10):L=T(I)-10*H:T(I)=16*H+L:NEXT:T(1)=T(1)ORF
113 C=56331:POKEC+4,PEEK(C+4)AND127
114 FORI=0TO3:POKEC-I,T(I+1):NEXT:FORI=0TO3:NEXT:RETURN
115 FORR=1TO8:POKE781,R:SYS59903:NEXT:RETURN