home *** CD-ROM | disk | FTP | other *** search
/ Floppy Magazine 1986 #6 / Floppy_Magazine_86-6_1986_Megasystems_Oy_fi_Side_B.d64 / imuri.bas (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  6KB  |  205 lines

  1. 3 ifpeek(49152)=169andpeek(49662)=192then5
  2. 4 load"imuri.asm",8,1
  3. 5 dimni$(1000):poke650,128:poke53280,14:poke53281,6:print"[154]":goto500
  4. 10 open1,8,15,"i":open2,8,2,"#":sys49416:sys49280
  5. 15 s=1
  6. 20 print#1,"u1: 2  0  18"s
  7. 25 sys49152
  8. 30 t=peek(832):s=peek(833):ift<1ort>35then50
  9. 35 goto20
  10. 50 close2
  11. 55 m=(peek(253)+256*peek(254)-50944)/2:printm
  12. 60 print"[147]":poke251,1:sys49342
  13. 70 poke251,1:sys49446:print""
  14. 75 q=1:vq=1:pb=1:v=0:ifm=0orkp=1001thenkp=kp-1:goto500
  15. 80 print"":poke251,pb:sys49342
  16. 82 poke252,peek(646):poke251,vq:sys49494
  17. 85 poke251,pb:sys49444
  18. 90 poke252,0:poke251,q:sys49494:vq=q
  19. 100 geta$:ifa$=""then100
  20. 105 ifa$=""andq+pb<mthenq=q+2
  21. 110 ifa$="[145]"and(q>2orpb>1)thenq=q-2
  22. 115 ifa$=""andq+pb-1<mthenq=q+1
  23. 120 ifa$="[157]"and(q>1orpb>1)thenq=q-1
  24. 125 ifq>32thenq=q-2:pb=pb+2:goto80
  25. 127 ifq<1thenpb=pb-2:q=q+2:goto80
  26. 128 ifq<>vqthen82
  27. 130 ifa$=" "thenpoke50686+q+pb,-(peek(50686+q+pb)=0):v=v+2*peek(50686+q+pb)-1:goto85
  28. 132 ifa$="[136]"andv>0then200
  29. 134 ifa$="[133]"thenkp=kp-1:goto500
  30. 150 goto100
  31. 200 yp=0:poke252,peek(646):poke251,q:sys49494
  32. 202 forn=50944to50944+m*2step2:yp=yp+peek(n/2+25216)*(peek(n)+256*peek(n+1)):next
  33. 205 n=0
  34. 207 ifpeek(50688+n)=0andn<m+2thenn=n+1:goto207
  35. 210 ni$="":forz=51200+16*nto51215+16*n:ni$=ni$+chr$(peek(z)):next
  36. 212 ni$=ni$+di$:yp$=mid$(str$(yp),2):iflen(yp$)>5thenyp$=right$(yp$,5)
  37. 214 iflen(yp$)<5thenyp$=" "+yp$:goto214
  38. 215 ni$(kp)=ni$+yp$:sys49696:kp=kp+1:m=m-v:goto75
  39. 230 print"[147] [204]aita imuroitava diski asemaan !"
  40. 232 print" [203]irjoita sen j[lkeen t[h[n diskin"
  41. 234 print" numero ja puoli (esim 15[193] tai 15a)"
  42. 235 input" ";di$:iflen(di$)>3then230
  43. 237 iflen(di$)<3thendi$="0"+di$:goto237
  44. 240 ifright$(di$,1)="a"thendi$=left$(di$,2)+"[193]"
  45. 242 ifright$(di$,1)="b"thendi$=left$(di$,2)+"[194]"
  46. 245 ifright$(di$,1)<>"[194]"andright$(di$,1)<>"[193]"then230
  47. 247 ifval(left$(di$,2))<1then230
  48. 250 kp=kp+1:goto10
  49. 260 print"[147] [193]akkostus diskien/nimien mukaan ? (d/n)"
  50. 265 geta$:ifa$<>"d"anda$<>"n"then265
  51. 275 print"[147] [193]akkostan tietoja. [207]dota."
  52. 277 ifa$="d"then880
  53. 280 forn=1tokp-1:b$=ni$(n):a=n:print""n"[157] ->"kp-1:form=n+1tokp
  54. 282 ifb$>ni$(m)thenb$=ni$(m):a=m
  55. 285 next:ni$(a)=ni$(n):ni$(n)=b$:next:goto500
  56. 300 print"[147] [205]ink[ nimisen tiedoston teet":print" ";
  57. 305 inputni$:iflen(ni$)=0orni$=chr$(160)then500
  58. 310 ni$="@:"+ni$+",s,w"
  59. 315 open1,8,15,"i":open2,8,2,ni$
  60. 320 input#1,a,b$,c,d:ifa<20then323
  61. 322 print""b$:poke198,0:wait198,1:goto500
  62. 323 poke53265,11:print#1,"ui-"
  63. 325 print#2,kp
  64. 330 forn=1tokp:print#2,ni$(n):next
  65. 332 print#1,"ui+":poke53265,27
  66. 335 input#1,a,b$,c,d:ifa>19then322
  67. 340 close1:close2:goto500
  68. 350 print"[147] [205]ink[ nimisen tiedoston lataat":print" ";
  69. 355 inputni$:iflen(ni$)=0orni$=chr$(160)then500
  70. 360 ni$=ni$+",s,r"
  71. 365 open1,8,15,"i":open2,8,2,ni$
  72. 370 input#1,a,b$,c,d:ifa<20then373
  73. 372 print"[147]"b$:poke198,0:wait198,1:goto500
  74. 373 poke53265,11:print#1,"ui-"
  75. 375 input#2,kp
  76. 380 forn=1tokp:input#2,ni$(n):next
  77. 382 print#1,"ui+":poke53265,27
  78. 385 input#1,a,b$,c,d:ifa>19then372
  79. 390 close1:close2:goto500
  80. 400 print"[147] [200]aettavan tiedoston nimi tai alku-"
  81. 405 print" kirjaimet";:inputni$
  82. 410 iflen(ni$)<1orlen(ni$)>16then500
  83. 412 n=1:m=len(ni$)
  84. 415 ifni$=left$(ni$(n),m)then430
  85. 420 n=n+1:ifn<=kpthen415
  86. 425 goto500
  87. 430 print" [206]imi   ";left$(ni$(n),16)
  88. 432 print" [196]iski  ";mid$(ni$(n),17,3)
  89. 435 print" [208]ituus ";right$(ni$(n),5)
  90. 440 poke198,0:poke204,0:wait198,1:poke204,1:goto420
  91. 500 close1:close2:print"[147]   [214][193][204][201][212][211][197][160][212][207][201][205][201][206][212][207]"
  92. 505 print"[193] - [212]ietojen imurointi"
  93. 510 print"[194] - [212]ietojen aakkostus"
  94. 515 print"[195] - [212]ietojen tulostus"
  95. 520 print"[196] - [212]ietojen korjaus"
  96. 525 print"[197] - [212]ietojen tallennus"
  97. 530 print"[198] - [212]ietojen lataus"
  98. 535 print"[199] - [212]iedoston etsiminen"
  99. 537 print"[200] - [196]isketin poistaminen"
  100. 550 poke198,0:wait198,1:geta$
  101. 555 ifa$="a"then230
  102. 557 ifa$="b"andkp>1then260
  103. 560 ifa$="e"andkp>0then300
  104. 565 ifa$="f"then350
  105. 567 ifa$="g"andkp>0then400
  106. 570 ifa$="c"andkp>0then600
  107. 575 ifa$="d"andkp>0then700
  108. 577 ifa$="h"andkp>0then820
  109. 590 goto550
  110. 600 print"[147] [205]ink[ diskin tulostat";:inputni$
  111. 601 iflen(ni$)=0then500
  112. 602 ifni$="kaikki"then660
  113. 603 di$=ni$:gosub900:iflen(di$)=3thenni$=di$:q=3:goto615
  114. 604 iflen(ni$)>2then600
  115. 605 ifval(ni$)<1then600
  116. 606 iflen(ni$)<2thenni$="0"+ni$
  117. 607 ifval(left$(ni$,1))=0andleft$(ni$,1)<>"0"then600
  118. 608 q=2
  119. 615 print" [208]ritterille vai n[ytt\\n ? (p/n)"
  120. 617 geta$:ifa$<>"p"anda$<>"n"then617
  121. 620 n=4:ifa$="n"thenn=3
  122. 625 open2,n,7
  123. 630 print"[147]"
  124. 640 m=1:forn=1tokp:ifmid$(ni$(n),17,q)<>ni$then655
  125. 645 print#2,right$("   "+str$(m),5);". ";left$(ni$(n),16);
  126. 650 print#2,"    ";mid$(ni$(n),17,3);"   ";right$(ni$(n),5);"  ";:m=m+1
  127. 655 nextn:ifa$="n"thenprint"ready.":poke198,0:wait198,1
  128. 657 print#2:goto500
  129. 660 print" [208]ritterille vai n[ytt\\n ? (p/n)"
  130. 662 geta$:ifa$<>"p"anda$<>"n"then662
  131. 664 ifa$="p"then800
  132. 666 print"[147]"
  133. 668 forn=1tokp
  134. 670 printright$("   "+str$(n),5);". ";left$(ni$(n),16);
  135. 672 print"    ";mid$(ni$(n),17,3);"   ";right$(ni$(n),5);"  ";
  136. 675 ifn/20=int(n/20)thenpoke198,0:wait198,1:print
  137. 680 nextn:print"ready.":poke198,0:wait198,1
  138. 685 goto500
  139. 700 forn=1tokp
  140. 702 print"[147] [206]imi   ";left$(ni$(n),16)
  141. 704 print" [196]iski  ";mid$(ni$(n),17,3)
  142. 706 print" [208]ituus ";right$(ni$(n),5)
  143. 710 print" [203]orjattavaa (ret/k)"
  144. 712 geta$:ifa$<>"k"anda$<>chr$(13)anda$<>"_"then712
  145. 713 ifa$="_"andn=1thenn=kp-1:goto765
  146. 714 ifa$="_"thenn=n-2:goto765
  147. 715 ifa$=chr$(13)then765
  148. 717 ni$="":input " [213]usi nimi";ni$:ifni$=""then725
  149. 718 ifni$=" "orni$=chr$(160)then725
  150. 719 iflen(ni$)>16thenni$=left$(ni$,16)
  151. 721 iflen(ni$)<16thenni$=ni$+chr$(160):goto721
  152. 723 ni$(n)=ni$+right$(ni$(n),8)
  153. 725 ni$="":input " [213]usi diski";ni$:ifni$=""then750
  154. 727 ifni$=" "orni$=chr$(160)then750
  155. 731 iflen(ni$)>3then725
  156. 733 iflen(ni$)<3thenni$="0"+ni$:goto733
  157. 735 ifright$(ni$,1)="a"thenni$=left$(ni$,2)+"[193]"
  158. 737 ifright$(ni$,1)="b"thenni$=left$(ni$,2)+"[194]"
  159. 739 ifright$(ni$,1)<>"[194]"andright$(ni$,1)<>"[193]"then725
  160. 741 ifval(left$(ni$,2))<1then725
  161. 745 ni$(n)=left$(ni$(n),16)+ni$+right$(ni$(n),5)
  162. 750 ni$="":input " uusi pituus";ni$:ifni$=""then765
  163. 751 ifni$=" "orni$=chr$(160)then765
  164. 752 ifval(ni$)=0then750
  165. 754 iflen(ni$)>5thenni$=right$(ni$,5)
  166. 756 iflen(ni$)<5thenni$=" "+ni$:goto756
  167. 760 ni$(n)=left$(ni$(n),19)+ni$
  168. 765 nextn:goto500
  169. 800 q=int(kp/2+.5):vq=int(kp/2)
  170. 805 open2,4,7:forn=1toq
  171. 810 print#2,right$("   "+str$(n),5);". ";left$(ni$(n),16);
  172. 812 print#2,"    ";mid$(ni$(n),17,3);"   ";right$(ni$(n),5);"  ";
  173. 814 ifn=>qandq<>vqthen817
  174. 815 print#2,right$("   "+str$(n+q),5);". ";left$(ni$(n+q),16);
  175. 816 print#2,"    ";mid$(ni$(n+q),17,3);"   ";right$(ni$(n+q),5);"  ";
  176. 817 nextn:print#2:goto500
  177. 820 print"[147] [205]ink[ diskin poistat";
  178. 822 inputdi$:iflen(di$)>3then820
  179. 823 ifval(right$(di$,1))>0orright$(di$,1)="0"then850
  180. 833 iflen(di$)<3thendi$="0"+di$:goto823
  181. 834 ifright$(di$,1)="a"thendi$=left$(di$,2)+"[193]"
  182. 835 ifright$(di$,1)="b"thendi$=left$(di$,2)+"[194]"
  183. 836 ifright$(di$,1)<>"[194]"andright$(di$,1)<>"[193]"then820
  184. 837 ifval(left$(di$,2))<1then820
  185. 840 n=1
  186. 841 ifmid$(ni$(kp),17,3)=di$thenkp=kp-1:goto841
  187. 842 ifmid$(ni$(n),17,3)=di$thena$=ni$(n):ni$(n)=ni$(kp):ni$(kp)=a$:kp=kp-1
  188. 844 n=n+1:ifn<=kpthen842
  189. 846 goto500
  190. 850 iflen(di$)=1thendi$="0"+di$
  191. 860 n=1
  192. 861 ifmid$(ni$(kp),17,2)=di$thenkp=kp-1:goto861
  193. 862 ifmid$(ni$(n),17,2)=di$thena$=ni$(n):ni$(n)=ni$(kp):ni$(kp)=a$:kp=kp-1
  194. 864 n=n+1:ifn<=kpthen862
  195. 866 goto500
  196. 880 forn=1tokp-1:b$=mid$(ni$(n),17,3)+ni$(n):a=n:print""n"[157] ->"kp-1:form=n+1tokp
  197. 882 ifb$>mid$(ni$(m),17,3)+ni$(m)thenb$=mid$(ni$(m),17,3)+ni$(m):a=m
  198. 885 next:ni$(a)=ni$(n):ni$(n)=mid$(b$,4):next:goto500
  199. 900 iflen(di$)<3thendi$="0"+di$:goto900
  200. 902 ifright$(di$,1)="a"thendi$=left$(di$,2)+"[193]"
  201. 904 ifright$(di$,1)="b"thendi$=left$(di$,2)+"[194]"
  202. 906 ifright$(di$,1)<>"[194]"andright$(di$,1)<>"[193]"thendi$="":return
  203. 908 ifval(left$(di$,2))<1thendi$="":return
  204. 910 return
  205.