150 FOR I = 0 TO 46: READ K: POKE 880 +I,K: NEXT : DATA 176,7,169,0,133,11,76,125,3,169,1,133,11,96,0,0,169,3,160,138,32,217,3,76,112,3,1,96,1,0,17,15,155,3,0,149,0,0,1,0,254,96,2,0,1,239,216
240 HTAB 5: PRINT "<5> RESURRECT A CLOBBERED TRACK"
250 HTAB 5: PRINT "<6> INITIALIZE ONE TRACK"
260 HTAB 5: PRINT "<7> CHANGE SLOT/DRIVE"
270 HTAB 5: PRINT "<8> EXIT PROGRAM"
280 VTAB 22: HTAB 1: PRINT "YOUR CHOICE IS: ";: GET A$: IF A$ = CHR$(13) THEN 300
290 PRINT A$
300 IF A$ <"1" OR A$ >"8" THEN PRINT CHR$(7): VTAB 22: HTAB 16: CALL -868: GOTO 280
310 A = VAL(A$): IF A = 8 THEN HOME : VTAB 12: INPUT "ARE YOU SURE YOU WANT TO QUIT? ";AN$: ON AN$ < >"Y" AND AN$ < > CHR$(121) GOTO 110: TEXT : POKE SLOT,BS: POKE DRIVE,BD: HOME : END
470 HOME : VTAB 15: HTAB 2: PRINT "TRACK $"TK$" - SECTOR $"SR$" READ INTO MEMORY": VTAB 22: HTAB 1: PRINT "PRESS <RETURN> TO CONTINUE";: GET Z$: PRINT :P2 = 1::TW$ = TK$:SW$ = SR$:RF = 1: GOTO 110
480 EF = 3: ONERR GOTO 2130
490 IF RF < >1 THEN HOME : VTAB 12: PRINT "NO SECTOR IN MEMORY": VTAB 22: PRINT "PRESS <RETURN> TO CONTINUE";: GET Z$: PRINT : HOME : GOTO 180
500 IF LEN(TK$) = 1 THEN TK$ = "0" +TK$
510 IF LEN(SR$) = 1 THEN SR$ = "0" +SR$
520 TEXT : HOME : INVERSE : PRINT SPC( 40)" DISK RESCUE ----- TRACK "TK$" - SECTOR "SR$; SPC( 41): NORMAL : POKE 34,4: VTAB 5: CALL HEXOUT: PRINT : PRINT "PRESS <RETURN> TO RETURN TO MENU. ";: GET A$: PRINT : GOTO 110
530 EF = 4: ONERR GOTO 2130
540 TEXT : HOME : VTAB 12: INVERSE : PRINT "WARNING!";: NORMAL : PRINT " THIS OPTION DESTROYS THE VTOC": PRINT "BEFORE IT RECREATES IT."
550 PRINT : PRINT "BE SURE PROPER DISK IS IN THE DRIVE.": VTAB 21: PRINT "<RETURN> TO CONTINUE, <ESC> FOR MENU";: GET Z$: PRINT : IF Z$ = CHR$(27) GOTO 110
560 TEXT : HOME : INVERSE : PRINT SPC( 40)" DISK RESCUE -------------- RESURRECTOR " SPC( 40): NORMAL : POKE 34,4: REM 14 -'S
570 POKE 34,7: HOME : PRINT " SLOT NUMBER (DEFAULT=" PEEK(SLOT);: INPUT "): ";A$
690 PRINT : PRINT "PRESS <RETURN> TO BEGIN THE": PRINT "RESURRECTION OF THE DISKETTE!": PRINT : PRINT "PRESS <ESC> TO RETURN TO MENU ";: GET A$: IF A$ = CHR$(27) THEN 110
810 HOME : PRINT : HTAB 5: PRINT "DO YOU WISH TO VIEW THE FIRST"
820 HTAB 5: INPUT "SECTOR OF THE FOUND FILE (Y/N)? ";AN$: IF AN$ < >"Y" AND AN$ < >"N" AND AN$ < > CHR$(110) AND AN$ < > CHR$(121) THEN PRINT CHR$(7);: GOTO 810
830 IF AN$ = "N" OR AN$ = CHR$(110) THEN GOTO 910
840 S2 = 37900: POKE ICMD,1
850 IF PEEK(S2) = 0 THEN VTAB 22: CALL -958: PRINT "THAT IS ALL OF THE FILE!": VTAB 23: PRINT "PRESS <RETURN> TO CONTINUE";: GET Z$: PRINT : GOTO 900
880 VTAB 22: HTAB 1: CALL -958: PRINT "DO YOU WISH TO VIEW THIS": INPUT "SECTOR ONCE AGAIN (Y/N)? ";AN$: ON AN$ < >"Y" AND AN$ < >"N" AND AN$ < > CHR$(110) AND AN$ < > CHR$(121) GOTO 880: IF AN$ = "Y" OR AN$ = CHR$(121) GOTO 870
890 VTAB 22: HTAB 1: CALL -958: PRINT "DO YOU WISH TO VIEW THE": INPUT "NEXT SECTOR OF THE FILE (Y/N)? ";AN$: ON AN$ < >"Y" AND AN$ < >"N" AND AN$ < > CHR$(110) AND AN$ < > CHR$(121) GOTO 890: IF AN$ = "Y" OR AN$ = CHR$(121) THEN S2 = S2 +2: GOTO 850
900 VTAB 22: CALL -958: PRINT "DO YOU WISH TO SEE": INPUT "THE ENTIRE FILE AGAIN (Y/N) ";AN$: ON AN$ < >"Y" AND AN$ < >"N" AND AN$ < > CHR$(110) AND AN$ < > CHR$(121) GOTO 900: IF AN$ = "Y" OR AN$ = CHR$(121) THEN GOTO 840
910 HOME : CALL SAVFILE: IF PEEK(14) = 206 THEN 710
920 PRINT : PRINT : PRINT :Q$ = "": FOR Q = NAME TO NAME +35:Q$ = Q$ + CHR$( PEEK(Q)): NEXT
930 IF ASC( MID$ (Q$,1,1)) -128 < ASC("A") OR ASC( MID$ (Q$,1,1)) -128 > ASC("Z") THEN 960
940 A$ = "": FOR Q = 2 TO LEN(Q$): IF ASC( MID$ (Q$,Q,1)) -128 = ASC(",") THEN A$ = ","
950 NEXT : IF A$ = "" THEN 970
960 PRINT : PRINT : PRINT CHR$(7);"THIS IS AN ILLEGAL FILE NAME!!!": PRINT : PRINT "FILE NAMES MUST BEGIN WITH A LETTER": PRINT "AND CANNOT HAVE A COMMA IN THEM": PRINT : PRINT "PRESS <RETURN> TO RE-ENTER NAME ";: GET A$: PRINT : GOTO 910
970 T = PEEK(FSVE) -128: HOME : PRINT : PRINT "FILE TYPE: "TYPE$(T)
980 PRINT : PRINT "FILE NAME: ";: FOR Q = NAME TO NAME +35: PRINT CHR$( PEEK(Q));: NEXT
990 PRINT : INPUT "IS THIS DATA CORRECT (Y/N)? ";AN$: ON AN$ < >"Y" AND AN$ < >"N" AND AN$ < > CHR$(110) AND AN$ < > CHR$(121) GOTO 990: IF AN$ = "N" OR AN$ = CHR$(110) THEN POKE 512,0: GOTO 910
1000 IF AN$ < >"Y" THEN 970
1010 CALL UPDTE: PRINT : PRINT "THE FILE HAS BEEN REENTERED IN THE VTOC": PRINT : PRINT "PRESS <RETURN> TO CONTINUE. ";: GET A$: PRINT : GOTO 710
1020 HOME : PRINT "THE DISKETTE HAS BEEN RESURRECTED!!": PRINT "PRESS <RETURN> TO RETURN TO THE MENU. ";: GET A$: GOTO 110
1030 EF = 5: ONERR GOTO 2130
1040 TEXT : HOME : INVERSE : PRINT SPC( 40)" DISK RESCUE -------- CHANGE SLOT/DRIVE " SPC( 40): NORMAL : POKE 34,4: HOME : REM 8 -'S
1050 VTAB 5: HTAB 1: INPUT "SLOT NUMBER: ";S$: IF S$ = "" THEN 1070
1060 S1 = VAL(S$): IF S1 > = 1 AND S1 < = 7 THEN 1080
1130 TEXT : HOME : VTAB 12: PRINT "BE SURE TO HAVE SEPARATE DISK": PRINT "TO MAKE TEMPORARY COPY OF BAD TRACK": VTAB 21: PRINT "<RETURN> TO CONTINUE, <ESC> FOR MENU";: GET Z$: PRINT : IF Z$ = CHR$(27) GOTO 110
1140 TEXT : HOME : INVERSE : PRINT SPC( 40)" DISK RESCUE -------------- TRACK SAVER " SPC( 40): NORMAL : POKE 34,4: HOME : REM 14 -'S
1150 POKE 34,5: HOME : INVERSE : PRINT "ORIGINAL";: NORMAL : PRINT " SLOT (DEFAULT=" PEEK(SLOT);: INPUT "): ";A$
1160 IF A$ = "" THEN S1 = PEEK(SLOT): VTAB 6: HTAB 16: CALL -868: PRINT S1: GOTO 1200
1660 HOME : VTAB 17: PRINT "A WRITING ERROR HAS OCCURRED ON THE": PRINT "STORAGE DISK. AN INITIALIZED DISK MUST": PRINT "BE USED FOR THIS PURPOSE.": PRINT : PRINT "PRESS <RETURN> TO RETURN TO MENU ";: GET A$
1770 IF SR <TK THEN HOME : VTAB 12: HTAB 1: PRINT "ENDING TRACK IS LESS THAN STARTING TRACK";: VTAB 22: PRINT "<RETURN> TO REENTER, <ESC> FOR MENU";: GET Z$: PRINT : ON Z$ = CHR$(27) GOTO 110: GOTO 1680
1780 HOME : PRINT "TRACK $ SCANNING SECTOR $": POKE 34,7: HOME : VTAB 21: PRINT "PRESS <ESC> TO STOP SCAN": POKE ICMD,1:M = 0:ERR = 0: REM 10/5 SPACES
1820 CALL RWTS: IF PEEK(11) THEN M = M +1: VTAB 13: PRINT "ERROR READING TRACK $"TR$" - SECTOR $"SR$
1830 POKE ICMD,2: CALL RWTS: IF NOT PEEK(11) THEN 1860
1840 IF PEEK(919) = 16 THEN HOME : PRINT : PRINT "THIS DISKETTE IS WRITE PROTECTED!": GOTO 1900
1850 M = M +1: VTAB 15: PRINT "ERROR WRITING TO TRACK $"TR$" - SECTOR $"SR$
1860 POKE ICMD,1
1870 IF PEEK( -16384) = 155 THEN POKE -16368,0: HOME : VTAB 21: PRINT "<ESC> PRESSED TO STOP SCAN": PRINT : PRINT "<ESC> TO QUIT,<RETURN> TO RESUME SCAN";: GET Z$: PRINT : VTAB 21: HTAB 1: CALL -958: IF Z$ = CHR$(27) THEN K = 15:I = SR
1880 NEXT K: NEXT I
1890 IF M = 0 THEN POKE 34,4: HOME : PRINT "NO ERRORS DETECTED!"
1900 VTAB 22: PRINT "PRESS <RETURN> FOR MENU ";: GET A$: PRINT : GOTO 110
1910 EF = 8: ONERR GOTO 2130
1920 TEXT : HOME : VTAB 12: INVERSE : PRINT "WARNING!": NORMAL : PRINT " THIS OPTION ERASES ALL": PRINT "DATA ON SELECTED TRACK.": VTAB 21: PRINT "<RETURN> TO CONTINUE, <ESC> FOR MENU";: GET Z$: PRINT : IF Z$ = CHR$(27) GOTO 110
1930 TEXT : HOME : INVERSE : PRINT SPC( 40)" DISK RESCUE ------------- TRACK INITER " SPC( 40): NORMAL : POKE 34,4: HOME : REM 13 -'S
2080 VTAB 19: PRINT "PRESS RETURN TO CONTINUE": PRINT : PRINT "PRESS ANY OTHER KEY": PRINT "TO RETURN TO MENU! ";: GET A$: IF A$ < > CHR$(13) THEN GOTO 110
2110 IF PEEK(919) = 16 OR PEEK(919) = 32 OR PEEK(919) = 64 OR PEEK(919) = 128 THEN HOME : PRINT : PRINT "A DISK ERROR HAS OCCURED.": PRINT "CHECK DRIVE DOOR AND WRITE-PROTECT TAB": PRINT : PRINT "PRESS <RETURN> TO CONTINUE ";: GET A$: PRINT : HOME : GOTO 2080
2120 POKE 34,4: HOME : VTAB 15: PRINT "INITIALIZING TRACK $";TK$: POKE TINIT +10,TK: POKE TINIT +35,TK: CALL TINIT: HOME : VTAB 15: PRINT "TRACK $"TK$" INITIALIZED!": VTAB 22: PRINT "PRESS <RETURN> TO RETURN TO MENU. ";: GET A$: PRINT : GOTO 110