8-Bit Software Online Conversion
ADFS Sector Rescue - Listing
10REM ADFS Disc Sector Rescue
20REM by M.Bobrowski 5'90
30ON ERROR CLOSE#0:VDU12,10:PRINT"Thi
s program is for ADFS SYSTEM only"':END
40MODE 7:VDU28,0,24,39,20:HIMEM=PAGE+
&600:W%=HIMEM:M%=(&7F00-W%)DIV256:*FX16
50PROCinitialise
60PROCreaddisc(W%,N%):*DISMOUNT
70CLS:PRINT"Insert destination disc,
then press COPY";:REPEATUNTILINKEY(-106)
:PRINT:*MOUNT
80PROCsave
90PRINTCHR$7"Done"
100END
110:
120DEF PROCinitialise
130fdc=&900:osword=&FFF1:*MOUNT
140REPEAT:PRINTTAB(0,0)SPC30:INPUTTAB(
0,0)"Input disc address...&"A$:IF A$=""
A$="FFFF"
150addr%=EVAL("&"+A$):UNTIL addr%>-1 A
ND addr%<&500
160REPEAT:PRINTTAB(0,1)SPC39;TAB(0,1)"
How many sectors (max.";M%;") ?";:INPUT"
"N%:UNTIL N%>0 AND N%<M%
170ENDPROC
180:
190DEF PROCreaddisc(buffor,count)
200LOCAL A%
210addr%=(addr%+&500)MOD&500:?fdc=0:fd
c!1=buffor:fdc?5=8:fdc?6=addr% DIV&10000
:fdc?7=(addr%DIV&100)AND&FF:fdc?8=addr%A
ND&FF:fdc?9=count
220A%=&72:Y%=fdc DIV256:X%=fdc MOD256:
CALL osword
230IF?fdc>0 PRINT''"*** Disc Error ***
";CHR$7;
240ENDPROC
250:
260DEFPROCsave
270S%=256*N%:REPEAT:PRINTTAB(0,2)"Crea
te a Basic Program ? ";:G$=GET$:UNTIL IN
STR("YyNn",G$):CLS:INPUT"Enter directory
pathname or press RETURN"P$:IF P$<>"" I
F RIGHT$(P$,1)<>"." P$=P$+"."
280IF INSTR("Nn",G$) C$="SAVE "+P$+"Re
scue"+A$+" "+STR$÷W%+" +"+STR$÷S%+" 0 0"
:OSCLI(C$):ENDPROC
290REPEAT:PRINTTAB(0,2)SPC38:INPUTTAB(
0,2)"Enter filename : "F$:UNTIL F$>"" AN
D LENF$<11:F$=P$+F$
300L%=W%+256*(N%-1):FOR I%=L% TO L%+&1
00:IF ?I%=&D T%=I%+2
310NEXT:?(T%-1)=&FF
320C$="SAVE "+F$+" "+STR$÷W%+" "+STR$÷
T%+" FFFF8023 FFFF0E00":OSCLI(C$):ENDPRO
C