home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 195 / 195.d81 / b.tyb-64 (.txt) < prev    next >
Encoding:
Commodore BASIC  |  2000-01-01  |  9.4 KB  |  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);[199](34)
  205. 1490 [151]pv[170]10,dp(f)[173]256:[151]pv[170]9,dp(f)[171][194](pv[170]10)[172]256
  206. 1492 [158]pk[170]15
  207. 1494 di$(0,f)[178]di$(0,dl):sz(f)[178]sz(dl):dp(f)[178]dp(dl):cl(f)[178]cl(dl)
  208. 1495 dl[178]dl[171]1
  209. 1496 [142]
  210. 1499 [153]"loadcopy cbm-dos to cbm-dos:":[153]
  211. 1500 [139]cc[179][177]1[167][153]"loadsource cbm device number not all0cated":[137]2030
  212. 1501 [139]cf[179][178]0[167][153]"commodore directory not loaded":[137]2030
  213. 1502 x[178]0:[133]"device number to copy to";x:[153]
  214. 1503 [139]x[179]8[176]x[177]30[167][153]"bad device number!":[137]2030
  215. 1504 [139]x[178]cd[167][153]"cannot copy to same device":[137]2030
  216. 1505 [159]8,x,15
  217. 1506 [129]f[178]1[164]cf:[139][202](di$(1,f),6,1)[179][177]"*"[167]1570
  218. 1507 [153]di$(1,f):[159]1,cd,2,cn$(f)[170]",r":[141]3050:[139]ds[177]19[167]1530
  219. 1508 cf$[178]cn$(f)[170]","[170][202](di$(1,f),31,1)[170]",w"
  220. 1509 [159]2,x,3,cf$
  221. 1510 [141]3051:[139]ds[179]20[175]ds[179][177]63[167]1550
  222. 1511 [139]ds[177]19[175]ds[179][177]63[167]1530
  223. 1512 [133]"file exists: overwrite (y/n)";x$:[139]x$[179][177]"y"[167]1560
  224. 1520 [160]2:[152]8,"s0:"[170](cn$(f))
  225. 1525 [159]2,x,3,cf$:[141]3051:[139]ds[179]20[167]1550
  226. 1530 [153]"cbm dos error: ";ds$:[137]1560
  227. 1550 [158]pk[170]24
  228. 1555 [141]3050:[139]ds[177]19[167][153]"loaddisk error",ds$:[137]1560
  229. 1556 [141]3051:[139]ds[177]19[167][153]"loaddisk error",ds$
  230. 1560 [160]1:[160]2
  231. 1570 [130]f
  232. 1580 [153]"done - type a key":[160]8:[141]5000:[137]510
  233. 2000 [153]"loadcopy cbm-dos to ms-dos:":[153]:[153]
  234. 2010 [139]dl[177][178]0[167]2035
  235. 2020 [153]"ms-dos directory must be loaded first"
  236. 2030 [153]"type a key":[141]5000:[137]510
  237. 2035 fc[178]0
  238. 2036 [129]f[178]1[164]cf:[139][202](di$(1,f),6,1)[179][177]"*"[167]2045
  239. 2040 fc[178]fc[170]1:c$[178]cn$(f)
  240. 2041 [153][202]([196](fc),2);" ";[202](di$(1,f),14,16);[202](di$(1,f),34);":";
  241. 2042 [141]6000:[153]m$
  242. 2043 tr[178]0:[139][202](di$(1,f),9,1)[178]"a"[167]tr[178]255
  243. 2044 [158]46374:[141]2100
  244. 2045 [130]:[139]fc[178]0[167]2049
  245. 2046 [129]g[178]49227[164]49229:[151]g,255:[130]:[153]"flushing...":[158]pk[170]12
  246. 2047 [158]pk[170]21:a[178][194](52048):x[178][194](52049):y[178][194](52050)
  247. 2048 ma[178]a[170]y[172]256[170]x[172]65536
  248. 2049 [153]:[153]"files copied =";fc:[137]2030
  249. 2100 [153]"finding free ms-dos directory entry!":[158]52736:[129]i[178]0[164]30[171]1
  250. 2105 [129]dp[178]db[164]27135[169]32
  251. 2110 [139][194](dp)[178]0[176][194](dp)[178]229[167]2140
  252. 2120 [130]dp
  253. 2130 [153]"no free ms-dos directory entries":fc[178]fc[171]1:[142]
  254. 2140 [130]i
  255. 2160 [129]i[178]1[164][195](m$):[151]dp[170]i[171]1,[198]([202](m$,i,1))[175]127:[130]
  256. 2170 [129]i[178]11[164]31:[151]dp[170]i,0:[130]
  257. 2180 [151]dp[170]26,255:[151]dp[170]27,15
  258. 2190 [151]pv[170]10,dp[173]256:[151]pv[170]9,dp[171][194](pv[170]10)[172]256:[158]52773
  259. 2200 [153]"on copying!                            ":[159]1,cd,2,c$
  260. 2300 [151]182,tr:[158]pk[170]9:s[178][194](52051)
  261. 2301 [160]1
  262. 2305 [141]3050:[139]ds[177]19[167][153]"loadcbm disk error",ds$:fc[178]fc[171]1:[142]
  263. 2306 [139]s[175]1[167]fc[178]fc[171]1:[141]380:[142]
  264. 2310 [158]52736:x$[178]"     asc  seq  ":[139]tr[178]0[167]x$[178]"     bin  prg  "
  265. 2320 dl[178]dl[170]1:d$[178][201](" "[170][196](dl),3)[170]x$
  266. 2330 d$[178]d$[170][200](m$,8)[170]"  "[170][201](m$,3)
  267. 2340 cl(dl)[178][194](dp[170]26)[170]256[172][194](dp[170]27)
  268. 2350 sz[178][194](dp[170]28)[170]256[172][194](dp[170]29)[170]65536[172][194](dp[170]30)
  269. 2360 di$(0,dl)[178]d$[170][201]("        "[170][196](sz),8)
  270. 2370 dp(dl)[178]dp
  271. 2380 sz(dl)[178]sz
  272. 2395 [142]
  273. 2499 [158]46374:z$[178]"":[139]cc[179][177]1[167][153]"loadcbm device number not all0cated":[137]2030
  274. 2500 [153]"loading commodore dos directory":[153]:g[178]0:c1[178]1:[129]x[178]1[164]30:di$(1,x)[178]"":[130]
  275. 2501 [159]1,cd,0,"$0:!#$%&":[141]3050:[139]ds[177]19[167][153]"loaddisk error",ds$:[160]1:[142]
  276. 2502 [129]x[178]1[164]34:[161]#1,x$:[130]
  277. 2503 [161]#1,x$:x[178][195](x$):[139]x[167]x[178][198](x$)
  278. 2504 [161]#1,x$:y[178][195](x$):[139]y[167]y[178][198](x$)
  279. 2505 ca[178](x[170]y[172]256)[172]256:[160]1
  280. 2506 [159]1,cd,0,"$0":[161]#1,a$,a$:cf[178][171]1:q$[178][199](34):xx[178]0
  281. 2507 [139]z$[177]""[175]g[178]0[167][153]"disk ="z$:g[178]1:[153]
  282. 2508 [158]pk[170]27:[141]3050:[139]ds[177]19[167][153]"loaddisk error",ds$:[160]1:[142]
  283. 2509 b[178][194](pv[170]11)[170]256[172][194](pv[170]12):t$[178][199]([194](pv[170]13))
  284. 2510 x[178][194](pv[170]14)
  285. 2520 [139]x[178]0[167]2670
  286. 2530 x$[178]"":[129]i[178]pv[170]15[164]pv[170]15[170]x[171]1:x$[178]x$[170][199]([194](i)):[130]
  287. 2575 cf[178]cf[170]1
  288. 2590 [139]cf[178]0[167]z$[178]q$[170]x$[170]q$:[137]2650
  289. 2600 cn$(cf)[178]x$
  290. 2610 a$[178][200](x$[170]"                 ",17)[170]t$[170][201]("       "[170][196](b[172]254),8)
  291. 2620 [139]t$[178]"s"[167]di$(1,cf)[178][201]("  "[170][196](cf),3)[170]"     asc  "[170]a$
  292. 2625 [139]t$[178]"p"[167]di$(1,cf)[178][201]("  "[170][196](cf),3)[170]"     bin  "[170]a$
  293. 2630 [153]di$(1,cf)
  294. 2650 xx[178]xx[170]1:[139]xx[178]31[167]2670
  295. 2655 [137]2507
  296. 2670 [158]46374:[160]1:[142]
  297. 3050 [132]5,ds,ds$,j,h:[142]
  298. 3051 [132]8,ds,ds$,j,h:[142]
  299. 5000 [151]198,0:[146]198,1:[151]198,0:[142]
  300. 6000 gg[178]0:x[178][195](c$):zz$[178]"            "
  301. 6001 [139]x[178][179]3[167]m$[178]c$:[137]6094
  302. 6005 g[178][195](c$)[171]3:[139][202](c$,g,1)[178]"."[167]z$[178][201](c$,3):gg[178]1:[137]6085
  303. 6010 [139]gg[178]0[175]x[177][178]12[167]x[178]12:m$[178][200](c$,12):[137]6094
  304. 6015 [139]gg[178]0[175]x[179]12[167]m$[178][200](c$,x):[137]6094
  305. 6085 [139]x[178][177]12[167]m$[178][200](c$,8):x[178]12:[137]6094
  306. 6090 m$[178][200](c$,x[171]4)
  307. 6094 xx$[178]"":z[178][195](m$):[129]i[178]1[164]z
  308. 6095 x$[178][199]([198]([202](m$,i,1))[175]127):[139]x$[178]"."[176]x$[178]" "[167]x$[178]"_"
  309. 6096 xx$[178]xx$[170]x$
  310. 6097 [130]i:[139]gg[167]m$[178][200](xx$,x[171]4)[170][200](zz$,12[171]x[170]1)[170]z$:[137]6101
  311. 6098 [139]x[178]12[167]m$[178]xx$:[137]6101
  312. 6099 [139]x[179]12[167]m$[178][200](xx$,x)[170][200](zz$,12[171]x)
  313. 6101 m$[178][200](m$,8)[170][201](m$,3):[142]
  314.