home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 195 / 195.d81 / b.tyb-64 (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  314 lines

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