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

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