10REM"
20REM"
40REM"
60REM" This program will convert most
70REM" files containing control codes
80REM" Remove line 320 to run from a
90REM" menu. Place filename in $&A00.
100REM" Run with Z%=1 for a printout
.
110REM" Remove the REM from line
s
120REM" 370 and 390 to save converte
d
130REM" file. Change the value o
f
140REM" PTR#F% in line 340 to miss ou
t
150REM" header files etc. 0 if none
.
160REM" To convert from a chosen poin
t
170REM" in a file, enter the phrase t
o
180REM" start from after entering "Y
"
190REM" To MARKED PRINTOUT? Pres
s
200REM" ESCAPE to stop printout
.
210REM" -----------------------------
-
220REM" This program is Public domain
.
230REM" Please do not alter it in an
y
240REM" way. If you use any of th
e
250REM" routines, please mention m
e
260REM" in the titles. Thanks, CJR
.
270REM" -----------------------------
-
280DEFFNS="7TO3"
285*FX229,0
290ONERROR:CLOSE#0:OSCLI"SPOOL":VDU3:Z
%=0:OSCLI"*EX. !BOOT":END
300MODE3:VDU21:PROCass
310VDU6,23;8202;0;0;0;19,1,3;0;
320REM REPEAT:PRINT"DRIVE TO READ FROM
?":D$=GET$:UNTILVALD$<4:OSCLI"DR."+D$:OS
CLI".":INPUT"FILE TO PRINTOUT?"$&A00:REM
REMOVE IF FROM MENU
330F%=OPENIN $&A00:?&A50=13:?&71=F%:!&
72=0:!&76=0
340PRINT"MARKED PRINTOUT? Y/N":IF GET$
="Y":PROCmark ELSE PTR#F%=&E7:IF RIGHT$(
$&A00,1)="1":PTR#F%=&10C
350PRINTTAB(18)"Print out a teletext f
ile by C.J.Richardson."'TAB(29)"Press SH
IFT to scroll."''
360IFZ%=1PRINTTAB(21)"Prepare your pri
nter and press a key.":REPEATUNTILGET:VD
U2 ELSE VDU14
370REM" *SPOOL newfile
380REPEAT:CALLa%:PRINTTAB(40-LEN$&A00/
2)$&A00:UNTILEOF#F%:CLOSE#F%:Z%=0:VDU3,1
5:*FX21
390REM" *SPOOL
400PRINT''TAB(23)"Press a key to retur
n to main menu.":REPEATUNTILGET:OSCLI"EX
. !BOOT":END
410DEFPROCass:FORL%=0TO2STEP2:P%=&900
420[:OPTL%:.a%:JSRl12:LDA&74:BEQl10:JS
R&FFE7:LDA#0:STA&74:.l10:LDY&73:.l11:STY
&73
430JSRget:.l:LDA&70:LDY&73
440STA&A00,Y:CMP#13:BNEl9:RTS:.l9:INY:
CPY#80:BCCl11:LDY#80
450.l3:DEY:TYA:BEQl20:LDA&A00,Y:CMP#32
:BNEl3:.l21:STY&75:LDA#13:STA&A00,Y:.l20
:RTS
460.l12:LDA&75:BNEl4:LDA#0:STA&73:RTS
470.l4:LDX#0:LDY&75:INY
480.l5:LDA&A00,Y:STA&A00,X:INX:INY:CPY
#80:BNEl5:LDA#0:STA&75:LDA#32:STA&A00,X:
STX&73:RTS
490.get:LDY&71:JSR&FFD7:BCSdone:STA&70
:JSRl14:LDA&70:CMP#0:BEQget:CMP#128:BCCl
ow:LDA#32
500.low:CMP#32:BCSok:LDA#32
510.ok:STA&70:CMP#32:BNErts:INC&72:LDA
&72:CMP#1:BEQrt:CMP#42:BNEl2:DEC&72:.l2
520CMP#40:BNEget:INC&74
530.done:LDA#13:STA&70:JMPl
540.rts:LDA#0
550.rt:STA&72:RTS
560.l14:LDA&70:CMP#96:BNEk:LDA#95:BNEk
3:.k:CMP#95:BNEk1:LDA#35:BNEk3:.k1:CMP#3
5:BNEk3:LDA#96:.k3:STA&70:INC&78:LDA&78:
CMP#40:BNEl13:LDA#0:STA&78
570LDA&77:BNEl16
580.l13:LDA&70:CMP#141:BEQl15:RTS
590.l15:INC&77:RTS
600.l16:LDA#0:STA&77:LDX#40
610.l17:LDY&71:JSR&FFD7:BCSdone:DEX:TX
A:BNEl17:RTS
620]:NEXT:ENDPROC
630DEFPROCmark:A%=0
640INPUT"Start string ";D$
650REPEAT
660IFBGET#F%=ASC(LEFT$(D$,1)):T%=PTR#F
%:PROCsrchstring
670UNTILA%=1 OR EOF#F%
680IF EOF#F%:PRINTD$;" Not found. (Q)u
it or (C)ontinue":IF GET$="Q" GROO ELSE
IF EOF#F% RUN
690PTR#F%=T%-1
700ENDPROC
710DEFPROCsrchstring
720L%=1:REPEAT:
730A%=BGET#F%:L%=L%+1
740UNTILL%>LEN D$ OR A%<>ASC(MID$(D$,L
%,1)) OR EOF#F%
750IF L%>LEN D$ A%=1 ELSE A%=0
760ENDPROC