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 >
Wrap
Commodore BASIC
|
2023-02-26
|
8KB
|
233 lines
0 dimt(35):forx=1to17:t(x)=20:next:forx=18to24:t(x)=18:next
1 forx=25to30:t(x)=17:next:forx=31to35:t(x)=16:next:dimd(256)
2 poke53280,0:poke53281,0:poke646,5:print""
3 print"[147] [197][211][208] [211]oftware - [196]isk [210]esurrection":print""
100 printtab(14)"[211]elect [207]ption:":close2:f=0:ef=0
110 printtab(14)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163]":close15
120 printtab(12)"1: [211]ave a [211]ector"
130 printtab(12)"2: [211]ave a [198]ile"
140 printtab(12)"3: [211]ave [197]ntire [196]isk"
150 printtab(12)"4: [210]ead [201]nstructions":poke198,0
155 printtab(12)"5: [197]xit [208]rogram":poke198,0
160 geti$:i=val(i$)
170 ifi<1ori>5then160
180 onigoto500,700,1200,1400,450
190 print"":forx=1to13
195 print" ":next:print"[145][145][145][145][145][145][145][145][145][145][145][145][145][145]":return
198 return
200 poke631,5:poke198,1:return
210 input#15,e1,e$,e2,e3:ife1=0thenreturn
220 gosub190:print" "e1;e$;e2;e3:forx=1to4000:next:gosub190:return
230 at=0:print#15,"m-w"chr$(10)chr$(0)chr$(2)chr$(t)chr$(s)
240 print#15,"m-w"chr$(2)chr$(0)chr$(1)chr$(code)
250 at=at+1:print#15,"m-r"chr$(2)chr$(0):get#15,e$:e=asc(e$+chr$(0))
260 ifat>500then290
270 ife>127then250
280 return
290 e$="[213]nrecoverable format error"
292 ife=3thene$="[195]annot find track"
293 ife=8thene$="[215]rite protect on"
310 e=e+18:gosub190:print""e;e$;t;s
320 print"[211]orry, unable to recover this sector":goto670
330 tt=0
340 tt=tt+1:iftt>3thenef=ef+1:return
345 print#15,"u;":forx=1to1000:next
350 close2:close15:open15,8,15,"i0"
360 gosub210:ife1<>0then100
370 open2,8,2,"#2":gosub210:ife1<>0then100
380 code=176:gosub230:gosub198:ife<>1then340
390 code=128:gosub230:gosub198:ife<>1then340
400 return
450 gosub190:poke198,1:sys64738
500 gosub190:printtab(14)"[211]ave a [211]ector"
510 printtab(14)"[163][163][163][163][163][163][163][163][163][163][163][163][163]":t=-1:s=-1
520 print"[201]nput track desired: ";:gosub200:inputt
525 ift<1thengosub190:goto2
530 ift>35thengosub190:printtab(14)"[201]nvalid track!":forx=1to4000:next:goto500
540 print"[201]nput sector desired:";:gosub200:inputs
550 ifs<0thengosub190:goto2
560 ifs>t(t)thengosub190:printtab(14)"[201]nvalid sector!":forx=1to4000:next:goto500
570 gosub190:printtab(15)"[215]orking..."
575 close15:open15,8,15,"u;":forx=1to1000:next
580 close15:open15,8,15,"i0":gosub210:ife1<>0then2
585 open2,8,2,"#2":gosub210:ife1<>0then2
590 printtab(7)"[210]eading track"t"sector"s
600 code=176:gosub230:ife<>1ande<>4ande<>5thengosub330:iftt<3then600
601 ife<>1ande<>4ande<>5then290
605 gosub198
610 code=128:gosub230
620 ife=5then650
625 ife=4then640
630 ife<>1thengosub330:iftt<3then600
631 ife<>1then290
635 print" [206]o errors on track"t"sector"s"!":goto670
640 print#15,"m-w"chr$(71)chr$(0)chr$(1)chr$(7)
650 code=144:gosub230:ife<>1thengosub330:iftt<3then600
651 ife<>1then290
660 printtab(8)"[212]rack"t"sector"s"saved!"
670 forx=1to5000:next
680 iff=0thenclose2:close15:gosub190:goto2
690 iff=1then820
700 gosub190:printtab(14)"[211]ave a [198]ile":printtab(14)"[163][163][163][163][163][163][163][163][163][163][163]"
705 f$="":lt=0:ls=0:ef=0
710 print"[201]nput filename:";:gosub200:inputf$
720 iff$=""thengosub190:goto2
730 close2:close15:open15,8,15,"u;":forx=1to1000:next
732 print#15,"i0":gosub210:ife1<>0then2
735 open2,8,2,"0:"+f$
740 gosub210:ife1=62ore1=21then700
741 ife1=22ore1=23thent=e2:s=e3:goto770
742 ife1<>0thenprinttab(10)"[195]annot save this file!":f=0:goto670
745 get#2,a$,b$
750 print#15,"m-r"chr$(24)chr$(0):get#15,t$:t=asc(t$+chr$(0))
760 print#15,"m-r"chr$(25)chr$(0):get#15,s$:s=asc(s$+chr$(0))
770 close2:open2,8,2,"#2"
771 p=11-(len(f$)/2):ifp<1thenp=0
775 f=1:gosub190:printtab(p+5)"[211]aving "chr$(34)f$chr$(34)
776 print" [210]eading track [157][157][157]"t"[157] sector [157][157][157]"s
780 ift=0thenprint" [197]nd of file":f=0
790 ift=0andef>0thenprinttab(p)""chr$(34)f$chr$(34)" has been saved!":goto670
791 ift=0andef<1thenprinttab(p+2)"[206]o errors in "chr$(34)f$chr$(34):goto670
792 ift>35ors>t(t)then940
800 print"[145] [210]eading track [157][157][157]"t"[157] sector [157][157][157]"s
820 code=176:gosub230:ife<>1thengosub330:iftt<3then820
825 gosub198
830 code=128:gosub230
840 ife=4thenprint#15,"m-w"chr$(71)chr$(0)chr$(1)chr$(7):ef=ef+1:goto870
850 ife=5thenef=ef+1:goto870
860 ife<>1thengosub330:iftt<3then820
865 ife<>1thennt=0:ns=0:goto920
870 print#15,"m-r"chr$(0)chr$(5):get#15,nt$
880 print#15,"m-r"chr$(1)chr$(5):get#15,ns$
890 nt=asc(nt$+chr$(0)):ns=asc(ns$+chr$(0))
900 remprint"nt="nt,"ns="ns:goto940
910 remcode=176:gosub230
915 gosub198
920 code=144:gosub230:ife<>1thengosub330:iftt<3then920
925 gosub198
930 ife=1thenlt=t:t=nt:ls=s:s=ns:goto780
936 ife=8thengosub190:printtab(10)"[210]emove [215]rite [208]rotect!":f=0:goto670
937 ife<>1thengosub330:iftt<3then920
940 gosub190:printtab(7)"[213]nrecoverable format error."
950 printtab(6)"[198]ixing sector links to allow"
960 printtab(5)"file recovery up to this point."
965 printtab(13)"([194]e patient!)"
970 t=lt:s=ls:code=176:gosub230:ife<>1thengosub330:goto970
980 code=128:gosub230:ife<>1then970
990 forx=0to255
1000 print#15,"m-r"chr$(x)chr$(5)
1010 get#15,d$:d(x)=asc(d$+chr$(0))
1020 next:x=0:y=0:d=0
1030 x=x+1:ifx>255then1060
1040 ifd(x)=dtheny=x
1050 goto1030
1060 ify=0andd=0thend=13:x=0:goto1030
1065 ify=0andd=13theny=255:goto1100
1070 d(0)=0:ify>253then1100
1090 d(1)=y+2:d(y)=d:d(y+1)=d:d(y+2)=d:goto1110
1100 d(1)=y-2:d(y)=d:d(y-1)=d:d(y-2)=d
1110 forx=0to255
1120 print#15,"m-w"chr$(x)chr$(5)chr$(1)chr$(d(x)):next
1130 code=144:gosub230
1135 ife<>1thengosub330:iftt<3then970
1136 ife<>1thenf=0:goto670
1140 gosub190:print:printtab(3)"[198]ile has been [208][193][210][212][201][193][204][204][217] recovered."
1150 print:printtab(2)"[198]ile copy all files to another disk;"
1160 printtab(3)"[212]here are permanent format errors"
1170 printtab(3)"that cannot be corrected without"
1180 printtab(8)"re-formatting the disk."
1190 print:printtab(12)"[208]ress any key":poke198,0:wait198,1
1195 gosub190:goto2
1200 gosub190:printtab(12)"[211]ave entire disk"
1210 printtab(12)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
1220 printtab(5)"[201]nsert disk and press [210][197][212][213][210][206] ":poke198,0
1230 geta$:ifa$=chr$(13)then1240
1235 ifa$<>""anda$<>chr$(13)thengosub190:goto2
1236 goto1230
1240 close2:close15:open15,8,15,"u;":forx=1to1000:next
1245 close15:open15,8,15,"i0":gosub210
1250 ife1<>0then2
1255 open2,8,2,"#2":gosub210:ife1<>0then2
1260 re=0:fe=0:we=0
1265 print"[145] "
1270 fort=1to35
1275 fors=0tot(t)
1280 printtab(5)"[145][215]orking on track [157][157][157]"t"[157] sector [157][157][157]"s
1285 code=176:gosub230:ife<>1ande<>4ande<>5thengosub330:iftt>3thenfe=fe+1:goto1330
1295 ife<>1ande<>4ande<>5thenfe=fe+1:goto1330
1300 code=128:gosub230:ife<>1ande<>4ande<>5thengosub330:iftt<3then1300
1305 ife<>1ande<>4ande<>5thenre=re+1:goto1330
1310 ife=4thenprint#15,"m-w"chr$(71)chr$(0)chr$(1)chr$(7)
1320 code=144:gosub230:ife>8thenwe=we+1:goto1330
1321 ife<>1thengosub330:code=144:gosub230
1325 ife<>1thenwe=we+1
1330 ife=3thens=t(t)+1
1335 nexts:nextt
1340 gosub190:printtab(10)"[198]ormat errors:"fe
1350 printtab(5)"[213]nrecoverable read errors:"re
1360 printtab(10)"[211]ectors saved:"683-we
1370 f=0:forx=1to5000:next:goto670
1400 c$="":q$=chr$(34):gosub190
1410 print""c$" [212]his program was taken from the "
1420 print"routines in the book [201]nside [195]ommodore"
1430 print"[196][207][211]. [211]pecial thanks to [210]ichard [201]mmers"
1440 print"and [199]erald [206]eufeld for an excellent "
1450 print"reference guide to the 1541. "
1460 print" [212]his program will correct "q$"soft"q$
1470 print"read errors on your disks. [212]hese are"
1480 print"#22 and #23 read errors. [212]he other "
1490 print"errors such as #20, #21, #27, #29, etc."
1500 print"are created during formatting, and "
1510 print"can't be repaired except by formatting"
1520 print"the disk again."
1530 print" [208]ress any key":poke198,0:wait198,1
1540 gosub190:print" [196]uring the testing of this program"
1550 print"it was discovered that many of the copy"
1560 print"programs do not faithfully duplicate"
1570 print"#22 or #23 errors. [212]hese errors hide a"
1580 printq$"hard"q$" error underneath the "q$"soft"q$
1590 print"error. [212]hese can't be repaired, either."
1600 print" [212]his program is intended to save"
1610 print"your files if you should develop a read"
1620 print"error. [201]f you can't load or read a file"
1630 print"because of a read error, this program"
1635 print"will let you get that file back again."
1640 poke198,0:wait198,1
1650 gosub190:print" [201]f you have a bad file, you should"
1660 print"use the "q$"[211]ave a [198]ile"q$" option. [212]his"
1670 print"will trace the file, and correct"
1680 printq$"soft"q$" errors as they are found. [201]f"
1690 print"any "q$"hard"q$" errors are found, the"
1700 print"file will be severed at that point,"
1710 print"since a hard error cannot be repaired."
1720 print" [212]his will let you retreive at least"
1730 print"a portion of the bad file. [201]f it is a"
1740 print"[194][193][211][201][195] program, the line links will be"
1750 print"corrected before the bad portion of the"
1760 print"file is severed."
1770 poke198,0:wait198,1
1780 gosub190:print" [212]he "q$"[211]ave [197]ntire [196]isk"q$" option"
1790 print"takes a long time, but may be useful"
1800 print"if you don't know where the read errors"
1810 print"are on the disk. [200]owever, this can take"
1820 print"a [214][197][210][217] long time, especially if there"
1830 print"are a number of "q$"hard"q$" errors on the"
1840 print"disk. [215]hen a "q$"hard"q$" error is found, the"
1850 print"program resets and then initializes the"
1860 print"drive and tries again; up to 3 times"
1870 print"per sector before giving up and then"
1880 print"accepting the error."
1890 poke198,0:wait198,1
1900 gosub190:print" [212]he "q$"[211]ave a [198]ile"q$" option is of"
1910 print"main interest. [201]t is the only option"
1920 print"that will allow you to recover a file"
1930 print"with "q$"soft"q$" errors. [212]he errors will"
1940 print"be corrected as the program steps thru"
1950 print"the file. [201]f a "q$"hard"q$" error is found,"
1960 print"the preceeding sector's information is"
1970 print"corrected to sever the bad portion of "
1980 print"the file from the good portion."
1985 print" [199]ood [204]uck!"
1990 poke198,0:wait198,1
2000 print" ":gosub190:goto2