start tok64 d64-rjxgfM 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) 10 POKE53281,0:POKE53280,0:PRINTCHR$(14)"{clear}{space*5}{white}{cm +*30}" 20 PRINT"{space*5}{white}{cm +}{reverse on}{blue}{space*28}{white}{reverse off}{cm +}" 30 PRINT"{space*5}{white}{cm +}{reverse on}{blue}{space*8}Resurrection{space*8}{white}{reverse off}{cm +}" 40 PRINT"{space*5}{white}{cm +}{reverse on}{blue}{space*8}{cm t*12}{space*8}{white}{reverse off}{cm +}" 50 PRINT"{space*5}{white}{cm +}{reverse on}{blue}{space*13}by{space*13}{white}{reverse off}{cm +}" 60 PRINT"{space*5}{white}{cm +}{reverse on}{blue}{space*28}{white}{reverse off}{cm +}" 70 PRINT"{space*5}{white}{cm +}{reverse on}{blue}{space*7}John Crookshank{space*6}{white}{reverse off}{cm +}" 80 PRINT"{space*5}{white}{cm +}{reverse on}{blue}{space*28}{white}{reverse off}{cm +}" 90 PRINT"{space*5}{white}{cm +*30}{down*2}" 100 PRINTTAB(14)"{white}Select Option:":CLOSE2:f=0:ef=0 110 PRINTTAB(14)"{white}{cm t*14}":CLOSE15 120 PRINTTAB(12)"{down*2}{green}1: {light blue}Save a Sector" 130 PRINTTAB(12)"{down}{green}2: {light blue}Save a File" 140 PRINTTAB(12)"{down}{green}3: {light blue}Save Entire Disk" 150 PRINTTAB(12)"{down}{green}4: {light blue}Read Instructions":POKE198,0 155 PRINTTAB(12)"{down}{green}5: {light blue}Exit Program":POKE198,0 160 GETi$:i=VAL(i$) 170 IFi<1ORi>5THEN160 180 ONiGOTO500,700,1200,1400,450 190 PRINT"{home}{down*10}":FORx=1TO13 195 PRINT"{space*39}":NEXT:PRINT"{up*14}":RETURN 198 RETURN 200 POKE631,154:POKE198,1:RETURN 210 INPUT#15,e1,e$,e2,e3:IFe1=0THENRETURN 220 GOSUB190:PRINT"{down*4}{space*9}{red}"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$="Unrecoverable format error" 292 IFe=3THENe$="Cannot find track" 293 IFe=8THENe$="Write protect on" 310 e=e+18:GOSUB190:PRINT"{down*2}{red}"e;e$;t;s 320 PRINT"{white}{down}Sorry, 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:POKE631,5:POKE198,1:END 500 GOSUB190:PRINTTAB(14)"{white}Save a Sector" 510 PRINTTAB(14)"{white}{cm t*13}":t=-1:s=-1 520 PRINT"{down*2}{green}Input track desired: {black}";:GOSUB200:INPUTt 525 IFt<1THENGOSUB190:GOTO100 530 IFt>35THENGOSUB190:PRINTTAB(14)"{white}{down*6}Invalid track!":FORx=1TO4000:NEXT:GOTO500 540 PRINT"{down*2}{green}Input sector desired:{black}";:GOSUB200:INPUTs 550 IFs<0THENGOSUB190:GOTO100 560 IFs>t(t)THENGOSUB190:PRINTTAB(14)"{white}{down*6}Invalid sector!":FORx=1TO4000:NEXT:GOTO500 570 GOSUB190:PRINTTAB(15)"{white}Working{.*3}" 575 CLOSE15:OPEN15,8,15,"u;":FORx=1TO1000:NEXT 580 CLOSE15:OPEN15,8,15,"i0":GOSUB210:IFe1<>0THEN100 585 OPEN2,8,2,"#2":GOSUB210:IFe1<>0THEN100 590 PRINTTAB(7)"{down*2}Reading 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"{down*2}{yellow}{space*4}No 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)"{down*2}{yellow}Track"t"sector"s"saved!" 670 FORx=1TO5000:NEXT 680 IFf=0THENCLOSE2:CLOSE15:GOSUB190:GOTO100 690 IFf=1THEN820 700 GOSUB190:PRINTTAB(14)"{white}Save a File":PRINTTAB(14)"{cm t*11}" 705 f$="":lt=0:ls=0:ef=0 710 PRINT"{down*2}{green}Input filename:{black}";:GOSUB200:INPUTf$ 720 IFf$=""THENGOSUB190:GOTO100 730 CLOSE2:CLOSE15:OPEN15,8,15,"u;":FORx=1TO1000:NEXT 732 PRINT#15,"i0":GOSUB210:IFe1<>0THEN100 735 OPEN2,8,2,"0:"+f$ 740 GOSUB210:IFe1=62ORe1=21THEN700 741 IFe1=22ORe1=23THENt=e2:s=e3:GOTO770 742 IFe1<>0THENPRINTTAB(10)"{down*4}Cannot 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)"{down}{white}Saving "CHR$(34)f$CHR$(34) 776 PRINT"{down*2}{light blue}{space*7}Reading track{space*3}{left*3}"t"{left} sector{space*3}{left*3}"s 780 IFt=0THENPRINT"{down*2}{white}{space*15}End of file":f=0 790 IFt=0ANDef>0THENPRINTTAB(p)"{down}{yellow}"CHR$(34)f$CHR$(34)" has been saved!":GOTO670 791 IFt=0ANDef<1THENPRINTTAB(p+2)"{down}{yellow}No errors in "CHR$(34)f$CHR$(34):GOTO670 792 IFt>35ORs>t(t)THEN940 800 PRINT"{up}{light blue}{space*7}Reading track{space*3}{left*3}"t"{left} sector{space*3}{left*3}"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)"{down*4}{red}Remove Write Protect!":f=0:GOTO670 937 IFe<>1THENGOSUB330:IFtt<3THEN920 940 GOSUB190:PRINTTAB(7)"{red}{down}Unrecoverable format error." 950 PRINTTAB(6)"{down}Fixing sector links to allow" 960 PRINTTAB(5)"file recovery up to this point." 965 PRINTTAB(13)"{down}(Be 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)"{light blue}File has been {white}partially{light blue} recovered." 1150 PRINT:PRINTTAB(2)"File copy all files to another disk;" 1160 PRINTTAB(3)"There are permanent format errors" 1170 PRINTTAB(3)"that cannot be corrected without" 1180 PRINTTAB(8)"re-formatting the disk." 1190 PRINT:PRINTTAB(12)"{white}Press any key":POKE198,0:WAIT198,1 1195 GOSUB190:GOTO100 1200 GOSUB190:PRINTTAB(12)"{white}Save entire disk" 1210 PRINTTAB(12)"{cm t*16}" 1220 PRINTTAB(5)"{green}{down*2}Insert disk and press {reverse on} RETURN {reverse off}":POKE198,0 1230 GETa$:IFa$=CHR$(13)THEN1240 1235 IFa$<>""ANDa$<>CHR$(13)THENGOSUB190:GOTO100 1236 GOTO1230 1240 CLOSE2:CLOSE15:OPEN15,8,15,"u;":FORx=1TO1000:NEXT 1245 CLOSE15:OPEN15,8,15,"i0":GOSUB210 1250 IFe1<>0THEN100 1255 OPEN2,8,2,"#2":GOSUB210:IFe1<>0THEN100 1260 re=0:fe=0:we=0 1265 PRINT"{up}{space*38}{down}" 1270 FORt=1TO35 1275 FORs=0TOt(t) 1280 PRINTTAB(5)"{up}Working on track{space*3}{left*3}"t"{left} sector{space*3}{left*3}"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)"{light blue}{down*2}Format errors:"fe 1350 PRINTTAB(5)"{down}Unrecoverable read errors:"re 1360 PRINTTAB(10)"{down}{yellow}Sectors saved:"683-we 1370 f=0:FORx=1TO5000:NEXT:GOTO670 1400 c$="{home}{down*11}":q$=CHR$(34):GOSUB190 1410 PRINT"{light blue}"c$"{space*3}This program was taken from the " 1420 PRINT"routines in the book {yellow}Inside Commodore" 1430 PRINT"DOS{light blue}. Special thanks to {green}Richard Immers{light blue}" 1440 PRINT"and {green}Gerald Neufeld{light blue} for an excellent{space*4}" 1450 PRINT"reference guide to the 1541.{space*11}" 1460 PRINT"{down}{space*3}This program will correct "q$"soft"q$ 1470 PRINT"read errors on your disks. These are" 1480 PRINT"#22 and #23 read errors. The 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"{space*13}{white}Press any key{home}":POKE198,0:WAIT198,1 1540 GOSUB190:PRINT"{light blue}{space*3}During 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. These errors hide a" 1580 PRINTq$"hard"q$" error underneath the "q$"soft"q$ 1590 PRINT"error. These can't be repaired, either." 1600 PRINT"{down}{space*3}This program is intended to save" 1610 PRINT"your files if you should develop a read" 1620 PRINT"error. If 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"{space*3}If you have a bad file, you should" 1660 PRINT"use the "q$"Save a File"q$" option. This" 1670 PRINT"will trace the file, and correct" 1680 PRINTq$"soft"q$" errors as they are found. If" 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"{space*3}This will let you retreive at least" 1730 PRINT"a portion of the bad file. If it is a" 1740 PRINT"BASIC 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"{light blue}{space*3}The "q$"Save Entire Disk"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. However, this can take" 1820 PRINT"a VERY long time, especially if there" 1830 PRINT"are a number of "q$"hard"q$" errors on the" 1840 PRINT"disk. When 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"{space*3}The "q$"Save a File"q$" option is of" 1910 PRINT"main interest. It is the only option" 1920 PRINT"that will allow you to recover a file" 1930 PRINT"with "q$"soft"q$" errors. The errors will" 1940 PRINT"be corrected as the program steps thru" 1950 PRINT"the file. If 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"{down}{space*14}Good Luck!" 1990 POKE198,0:WAIT198,1 2000 PRINT"{down*2}{space*38}{home}":GOSUB190:GOTO100 stop tok64 (bastext 1.0)