Advertisement
Armakuni

c64 basic-asm analog clock

Dec 2nd, 2021
3,125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 10 rem generated ml loader
  2. 20 poke53281,0:poke53280,0
  3. 30 def fn rs(s)=((3.14/30)*s) - (3.14/2)
  4. 40 def fn rh(h)=((3.14/6)*h) - (3.14/2)
  5. 50 print chr$(147)"wait..."
  6. 60 sa = 49152
  7. 70 for n = 0 to 1311
  8. 80 read a% : poke sa+n,a%: next n
  9. 90 sys sa
  10. 100 gosub1820
  11. 110 print"{clear}":rem main prg
  12. 120 print"insert current hour as hh mm":input a$
  13. 130 gosub 2100:h=val(left$(a$,2)):m=val(right$(a$,2)):s=0:sc=peek(50527):ti$="000000":om=m:gosub2020
  14. 140 ifpeek(50527)=scthen 140
  15. 150 print"{home}"spc(24)h":"m" "int(s):sc=peek(50527):gosub 1960:om=m:ti$="000000":s=s+1:ifs>59thens=0:m=m+1:ifm>59thenm=0:h=h+1:ifh>23thenh=0
  16. 160 goto 140
  17. 180data 169,188,141,8,3,169,192,141
  18. 190data 9,3,169,86,141,10,3,169
  19. 200data 192,141,11,3,96,8,4,2
  20. 210data 1,7,11,13,14,32,108,123
  21. 220data 98,124,225,255,254,126,127,97
  22. 230data 252,226,251,236,160,0,0,0
  23. 240data 0,0,0,0,0,0,0,0
  24. 250data 0,0,0,0,0,0,0,0
  25. 260data 1,69,66,67,79,84,76,80
  26. 270data 249,192,11,194,38,193,242,192
  27. 280data 243,195,147,194,36,196,169,0
  28. 290data 133,13,32,115,0,201,153,240
  29. 300data 6,32,121,0,76,141,174,32
  30. 310data 115,0,32,250,174,32,158,183
  31. 320data 142,11,196,32,253,174,32,158
  32. 330data 183,142,24,196,32,10,196,10
  33. 340data 24,109,59,192,170,189,21,192
  34. 350data 141,170,192,32,247,174,32,180
  35. 360data 192,174,57,192,224,40,176,22
  36. 370data 172,58,192,192,25,176,15,32
  37. 380data 176,196,160,0,177,251,32,160
  38. 390data 196,41,0,32,126,189,32,204
  39. 400data 188,76,121,0,162,5,149,97
  40. 410data 202,16,251,96,32,115,0,8
  41. 420data 201,38,240,4,40,76,231,167
  42. 430data 40,32,207,192,76,174,167,32
  43. 440data 115,0,32,232,192,48,14,138
  44. 450data 10,170,189,73,192,72,189,72
  45. 460data 192,72,76,115,0,76,8,175
  46. 470data 162,6,221,65,192,240,3,202
  47. 480data 16,248,96,32,158,183,142,62
  48. 490data 192,96,32,158,183,142,63,192
  49. 500data 96,32,23,193,32,253,174,32
  50. 510data 158,183,142,47,192,32,253,174
  51. 520data 32,158,183,142,48,192,96,32
  52. 530data 158,183,142,45,192,32,253,174
  53. 540data 32,158,183,142,46,192,96,32
  54. 550data 23,193,32,253,174,32,158,183
  55. 560data 142,53,192,169,255,141,52,192
  56. 570data 169,0,141,54,192,169,1,56
  57. 580data 237,53,192,141,51,192,174,53
  58. 590data 192,32,188,193,238,54,192,173
  59. 600data 52,192,48,7,208,25,173,51
  60. 610data 192,208,20,173,54,192,10,24
  61. 620data 105,1,109,51,192,141,51,192
  62. 630data 144,32,238,52,192,176,27,206
  63. 640data 53,192,173,54,192,56,237,53
  64. 650data 192,10,24,105,1,109,51,192
  65. 660data 141,51,192,16,5,169,255,141
  66. 670data 52,192,174,53,192,236,54,192
  67. 680data 176,183,96,173,45,192,24,105
  68. 690data 0,141,11,196,173,46,192,24
  69. 700data 105,0,141,24,196,32,10,196
  70. 710data 32,55,196,96,174,152,193,172
  71. 720data 161,193,142,161,193,140,152,193
  72. 730data 32,147,193,96,142,152,193,174
  73. 740data 54,192,142,161,193,162,24,142
  74. 750data 150,193,142,159,193,162,105,142
  75. 760data 151,193,142,160,193,32,147,193
  76. 770data 32,172,193,162,56,142,150,193
  77. 780data 162,233,142,151,193,32,147,193
  78. 790data 32,172,193,162,56,142,159,193
  79. 800data 162,233,142,160,193,32,147,193
  80. 810data 32,172,193,162,24,142,150,193
  81. 820data 162,105,142,151,193,32,147,193
  82. 830data 32,172,193,96,32,1,193,174
  83. 840data 45,192,202,142,116,194,142,144
  84. 850data 194,174,46,192,202,142,60,194
  85. 860data 142,88,194,173,47,192,141,11
  86. 870data 196,172,48,192,140,57,194,140
  87. 880data 24,196,32,10,196,32,55,196
  88. 890data 160,0,136,192,0,208,237,173
  89. 900data 45,192,141,11,196,172,48,192
  90. 910data 140,85,194,140,24,196,32,10
  91. 920data 196,32,55,196,160,0,136,192
  92. 930data 0,208,237,172,46,192,140,24
  93. 940data 196,172,47,192,140,113,194,140
  94. 950data 11,196,32,10,196,32,55,196
  95. 960data 160,0,136,192,0,208,237,172
  96. 970data 48,192,140,24,196,172,47,192
  97. 980data 140,141,194,140,11,196,32,10
  98. 990data 196,32,55,196,160,0,136,192
  99. 1000data 0,208,237,96,32,1,193,32
  100. 1010data 220,195,32,196,195,173,56,192
  101. 1020data 205,55,192,176,20,173,47,192
  102. 1030data 205,45,192,176,9,32,171,195
  103. 1040data 32,220,195,32,196,195,76,41
  104. 1050data 195,173,48,192,205,46,192,176
  105. 1060data 9,32,171,195,32,220,195,32
  106. 1070data 196,195,238,48,192,173,45,192
  107. 1080data 141,53,192,162,238,173,49,192
  108. 1090data 16,7,162,206,56,233,1,73
  109. 1100data 255,142,18,195,10,141,49,192
  110. 1110data 56,237,50,192,141,51,192,173
  111. 1120data 50,192,10,141,50,192,174,46
  112. 1130data 192,142,33,195,142,24,196,174
  113. 1140data 53,192,142,11,196,32,10,196
  114. 1150data 32,55,196,173,51,192,240,9
  115. 1160data 48,7,238,53,192,56,237,50
  116. 1170data 192,24,109,49,192,141,51,192
  117. 1180data 162,0,232,236,48,192,144,209
  118. 1190data 96,238,47,192,173,46,192,141
  119. 1200data 54,192,162,238,173,50,192,16
  120. 1210data 7,162,206,56,233,1,73,255
  121. 1220data 160,0,140,52,192,142,123,195
  122. 1230data 10,141,50,192,56,237,49,192
  123. 1240data 16,5,160,255,140,52,192,141
  124. 1250data 51,192,173,49,192,10,141,49
  125. 1260data 192,174,45,192,142,163,195,142
  126. 1270data 11,196,174,54,192,142,24,196
  127. 1280data 32,10,196,32,55,196,173,52
  128. 1290data 192,48,21,238,54,192,173,51
  129. 1300data 192,56,237,49,192,141,51,192
  130. 1310data 173,52,192,233,0,141,52,192
  131. 1320data 173,51,192,24,109,50,192,141
  132. 1330data 51,192,173,52,192,105,0,141
  133. 1340data 52,192,162,0,232,236,47,192
  134. 1350data 144,186,96,173,45,192,174,47
  135. 1360data 192,142,45,192,141,47,192,173
  136. 1370data 46,192,174,48,192,142,46,192
  137. 1380data 141,48,192,96,173,47,192,56
  138. 1390data 237,45,192,141,49,192,141,55
  139. 1400data 192,16,8,56,233,1,73,255
  140. 1410data 141,55,192,96,173,48,192,56
  141. 1420data 237,46,192,141,50,192,141,56
  142. 1430data 192,16,8,56,233,1,73,255
  143. 1440data 141,56,192,96,32,158,183,173
  144. 1450data 64,192,224,0,240,6,9,1
  145. 1460data 141,64,192,96,41,254,141,64
  146. 1470data 192,96,162,0,138,74,141,57
  147. 1480data 192,138,41,1,141,59,192,162
  148. 1490data 0,138,74,141,58,192,138,41
  149. 1500data 1,141,60,192,96,32,158,183
  150. 1510data 142,11,196,32,253,174,32,158
  151. 1520data 183,142,24,196,32,10,196,10
  152. 1530data 24,109,59,192,141,95,196,170
  153. 1540data 189,21,192,141,61,192,174,57
  154. 1550data 192,224,40,176,82,172,58,192
  155. 1560data 192,25,176,75,32,176,196,173
  156. 1570data 64,192,41,1,208,39,162,0
  157. 1580data 189,25,192,141,61,192,160,0
  158. 1590data 177,251,32,160,196,45,61,192
  159. 1600data 170,189,29,192,160,0,145,251
  160. 1610data 224,0,208,8,32,5,197,173
  161. 1620data 63,192,145,251,96,160,0,177
  162. 1630data 251,32,160,196,13,61,192,170
  163. 1640data 189,29,192,160,0,145,251,32
  164. 1650data 5,197,173,62,192,145,251,96
  165. 1660data 162,15,221,29,192,240,5,202
  166. 1670data 16,248,162,0,138,96,0,0
  167. 1680data 169,0,133,251,169,4,133,252
  168. 1690data 32,188,196,96,140,174,196,169
  169. 1700data 0,141,175,196,14,174,196,14
  170. 1710data 174,196,14,174,196,173,174,196
  171. 1720data 14,174,196,46,175,196,14,174
  172. 1730data 196,46,175,196,24,109,174,196
  173. 1740data 141,174,196,144,3,238,175,196
  174. 1750data 138,24,109,174,196,141,174,196
  175. 1760data 144,3,238,175,196,24,173,174
  176. 1770data 196,101,251,133,251,173,175,196
  177. 1780data 101,252,133,252,96,56,165,251
  178. 1790data 233,0,133,251,165,252,233,4
  179. 1800data 133,252,24,165,251,105,0,133
  180. 1810data 251,165,252,105,216,133,252,96
  181. 1820 rem generated ml loader
  182. 1830 sa = 50465
  183. 1840 for n = 0 to 61
  184. 1850 read a% : poke sa+n,a%: next n
  185. 1860 sys sa
  186. 1870 return
  187. 1880 data 169,127,141,13,221,169,84,141
  188. 1890 data 24,3,169,197,141,25,3,169
  189. 1900 data 138,141,4,221,169,240,141,5
  190. 1910 data 221,169,16,141,6,221,169,0
  191. 1920 data 141,7,221,169,17,141,14,221
  192. 1930 data 169,81,141,15,221,169,130,141
  193. 1940 data 13,221,96,72,173,13,221,16
  194. 1950 data 3,238,95,197,104,64,0
  195. 1960 rem display clock
  196. 1970  ifm=omthen return
  197. 1980 gosub 2100
  198. 1990 rem ss=fn rs(s)
  199. 2000 rem &o 7
  200. 2010 rem &l 40,25,40+18*cos(ss),25+18*sin(ss)
  201. 2020 &o 12
  202. 2030 mm=fn rs(m)
  203. 2040 &l 40,25,40+15*cos(mm),25+15*sin(mm)
  204. 2050 &o 15
  205. 2060 hh=fn rh(h)
  206. 2070 &l 40,25,40+10*cos(hh),25+10*sin(hh)
  207. 2080 os=ss:om=mm:oh=hh
  208. 2090 return
  209. 2100 rem clean screen
  210. 2110 print"{clear}"
  211. 2120 &o 11
  212. 2130 &c 40,25,24
  213. 2140 return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement