8-Bit Software Online Conversion

Pound Sign Fix - Listing

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