8-Bit Software Online Conversion

:0.$.7to3 - Listing

10REM" 20REM"      30REM"      40REM"   50REM"   60REM" This program will convert most 70REM" files containing control codes 80REM" You can pass the filename of a 90REM" file to use in memory at &A00. 100REM" Run with Z%=1 for a printout . 110REM" Remove the REM from line s 120REM" 400 and 420 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":REM V3.01 290REM Modified JGH 20-06-96 300*FX229,0 310IFINKEY(0)=0:INPUT""A$:$&A00=A$ 320ONERROR:CLOSE#0:OSCLI"SPOOL":VDU3:Z %=0:IFINKEY-1=0:OSCLI"*EXEC $.!BOOT":END ELSE END 330MODE3:VDU21:PROCass 340VDU6,23;8202;0;0;0;19,1,3;0; 350A$=$&A00:IFA$="" ORLENA$>80 ORASCA$ <32 ORASCA$>126:PROCfile ELSE $&A00="" 360F%=OPENIN A$:?&A50=13:?&71=F%:!&72= 0:!&76=0:IFF%=0:PRINTA$" not found" 370PRINT"MARKED PRINTOUT? Y/N":IF GET$ ="Y":PROCmark ELSE PTR#F%=&100:REM IF RI GHT$(A$,1)="1":PTR#F%=&10C 380PRINTTAB(18)"Print out a teletext f ile by C.J.Richardson."'TAB(29)"Press SH IFT to scroll."'' 390IFZ%=1PRINTTAB(21)"Prepare your pri nter and press a key.":REPEATUNTILGET:VD U2 ELSE VDU14 400REM" *SPOOL newfile 410REPEAT:CALLa%:PRINTTAB(40-LEN$&A00/ 2)$&A00:$&A00="":UNTILEOF#F%:CLOSE#F%:Z% =0:VDU3,15:*FX21 420REM" *SPOOL 430PRINT''TAB(23)"Press a key to retur n to main menu.":REPEATUNTILGET:OSCLI"EX . !BOOT":END 440DEFPROCfile:REPEATCLS:*. 450REPEATINPUTLINE'"Filename: "A$:IFLE FT$(A$,1)="*":OSCLIA$ 460UNTILLEFT$(A$,1)<>"*":UNTILA$<>"":E NDPROC 470DEFPROCass:FORL%=0TO2STEP2:P%=&900 480[:OPTL%:.a%:JSRl12:LDA&74:BEQl10:JS R&FFE7:LDA#0:STA&74:.l10:LDY&73:.l11:STY &73 490JSRget:.l:LDA&70:LDY&73 500STA&A00,Y:CMP#13:BNEl9:RTS:.l9:INY: CPY#80:BCCl11:LDY#80 510.l3:DEY:TYA:BEQl20:LDA&A00,Y:CMP#32 :BNEl3:.l21:STY&75:LDA#13:STA&A00,Y:.l20 :RTS 520.l12:LDA&75:BNEl4:LDA#0:STA&73:RTS 530.l4:LDX#0:LDY&75:INY 540.l5:LDA&A00,Y:STA&A00,X:INX:INY:CPY #80:BNEl5:LDA#0:STA&75:LDA#32:STA&A00,X: STX&73:RTS 550.get:LDY&71:JSR&FFD7:BCSdone:STA&70 :JSRl14:LDA&70:CMP#0:BEQget:CMP#128:BCCl ow:LDA#32 560.low:CMP#32:BCSok:LDA#32 570.ok:STA&70:CMP#32:BNErts:INC&72:LDA &72:CMP#1:BEQrt:CMP#42:BNEl2:DEC&72:.l2 580CMP#40:BNEget:INC&74 590.done:LDA#13:STA&70:JMPl 600.rts:LDA#0 610.rt:STA&72:RTS 620.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 630LDA&77:BNEl16 640.l13:LDA&70:CMP#141:BEQl15:RTS 650.l15:INC&77:RTS 660.l16:LDA#0:STA&77:LDX#40 670.l17:LDY&71:JSR&FFD7:BCSdone:DEX:TX A:BNEl17:RTS 680]:NEXT:ENDPROC 690DEFPROCmark:A%=0 700INPUT"Start string ";D$ 710REPEAT 720IFBGET#F%=ASC(LEFT$(D$,1)):T%=PTR#F %:PROCsrchstring 730UNTILA%=1 OR EOF#F% 740IF EOF#F%:PRINTD$;" Not found. (Q)u it or (C)ontinue":IF GET$="Q" GROO ELSE IF EOF#F% RUN 750PTR#F%=T%-1 760ENDPROC 770DEFPROCsrchstring 780L%=1:REPEAT: 790A%=BGET#F%:L%=L%+1 800UNTILL%>LEN D$ OR A%<>ASC(MID$(D$,L %,1)) OR EOF#F% 810IF L%>LEN D$ A%=1 ELSE A%=0 820ENDPROC