5 MODE7 10 REM ` Sign patch (C)1996 SPROW 20 REM Printer at the ready 30 PROCclearit 40 PRINT"There is no universally agreed pound sign character,so different printers print out different letters even though the computer may think it is sending a pound sign.This problem can be fixed." 50 INPUT'"Set IGNORE character: *FX6,"I$ 60 IFLEN(I$)=0 THENPRINT'"See page 423 of the BBC User Guide":A=INKEY(500):RUN 70 ignore=EVAL(I$) AND255 80 OSCLI"FX6,"+STR$(ignore) 90 INPUT"Set printer type: *FX5,"P$ 100 IFLEN(P$)=0 THENPRINT'"See page 423 of the BBC User Guide":A=INKEY(500):RUN 110 type=EVAL(P$) AND255 120 OSCLI"FX5,"+STR$(type) 130 PRINT'"Turn the printer power switch on" 140 PRINT'"When ready press a key, a list will appear on the currently selected printer":A=GET 150 REM *FX3,2 REMOVED BY CJR AS IT STOPPED THE PROGRAM WORKING ON MY MASTER 160 REM Disable screen output 170 VDU2:REM Start printer 180 FORX=32 TO (32+56) 190 FORY=0 TO 3:PRINT(X+(Y*56));" => ";:IF(X+(Y*56))=127 THENPRINT"DEL";:NEXT ELSE PRINTCHR$(X+(Y*56));" ";:NEXT 200 PRINT:NEXT:REM Print available charcter set in columns of 4 210 VDU1,12,3:REM Form feed,and turn off printer 220 *FX3,0 230 REM Reset output to default 240 PROCclearit 250 INPUT"Enter the number from the list printed that looks like a pound sign "printer 260 INPUT'"Enter the number from the list that your WP prints for a pound sign "wproc 270 IFwproc>255 OR wproc<33 OR printer>255 OR printer<33 THENPRINT'"Bad value: from 33 to 255 inclusive":A=INKEY(150):GOTO240 280 IFprinter=wproc THENPRINT'"They're the same":A=INKEY(150):GOTO240 290 IFprinter=127 OR wproc=127 THENPRINT'"127 is reserved for DELETE":A=INKEY(150):GOTO240 300 PRINT'"Wordprocessor=chr$ ";wproc 310 PRINT'"Printer=chr$ ";printer 320 PRINT'"Agree? (Y/N)" 330 A=GET AND&DF 340 IFA=ASC"Y" THENGOTO360 350 IFA=ASC"N" THENGOTO240 ELSEGOTO330 360 PROCasm:REM Generate patch 370 PRINT'"In future,typing *FIXIT will set up the ignore character and printer type and will correct the pound sign problem":END 380 : 390 DEFPROCclearit 400 PRINT"Pound sign fixer"' 410 ENDPROC 420 : 430 DEFPROCasm 440 osby=&FFF4:oswc=&FFEE 450 loc%=&C00:REM Redefn buffer 460 FORX=0 TO2STEP2 470 P%=loc% 480 [OPTX 490 .repoint 500 SEI 510 LDX&20E:STXnewvec+1 520 LDY&20F:STYnewvec+2 530 LDX#vduque MOD256:STX&20E 540 LDY#vduque DIV256:STY&20F 550 \Repoint write character vector 560 CLI 570 LDA#5:LDX#type:LDY#0:JSRosby 580 LDA#6:LDX#ignore:LDY#0:JMPosby 590 \Set ignore chr$ and prn type 600 .vduque 610 STAslot:TYA:PHA:LDAslot:PHA:\Save registers ensuring A is on top 620 LDYcounter:BEQcodes:\If we're half way a VDU sequence then prevent ` sign checking 630 DEY:STYcounter:JMPbalance:\Decrement VDU 'characters-yet-to-come' counter and exit 640 .codes 650 LDY#reps-ctrl:\Works out length of table for me 660 .lookup 670 CMPctrl,Y:BEQmark:DEY:BNElookup:\Search through lookup table to see if it is a ctrl chr$ that has bytes to follow (eg.VDU23 and VDU19) 680 .mark 690 LDAreps,Y:STAcounter:\Read from second table just how many bytes ARE to follow 700 BNEbalance:PLA:\If zero then it may be a ` sign we've encountered 710 .printon 720 CMP#2:BNEprintoff:PHA:LDA#255:STAflagP:BMIbalance:\Keeps a flag of VDU2 activity 730 .printoff 740 CMP#3:BNEcheck`:PHA:LDA#0:STAflagP:\See if the printer is being turned off with VDU3 750 .balance 760 PLA:\Keep stack happy 770 .justy 780 STAslot:PLA:TAY:LDAslot:\Restore 790 .newvec 800 JMP&9999:\Self modified earlier 810 EQUS"(C)1996 SPROW" 820 .flagP 830 EQUB0 840 .slot 850 EQUB0 860 .counter 870 EQUB0 880 .check` 890 LDYflagP:BEQjusty:\Stop here if the printer is off 900 .swopem 910 CMP#wproc:BNEjusty:\Stop here if it was a ` sign 920 LDY#3 930 .force 940 LDAstream,Y:JSRnewvec:DEY:BPLforce:\Force the VDU software to do something totally different using JSRnewvec to avoid re-entrancy problems 950 LDA#2:JMPjusty:\Turn printer back on and exit 960 .ctrl 970 EQUD&12110100:EQUD&18171613 980 EQUD&1F1D1C19:\VDU chr$ that have bytes to follow and &00 as a default 990 .reps 1000 EQUD&02010100:EQUD&08090105 1010 EQUD&02040405:\# of chr$ to follow and &00 if default chosen 1020 .stream 1030 EQUBwproc:EQUB8:EQUB3:EQUBprinter:\New sequence (reverse order) 1040 ] 1050 NEXT 1060 OSCLI("SAVE FIXIT "+STR$~(loc%)+" "+STR$~(P%)+" "+STR$~(loc%)) 1070 ENDPROC