10REM"
20REM"
40REM"
60REM" This program will convert most
70REM" files containing control codes
80REM" Remove the REM from line 270
90REM" to run this program directly.
100REM" Run with Z%=1 for a printout
.
110REM" Remove the REM from line
s
120REM" 310 and 330 to save converte
d
130REM" file. Change the value o
f
140REM" PTR#F% in line 280 to miss ou
t
150REM" header files etc. 0 if none
.
160REM" -----------------------------
-
170REM" This program is Public domain
.
180REM" Please do not alter it in an
y
190REM" way. If you use any of th
e
200REM" routines, please mention m
e
210REM" in the titles. Thanks, CJR
.
220REM" -----------------------------
-
230DEFFNS="7TO3"
240ONERROR:CLOSE#0:OSCLI"SPOOL":VDU3:Z
%=0:OSCLI"*EX. !BOOT":END
250MODE3:VDU21:PROCass
260VDU6,23;8202;0;0;0;19,1,3;0;
270REM" REPEAT:PRINT"DRIVE TO READ FR
OM?":D$=GET$:UNTILVALD$<4:OSCLI"DR."+D$:
OSCLI".":INPUT"FILE TO PRINTOUT?"$&A00:R
EM REMOVE IF FROM MENU
280F%=OPENIN $&A00:?&A50=13:PTR#F%=&E7
:?&71=F%:!&72=0:!&76=0
290PRINTTAB(18)"Print out a teletext f
ile by C.J.Richardson."'TAB(29)"Press SH
IFT to scroll."''
300IFZ%=1PRINTTAB(21)"Prepare your pri
nter and press a key.":REPEATUNTILGET:VD
U2 ELSE VDU14
310REM" *SPOOL newfile
320REPEAT:CALLa%:PRINTTAB(40-LEN$&A00/
2)$&A00:UNTILEOF#F%:CLOSE#F%:Z%=0:VDU3,1
5:*FX21
330REM" *SPOOL
340PRINT''TAB(23)"Press a key to retur
n to main menu.":REPEATUNTILGET:OSCLI"EX
. !BOOT":END
350DEFPROCass:FORL%=0TO2STEP2:P%=&900
360[:OPTL%:.a%:JSRl12:LDA&74:BEQl10:JS
R&FFE7:LDA#0:STA&74:.l10:LDY&73:.l11:STY
&73
370JSRget:.l:LDA&70:LDY&73
380STA&A00,Y:CMP#13:BNEl9:RTS:.l9:INY:
CPY#80:BCCl11:LDY#80
390.l3:DEY:TYA:BEQl20:LDA&A00,Y:CMP#32
:BNEl3:.l21:STY&75:LDA#13:STA&A00,Y:.l20
:RTS
400.l12:LDA&75:BNEl4:LDA#0:STA&73:RTS
410.l4:LDX#0:LDY&75:INY
420.l5:LDA&A00,Y:STA&A00,X:INX:INY:CPY
#80:BNEl5:LDA#0:STA&75:LDA#32:STA&A00,X:
STX&73:RTS
430.get:LDY&71:JSR&FFD7:BCSdone:STA&70
:JSRl14:LDA&70:CMP#0:BEQget:CMP#128:BCCl
ow:LDA#32
440.low:CMP#32:BCSok:LDA#32
450.ok:STA&70:CMP#32:BNErts:INC&72:LDA
&72:CMP#1:BEQrt:CMP#42:BNEl2:DEC&72:.l2
460CMP#40:BNEget:INC&74
470.done:LDA#13:STA&70:JMPl
480.rts:LDA#0
490.rt:STA&72:RTS
500.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
510LDA&77:BNEl16
520.l13:LDA&70:CMP#141:BEQl15:RTS
530.l15:INC&77:RTS
540.l16:LDA#0:STA&77:LDX#40
550.l17:LDY&71:JSR&FFD7:BCSdone:DEX:TX
A:BNEl17:RTS
560]:NEXT:ENDPROC