10REM Bad program fixer
20REM (C) 1996 Jon Ripley
30REM This program is PD
40REM Please DO NOT ALTER this progra
m
50DEFFNS="BPrgFix"
60MODE 7
70FORX=1TO2:PRINTTAB(1,X)CHR$141;CHR$
(126+2*X)"Bad Program Fixer (C) Jon Ripl
ey":NEXT
80VDU28,0,24,39,4
90INPUT"Start of program (eg 1900) :&
"P$
100P%=EVAL("&"+P$)
110line=P%:line?1=0:finished=FALSE
120REPEAT
130PROCrecover
140UNTILfinished
150PAGE=P%
160END
170DEFPROCrecover
180?line=&0D:lenpos=line+3:count=1
190IF?line=&0D AND line?1=&FF finished
=TRUE:ENDPROC
200PRINT(line?1)*256+(line?2);
210REPEAT
220IF line?count<>&0D count=count+1
230IF line?count<>&0D AND line?count<3
2 AND count>4 line?count=35
240IF count>250 line?(count+1)=&0D
250UNTILline?count=&0D
260PRINT÷line
270line=line+count:?lenpos=count
280ENDPROC