8-Bit Software Online Conversion
:2.$.DFSRcvr - Listing
10MODE7:T$= "File Rescue"
20h%=(TOP+&900)AND&FF00:H%=HIMEM
30HIMEM=h%:ON ERROR PROCerr
40PROCinit:ON ERROR PROCerror
50REPEAT CLS:PROChd("Main Menu")
60FOR Y%=1 TO opts
70PRINTTAB(ox%,4+Y%)red$;Y%ylw$opt$(Y
%)
80NEXT:REPEAT PROCmemused
90PRINTTAB(25,oy%-3)cyn$drv
100PRINTTAB(25,oy%-2)cyn$traks
110PROCcn(grn$+"Press key for your cho
ice : ",oy%+2)
120Q%=FNin(opts$):IF Q%=3 PROCwipe
130IF Q%=4 PROCdrive
140IF Q%=5 PROCswap
150UNTIL Q%=1 OR Q%=2 OR Q%=6
160IF Q%=1 PROCsearch
170IF Q%=2 PROCrecover
180IF Q%=6 quit=TRUE
190UNTIL quit:PROCquit:END
200DEF PROCerror:PROCcoff
210IF ERR=17 ENDPROC
220ON ERROR OFF:PROCquit
230DEF PROCerr:PROCcon
240REPORT:PRINT" at line ";ERL:END
250DEF PROCquit:CLS:*fx4
260PROCcon:PROChd("End"):*FX18
270PRINT':@%=10:ENDPROC
280DEF PROCinit:PROCcoff:*FX4,1
290READ opts:DIM opt$(opts)
300FOR O%=1 TO opts:READ opt$(O%)
310opts$=opts$+STR$O%:NEXT
320ox%=2:oy%=O%+4
330c$=CHR$&88+CHR$&88+CHR$&89+CHR$&89
340copy$=CHR$&87:tab$=CHR$9:cr$=CHR$13
350buff1=&B00:buff2=&C00:buff3=&A00
360quit=FALSE:ctrl=&70:PROCassem
370sects=10:traks=40:sct=2:trk=0
380drv=0:P%=999:@%=5:J%=0
390red$=CHR$129:grn$=CHR$130
400ylw$=CHR$131:blu$=CHR$132
410mag$=CHR$133:cyn$=CHR$134
420wht$=CHR$135:ENDPROC
430DATA 6
440DATA Search disc for data
450DATA Recover data from disc
460DATA Wipe memory clean
470DATA Select disc drive
480DATA Number of tracks
490DATA Quit
500DEF PROCcoff:LOCAL B%
510DEF PROCcon:LOCAL B%:B%=1
520VDU23,1,B%;0;0;0;:ENDPROC
530DEF PROChd(t$):VDU26,12
540PROCdb(grn$+T$+" ` "+t$+" ",0)
550ENDPROC
560DEF PROCdb(t$,Y%)
570PROCcn(CHR$141+t$+" ",Y%)
580PROCcn(CHR$141+t$+" ",Y%+1)
590ENDPROC
600DEF PROCcn(t$,Y%)
610LOCAL X%:X%=(40-LEN(t$))DIV2
620PRINTTAB(X%,Y%)t$:ENDPROC
630DEF FNin(k$):LOCAL I%:*FX21
640PROCcon:REPEAT I%=INSTR(k$,GET$)
650VDU-7*(I%=0):UNTILI%:PROCcoff:=I%
660DEF PROCrd(d%,t%,s%,b%):W%=&53
670DEF PROCwrt(d%,t%,s%,b%):W%=&4B
680ctrl?0=d%:ctrl!1=b%:ctrl?5=3
690ctrl?6=W%:ctrl?7=t%:ctrl?8=s%
700ctrl?9=&21:PROCdfs(ctrl,10)
710ENDPROC
720DEF PROCdfs(C%,e%)
730LOCAL A%,X%,Y%,R%
740A%=&7F:X%=C%:Y%=X%DIV256
750REPEAT R%=R%+1:CALL &FFF1
760UNTIL C%?e%=0 OR R%=10
770IF C%?e%=0 ENDPROC
780PROCcn("Disc Error!!",VPOS+1)
790PROCcn("Press Space to continue or
Escape",VPOS+2
800Z%=FNin(" "):ENDPROC
810DEF PROCrecover:PROChd("Recover")
820IF NOT FNfull PROCsaving
830IF J%>0 PROCmemsave
840ENDPROC
850DEF PROCsaving
860PROCcn(cyn$+"Use [ and ] to change
sector, ",5)
870PROCcn(cyn$+"S to save, or Q to qui
t: ",6)
880LOCAL F%,X%,Y%:X%=POS:Y%=VPOS
890REPEAT PROCmemused
900PROCrd(drv,trk,sct,buff1)
910PROCscreen(buff1):VDU31X%Y%
920K%=(FNin(c$+"SsQq")+1)DIV2
930IF K%=3 PROCsave
940IF K%=2 PROCinc
950IF K%=1 PROCdec
960UNTIL (K%=4) OR FNfull
970PROCmemused:ENDPROC
980DEF PROCsave
990!ptr=J%+HIMEM:CALLshift2
1000J%=J%+&100:SOUND 1,-7,40,1
1010PROCinc:ENDPROC
1020DEF FNfull=((J%+HIMEM)=H%)
1030DEF PROCmemused:LOCAL L%,j$
1040IF FNfull j$=red$+"Memory full"+wht
$ ELSE j$=grn$+"Memory used"+wht$
1050PROCcn(j$,19):L%=38*J%DIV(H%-HIMEM)
1060j$=grn$+STRING$(L%,CHR$&FF)
1070IF L%>30 j$=ylw$+MID$(j$,2)
1080IF L%>35 j$=red$+MID$(j$,2)
1090PRINTTAB(0,20)j$SPC(38-L%):ENDPROC
1100DEF PROCmemsave
1110PROCcn(ylw$+"Do you want to save no
w? ",22)
1120IF FNin("YyNn")>2 ENDPROC
1130PRINTCHR$13SPC39:PROCcn(ylw$+"Chang
e disc, then press Space...",22)
1140Z%=FNin(" "):PRINTCHR$13SPC39CHR$13
;
1150PRINTmag$"Enter filename:"red$;
1160F$=FNfnm(12):PROCcli("SAVE "+F$+" "
+STR$÷HIMEM+"+"+STR$÷J%+" 0 0")
1170ENDPROC
1180DEF FNfnm(L%):LOCAL F$,X%,Y%
1190X%=POS:Y%=VPOS:REPEAT PROCcon
1200PRINTTAB(X%,Y%)SPC(LENF$);
1210INPUTTAB(X%,Y%)F$:PROCcoff
1220UNTIL LENF$<=L%:=F$
1230DEF PROCscreen(!ptr)
1240VDU28,3,17,37,8,12
1250CALL ascout:VDU26:ENDPROC
1260DEF PROCwipe:IF J%=0 ENDPROC
1270PROCcn(ylw$+"Are you sure?"+wht$,15
)
1280IF FNin("YyNn")<3 J%=0
1290PRINTCHR$13SPC40;:ENDPROC
1300DEF PROCdrive
1310drv=drv+1:IF drv=4 drv=0
1320ENDPROC
1330DEF PROCswap
1340IF traks=80 traks=40 ELSE traks=80
1350ENDPROC
1360DEF PROCsearch
1370PROChd("Search")
1380PROCcn("Enter a distinctive string
from the",VPOS+2)
1390PROCcn("file you wish to find:",VPO
S+1)
1400Y%=VPOS+2:PROCcon
1410REPEAT INPUTTAB(0,Y%)$buff3
1420UNTIL $buff3>"":?leng=LEN$buff3
1430PROCcn(CHR$136+"Searching...",VPOS+
2)
1440M%=sects*traks-1:trk=0:sct=2
1450PROCrd(drv,trk,sct,buff1)
1460REPEAT REPEAT PROCinc
1470PROCrd(drv,trk,sct,buff2)
1480A%=USR(cmp)AND&FF:IF A% CALLshift1
1490UNTIL FNend:IF A%=0 PROCthis`it
1500UNTIL FNend:IF A%<>0 PROCnot`fnd
1510ENDPROC
1520DEF FNend=A%=0ORV%=M%OR!buff1=&E5E5
E5E5
1530DEF PROCthis`it
1540PROCdec:PROCscreen(buff1)
1550PROCcn(red$+"Is this the file you w
ant? ",20):A%=FNin("YyNn")>2
1560PROCcn(STRING$(28," "),VPOS)
1570IF A% PROCcn(ylw$+CHR$136+"Continui
ng search...",VPOS):CALL shift1
1580ENDPROC
1590DEF PROCnot`fnd
1600PROCcn(red$+"I could not find this
string. ",20)
1610PROCcn(ylw$+"Press SPACE to continu
e... ",22)
1620Z%=FNin(" "):ENDPROC
1630DEF PROCinc:sct=sct+1
1640IF sct=sects trk=trk+1:sct=0
1650IF trk=traks trk=0:sct=2
1660V%=trk*10+sct:ENDPROC
1670DEF PROCdec:sct=sct-1
1680IF sct=1 IF trk=0 sct=-1
1690IF sct=-1 sct=sects-1:trk=trk-1
1700IF trk=-1 trk=traks-1
1710V%=trk*10+sct:ENDPROC
1720DEF PROCcli($&700):LOCAL X%,Y%
1730Y%=7:CALL &FFF7:ENDPROC
1740DEF PROCassem:LOCAL L%,P%
1750DIM code &80
1760oswrch=&FFEE:osnewl=&FFE7
1770ptr=&88:leng=&8A
1780FOR L%=0 TO 2 STEP 2
1790P%=code:[OPT L%:.cmp
1800 LDA #buff1 MOD256:STA ptr
1810 LDA #buff1 DIV256:STA ptr+1
1820.clp1 LDY #&00:.clp2 LDA (ptr),Y
1830 CMP buff3,Y:BNE notsame:INY
1840 CPY leng:BNE clp2:LDA #&00:RTS
1850.notsame INC ptr:BNE clp1
1860 LDA #&FF:RTS
1870.shift1 LDY #0:.slp1 LDA buff2,Y
1880 STA buff1,Y:INY:BNE slp1:RTS
1890.shift2 LDY #0:.slp2 LDA buff1,Y
1900 STA (ptr),Y:INY:BNE slp2:RTS
1910.ascout LDY #0:.asclp TYA
1920 AND #&1F:BNE nocr:JSR osnewl
1930.nocr LDA (ptr),Y:JSR ascii
1940 JSR oswrch:INY:BNE asclp:RTS
1950.ascii CMP #32:BCC dot
1960 CMP #127:BCS dot:RTS
1970.dot LDA #ASC".":RTS
1980]:NEXT:ENDPROC