home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 34 / 034.d81 / clock (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  114 lines

  1. 2 sys65418:mm=-1:poke650,128
  2. 5 gosub60100:clr:dim g$(2):poke198,.
  3. 10 def fnh(de)=int(de/256)
  4. 15 def fnl(dn)=dn-fnh(dn)*256
  5. 20 def fns(s)=16*int(s/10)+s-int(s/10)*10
  6. 25 def fnr(r)=(((peek(r)and112)/1.6)+(peek(r)and15))and127
  7. 30 def fnpm(s)=peek(56331)or128
  8. 35 def fnrp(r)=peek(56331)and128
  9. 50 hrs=56331:min=56330:sec=56329:ten=56328
  10. 60 sa=49152:rem change sa to relocate ml
  11. 70 sm=1050:cm=54272:gosub800
  12. 180 gosub700:gosub 900:sys(sa+104):pokesa+92,2
  13. 185 gosub800:goto500
  14. 200 h=fnr(hrs):print"enter the hour:  [157][157]";:gosub1000:h=val(a$)
  15. 201 ifh<0orh>12thenprint"[145]";:goto200
  16. 202 poke hrs,fns(h)+fnrp(0)
  17. 205 w$="am":iffnrp(0) then w$="pm"
  18. 210 print"am or pm":print"-->  [157][157]";:z8=-1:gosub1000:z8=.
  19. 211 w$=a$:ifw$<>"am"and w$<>"pm"andw$<>"a"andw$<>"p"thenprint"[145][145]";:goto210
  20. 212 ifw$="p"thenw$="pm"
  21. 213 ifw$="a"thenw$="am"
  22. 215 if w$="pm" then poke hrs,peek(hrs)or128
  23. 216 if w$="am" then poke hrs,peek(hrs)and255-128
  24. 220 m=fnr(min):print"enter the minute:  [157][157]";:gosub1000:m=val(a$)
  25. 221 ifm<.orm>59thenprint"[145]";:goto220
  26. 222 poke min,fns(m)
  27. 230 s=fnr(sec):print"enter the second:  [157][157]";:gosub1000:s=val(a$)
  28. 231 ifs<.ors>59thenprint"[145]";:goto230
  29. 232 poke sec,fns(s)
  30. 240 poke ten,0
  31. 490 gosub812
  32. 500 poke198,.:wait 198,1:get k$:ifk$=""then500
  33. 510 if k$="[136]" then 750
  34. 512 if k$="" then c=1050
  35. 515 if k$="" then c=sm+1
  36. 520 if k$="[157]" then c=sm-1
  37. 525 if k$="" then c=sm+40
  38. 530 if k$="[145]" then c=sm-40
  39. 532 if k$="[133]" then gosub700:goto200
  40. 533 if k$="[135]" then gosub600
  41. 535 if k$="[134]" then poke sa+92,(peek(sa+92)+1)and 15
  42. 540 if c>1023 and c<2011 then sm=c:gosub800:c=0
  43. 550 goto 500
  44. 600 b=b+1and3:if b=0 then 70
  45. 605 pokeu,peek(u)and254
  46. 610 b(1)=29:b(2)=38:b(3)=44:l(1)=10:l(2)=7:l(3)=4
  47. 615 poke sa+29,240
  48. 620 poke sa+30,b(b)
  49. 625 poke sa+94,l(b)
  50. 650 cm=54271:gosub800:goto985
  51. 700 print chr$(147):print:print tab(16)"the clock"
  52. 710 print tab(10)"by bennett cookson jr.":print:print
  53. 720 return
  54. 750 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  55. 760 ifer<>63thenprint"enter sys65418 to disable clock.":end
  56. 770 sys65418:load"hello connect",8
  57. 800 restore:data 8,17,23,45,51,57,89
  58. 805 forx=1to7:read i:poke sa+i,fnl(sm):poke sa+i+1,fnh(sm):next
  59. 810 poke sa+96,fnl(sm+cm):poke sa+97,fnh(sm+cm)
  60. 812 gosub 700:ifmmthenmm=.:return
  61. 817 print"     cursor controls to move clock":print
  62. 820 print"       home to move clock to top":print
  63. 822 print"           f1 to set time":print
  64. 825 print"           f3 to change color":print
  65. 830 print"           f5 to shorten time display":print
  66. 840 print"           f7 to end program":print
  67. 850 return
  68. 900 i=sa
  69. 901 u=56334:pokeu,peek(u)and254:rem turn interrupts off
  70. 902 read a:if a=256 then 950
  71. 904 poke i,a:i=i+1:goto 902
  72. 906 data 170,74,74,74,74,9,48,153
  73. 908 data 26,4,200,138,41,15,9,48
  74. 910 data 153,26,4,200,169,58,153,26
  75. 912 data 4,200,96,160,0,32,20,192
  76. 914 data 162,1,173,11,220,41,128,240
  77. 916 data 2,162,16,138,153,26,4,200
  78. 918 data 169,13,153,26,4,200,169,32
  79. 920 data 153,26,4,200,173,11,220,170
  80. 922 data 41,16,32,1,192,173,10,220
  81. 924 data 32,0,192,173,9,220,32,0
  82. 926 data 192,173,8,220,41,15,9,48
  83. 928 data 153,26,4,169,1,160,13,153
  84. 930 data 26,216,136,208,250,76,49,234
  85. 932 data 120,169,27,141,20,3,169,192
  86. 934 data 141,21,3,88,96,256
  87. 950 poke sa+106,fnl(sa+27)
  88. 955 poke sa+111,fnh(sa+27)
  89. 960 read i,p: if i=-1 then 985
  90. 965 poke sa+i,fnl(sa+p)
  91. 966 poke sa+i+1,fnh(sa+p)
  92. 970 goto 960
  93. 980 data 30,20,67,1,73,0,79,0,-1,0
  94. 985 pokeu,peek(u)or1:return
  95. 1000 print"[164]";:fora=1to2:g$(a)=""
  96. 1010 geta$:ifa$=""then1010
  97. 1020 ifa$=chr$(13)then1060
  98. 1030 ifa$=chr$(20)and(a>1)thena=a-1:print"[157][157]  [157][157][164]";:g$(a)="":goto1010
  99. 1035 if(z8)and(a$>="[193]"anda$<="[218]")thena$=chr$(asc(a$)-128):goto1050
  100. 1040 if(z8)and(a$>="a"anda$<="z")then1050
  101. 1042 if(z8)or(a$<"0"ora$>"9")then1010
  102. 1050 print"[157] [157]"a$;:poke212,.:print"[164]";:g$(a)=a$:next
  103. 1060 print"[157] ":a$="":forb=1toa-1:a$=a$+g$(b):next:return
  104. 60100 poke53280,5:poke53281,1
  105. 60105 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"chr$(142);
  106. 60110 fora=1to23:print"[221]"spc(38)"[221]";:next
  107. 60120 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][157][148][192]";
  108. 60130 print"[149]          loadstar presents:"
  109. 60140 print"                clock"
  110. 60150 print"        by bennett cookson jr."
  111. 60155 print"           (c)opyright 1987"
  112. 60160 print"[129]      press any key to continue."
  113. 60170 poke198,.:wait198,1:return
  114.