home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 23 / 64er_Magazin_Sonderheft_23_19xx_Markt__Technik_de_Disk_1_of_2_Side_B.d64 / sid-director (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  7KB  |  213 lines

  1. 1 iflc=0thenlc=1:load"mc",8,8
  2. 2 iflc=1thenlc=2:load"p.cursor",8,8
  3. 3 iflc=2thenlc=3:printchr$(147)chr$(142)chr$(8);:load"c.mask",8,8
  4. 4 iflc=3thenlc=4:poke53280,11:poke53281,11:load"mask",8,8
  5. 5 poke55,63:poke56,156:clr:dim vi(39,24),jr(26)
  6. 6 dimsx(17),sy(17),mx(15),my(15)
  7. 7 def  fn jy(x) =jr(peek(x)-101)
  8. 8 def  fn xb(x) =int((x-24)/8)
  9. 9 def  fn yb(y) =int((y-50)/8)
  10. 20 def fn pw(x) =int(x*40.96)
  11. 21 def fn fr(x) =int(x*17.02841156)
  12. 22 def fn gr(x) =int(((x*1000)-30)/5.8182)
  13. 23 def fn hi(x) =int(x/256)
  14. 24 def fn lo(x) =x-256*fn hi(x)
  15. 25 def fn po(n1)=n1+16*n2
  16. 26 def fn xk(x) =peek(700)+peek(701)*256
  17. 27 def fn yk(x) =peek(702)
  18. 28 def fn sx(x) =x*8+24
  19. 29 def fn sy(y) =y*8+50
  20. 30 def fn od(w) =w and 1
  21. 31 def fn gh(x) =int(x/8)
  22. 32 def fn gl(x) =x-8*fn gh(x)
  23. 36 s=54272:fori=0to2:a=i+1:b=s+7*i:fl(a)=b:fh(a)=b+1:pl(a)=b+2:ph(a)=b+3
  24. 37 ko(a)=b+4:ad(a)=b+5:sr(a)=b+6:nexti
  25. 40 gl=s+21:gh=s+22:rf=s+23:ml=s+24
  26. 43 vo=0:fu=0:fo=3848.568011:ug=0.03:og=11.9398554:pu=0:po=100:v=1:cs=58640
  27. 44 jo=56320:fori=0to24:pokes+i,0:nexti
  28. 50 fori=1to7:readx,y,m:vi(x,y)=m:vi(x,y+1)=m:vi(x,y+2)=m:sx(i)=fnsx(x)
  29. 51 sy(i)=fnsy(y):nexti:fori=1to10:readx,y,m:vi(x,y)=m:vi(x+1,y)=m:vi(x+2,y)=m
  30. 52 sx(i+7)=fnsx(x):sy(i+7)=fnsy(y):nexti:fori=0to26:readjr(i):nexti
  31. 55 poke2041,14:poke2042,15:fori=896to919:pokei,255:nexti:fori=960to1022:pokei,0
  32. 56 nexti:fori=920to958:pokei,0:nexti:fori=960to995step3:pokei,255:nexti
  33. 57 poke53271,4:poke53275,14:poke700,32:poke701,0:poke702,58
  34. 58 fori=0to3:poke53287+i,1:nexti
  35. 59 fori=1to15:readmx(i),my(i):next
  36. 60 poke2043,14:poke53254,248:poke53255,138
  37. 200 poke53269,(do*8)*-(v=3):sys40000:x=fnxk(0):y=fnyk(0):m=vi(fnxb(x),fnyb(y))
  38. 201 ifx>255thenpoke700,peek(700)-1
  39. 202 ifm=0goto200
  40. 203 poke53269,(do*8)*-(v=3):xp=53252:yp=53253:a=4
  41. 210 ifm>7thenxp=53250:yp=53251:a=2
  42. 211 pokeyp,sy(m):ifx<256thenpokexp,sx(m)
  43. 212 ifx>255thenpokexp,sx(m)-255:poke53264,a
  44. 213 poke53269,peek(53269)or a
  45. 214 onmgosub300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620
  46. 220 goto200
  47. 300 w=a(v):gosub650:a(v)=w:n2=a(v):pokead(v),fnpo(d(v)):return
  48. 320 w=d(v):gosub650:d(v)=w:n2=a(v):pokead(v),fnpo(w):return
  49. 340 w=s(v):gosub650:s(v)=w:n2=s(v):pokesr(v),fnpo(r(v)):return
  50. 360 w=r(v):gosub650:r(v)=w:n2=s(v):pokesr(v),fnpo(w):return
  51. 380 w=vo:gosub650:vo=w:pokeml,vo+fi+do*128:return
  52. 400 w=rs:gosub650:rs=w:pokerf,rs*16+f(1)+f(2)+f(3):return
  53. 420 iffi=16thenf=2
  54. 421 iffi=32thenf=3
  55. 422 iffi=64thenf=1
  56. 423 iffi=80thenf=4
  57. 425 gosub850:pokeml,fi+vo+do*128:return
  58. 440 gv=3:gosub1000:if(a<ug)or(a>og)goto440
  59. 441 gr=fngr(a):pokegl,fngl(gr):pokegh,fngh(gr):return
  60. 460 gv=4:gosub1000:if(a<fu)or(a>fo)goto460
  61. 461 fr$(v)=b$:fr(v)=fnfr(a):pokefl(v),fnlo(fr(v)):pokefh(v),fnhi(fr(v)):return
  62. 480 gv=3:gosub1000:if(a<pu)or(a>po)goto480
  63. 481 pw$(v)=b$:pw(v)=fnpw(a):pokepl(v),fnlo(pw(v)):pokeph(v),fnhi(pw(v)):return
  64. 500 w=0:ifri(v)>0thenw=1
  65. 501 gosub950:ri(v)=w*4:pokeko(v),ra(v)+re(v)+sa(v)+dr(v)+ri(v)+sc(v):return
  66. 520 w=0:ifsc(v)>0thenw=1
  67. 521 gosub950:sc(v)=w*2:pokeko(v),ra(v)+re(v)+sa(v)+dr(v)+ri(v)+sc(v):return
  68. 540 w=0:iff(v)>0thenw=1
  69. 541 gosub950:f(v)=w*2^(v-1):pokerf,rs*16+f(1)+f(2)+f(3):return
  70. 560 kr=0
  71. 561 ifra(v)=128thenkr=1
  72. 562 ifre(v)= 64thenkr=2
  73. 563 ifsa(v)= 32thenkr=3
  74. 564 ifdr(v)= 16thenkr=4
  75. 565 ifv=3thengosub800:goto570
  76. 566 gosub750
  77. 570 pokeko(v),kr+ri(v)+sc(v)
  78. 571 pokeml,fi+vo+do*128:return
  79. 580 vv=v:w=v:gosub1100
  80. 581 poke211,mx(9):poke214,my(9):syscs:fori=1to8-len(fr$(v)):print"[153] ";:nexti
  81. 582 print"";fr$(v):poke211,mx(10):poke214,my(10):syscs:fori=1to7-len(pw$(v))
  82. 583 print"[153] ";:nexti:print"";pw$(v)
  83. 584 p=160:m=1:w=a(vv):gosub1252:m=2:w=d(vv):gosub1252:m=3:w=s(vv):gosub1252
  84. 585 m=4:w=r(vv):gosub1252
  85. 586 poke1024+mx(14)+(my(14)-ki(vv))*40,160
  86. 587 if v=3 then if do=1 then poke53269,peek(53269) or 8
  87. 588 if v=3 then if do=0 then poke53269,peek(53269) and 247
  88. 594 w=a(v):m=1:gosub1250:w=d(v):m=2:gosub1250:w=s(v):m=3:gosub1250:w=r(v):m=4
  89. 595 gosub1250:va=1024+mx(14)+my(14)*40:pokeva-ki(v)*40,192
  90. 596 m=11:w=ri(v):gosub1300:m=12:w=sc(v):gosub1300:m=13:w=f(v):gosub1300
  91. 599 return
  92. 600 a$=",":c$(1)="100 data":fori=1to3:fl(i)=fnlo(fr(i)):fh(i)=fnhi(fr(i))
  93. 601 pl(i)=fnlo(pw(i)):ph(i)=fnhi(pw(i))
  94. 602 ki(i)=ra(i)+re(i)+sa(i)+dr(i)+ri(i)+sc(i):ad(i)=a(i)*16+d(i)
  95. 603 sr(i)=s(i)*16+r(i):nexti:c$(2)="101 data"
  96. 604 fori=1to3:b$(i)=str$(fl(i))+a$+str$(fh(i))+a$+str$(pl(i))+a$+str$(ph(i))+a$
  97. 605 b$(i)=b$(i)+str$(ki(i))+a$+str$(ad(i))+a$+str$(sr(i)):nexti
  98. 606 a$(1)=c$(1)+b$(1)+a$+b$(2):a$(2)=c$(2)+b$(3)+a$:gl=fngl(gr):gh=fngh(gr)
  99. 607 a$(2)=a$(2)+str$(gl)+a$+str$(gh)+a$+str$(rs*16+f(1)+f(2)+f(3))+a$
  100. 608 a$(2)=a$(2)+str$(fi+vo+do*128):a$(4)="103 ":a$(5)="104 "
  101. 609 a$(3)="102 s=54272:fori=0to24:readd:pokes+i,d:nexti"
  102. 610 ifki(1)>15thena$(4)=a$(4)+"poke"+str$(ko(1))+","+str$(ki(1)+1)
  103. 611 ifki(2)>15thena$(4)=a$(4)+":poke"+str$(ko(2))+","+str$(ki(2)+1)
  104. 612 ifki(3)>15thena$(4)=a$(4)+":poke"+str$(ko(3))+","+str$(ki(3)+1)
  105. 613 a$(4)=a$(4)+":fori=1to1000:nexti"
  106. 614 ifki(1)>15thena$(5)=a$(5)+"poke"+str$(ko(1))+","+str$(ki(1))
  107. 615 ifki(2)>15thena$(5)=a$(5)+":poke"+str$(ko(2))+","+str$(ki(2))
  108. 616 ifki(3)>15thena$(5)=a$(5)+":poke"+str$(ko(3))+","+str$(ki(3))
  109. 617 print"[147]";"new":printa$(1):printa$(2):printa$(3):printa$(4):printa$(5)
  110. 619 poke631,19:fori=1to6:poke631+i,13:nexti:poke198,7:poke53269,0:end
  111. 620 fori=1to3:kr=ra(i)+re(i)+sa(i)+dr(i):ifkr>0thenpokeko(i),kr+ri(i)+sc(i)+1
  112. 621 nexti:wait56320,16,239:fori=1to3:kr=ra(i)+re(i)+sa(i)+dr(i)+ri(i)+sc(i)
  113. 622 pokeko(i),kr:nexti:return
  114. 650 x=mx(m):y=my(m):va=1024+x+(y-int(w/2))*40
  115. 651 j=fnjy(jo)
  116. 652 if(j<9)or(j=18)thenreturn
  117. 655 ifj=10 thenifw<15thenw=w+1
  118. 656 ifj=14 thenifw> 0thenw=w-1
  119. 660 if fn od(w)=1thenp=197
  120. 661 if fn od(w)=0thenp=210
  121. 665 v2=va:va=1024+x+(y-int(w/2))*40:pokeva,p:ifv2<>vathenpokev2,160
  122. 669 goto651
  123. 750 x=mx(m):y=my(m):va=1024+x+(y-kr)*40:p=192
  124. 751 j=fnjy(jo)
  125. 752 if(j<9)or(j=18)thengosub770:return
  126. 755 ifj=10 thenifkr<4thenkr=kr+1
  127. 756 ifj=14 thenifkr>0thenkr=kr-1
  128. 765 v2=va:va=1024+x+(y-kr)*40:pokeva,p:ifv2<>vathenpokev2,160
  129. 769 goto751
  130. 770 ra(v)=0:re(v)=0:sa(v)=0:dr(v)=0:ki(v)=kr
  131. 771 ifkr=1thenra(v)=128:kr=128
  132. 772 ifkr=2thenre(v)=64 :kr= 64
  133. 773 ifkr=3thensa(v)=32 :kr= 32
  134. 774 ifkr=4thendr(v)=16 :kr= 16
  135. 775 return
  136. 800 x=mx(m):y=my(m):va=1024+x+(y-kr)*40:p=192
  137. 801 j=fnjy(jo)
  138. 802 if(j<9)or(j=18)thengosub820:return
  139. 805 ifj=10 thenifkr<4thenkr=kr+1
  140. 806 ifj=14 thenifkr>0thenkr=kr-1
  141. 807 ifj=12 then do=0:poke53269,peek(53269)and 247
  142. 808 ifj=16 then do=1:poke53269,peek(53269)or 8
  143. 815 v2=va:va=1024+x+(y-kr)*40:pokeva,p:ifv2<>vathenpokev2,160
  144. 816 goto801
  145. 820 ra(v)=0:re(v)=0:sa(v)=0:dr(v)=0:ki(v)=kr
  146. 821 ifkr=1thenra(v)=128:kr=128
  147. 822 ifkr=2thenre(v)=64 :kr= 64
  148. 823 ifkr=3thensa(v)=32 :kr= 32
  149. 824 ifkr=4thendr(v)=16 :kr= 16
  150. 825 pokeml,vo+fi+do*128
  151. 826 return
  152. 850 x=mx(m):y=my(m):va=55296+x+y*40
  153. 851 j=fnjy(jo):f2=f
  154. 852 if(j<9)or(j=18)thenreturn
  155. 855 ifj=10 theniff<4thenf=f+1
  156. 856 ifj=14 theniff>1thenf=f-1
  157. 860 iff2=fthen851
  158. 862 iff=1thenfori=5to7:pokeva-i*40,7:next:fori=0to4:pokeva-i*40,0:next:fi=64
  159. 863 iff=1goto851
  160. 864 iff=2thenfori=0to2:pokeva-i*40,7:next:fori=3to7:pokeva-i*40,0:next:fi=16
  161. 865 iff=2goto851
  162. 866 iff=3thenfori=0to7:pokeva-i*40,0:next:fori=2to5:pokeva-i*40,7:next:fi=32
  163. 867 iff=3goto851
  164. 868 iff=4thenfori=0to7:pokeva-i*40,7:next:fori=2to5:pokeva-i*40,0:next:fi=80
  165. 869 goto851
  166. 950 x=mx(m):y=my(m):va=1024+x+y*40:p=189:v2=55296+x+y*40
  167. 951 j=fnjy(jo)
  168. 952 if(j<9)or(j=18)thenreturn
  169. 955 ifj=16 thenw=0
  170. 956 ifj=12 thenw=1
  171. 960 if w=1thenpokeva-4,160:pokeva-3,p  :pokev2,7
  172. 961 if w=0thenpokeva-4,p  :pokeva-3,160:pokev2,0
  173. 965 goto951
  174. 1000 x=mx(m):y=my(m):kf=0:ns=0:vs=0:b$="":va=1024+x+y*40
  175. 1001 fori=0to4+gv:pokeva+i,160:nexti
  176. 1010 geta$:ifa$=""goto1010
  177. 1011 a=asc(a$):if((a<48)or(a>57))and(a<>46)and(a<>13)and(a<>20)goto1010
  178. 1012 if(a<>13)goto1015
  179. 1013 if(kf=0)or((kf=1)and(ns<2))goto1010
  180. 1014 a=val(b$):return
  181. 1015 if(a<>20)goto1020
  182. 1016 if(vs>0)thenb$=left$(b$,len(b$)-1)
  183. 1017 if((kf=0)and(vs>0))thenvs=vs-1
  184. 1018 if((kf=1)and(ns=0))thenkf=0
  185. 1019 if((kf=1)and(ns>0))thenns=ns-1
  186. 1020 if((a=46)and(vs=0))or((a=46)and(kf=1))then1010
  187. 1021 b=((a>47)and(a<58)):if(a=46)thenkf=1
  188. 1022 if b and((vs=gv)and(kf=0))goto1010
  189. 1023 if b and(ns=2)goto1010
  190. 1024 if b and(kf=1)thenns=ns+1
  191. 1025 if b and(kf=0)thenvs=vs+1
  192. 1026 if((a<>20)and(a<>13))thenb$=b$+a$
  193. 1030 poke211,x:poke214,y:syscs:fori=1to(4+gv)-len(b$):print"[153] ";:nexti
  194. 1031 print"";b$:goto1010
  195. 1100 x=mx(m):y=my(m)
  196. 1101 j=fnjy(jo)
  197. 1102 if(j<9)or(j=18)thenreturn
  198. 1103 ifj=10 thenifv<3thenv=v+1
  199. 1104 ifj=14 thenifv>1thenv=v-1
  200. 1105 poke211,x:poke214,y:syscs:print"[153]";right$(str$(v),1):goto1101
  201. 1250 if fn od(w)=1thenp=197
  202. 1251 if fn od(w)=0thenp=210
  203. 1252 va=1024+mx(m)+(my(m)-int(w/2))*40:pokeva,p:return
  204. 1300 q=mx(m)+my(m)*40:ifw>0thenpoke55296+q,7:poke1020+q,160:poke1021+q,189
  205. 1301 ifw=0thenpoke55296+q,0:poke1020+q,189:poke1021+q,160
  206. 1302 return
  207. 60000 data 3,20,1,6,20,2,9,20,3,12,20,4,15,20,5,18,20,6,21,20,7
  208. 60001 data 16,3,8,16,7,9,33,3,10,31,15,11,31,18,12,31,21,13,20,7,14
  209. 60002 data 35,18,15,35,16,16,35,14,17
  210. 60003 data 13,11,12,0,15,17,16,0,14,10,9,0,0,0,0,0,4,2,3,0,6,8,7,0,5,1,18
  211. 60004 data 3,18,6,18,9,18,12,18,15,18,18,18,21,18,3,3,3,7,22,3
  212. 60005 data 29,15,29,18,29,21,25,11,36,21
  213.