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 >
Wrap
Commodore BASIC
|
2023-02-26
|
6KB
|
205 lines
3 ifpeek(49152)=169andpeek(49662)=192then5
4 load"imuri.asm",8,1
5 dimni$(1000):poke650,128:poke53280,14:poke53281,6:print"[154]":goto500
10 open1,8,15,"i":open2,8,2,"#":sys49416:sys49280
15 s=1
20 print#1,"u1: 2 0 18"s
25 sys49152
30 t=peek(832):s=peek(833):ift<1ort>35then50
35 goto20
50 close2
55 m=(peek(253)+256*peek(254)-50944)/2:printm
60 print"[147]":poke251,1:sys49342
70 poke251,1:sys49446:print""
75 q=1:vq=1:pb=1:v=0:ifm=0orkp=1001thenkp=kp-1:goto500
80 print"":poke251,pb:sys49342
82 poke252,peek(646):poke251,vq:sys49494
85 poke251,pb:sys49444
90 poke252,0:poke251,q:sys49494:vq=q
100 geta$:ifa$=""then100
105 ifa$=""andq+pb<mthenq=q+2
110 ifa$="[145]"and(q>2orpb>1)thenq=q-2
115 ifa$=""andq+pb-1<mthenq=q+1
120 ifa$="[157]"and(q>1orpb>1)thenq=q-1
125 ifq>32thenq=q-2:pb=pb+2:goto80
127 ifq<1thenpb=pb-2:q=q+2:goto80
128 ifq<>vqthen82
130 ifa$=" "thenpoke50686+q+pb,-(peek(50686+q+pb)=0):v=v+2*peek(50686+q+pb)-1:goto85
132 ifa$="[136]"andv>0then200
134 ifa$="[133]"thenkp=kp-1:goto500
150 goto100
200 yp=0:poke252,peek(646):poke251,q:sys49494
202 forn=50944to50944+m*2step2:yp=yp+peek(n/2+25216)*(peek(n)+256*peek(n+1)):next
205 n=0
207 ifpeek(50688+n)=0andn<m+2thenn=n+1:goto207
210 ni$="":forz=51200+16*nto51215+16*n:ni$=ni$+chr$(peek(z)):next
212 ni$=ni$+di$:yp$=mid$(str$(yp),2):iflen(yp$)>5thenyp$=right$(yp$,5)
214 iflen(yp$)<5thenyp$=" "+yp$:goto214
215 ni$(kp)=ni$+yp$:sys49696:kp=kp+1:m=m-v:goto75
230 print"[147] [204]aita imuroitava diski asemaan !"
232 print" [203]irjoita sen j[lkeen t[h[n diskin"
234 print" numero ja puoli (esim 15[193] tai 15a)"
235 input" ";di$:iflen(di$)>3then230
237 iflen(di$)<3thendi$="0"+di$:goto237
240 ifright$(di$,1)="a"thendi$=left$(di$,2)+"[193]"
242 ifright$(di$,1)="b"thendi$=left$(di$,2)+"[194]"
245 ifright$(di$,1)<>"[194]"andright$(di$,1)<>"[193]"then230
247 ifval(left$(di$,2))<1then230
250 kp=kp+1:goto10
260 print"[147] [193]akkostus diskien/nimien mukaan ? (d/n)"
265 geta$:ifa$<>"d"anda$<>"n"then265
275 print"[147] [193]akkostan tietoja. [207]dota."
277 ifa$="d"then880
280 forn=1tokp-1:b$=ni$(n):a=n:print""n"[157] ->"kp-1:form=n+1tokp
282 ifb$>ni$(m)thenb$=ni$(m):a=m
285 next:ni$(a)=ni$(n):ni$(n)=b$:next:goto500
300 print"[147] [205]ink[ nimisen tiedoston teet":print" ";
305 inputni$:iflen(ni$)=0orni$=chr$(160)then500
310 ni$="@:"+ni$+",s,w"
315 open1,8,15,"i":open2,8,2,ni$
320 input#1,a,b$,c,d:ifa<20then323
322 print""b$:poke198,0:wait198,1:goto500
323 poke53265,11:print#1,"ui-"
325 print#2,kp
330 forn=1tokp:print#2,ni$(n):next
332 print#1,"ui+":poke53265,27
335 input#1,a,b$,c,d:ifa>19then322
340 close1:close2:goto500
350 print"[147] [205]ink[ nimisen tiedoston lataat":print" ";
355 inputni$:iflen(ni$)=0orni$=chr$(160)then500
360 ni$=ni$+",s,r"
365 open1,8,15,"i":open2,8,2,ni$
370 input#1,a,b$,c,d:ifa<20then373
372 print"[147]"b$:poke198,0:wait198,1:goto500
373 poke53265,11:print#1,"ui-"
375 input#2,kp
380 forn=1tokp:input#2,ni$(n):next
382 print#1,"ui+":poke53265,27
385 input#1,a,b$,c,d:ifa>19then372
390 close1:close2:goto500
400 print"[147] [200]aettavan tiedoston nimi tai alku-"
405 print" kirjaimet";:inputni$
410 iflen(ni$)<1orlen(ni$)>16then500
412 n=1:m=len(ni$)
415 ifni$=left$(ni$(n),m)then430
420 n=n+1:ifn<=kpthen415
425 goto500
430 print" [206]imi ";left$(ni$(n),16)
432 print" [196]iski ";mid$(ni$(n),17,3)
435 print" [208]ituus ";right$(ni$(n),5)
440 poke198,0:poke204,0:wait198,1:poke204,1:goto420
500 close1:close2:print"[147] [214][193][204][201][212][211][197][160][212][207][201][205][201][206][212][207]"
505 print"[193] - [212]ietojen imurointi"
510 print"[194] - [212]ietojen aakkostus"
515 print"[195] - [212]ietojen tulostus"
520 print"[196] - [212]ietojen korjaus"
525 print"[197] - [212]ietojen tallennus"
530 print"[198] - [212]ietojen lataus"
535 print"[199] - [212]iedoston etsiminen"
537 print"[200] - [196]isketin poistaminen"
550 poke198,0:wait198,1:geta$
555 ifa$="a"then230
557 ifa$="b"andkp>1then260
560 ifa$="e"andkp>0then300
565 ifa$="f"then350
567 ifa$="g"andkp>0then400
570 ifa$="c"andkp>0then600
575 ifa$="d"andkp>0then700
577 ifa$="h"andkp>0then820
590 goto550
600 print"[147] [205]ink[ diskin tulostat";:inputni$
601 iflen(ni$)=0then500
602 ifni$="kaikki"then660
603 di$=ni$:gosub900:iflen(di$)=3thenni$=di$:q=3:goto615
604 iflen(ni$)>2then600
605 ifval(ni$)<1then600
606 iflen(ni$)<2thenni$="0"+ni$
607 ifval(left$(ni$,1))=0andleft$(ni$,1)<>"0"then600
608 q=2
615 print" [208]ritterille vai n[ytt\\n ? (p/n)"
617 geta$:ifa$<>"p"anda$<>"n"then617
620 n=4:ifa$="n"thenn=3
625 open2,n,7
630 print"[147]"
640 m=1:forn=1tokp:ifmid$(ni$(n),17,q)<>ni$then655
645 print#2,right$(" "+str$(m),5);". ";left$(ni$(n),16);
650 print#2," ";mid$(ni$(n),17,3);" ";right$(ni$(n),5);" ";:m=m+1
655 nextn:ifa$="n"thenprint"ready.":poke198,0:wait198,1
657 print#2:goto500
660 print" [208]ritterille vai n[ytt\\n ? (p/n)"
662 geta$:ifa$<>"p"anda$<>"n"then662
664 ifa$="p"then800
666 print"[147]"
668 forn=1tokp
670 printright$(" "+str$(n),5);". ";left$(ni$(n),16);
672 print" ";mid$(ni$(n),17,3);" ";right$(ni$(n),5);" ";
675 ifn/20=int(n/20)thenpoke198,0:wait198,1:print
680 nextn:print"ready.":poke198,0:wait198,1
685 goto500
700 forn=1tokp
702 print"[147] [206]imi ";left$(ni$(n),16)
704 print" [196]iski ";mid$(ni$(n),17,3)
706 print" [208]ituus ";right$(ni$(n),5)
710 print" [203]orjattavaa (ret/k)"
712 geta$:ifa$<>"k"anda$<>chr$(13)anda$<>"_"then712
713 ifa$="_"andn=1thenn=kp-1:goto765
714 ifa$="_"thenn=n-2:goto765
715 ifa$=chr$(13)then765
717 ni$="":input " [213]usi nimi";ni$:ifni$=""then725
718 ifni$=" "orni$=chr$(160)then725
719 iflen(ni$)>16thenni$=left$(ni$,16)
721 iflen(ni$)<16thenni$=ni$+chr$(160):goto721
723 ni$(n)=ni$+right$(ni$(n),8)
725 ni$="":input " [213]usi diski";ni$:ifni$=""then750
727 ifni$=" "orni$=chr$(160)then750
731 iflen(ni$)>3then725
733 iflen(ni$)<3thenni$="0"+ni$:goto733
735 ifright$(ni$,1)="a"thenni$=left$(ni$,2)+"[193]"
737 ifright$(ni$,1)="b"thenni$=left$(ni$,2)+"[194]"
739 ifright$(ni$,1)<>"[194]"andright$(ni$,1)<>"[193]"then725
741 ifval(left$(ni$,2))<1then725
745 ni$(n)=left$(ni$(n),16)+ni$+right$(ni$(n),5)
750 ni$="":input " uusi pituus";ni$:ifni$=""then765
751 ifni$=" "orni$=chr$(160)then765
752 ifval(ni$)=0then750
754 iflen(ni$)>5thenni$=right$(ni$,5)
756 iflen(ni$)<5thenni$=" "+ni$:goto756
760 ni$(n)=left$(ni$(n),19)+ni$
765 nextn:goto500
800 q=int(kp/2+.5):vq=int(kp/2)
805 open2,4,7:forn=1toq
810 print#2,right$(" "+str$(n),5);". ";left$(ni$(n),16);
812 print#2," ";mid$(ni$(n),17,3);" ";right$(ni$(n),5);" ";
814 ifn=>qandq<>vqthen817
815 print#2,right$(" "+str$(n+q),5);". ";left$(ni$(n+q),16);
816 print#2," ";mid$(ni$(n+q),17,3);" ";right$(ni$(n+q),5);" ";
817 nextn:print#2:goto500
820 print"[147] [205]ink[ diskin poistat";
822 inputdi$:iflen(di$)>3then820
823 ifval(right$(di$,1))>0orright$(di$,1)="0"then850
833 iflen(di$)<3thendi$="0"+di$:goto823
834 ifright$(di$,1)="a"thendi$=left$(di$,2)+"[193]"
835 ifright$(di$,1)="b"thendi$=left$(di$,2)+"[194]"
836 ifright$(di$,1)<>"[194]"andright$(di$,1)<>"[193]"then820
837 ifval(left$(di$,2))<1then820
840 n=1
841 ifmid$(ni$(kp),17,3)=di$thenkp=kp-1:goto841
842 ifmid$(ni$(n),17,3)=di$thena$=ni$(n):ni$(n)=ni$(kp):ni$(kp)=a$:kp=kp-1
844 n=n+1:ifn<=kpthen842
846 goto500
850 iflen(di$)=1thendi$="0"+di$
860 n=1
861 ifmid$(ni$(kp),17,2)=di$thenkp=kp-1:goto861
862 ifmid$(ni$(n),17,2)=di$thena$=ni$(n):ni$(n)=ni$(kp):ni$(kp)=a$:kp=kp-1
864 n=n+1:ifn<=kpthen862
866 goto500
880 forn=1tokp-1:b$=mid$(ni$(n),17,3)+ni$(n):a=n:print""n"[157] ->"kp-1:form=n+1tokp
882 ifb$>mid$(ni$(m),17,3)+ni$(m)thenb$=mid$(ni$(m),17,3)+ni$(m):a=m
885 next:ni$(a)=ni$(n):ni$(n)=mid$(b$,4):next:goto500
900 iflen(di$)<3thendi$="0"+di$:goto900
902 ifright$(di$,1)="a"thendi$=left$(di$,2)+"[193]"
904 ifright$(di$,1)="b"thendi$=left$(di$,2)+"[194]"
906 ifright$(di$,1)<>"[194]"andright$(di$,1)<>"[193]"thendi$="":return
908 ifval(left$(di$,2))<1thendi$="":return
910 return