home *** CD-ROM | disk | FTP | other *** search
- 0 a$="":iflf=1then2
- 1 gosub10000:dimp$(145),a$(255):iflf=0thenlf=1:load"input 1-255.o",8,1
- 2 q$=chr$(34):zz$=chr$(0)
- 4 :
- 5 print"[147][144]";:poke53281,44:poke53280,125
- 10 gosub 20000:poke198,0:rem instructions
- 11 getk$:ifk$<>" "then11
- 12 gosub 30000:ifsc=0then800
- 13 print"[213]n-scratch which file? <'quit' to exit>":inputf$:print"[145] "f$"*"
- 14 iff$="quit"then60002
- 20 fd=0:open15,8,15
- 30 open2,8,2,"#"
- 35 :
- 40 tr=18:se=1:bp=2:tt=0
- 42 rem tr and se are track and sector
- 43 rem they start at 18-1
- 44 :
- 50 print#15,"u1:"2;0;tr;se
- 52 rem read a block from the directory
- 54 :
- 60 get#2,x$:get#2,z$:x=0
- 62 rem get next track/sector link
- 63 :
- 64 ot=tr:tr=asc(x$+zz$)
- 65 os=se:se=asc(z$+zz$)
- 70 x=x+1
- 75 print#15,"b-p:"2;bp
- 79 :
- 80 sys828,2,19:ty=asc(mid$(a$,1,1)):ifty<>0andty<>128then90
- 81 rem read a name & check type
- 82 :
- 83 qd$=mid$(a$,4)
- 84 iff$=mid$(a$,4,len(f$))thenprintq$qd$q$" found!!":fd=1:goto500
- 90 bp=bp+32
- 91 :
- 92 ifx<8then70
- 93 rem 8 files per directory block
- 94 :
- 96 iftr<>0andse<>255thenbp=2:tt=tt+1:goto50
- 98 forp=0toc
- 99 printp$(p):next
- 100 close2:close15
- 500 rem time to try un-newing
- 501 iffd=0thenprint"[212]hat file is not there!":goto800
- 502 print"[215]hat kind of file do you think it was?"
- 503 print:print" 1 = [211][197][209]":print" 2 = [208][210][199]":print" 3 = [213][211][210]"
- 504 getk$:ifk$<"1"ork$>"3"then504
- 505 tz=val(k$)+128
- 506 printk$"... [200]ere goes!"
- 510 tr=ot:se=os
- 520 :
- 530 :
- 540 print#15,"b-p:"2;bp
- 550 forx=bptobp+29:get#2,a$(x):next
- 559 :
- 560 a$(bp)=chr$(tz)
- 561 rem change type of file
- 562 :
- 620 print#15,"b-p:"2;bp
- 630 print#2,a$(bp);
- 631 print#15,"b-p:"2;1
- 632 print#15,"u2:"2;0;tr;se
- 633 rem write the next directory block
- 640 :
- 641 nt=asc(a$(bp+1)+zz$)
- 642 ns=asc(a$(bp+2)+zz$)
- 643 lb=asc(a$(bp+28)+zz$)
- 644 hb=asc(a$(bp+29)+zz$)
- 645 nb=lb+hb*256
- 646 :
- 647 rem the next section tries to
- 648 rem re-allocate the blocks used by
- 649 rem the unscratched file.
- 650 forx=1tonb
- 660 print#15,"u1:"2;0;nt;ns
- 670 print#15,"b-a:"0;nt;ns
- 672 input#15,er,er$,tr,se
- 674 ifer=65 thenprint"[211]orry...can't un-new this file!":x=nb+10:fl=10
- 675 :
- 676 rem get link again
- 680 get#2,a$:get#2,b$
- 690 nt=asc(a$+zz$)
- 700 ns=asc(b$+zz$)
- 740 nextx
- 745 iffl<>10then790
- 750 forqd=15to1step-1:ifright$(qd$,1)=chr$(160)thenqd$=left$(qd$,qd)
- 751 next
- 760 iffl=10thenprint#15,"s0:"qd$:print#15,"v0"
- 770 print"[202]ust to clean things up, we need to "
- 780 print"validate. [208]lease wait while [201] do so."
- 790 close15:close2
- 800 close15:print"finished..":goto60000
- 10000 t$=" ":c=0:c$="":print"[147]":poke53281,0
- 10030 printspc(7)""t$:printspc(7)" 1541 [198]ile [213]n-scratcher. [146]"
- 10051 printspc(7)""t$:print:printtab(18)"by"
- 10060 print:printspc(13)"[193]lan [199]ardner"
- 10065 print:printspc(10)"& [202]ames [199]. [215]eiler"
- 10070 print:printspc(12)"[195]opyright 1985"
- 10080 print:print:print:print" [204][207][193][196][211][212][193][210] is not public domain."
- 10090 print:print" [208]lease respect the author's rights."
- 10100 print:print" [208]ress space bar to continue."
- 10110 forcc=1to48:getk$:ifk$=" "then10130
- 10120 ifcc=1thenprintmid$(c$,c+2,1)"[145][145]";:c=not(c)
- 10125 next:goto10100
- 10130 printc$:return
- 20000 print"[147] [202]ust give me a file name."
- 20005 print:print"[201]f that file has been scratched, or if"
- 20006 print:print"a file whose name starts with what you"
- 20007 print:print"typed has been scratched, [201] will un-"
- 20020 print:print"scratch it if [201] can find it all."
- 20030 print:print:print" [206]ow, put the disk with the scratched"
- 20040 print:print"file on it in your disk drive"
- 20050 print:print"and press the space bar."
- 20090 return
- 30000 sc=0:print"[147][211]cratched files on this disk:"
- 30005 open15,8,15
- 30010 open2,8,2,"#"
- 30020 tr=18:se=1:bp=2:tt=0
- 30030 print#15,"u1:"2;0;tr;se
- 30040 get#2,x$:get#2,z$:x=0
- 30050 ot=tr:tr=asc(x$+zz$)
- 30060 os=se:se=asc(z$+zz$)
- 30070 x=x+1
- 30080 print#15,"b-p:"2;bp
- 30090 sys828,2,19:ty=asc(mid$(a$,1,1)):ifty<>0andty<>128then30110
- 30100 ifmid$(a$,4,1)<>zz$thenprintq$mid$(a$,4)q$:sc=sc+1
- 30110 bp=bp+32
- 30120 ifx<8then30070
- 30130 iftr<>0andse<>255thenbp=2:tt=tt+1:goto30030
- 30140 forp=0toc
- 30150 printp$(p):next
- 30160 close2:close15
- 30165 ifsc=0thenprint"[212]here are no scratched files there!"
- 30170 return
- 50000 open15,8,15
- 50010 input#15,a$,b$,c$,d$
- 50020 printa$,b$,c$,d$:close15
- 60000 print""spc(14)"<press a key>"
- 60001 poke198,0:wait198,1:geta$
- 60002 print"[147][215]ould you like to try another?"
- 60003 poke198,0:wait198,1:geta$:ifa$<>"y"anda$<>"n"thenpoke53280,rnd(1)*15:goto60003
- 60004 ifa$="y"then0
- 60006 goto63000
- 60010 :
- 63000 print"[147][208]lease put the [204][207][193][196][211][212][193][210] disk back in thedrive and press a key.
- 63002 [151]198,0:[146]198,1:[161]a$
- 63003 [151]927,0: [143] _ menu.sp1
- 63005 [153]"loadload"[199](34)"hello"[199](34)",8":[153]"run"
- 63010 [151]631,13:[151]632,13:[151]198,2:[128]
-