Font OSBYTEs and Extensions =========================== *FX20 and OSBYTE 20 ------------------- On entry: X=&00+n : set font explosion state, resetting characters &20-&7F n=0 &80-&9F n=4 &20-&3F, &80-&FF n=1 &80-&BF n=5 &20-&5F, &80-&FF n=2 &80-&DF n=6 &20-&FF n=3 &80-&FF n>6 &20-&FF Extensions: X=&07 : reserved X=&08+n : explode full font and set font base the font base is set to X*256, eg X=&11 sets the font to occupy &1100-&17FF. On exit: X<&80 : font permanently exploded X>&7F : font explodable/implodable Implementation: On exit: Master: X=&00 RISC OS: X=&01 (first font bank reset) BB4W: X=&20 (character under cursor) BBC/Electron: X=&FF (return value from Service Call &11) All calls reset characters &20-&7F. On the Master and later the font is always fully exploded, and OSBYTE 20 just resets characters &20-&7F. BB4W and similar systems just return without performing any action. *FX25 and OSBYTE 25 ------------------- On entry: X=&00+n : set font group n to ROM, resetting characters X=&80+n : set font group n to use RAM n=0 &20-&FF n=4 &80-&9F n=1 &20-&3F n=5 &A0-&BF n=2 &40-&5F n=6 &C0-&DF n=3 &60-&7F n=7 &E0-&FF Extensions: X=&08+n : reserved X=&10+n : soft teletext functions X=&88+n : reserved On exit: X<&80 : implemented X>&7F : unimplemented Implementation: On exit: Master: X=&00 BBC/Electron: X=&00 (if implemented) RISC OS: X=&01 if X=&00 on entry RISC OS: X=preserved if X>&01 on entry BB4W: X=&20 (character under cursor) BBC/Electron: X=&FF (unimplemented OSBYTE) If you wamt to ensure the font is fully exploded and reset, possibly changing PAGE. In BASIC: A%=FNbyte(25,0):*FX20,6 In 6502 machine code: LDA #25:LDX #0:JSR OSBYTE :\ Try 'reset all font' LDA #20:LDX #6:JSR OSBYTE :\ 'explode full font' If you want to reset the font, but leave the explosion state unchanged and avoid overwriting memory at PAGE. In BASIC: A%=FNbyte(25,0):A%=FNbyte(20,FNbyte(182,&FF00)) In 6502 machine code: LDA #25:LDX #0:JSR OSBYTE :\ Try 'reset all font' LDA #182:LDX #0:LDY #&FF:JSR OSBYTE :\ Read current explosion state LDA #20:JSR OSBYTE :\ 'explode full font' The BASIC code uses: DEFFNbyte(A%,X%):LOCAL Y%:Y%=X%DIV256:=((USR&FFF4)AND&FF00)DIV256 On platforms such as BBC BASIC for Windows, use the following code: DIM ctrl% 31:X%=ctrl%:Y%=X%DIV256 ... DEFPROCfont_Reset A%=FNbyte(25,0):IF FNbyte(20,FNbyte(182,&FF00))<>32:ENDPROC A%=10:FOR B%=32 TO 255:?X%=B%:CALL &FFF1:VDU 23,B% FOR C%=1 TO 8:VDU X%?C%:NEXT:NEXT ENDPROC *FX163 and OSBYTE 163 --------------------- On entry: X=&80+n : set font control for font group n for n=1..7 Y=0 : set font page soft (RAM) Y=1 : set font page hard (ROM) Y=2 : copy current page to RAM (no effect if soft) Y=3 : copy ROM page to RAM Y>3 : set font page soft and RAM page number to Y Y=??? : set font uses SROM bank On exit: X,Y : preserved if unimplemented X<&80 : implemented