home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 195
/
195.d81
/
b.tyb-64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
314 lines
4 poke56,102:clr:printchr$(142)
5 ifpeek(49182)=203then60
6 poke53281,0:poke53280,0:print"[147]"
7 cd=peek(186):sys57812"screen",cd,0:poke780,0:poke781,0:poke782,4:sys65493
9 forx=55296to56319:pokex,7:next
55 sys57812"binc000",cd,0:poke780,0:poke781,0:poke782,192:sys65493
60 poke53280,7:poke53281,7:poke646,0
61 pk=12*4096:pv=pk+30:syspk:cd=0
69 dimt,r,b,i,a$,c,dt$,fl$,il$,x,x$,xx$,g,z$,c$,m$,xx,fc,f,mf,mc,dv,bl,dc,bh,gg
70 dims,t$,db,dp,d$,sz,q$,ma,ca,cc,cm,j,h,m1,c1
71 cm$="dmftc+-q "+chr$(13)+chr$(145)+chr$(17)+chr$(157)+chr$(29)+chr$(19)
72 cm$=cm$+chr$(147)+"/rnx"+chr$(92)
75 dl=-1:cf=-1:me=0
80 dimdi$(1,30),cl(30),sz(30),dp(30),cn$(30)
100 fl$=""
110 il$=fl$:fori=1to18:il$=il$+chr$(17):next
120 goto500
140 ifcm<>1thenprint"[147]ms-dos device number not allocated":goto2030
141 print"loading ms-dos directory...":print:open15,dv,15:print#15,"uj":close15
150 m1=1:syspk:syspk+3:forx=1to30:di$(0,x)="":next
170 dl=0:bl=peek(52048):bh=peek(52050):s=peek(52051):ifpeek(52049)>0thendc=1
180 if(sand1)thengosub380:dl=-1:return
190 print"scanning ms-dos directory...":print
200 db=bl+256*bh
205 syspk+21:bl=peek(52048):x=peek(52049):bh=peek(52050)
206 ma=bl+bh*256+x*65536
210 ifdc=0then360
220 fordp=dbto27135step32
230 ifpeek(dp)=0orpeek(dp)=229then345
240 ifpeek(dp+11)and24then345
250 dl=dl+1:ifdl>30thendl=30:dp=db:goto360
260 d$=right$(" "+str$(dl),3)+" bin prg "
270 a$="":fori=0to10:a$=a$+chr$(peek(dp+i)):next
277 a$=left$(a$,8)+" "+right$(a$,3)
290 printdl;a$
300 d$=d$+a$+" "
310 cl(dl)=peek(dp+26)+256*peek(dp+27)
320 sz=peek(dp+28)+256*peek(dp+29)+65536*peek(dp+30)
330 di$(0,dl)=d$+right$(" "+str$(sz),6)
335 dp(dl)=dp
340 sz(dl)=sz
345 ifdb>27135thendp=db:goto360
350 nextdp
360 sys46374:return
380 e=peek(pv+2)
381 printchr$(18);"[144]ms-dos disk error #";mid$(str$(e),2)
383 ife=0thenprint"** disk full?? **"
385 poke49184,0
390 print"type a key[146]":gosub5000:return
420 print"[147]";
421 ifme=0thenprint"ms-dos";
422 ifme<>0thenprint"cbmdos";
423 print"[146]";" ms=";mid$(str$(dv),2);
430 print" cbm=";mid$(str$(cd),2);
435 ifme=0thenprint" fre="ma
436 ifme<>0thenprint" fre="ca
440 return
460 printil$;"d=dir m=msdev f=cbmdev c=copy q=quit "
470 print "t=toggle r=remove x=cbmcpy /=menu +-=pg";
480 return
500 t=1:c=0:r=0
510 ifme=0thenmf=dl:mc=2
515 ifme<>0thenmf=cf:mc=1
520 gosub420
521 ifme<>0then542
530 print"num s trn typ filename ext length"
540 print"--- - --- --- -------- --- ------"
541 goto550
542 print"num s trn filename t length"
543 print"--- - --- ---------------- - ------"
550 gosub460
560 b=t+16:ifb>mfthenb=mf
575 printfl$;:ift>mfthen590
580 fori=ttob:printdi$(me,i):next
590 ifmf<0thenprint"<directory not loaded>[146]";
591 ifmf=0thenprint"<no files>[146]"
600 ifmf<=0then660
610 printleft$(il$,r+5);chr$(18);
620 onc+1goto630,640,650
630 printspc(4);mid$(di$(me,t+r),5,3):goto660
640 printspc(7);mid$(di$(me,t+r),8,5):goto660
650 printspc(12);mid$(di$(me,t+r),13,5):goto660
660 geta$:ifa$=""then660
670 forg=1tolen(cm$):ifa$=mid$(cm$,g,1)theni=g
675 next
680 ifmf>0thenprintleft$(il$,r+5);di$(me,t+r)
690 ifi=0then600
700 onigoto760,1050,1110,950,1150,1000,1020,730,860,860,770,790,810,830,850
705 oni-15goto500,713,1400,713,1499,713
710 stop
713 me=-(me=0)
714 goto500
730 close5:close15:print"[147]thanks craig bruce!!":print:print:poke186,cd
740 print:print"adapted for the c64 from":print"little red reader[146] for the c128"
741 print"by craig bruce":print
742 print"adaption by":print"doreen horne":print"brisbane, australia"
743 :print:print"august 2000":end
760 ifme=1andc1thensys46374
761 ifme=1thengosub420:gosub2499:goto500
762 ifme=0andm1thensys46374
765 gosub420:gosub140:goto500
770 r=r-1:ifr<0thenr=b-t
780 goto600
790 r=r+1:ift+r>bthenr=0
800 goto 600
810 c=c-1:ifc<0thenc=mc
820 goto600
830 c=c+1:ifc>mcthenc=0
840 goto600
850 r=0:c=0:goto600
860 ifmf<=0then600
870 x=t+r:onc+1gosub890,910,930
880 printleft$(il$,r+5);di$(me,x):goto600
890 ifmid$(di$(me,x),6,1)=" "thenx$="*"
895 ifmid$(di$(me,x),6,1)<>" "thenx$=" "
896 l=len(di$(me,x))
897 l$=left$(di$(me,x),5)+x$+right$(di$(me,x),l-6)
900 di$(me,x)=l$:return
910 ifmid$(di$(me,x),9,1)="a"thenx$="bin"
915 ifmid$(di$(me,x),9,1)<>"a"thenx$="asc"
916 l=len(di$(me,x))
917 l$=left$(di$(me,x),8)+x$+right$(di$(me,x),l-11)
920 di$(me,x)=l$:return
930 ifmid$(di$(me,x),14,1)="s"thenx$="prg"
935 ifmid$(di$(me,x),14,1)<>"s"thenx$="seq"
936 l=len(di$(me,x))
937 l$=left$(di$(me,x),13)+x$+right$(di$(me,x),l-16)
940 di$(me,x)=l$:return
950 ifmf<=0then600
960 forx=1tomf
970 onc+1gosub890,910,930
980 nextx
990 goto520
1000 r=0:ifb=mfthent=1:goto510
1010 t=t+17:goto510
1020 ifmf<=0then660
1025 r=0:ift=1thent=mf-(mf-int(mf/17)*17)+1:ift<=mfthen510
1030 t=t-17:ift<1thent=1
1040 goto510
1050 printil$;:print" "
1052 print" "
1060 printil$;:print"ms-dos device number (8-30) ";:input"[157][157][157][157]";dv
1062 ifcd=dvthenprint"ms-dos & cbm-dos devices must differ":gosub5000:goto1050
1090 pokepv+3,dv:pokepv+4,dt:syspk:dl=-1
1100 cm=1:goto500
1110 printil$;:print" "
1115 print" "
1120 printil$;:print"cbm-dos device number (0-30) ";:input"[157][157][157][157]";cd
1130 ifcd=dvthenprint"ms-dos & cbm-dos devices must differ":gosub5000:goto1110
1140 cf=-1:cc=1:close5:open5,cd,15:goto500
1150 ifcc<>1thenprint"[147]cbm device number not all0cated":goto2030
1151 ifme=1then2000
1152 print"[147]copy ms-dos -> cbm-dos":print:print
1160 ifdl<=0thenfc=0:goto1190
1170 fc=0:forf=1todl:ifmid$(di$(0,f),6,1)="*"thengosub1200
1180 nextf
1190 print:print"files copied =";fc;" - type key":gosub5000
1191 print"[147]to view the files copied to the cbm directory, use '/' then
1192 [153]"'dir' again.":[153]:[153]"type a key":[141]5000:[137]520
1200 fc[178]fc[170]1
1210 x$[178][202](di$(0,f),19,8)[170]"."[170][202](di$(0,f),29,3)
1220 cf$[178]"":[129]i[178]1[164][195](x$):[139][202](x$,i,1)[179][177]" "[167]cf$[178]cf$[170][202](x$,i,1)
1230 [130]
1231 [139][201](cf$,1)[178]"."[167]cf$[178][200](cf$,[195](cf$)[171]1)
1232 cf$[178]cf$[170]","[170][202](di$(0,f),14,1)
1240 [153][196](fc);". ";[199](34);cf$;[199](34);[163]20);sz(f)"bytes";
1245 [153][163]35);[202](di$(0,f),9,3)
1250 cl[178]cl(f):lb[178]sz(f)[171][181](sz(f)[173]65536)[172]65536
1254 a$[178]"":x[178][195](cf$):[129]i[178]1[164]x
1255 a$[178]a$[170][202](cf$,i,1)
1256 [139][198]([202](cf$,i,1))[178]126[167]a$[178][200](cf$,i[171]1):a$[178]a$[170][199](32)[170][201](cf$,x[171]i):i[178]x:[137]1258
1257 [130]
1258 cf$[178]a$
1260 [159]1,cd,7,(cf$)[170]",w"
1270 [141]3050:[139]ds[179]20[175]ds[179][177]63[167]1320
1271 [139]ds[177]19[175]ds[179][177]63[167]1310
1275 [153]"cbm file exists; overwrite (y/n)";
1280 [160]1:[133]x$:[139]x$[178]"n"[167]fc[178]fc[171]1:[142]
1285 [152]5,"s0:"cf$
1286 [159]1,cd,7,(cf$)[170]",w"
1300 [141]3050:[139]ds[179]20[167]1320
1310 [153]"cbm disk error: "[170]ds$:fc[178]fc[171]1:[160]1:[142]
1320 [151]pv[170]6,cl[173]256:[151]pv[170]5,cl[171][194](pv[170]6)[172]256
1330 [151]pv[170]8,lb[173]256:[151]pv[170]7,lb[171][194](pv[170]8)[172]256
1340 tr[178]0:[139][202](di$(0,f),9,1)[178]"a"[167]tr[178]255
1350 [151]182,tr:[158]pk[170]6
1355 s[178][194](52051)
1357 [139](s[175]1)[167][141]380:fc[178]fc[171]1
1370 [141]3050:[139]ds[177]19[167]1310
1380 [160]1:[142]
1400 [153]"loadremove (delete) selected ms-dos files:":[153]
1401 [139]me[179][177]0[167][153]"ms-dos menu must be selected!":[137]2030
1402 [153]"deletion irreversible":[133]"continue (y/n)";a$
1403 [153]:[139]a$[179][177]"y"[167]520
1410 [139]dl[179][178]0[167]fc[178]0:[137]1440
1420 fc[178]0:f[178]1:[158]52736
1425 [139][202](di$(0,f),6,1)[178]"*"[167][141]1470:fc[178]fc[170]1:f[178]f[171]1
1430 f[178]f[170]1:[139]f[179][178]dl[167]1425
1434 [129]g[178]49227[164]49229:[151]g,255:[130]:[153]"flushing...":[158]pk[170]12
1440 [153]:[153]"files removed =";fc
1445 [158]pk[170]21:a[178][194](52048):x[178][194](52049):y[178][194](52050)
1446 ma[178]a[170]y[172]256[170]x[172]65536
1448 [153]"type a key":[141]5000:[137]500
1470 [153]"removing ";[199](34);[202](di$(0,f),19,13);[19