home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 75 / 075.d81 / copier (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  148 lines

  1. 10 goto30
  2. 20 hi=int(nu/256):lo=nu-hi*256:return
  3. 30 ify=0theny=1:load"filecopy.o",8,1
  4. 40 poke51,.:poke56,47:clr:dim f$(100),t$(100),ea(100),sa(100)
  5. 45 dd%=9:close2:open2,9,15:close2:ifstthendd%=8
  6. 46 ifdd%=9thengosub2000
  7. 50 rb=1:gosub520:sa=12288
  8. 60 fl$="":f=32768
  9. 70 a=peek(f):ifa<>0thenfl$=fl$+chr$(a):f=f+1:goto70
  10. 80 iflen(fl$)>16thenfl$=left$(fl$,16)
  11. 90 open2,8,2,"files on side "+si$
  12. 100 input#2,a$:i=st:input#2,nf$:nf=val(nf$):input#2,nb$:nb=val(nb$)+1
  13. 110 forx=1tonf:input#2,f$(x),t$(x):next
  14. 120 nf=nf+1:f$(nf)="loadstar reader":t$(nf)="p"
  15. 130 ifa$<>fl$andi=0then100
  16. 140 ifa$=fl$then170
  17. 150 print"error....file "fl$" not found in file!":close2
  18. 160 stop
  19. 170 close2
  20. 180 print
  21. 190 print:poke198,.
  22. 200 :
  23. 210 :
  24. 220 d1=.
  25. 230 nu=sa:gosub20:d1=d1+1:d=d1:poke12131,hi:poke12135,lo:sa(d1)=sa
  26. 240 gosub670:print"[154]reading:"f$(d)
  27. 250 open1,8,2,f$(d):sys12040:close1
  28. 260 ea(d1)=peek(832)+peek(833)*256:sa=ea(d1)+1
  29. 270 if (ea(d1)<53248) and (d1<nf) then 230
  30. 280 if ea(d1)<53248 then 310
  31. 290 d1=d1-1:sa=12288:print"[150]                            "
  32. 300 print"                      "
  33. 310 ifdd%=9then340
  34. 315 print"       insert destination disk...      "
  35. 320 print"    press space when ready to copy.":poke198,.
  36. 330 geta$:ifa$<>" "then330
  37. 340 ifrbthenprint"       [129]checking # of blocks free"
  38. 350 ifrbthenrb=.:gosub790
  39. 360 d2=d2+1:d=d2:gosub670
  40. 370 print"[154]writing:"f$(d):gosub640
  41. 380 if(mm)then420
  42. 390 nu=ea(d2):gosub20:poke832,lo:poke833,hi
  43. 400 nu=sa(d2):gosub20:poke12131,hi:poke12135,lo
  44. 410 open1,dd%,2,f$(d)+","+t$(d)+",w":sys12084:close1
  45. 420 if d2<d1 then 360
  46. 430 ifdd%=9then460
  47. 435 print"       insert [153]"dn$"..."
  48. 440 print" press space when ready to continue.":poke198,.
  49. 450 geta$:ifa$<>" "then450
  50. 460 gosub600:if(mm$<>dn$)thengosub710:goto460
  51. 470 print"[145][145]";:fora=1to2:print"                                       ":next
  52. 480 print"[145][145][145]";:poke832,.:poke833,32
  53. 490 if d1<nf then 230
  54. 500 gosub1030:rem  loading instructions
  55. 510 goto1310
  56. 520 poke53280,0:poke53281,0
  57. 530 printchr$(142)"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]";
  58. 540 print"[221]       loadstar program copier        [221]";
  59. 550 print"[221]   [154]by:  mike maynard & alan gardner   [221]";
  60. 560 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]";
  61. 570 fora=217to242:pokea,peek(a)or128:next
  62. 580 gosub600:si$=right$(dn$,1):mm$=dn$
  63. 590 print" please wait five more seconds... ":return
  64. 600 open15,8,15,"i0":open8,8,8,"#"
  65. 610 print#15,"ua:8 0 18 0"
  66. 620 print#15,"b-p:8 144"
  67. 630 dn$="":fora=1to16:get#8,a$:dn$=dn$+a$:next:close8:close15:return
  68. 640 open15,dd%,15,"r0:"+f$(d)+"="+f$(d):input#15,er:close15
  69. 650 mm=.:ifer=63thenmm=1
  70. 660 return
  71. 670 print"";:fora=1to20:print"                                       ":next
  72. 680 return
  73. 690 print"[145][145][145][145][145][145]";:fora=1to6:print"                                       "
  74. 700 next:print"[145][145][145][145][145]";:return
  75. 710 print"[145][145][159] "mm$"[154] is not in the drive."
  76. 720 print"                                     "
  77. 730 print" put [159]"mm$" [154]in the drive and"
  78. 740 print"       press space [154]to try again.":poke198,.
  79. 750 geta$:ifa$<>" "then750
  80. 760 print"[145][145][145][145]";:fora=1to4:print"                                      ":next
  81. 770 print"[145][145][145]":return
  82. 780 rem check # of blocks free
  83. 790 open15,dd%,15,"i0":input#15,er:close15:if(er<20)or(er>24)then810
  84. 800 gosub670:print" the disk in the drive isn't formatted.":goto910
  85. 810 open15,dd%,15,"i0":open8,dd%,8,"#"
  86. 820 print#15,"ua:8 0 18 0":print#15,"b-p:8 4"
  87. 830 ba=.:fora=1to35:ifa=18thenget#8,a$:goto850
  88. 840 get#8,a$:ba=ba+asc(a$+chr$(.))
  89. 850 forb=1to3:get#8,a$:next
  90. 860 next:ifnb<bathenclose8:close15:return
  91. 870 close8:close15
  92. 880 gosub670:print"there's not enough room on this disk"
  93. 890 print"for [150]"f$(d)" and the files"
  94. 900 print"associated with it."
  95. 910 print"[158]             your options:"
  96. 920 print"f[154]ormat a disk for this program"
  97. 930 print"t[154]ry saving this program on another disk"
  98. 940 print"q[154]uit (forget about copying it)
  99. 950 [153]"press fcont, tcont, or qcont.":[151]198,.
  100. 960 a[178][194](203):[139]a[179][177]21[175]a[179][177]22[175]a[179][177]62[167]960
  101. 970 [139]a[178]62[167][141]1250:[137]960
  102. 980 [139]a[178]22[167][153]"       forchecking # of blocks free":[137]790
  103. 990 [153]"cont     put disk to format in drive 0"
  104. 1000 [153]"    press spacecont when ready to format":[151]198,.
  105. 1010 [161]a$:[139]a$[179][177]" "[167]1010
  106. 1020 [159]15,dd%,15,"n0:loadstar progs,mm":[160]15:[137]790
  107. 1030 [141]670:[153]"         cont-- finished copying cont--"
  108. 1040 [153]"contto load this program from basic, enter:"
  109. 1050 [153]"load "[199](34)f$(1)[199](34)",8"
  110. 1060 [153]"on"[163]30)"contthen...":[153]"run"
  111. 1070 [153]"cont      please make note of this..."
  112. 1080 [153]"         press space contfor more"
  113. 1090 [139][194](203)[179][177]60[167]1090
  114. 1100 [141]670:[153]""
  115. 1110 [153]"contto read about this program from basic,"
  116. 1120 [153]"enter the following:"
  117. 1130 [153]"load "[199](34)"loadstar reader"[199](34)",8,1   contthen..."
  118. 1140 [153]"new                          contthen..."
  119. 1150 [153]"sys 679,"[199](34)"t."f$(1)[199](34)
  120. 1160 [153]"contuse pcont to pause, ccont to continue, and"
  121. 1170 [153]"acont to abort."
  122. 1180 [153]"cont      please make note of this..."
  123. 1190 [153]"   press space contto return to loadstar"
  124. 1200 [139][194](203)[179][177]60[167]1200
  125. 1210 [142]
  126. 1220 [159]3,8,3,"files on side 1"
  127. 1230 [129]i[178].[164]1:[161]#3,a$:i[178]st:[153]a$;
  128. 1240 [130]:[160]3
  129. 1250 [153]" contare you sure you want to quit? (ycont/ncont)":[151]198,.
  130. 1260 a[178][194](203):[139]a[179][177]25[175]a[179][177]39[167]1260
  131. 1270 [139]a[178]39[167][153]"on                                     ":[153]"onon";:[142]
  132. 1280 [153]"contplace open"dn$" contin the drive and"
  133. 1290 [153]"press space contto return to loadstar":[151]198,.
  134. 1300 a[178][194](203):[139]a[179][177]60[167]1300
  135. 1310 [137]3000
  136. 2000 [153]"sys   is drive 9 your destination?  (y/n)"
  137. 2010 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]2010
  138. 2020 [153]"                                         "
  139. 2030 [139]a$[178]"n"[167]dd%[178]8
  140. 2040 [142]
  141. 3000 [151]45,135:[151]46,27:[151]47,142:[151]48,27:[151]49,142:[151]50,27:[151]51,0
  142. 3010 [151]52,128:[151]53,0:[151]54,0:[151]55,0:[151]56,128:[156]
  143. 60000 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er:[160]15
  144. 60010 [139] er[179][177]63 [167] [153]"load":[128]
  145. 60020 a$[178]"hello connect":q$[178][199](34):[151]53281,7:[151]53280,7:[153]"load"
  146. 60030 [153]"sysload"q$a$q$",8"
  147. 60040 [153]"run":[151]631,13:[151]632,13:[151]198,2:[162]
  148.