home *** CD-ROM | disk | FTP | other *** search
/ Light / Light_Vol.1_July_1992_Datasphere_Publications_Disk_1_of_2_Side_B.d64 / rescue (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  8KB  |  233 lines

  1. 0 dimt(35):forx=1to17:t(x)=20:next:forx=18to24:t(x)=18:next
  2. 1 forx=25to30:t(x)=17:next:forx=31to35:t(x)=16:next:dimd(256)
  3. 2 poke53280,0:poke53281,0:poke646,5:print""
  4. 3 print"[147]    [197][211][208] [211]oftware - [196]isk [210]esurrection":print""
  5. 100 printtab(14)"[211]elect [207]ption:":close2:f=0:ef=0
  6. 110 printtab(14)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163]":close15
  7. 120 printtab(12)"1: [211]ave a [211]ector"
  8. 130 printtab(12)"2: [211]ave a [198]ile"
  9. 140 printtab(12)"3: [211]ave [197]ntire [196]isk"
  10. 150 printtab(12)"4: [210]ead [201]nstructions":poke198,0
  11. 155 printtab(12)"5: [197]xit [208]rogram":poke198,0
  12. 160 geti$:i=val(i$)
  13. 170 ifi<1ori>5then160
  14. 180 onigoto500,700,1200,1400,450
  15. 190 print"":forx=1to13
  16. 195 print"                                       ":next:print"[145][145][145][145][145][145][145][145][145][145][145][145][145][145]":return
  17. 198 return
  18. 200 poke631,5:poke198,1:return
  19. 210 input#15,e1,e$,e2,e3:ife1=0thenreturn
  20. 220 gosub190:print"         "e1;e$;e2;e3:forx=1to4000:next:gosub190:return
  21. 230 at=0:print#15,"m-w"chr$(10)chr$(0)chr$(2)chr$(t)chr$(s)
  22. 240 print#15,"m-w"chr$(2)chr$(0)chr$(1)chr$(code)
  23. 250 at=at+1:print#15,"m-r"chr$(2)chr$(0):get#15,e$:e=asc(e$+chr$(0))
  24. 260 ifat>500then290
  25. 270 ife>127then250
  26. 280 return
  27. 290 e$="[213]nrecoverable format error"
  28. 292 ife=3thene$="[195]annot find track"
  29. 293 ife=8thene$="[215]rite protect on"
  30. 310 e=e+18:gosub190:print""e;e$;t;s
  31. 320 print"[211]orry, unable to recover this sector":goto670
  32. 330 tt=0
  33. 340 tt=tt+1:iftt>3thenef=ef+1:return
  34. 345 print#15,"u;":forx=1to1000:next
  35. 350 close2:close15:open15,8,15,"i0"
  36. 360 gosub210:ife1<>0then100
  37. 370 open2,8,2,"#2":gosub210:ife1<>0then100
  38. 380 code=176:gosub230:gosub198:ife<>1then340
  39. 390 code=128:gosub230:gosub198:ife<>1then340
  40. 400 return
  41. 450 gosub190:poke198,1:sys64738
  42. 500 gosub190:printtab(14)"[211]ave a [211]ector"
  43. 510 printtab(14)"[163][163][163][163][163][163][163][163][163][163][163][163][163]":t=-1:s=-1
  44. 520 print"[201]nput track desired: ";:gosub200:inputt
  45. 525 ift<1thengosub190:goto2
  46. 530 ift>35thengosub190:printtab(14)"[201]nvalid track!":forx=1to4000:next:goto500
  47. 540 print"[201]nput sector desired:";:gosub200:inputs
  48. 550 ifs<0thengosub190:goto2
  49. 560 ifs>t(t)thengosub190:printtab(14)"[201]nvalid sector!":forx=1to4000:next:goto500
  50. 570 gosub190:printtab(15)"[215]orking..."
  51. 575 close15:open15,8,15,"u;":forx=1to1000:next
  52. 580 close15:open15,8,15,"i0":gosub210:ife1<>0then2
  53. 585 open2,8,2,"#2":gosub210:ife1<>0then2
  54. 590 printtab(7)"[210]eading track"t"sector"s
  55. 600 code=176:gosub230:ife<>1ande<>4ande<>5thengosub330:iftt<3then600
  56. 601 ife<>1ande<>4ande<>5then290
  57. 605 gosub198
  58. 610 code=128:gosub230
  59. 620 ife=5then650
  60. 625 ife=4then640
  61. 630 ife<>1thengosub330:iftt<3then600
  62. 631 ife<>1then290
  63. 635 print"    [206]o errors on track"t"sector"s"!":goto670
  64. 640 print#15,"m-w"chr$(71)chr$(0)chr$(1)chr$(7)
  65. 650 code=144:gosub230:ife<>1thengosub330:iftt<3then600
  66. 651 ife<>1then290
  67. 660 printtab(8)"[212]rack"t"sector"s"saved!"
  68. 670 forx=1to5000:next
  69. 680 iff=0thenclose2:close15:gosub190:goto2
  70. 690 iff=1then820
  71. 700 gosub190:printtab(14)"[211]ave a [198]ile":printtab(14)"[163][163][163][163][163][163][163][163][163][163][163]"
  72. 705 f$="":lt=0:ls=0:ef=0
  73. 710 print"[201]nput filename:";:gosub200:inputf$
  74. 720 iff$=""thengosub190:goto2
  75. 730 close2:close15:open15,8,15,"u;":forx=1to1000:next
  76. 732 print#15,"i0":gosub210:ife1<>0then2
  77. 735 open2,8,2,"0:"+f$
  78. 740 gosub210:ife1=62ore1=21then700
  79. 741 ife1=22ore1=23thent=e2:s=e3:goto770
  80. 742 ife1<>0thenprinttab(10)"[195]annot save this file!":f=0:goto670
  81. 745 get#2,a$,b$
  82. 750 print#15,"m-r"chr$(24)chr$(0):get#15,t$:t=asc(t$+chr$(0))
  83. 760 print#15,"m-r"chr$(25)chr$(0):get#15,s$:s=asc(s$+chr$(0))
  84. 770 close2:open2,8,2,"#2"
  85. 771 p=11-(len(f$)/2):ifp<1thenp=0
  86. 775 f=1:gosub190:printtab(p+5)"[211]aving "chr$(34)f$chr$(34)
  87. 776 print"       [210]eading track   [157][157][157]"t"[157] sector   [157][157][157]"s
  88. 780 ift=0thenprint"               [197]nd of file":f=0
  89. 790 ift=0andef>0thenprinttab(p)""chr$(34)f$chr$(34)" has been saved!":goto670
  90. 791 ift=0andef<1thenprinttab(p+2)"[206]o errors in "chr$(34)f$chr$(34):goto670
  91. 792 ift>35ors>t(t)then940
  92. 800 print"[145]       [210]eading track   [157][157][157]"t"[157] sector   [157][157][157]"s
  93. 820 code=176:gosub230:ife<>1thengosub330:iftt<3then820
  94. 825 gosub198
  95. 830 code=128:gosub230
  96. 840 ife=4thenprint#15,"m-w"chr$(71)chr$(0)chr$(1)chr$(7):ef=ef+1:goto870
  97. 850 ife=5thenef=ef+1:goto870
  98. 860 ife<>1thengosub330:iftt<3then820
  99. 865 ife<>1thennt=0:ns=0:goto920
  100. 870 print#15,"m-r"chr$(0)chr$(5):get#15,nt$
  101. 880 print#15,"m-r"chr$(1)chr$(5):get#15,ns$
  102. 890 nt=asc(nt$+chr$(0)):ns=asc(ns$+chr$(0))
  103. 900 remprint"nt="nt,"ns="ns:goto940
  104. 910 remcode=176:gosub230
  105. 915 gosub198
  106. 920 code=144:gosub230:ife<>1thengosub330:iftt<3then920
  107. 925 gosub198
  108. 930 ife=1thenlt=t:t=nt:ls=s:s=ns:goto780
  109. 936 ife=8thengosub190:printtab(10)"[210]emove [215]rite [208]rotect!":f=0:goto670
  110. 937 ife<>1thengosub330:iftt<3then920
  111. 940 gosub190:printtab(7)"[213]nrecoverable format error."
  112. 950 printtab(6)"[198]ixing sector links to allow"
  113. 960 printtab(5)"file recovery up to this point."
  114. 965 printtab(13)"([194]e patient!)"
  115. 970 t=lt:s=ls:code=176:gosub230:ife<>1thengosub330:goto970
  116. 980 code=128:gosub230:ife<>1then970
  117. 990 forx=0to255
  118. 1000 print#15,"m-r"chr$(x)chr$(5)
  119. 1010 get#15,d$:d(x)=asc(d$+chr$(0))
  120. 1020 next:x=0:y=0:d=0
  121. 1030 x=x+1:ifx>255then1060
  122. 1040 ifd(x)=dtheny=x
  123. 1050 goto1030
  124. 1060 ify=0andd=0thend=13:x=0:goto1030
  125. 1065 ify=0andd=13theny=255:goto1100
  126. 1070 d(0)=0:ify>253then1100
  127. 1090 d(1)=y+2:d(y)=d:d(y+1)=d:d(y+2)=d:goto1110
  128. 1100 d(1)=y-2:d(y)=d:d(y-1)=d:d(y-2)=d
  129. 1110 forx=0to255
  130. 1120 print#15,"m-w"chr$(x)chr$(5)chr$(1)chr$(d(x)):next
  131. 1130 code=144:gosub230
  132. 1135 ife<>1thengosub330:iftt<3then970
  133. 1136 ife<>1thenf=0:goto670
  134. 1140 gosub190:print:printtab(3)"[198]ile has been [208][193][210][212][201][193][204][204][217] recovered."
  135. 1150 print:printtab(2)"[198]ile copy all files to another disk;"
  136. 1160 printtab(3)"[212]here are permanent format errors"
  137. 1170 printtab(3)"that cannot be corrected without"
  138. 1180 printtab(8)"re-formatting the disk."
  139. 1190 print:printtab(12)"[208]ress any key":poke198,0:wait198,1
  140. 1195 gosub190:goto2
  141. 1200 gosub190:printtab(12)"[211]ave entire disk"
  142. 1210 printtab(12)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  143. 1220 printtab(5)"[201]nsert disk and press  [210][197][212][213][210][206] ":poke198,0
  144. 1230 geta$:ifa$=chr$(13)then1240
  145. 1235 ifa$<>""anda$<>chr$(13)thengosub190:goto2
  146. 1236 goto1230
  147. 1240 close2:close15:open15,8,15,"u;":forx=1to1000:next
  148. 1245 close15:open15,8,15,"i0":gosub210
  149. 1250 ife1<>0then2
  150. 1255 open2,8,2,"#2":gosub210:ife1<>0then2
  151. 1260 re=0:fe=0:we=0
  152. 1265 print"[145]                                      "
  153. 1270 fort=1to35
  154. 1275 fors=0tot(t)
  155. 1280 printtab(5)"[145][215]orking on track   [157][157][157]"t"[157] sector   [157][157][157]"s
  156. 1285 code=176:gosub230:ife<>1ande<>4ande<>5thengosub330:iftt>3thenfe=fe+1:goto1330
  157. 1295 ife<>1ande<>4ande<>5thenfe=fe+1:goto1330
  158. 1300 code=128:gosub230:ife<>1ande<>4ande<>5thengosub330:iftt<3then1300
  159. 1305 ife<>1ande<>4ande<>5thenre=re+1:goto1330
  160. 1310 ife=4thenprint#15,"m-w"chr$(71)chr$(0)chr$(1)chr$(7)
  161. 1320 code=144:gosub230:ife>8thenwe=we+1:goto1330
  162. 1321 ife<>1thengosub330:code=144:gosub230
  163. 1325 ife<>1thenwe=we+1
  164. 1330 ife=3thens=t(t)+1
  165. 1335 nexts:nextt
  166. 1340 gosub190:printtab(10)"[198]ormat errors:"fe
  167. 1350 printtab(5)"[213]nrecoverable read errors:"re
  168. 1360 printtab(10)"[211]ectors saved:"683-we
  169. 1370 f=0:forx=1to5000:next:goto670
  170. 1400 c$="":q$=chr$(34):gosub190
  171. 1410 print""c$"   [212]his program was taken from the "
  172. 1420 print"routines in the book [201]nside [195]ommodore"
  173. 1430 print"[196][207][211]. [211]pecial thanks to [210]ichard [201]mmers"
  174. 1440 print"and [199]erald [206]eufeld for an excellent    "
  175. 1450 print"reference guide to the 1541.           "
  176. 1460 print"   [212]his program will correct "q$"soft"q$
  177. 1470 print"read errors on your disks. [212]hese are"
  178. 1480 print"#22 and #23 read errors. [212]he other "
  179. 1490 print"errors such as #20, #21, #27, #29, etc."
  180. 1500 print"are created during formatting, and "
  181. 1510 print"can't be repaired except by formatting"
  182. 1520 print"the disk again."
  183. 1530 print"             [208]ress any key":poke198,0:wait198,1
  184. 1540 gosub190:print"   [196]uring the testing of this program"
  185. 1550 print"it was discovered that many of the copy"
  186. 1560 print"programs do not faithfully duplicate"
  187. 1570 print"#22 or #23 errors. [212]hese errors hide a"
  188. 1580 printq$"hard"q$" error underneath the "q$"soft"q$
  189. 1590 print"error. [212]hese can't be repaired, either."
  190. 1600 print"   [212]his program is intended to save"
  191. 1610 print"your files if you should develop a read"
  192. 1620 print"error. [201]f you can't load or read a file"
  193. 1630 print"because of a read error, this program"
  194. 1635 print"will let you get that file back again."
  195. 1640 poke198,0:wait198,1
  196. 1650 gosub190:print"   [201]f you have a bad file, you should"
  197. 1660 print"use the "q$"[211]ave a [198]ile"q$" option. [212]his"
  198. 1670 print"will trace the file, and correct"
  199. 1680 printq$"soft"q$" errors as they are found. [201]f"
  200. 1690 print"any "q$"hard"q$" errors are found, the"
  201. 1700 print"file will be severed at that point,"
  202. 1710 print"since a hard error cannot be repaired."
  203. 1720 print"   [212]his will let you retreive at least"
  204. 1730 print"a portion of the bad file. [201]f it is a"
  205. 1740 print"[194][193][211][201][195] program, the line links will be"
  206. 1750 print"corrected before the bad portion of the"
  207. 1760 print"file is severed."
  208. 1770 poke198,0:wait198,1
  209. 1780 gosub190:print"   [212]he "q$"[211]ave [197]ntire [196]isk"q$" option"
  210. 1790 print"takes a long time, but may be useful"
  211. 1800 print"if you don't know where the read errors"
  212. 1810 print"are on the disk. [200]owever, this can take"
  213. 1820 print"a [214][197][210][217] long time, especially if there"
  214. 1830 print"are a number of "q$"hard"q$" errors on the"
  215. 1840 print"disk. [215]hen a "q$"hard"q$" error is found, the"
  216. 1850 print"program resets and then initializes the"
  217. 1860 print"drive and tries again; up to 3 times"
  218. 1870 print"per sector before giving up and then"
  219. 1880 print"accepting the error."
  220. 1890 poke198,0:wait198,1
  221. 1900 gosub190:print"   [212]he "q$"[211]ave a [198]ile"q$" option is of"
  222. 1910 print"main interest. [201]t is the only option"
  223. 1920 print"that will allow you to recover a file"
  224. 1930 print"with "q$"soft"q$" errors. [212]he errors will"
  225. 1940 print"be corrected as the program steps thru"
  226. 1950 print"the file. [201]f a "q$"hard"q$" error is found,"
  227. 1960 print"the preceeding sector's information is"
  228. 1970 print"corrected to sever the bad portion of "
  229. 1980 print"the file from the good portion."
  230. 1985 print"              [199]ood [204]uck!"
  231. 1990 poke198,0:wait198,1
  232. 2000 print"                                      ":gosub190:goto2
  233.