home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 43 / 043.d81 / copier (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  126 lines

  1. 0 goto10
  2. 5 hi=int(nu/256):lo=nu-hi*256:return
  3. 10 ify=0theny=1:load"filecopy.o",8,1
  4. 11 poke51,.:poke56,47:clr:dim f$(100),t$(100),ea(100),sa(100)
  5. 12 rb=1:gosub500:sa=12288
  6. 15 fl$="":f=32768
  7. 17 a=peek(f):ifa<>0thenfl$=fl$+chr$(a):f=f+1:goto17
  8. 20 iflen(fl$)>16thenfl$=left$(fl$,16)
  9. 25 open2,8,2,"files on side "+si$
  10. 30 input#2,a$:i=st:input#2,nf$:nf=val(nf$):input#2,nb$:nb=val(nb$)
  11. 35 forx=1tonf:input#2,f$(x),t$(x):next
  12. 40 ifa$<>fl$andi=0then30
  13. 42 ifa$=fl$then50
  14. 47 print"error....file "fl$" not found in file!":close2
  15. 48 print"please report this error to loadstar!":stop
  16. 50 close2
  17. 51 print"[154]  press: space[146] [154]to start copying"
  18. 52 print"         return[146] [154]to return to loadstar.":poke198,.
  19. 53 geta$:ifa$<>" "anda$<>chr$(13)then53
  20. 54 ifa$=chr$(13)thengosub60000:poke198,.:goto53
  21. 55 d1=.
  22. 56 nu=sa:gosub5:d1=d1+1:d=d1:poke12131,hi:poke12135,lo:sa(d1)=sa
  23. 57 gosub900:print"[154]reading:"f$(d)
  24. 60 open1,8,2,f$(d):sys12040:close1
  25. 80 ea(d1)=peek(832)+peek(833)*256:sa=ea(d1)+1
  26. 85 if (ea(d1)<53248) and (d1<nf) then 56
  27. 87 if ea(d1)<53248 then 90
  28. 88 d1=d1-1:sa=12288:print"[150]            buffer overflow!"
  29. 89 print"          must recopy "f$(d)
  30. 90 print"       insert destination disk...      "
  31. 92 print"    press space when ready to copy.":poke198,.
  32. 93 geta$:ifa$<>" "then93
  33. 94 ifrbthenprint"       [129]checking # of blocks free"
  34. 95 ifrbthenrb=.:gosub3000
  35. 96 d2=d2+1:d=d2:gosub900:print"[154]writing:"f$(d):gosub700
  36. 98 ifmm=1then90
  37. 99 ifmm=2then96
  38. 100 nu=ea(d2):gosub5:poke832,lo:poke833,hi
  39. 101 nu=sa(d2):gosub5:poke12131,hi:poke12135,lo
  40. 105 open1,8,2,f$(d)+","+t$(d)+",w":sys12084:close1
  41. 110 if d2<d1 then 96
  42. 120 print"       insert [153]"dn$"..."
  43. 122 print" press space when ready to continue.":poke198,.
  44. 124 geta$:ifa$<>" "then124
  45. 125 gosub600:if(mm$<>dn$)thengosub2000:goto125
  46. 126 print"[145][145]";:fora=1to2:print"                                       ":next
  47. 127 print"[145][145][145]";:poke832,.:poke833,32
  48. 129 if d1<nf then 56
  49. 130 gosub900:print"         [154]-- finished copying [154]--"
  50. 131 goto60030
  51. 500 poke53280,0:poke53281,0:sys51459
  52. 510 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]";
  53. 513 print"[221]       loadstar program copier        [221]";
  54. 515 print"[221]   [154]by:  mike maynard & alan gardner   [221]";
  55. 516 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]";
  56. 518 fora=217to242:pokea,peek(a)or128:next
  57. 520 gosub600:si$=right$(dn$,1):mm$=dn$
  58. 550 print" please wait -- reading [153]files on side "si$:return
  59. 600 open15,8,15,"i0":open8,8,8,"#"
  60. 610 print#15,"ua:8 0 18 0"
  61. 620 print#15,"b-p:8 144"
  62. 630 dn$="":fora=1to16:get#8,a$:dn$=dn$+a$:next:close8:close15:return
  63. 700 open15,8,15,"r0:"+f$(d)+"="+f$(d):input#15,er:close15
  64. 710 ifer<>63thenmm=.:return
  65. 715 print"[145]                                     "
  66. 720 print"[145]"f$(d)" [154]already exists..."
  67. 730 print"     t[154]ry again with another disk."
  68. 740 print"     s[154]cratch and replace file."
  69. 760 print"choose t[154] or s[154].":poke198,.
  70. 770 geta$:ifa$=""then770
  71. 780 ifa$="t"ora$="[212]"then820
  72. 790 ifa$="s"ora$="[211]"then840
  73. 810 goto770
  74. 820 gosub1000:mm=1:rb=1:return
  75. 840 gosub1000:print"[154]scratching:"f$(d)
  76. 850 open15,8,15,"s0:"+f$(d):close15:print"[145]                                    "
  77. 860 mm=2:return
  78. 900 print"";:fora=1to20:print"                                       ":next
  79. 905 return
  80. 1000 print"[145][145][145][145][145][145]";:fora=1to6:print"                                       "
  81. 1010 next:print"[145][145][145][145][145]";:return
  82. 2000 print"[145][145][159] "mm$"[154] is not in the drive."
  83. 2005 print"                                     "
  84. 2010 print" put [159]"mm$" [154]in the drive and"
  85. 2020 print"       press space [154]to try again.":poke198,.
  86. 2030 geta$:ifa$<>" "then2030
  87. 2040 print"[145][145][145][145]";:fora=1to4:print"                                      ":next
  88. 2050 print"[145][145][145]":return
  89. 2999 rem check # of blocks free
  90. 3000 open15,8,15,"i0":input#15,er:close15:ifer<>21then3008
  91. 3005 gosub900:print" the disk in the drive isn't formatted.":goto3070
  92. 3008 open15,8,15,"i0":open8,8,8,"#"
  93. 3010 print#15,"ua:8 0 18 0":print#15,"b-p:8 4"
  94. 3020 ba=.:fora=1to35:ifa=18thenget#8,a$:goto3035
  95. 3030 get#8,a$:ba=ba+asc(a$+chr$(.))
  96. 3035 forb=1to3:get#8,a$:next
  97. 3040 next:ifnb<bathenclose8:close15:return
  98. 3045 close8:close15
  99. 3050 gosub900:print"there's not enough room on this disk"
  100. 3060 print"for [150]"f$(d)" and the files"
  101. 3065 print"associated with it."
  102. 3070 print"[158]             your options:"
  103. 3075 print"f[154]ormat a disk for this program"
  104. 3080 print"t[154]ry saving this program on another disk"
  105. 3085 print"q[154]uit (forget about copying it)
  106. 3090 [153]"press fcont, tcont, or qcont.":[151]198,.
  107. 3100 a[178][194](203):[139]a[179][177]21[175]a[179][177]22[175]a[179][177]62[167]3100
  108. 3110 [139]a[178]62[167][141]60000:[137]3100
  109. 3120 [139]a[178]22[167][153]"       forchecking # of blocks free":[137]3000
  110. 3130 [153]"cont     put disk to format in drive 0"
  111. 3140 [153]"    press spacecont when ready to format":[151]198,.
  112. 3150 [161]a$:[139]a$[179][177]" "[167]3150
  113. 3160 [159]15,8,15,"n0:loadstar progs,mm":[160]15:[137]3000
  114. 5000 [159]3,8,3,"files on side 1"
  115. 5010 [129]i[178].[164]1:[161]#3,a$:i[178]st:[153]a$;
  116. 5020 [130]:[160]3
  117. 60000 [153]" contare you sure you want to quit? (ycont/ncont)":[151]198,.
  118. 60010 a[178][194](203):[139]a[179][177]25[175]a[179][177]39[167]60010
  119. 60020 [139]a[178]39[167][153]"on                                     ":[153]"onon";:[142]
  120. 60022 [153]"contplace open"dn$" contin the drive and"
  121. 60024 [153]"press space contto return to loadstar":[151]198,.
  122. 60026 a[178][194](203):[139]a[179][177]60[167]60026
  123. 60030 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er:[160]15
  124. 60040 [139]er[179][177]63[167][128]
  125. 60050 [147]"hello connect",8
  126.