Compucolor.org – Virtual Media

Listing of file='DIRFIX.BAS;01' on disk='vmedia/catalog_32-sector.ccvf'

100 REM  	DIRFIX	16/3/81
110 PLOT 12:CLEAR 1000
120 PLOT 6,48,14,3,11,0:PRINT "   D I R E C T O R Y   R E S T O R E R   ":PLOT 6,2,15,3,0,5
130 PRINT "AS THE DATA DISKS HOLD THE DIRECTORY BLOCKS OF ALL INDEXED":PRINT
140 PRINT "DISKS, CURRENT AT THE LAST UPDATE, DAMAGED DISK DIRECTORIES":PRINT
150 PRINT "MAY BE RESTORED AS FAR AS THE LAST INDEX UPDATE BY COPYING":PRINT
160 PRINT "THE DIRECTORY BLOCKS BACK TO THE DISK.":PRINT :PRINT
170 PRINT "AS THIS PROGRAM WRITES DIRECTORY BLOCKS BACK TO DISK, USE":PRINT
180 PRINT "EXTREME CARE IN INSERTING THE CORRECT DISK IN THE CORRECT":PRINT
190 PRINT "DRIVE AS PROMPTED ON SCREEN.":PRINT :PRINT
200 TM= PEEK (32940)+ PEEK (32941)* 256:DR= PEEK (TM+ 1):DR$= MID$ (STR$ (DR),2)+ ":"
210 LA= TM+ 3:Z= LA:GOSUB 440:LA$= B$
220 FILE "T",430
230 FILE "R",1,"INDEX",1:GET 1,1;ST$[1]
240 PRINT :INPUT "DISK NUMBER AND SIDE  E.G.  C2F   ? ";DN$:PRINT
250 IF LEN (DN$)< > 3THEN 240
260 DS$= RIGHT$ (DN$,1):IF DS$< > "F"AND DS$< > "B"THEN 240
270 AL$= LEFT$ (DN$,1):IF AL$< "A"OR AL$> "J"THEN 240
280 NU= VAL (MID$ (DN$,2,1)):IF NU< 0OR NU> 9THEN 240
290 RE= (ASC (AL$)- 65)* 20+ NU* 2+ 1- (DS$= "B")
295 GET 1,RE;ST$[1]:IF ST$= CHR$ (0)THEN PRINT "NO RECORD EXISTS FOR "DN$:PRINT :GOTO 240
300 GET 1,RE,11;S1$[1],S2$[1],S3$[1]:SZ= (ASC (S1$)AND 127):SB= ASC (S2$)+ ASC (S3$)* 256
310 Z= SZ* 128:GOSUB 440:SZ$= B$:Z= SB:GOSUB 440:SB$= B$:DD= 1- (S1$> CHR$ (127))
320 PRINT :PRINT "INSERT DATA DISK #"DD" IN CD"DR$"":INPUT "";YN$
330 PLOT 27,4:PRINT "REA"+ DR$+ " "+ SB$+ " "+ LA$+ " "+ SZ$:PLOT 27,27
340 PRINT "INSERT DISK "DN$" IN CD"DR$"":INPUT "";YN$
350 INPUT "PRESS ENTER AFTER DOUBLE-CHECKING THE DISK AND THE DRIVE. ";YN$:PRINT
360 PLOT 27,4:PRINT "WRI"+ DR$+ " 0 "+ LA$+ " "+ SZ$:PLOT 27,27
370 PRINT "DIRECTORY RESTORED TO DISK "DN$" FROM DATA DISK.":PRINT
375 PLOT 27,4:PRINT "DIR"+ DR$:PLOT 27,27:PRINT
380 PRINT "INSERT PROGRAM DISK IN CD0:":PRINT
390 INPUT "ANOTHER ONE   Y/N?  ";YN$:PRINT
400 IF YN$= "Y"THEN 240
410 IF YN$< > "N"THEN 390
420 FILE "C",1:PLOT 1
430 PRINT "FILE ERROR!":PRINT :GOTO 420
440 B$= "":Z2= Z
450 Z1= Z2- INT (Z2/ 16)* 16:Z2= INT (Z2/ 16)
460 IF Z1< 10THEN B$= CHR$ (48+ Z1)+ B$
470 IF Z1> 9THEN B$= CHR$ (55+ Z1)+ B$
480 IF Z2= 0THEN RETURN
490 GOTO 450