Difference between revisions of "OSBYTE &19"

From BeebWiki
Jump to: navigation, search
(Tidied up description)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:OSBYTE]]
 
[[Category:OSBYTE]]
{{PageTitle|OSBYTE &19 (24): Reset font groups}}
+
{{PageTitle|OSBYTE &19 (25): Reset font groups}}__NOTOC__
__NOTOC__
 
  OSBYTE &19 (25) - Reset a group of font definitions
 
 
   On entry:
 
   On entry:
     X=0    reset all font groups - CHR$32-CHR$255
+
     X=&00+n    reset font group
    X=1    reset font group 1 - CHR$32-CHR$63
 
    X=2    reset font group 2 - CHR$64-CHR$95
 
    X=3    reset font group 3 - CHR$96-CHR$127
 
    X=4    reset font group 4 - CHR$128-CHR$159
 
    X=5    reset font group 5 - CHR$160-CHR$191
 
    X=6    reset font group 6 - CHR$192-CHR$223
 
    X=7    reset font group 7 - CHR$224-CHR$255
 
 
   Extension:
 
   Extension:
     X=16   resets soft Teletext font (where supported)
+
     X=&10+n   soft Teletext font functions
     X=&80+n ...
+
    X=&08-&7F  set base address for font to use
 +
     X=&80+n   set font group to RAM
 
    
 
    
 
   On exit:
 
   On exit:
Line 20: Line 12:
 
     X=preserved: subcall unsupported
 
     X=preserved: subcall unsupported
 
     X=&00:      subcall actioned
 
     X=&00:      subcall actioned
 +
 
 +
  Font groups:
 +
    n=0  all font groups - CHR$32-CHR$255
 +
    n=1  font group 1 - CHR$32-CHR$63
 +
    n=2  font group 2 - CHR$64-CHR$95
 +
    n=3  font group 3 - CHR$96-CHR$127
 +
    n=4  font group 4 - CHR$128-CHR$159
 +
    n=5  font group 5 - CHR$160-CHR$191
 +
    n=6  font group 6 - CHR$192-CHR$223
 +
    n=7  font group 7 - CHR$224-CHR$255
  
On MOS 3 and later each font group is reset by copying it from ROM into RAM. On earlier MOSs (Electron, BBC, BBC B+) a font group can be reset by clearing the appropriate bit of the FONTFLG VDU variable, b6 for font group 1 down to b0 for font group 7. This will result in that font group being read from ROM until any future VDU 23 to redefine a character in that font group.
+
On MOS 3 and later each font group is reset by copying it from ROM into RAM.
 +
On earlier MOSs (Electron, BBC, BBC B+) a font group can be reset by
 +
clearing the appropriate bit of the FONTFLG VDU variable, b6 for font group
 +
1 down to b0 for font group 7. This will result in that font group being
 +
read from ROM until any future VDU 23 to redefine a character in that font
 +
group.
  
 
===Extensions===
 
===Extensions===
 +
  On entry: X=&08-&7F
 +
    Sets base address for full font to use to X*256.
 +
 
 
   On entry: X=16
 
   On entry: X=16
placeholder
+
    Soft teletext font function
 
+
 
 
   On entry: X=&80+n
 
   On entry: X=&80+n
placeholder
+
    Force font group to use RAM
  
 
==Example code==
 
==Example code==
On MOS 3 and later the font is always exploded, on earlier MOSs OSBYTE &19 does not exist and [[OSBYTE &14]] only resets CHR$32-CHR$127. The following code will reset the whole font regardless of what machine the code is running on. OSBYTE 25 - if it exists - resets all characters, then *FX20,6 resets characters &20-&7F. OSBYTE 25 has to be called via OSBYTE as *FX25 will give an error if it is not present.
+
On MOS 3 and later the font is always exploded, on earlier MOSs OSBYTE &19
 +
does not exist and [[OSBYTE &14]] only resets CHR$32-CHR$127. The following
 +
code will reset the whole font regardless of what machine the code is
 +
running on. OSBYTE 25 - if it exists - resets all characters, then *FX20,6
 +
resets characters &20-&7F. OSBYTE 25 has to be called via OSBYTE as *FX25
 +
will give an error if it is not present.
  
 
===BASIC===
 
===BASIC===
      if you want to ensure the full font is exploded, this may change PAGE
+
    If you want to ensure the full font is exploded, this may change PAGE
      on the BBC:
+
    on the BBC:
      A%=FNbyte(25,0):*FX20,6
+
    A%=FNbyte(25,0):*FX20,6
     
+
   
      if you want to leave the explosion state unchanged on the BBC and not
+
    If you want to leave the explosion state unchanged on the BBC and not
      overwrite memory at PAGE:
+
    overwrite memory at PAGE:
      A%=FNbyte(25,0):A%=FNbyte(20,FNbyte(182,&FF00))
+
    A%=FNbyte(25,0):A%=FNbyte(20,FNbyte(182,&FF00))
     
+
   
      using:
+
    using:
      DEFFNbyte(A%,X%):LOCAL Y%:Y%=X%DIV256:=((USR&FFF4)AND&FF00)DIV256
+
    DEFFNbyte(A%,X%):LOCAL Y%:Y%=X%DIV256:=((USR&FFF4)AND&FF00)DIV256
  
 
===6502===
 
===6502===
      if you want to ensure the full font is exploded, this may change PAGE:
+
    If you want to ensure the full font is exploded, this may change PAGE:
      on the BBC:
+
    on the BBC:
      LDA #25:LDX #0:JSR OSBYTE  :\ try 'reset all font'
+
    LDA #25:LDX #0:JSR OSBYTE  :\ try 'reset all font'
      LDA #20:LDX #6:JSR OSBYTE  :\ 'explode full font'
+
    LDA #20:LDX #6:JSR OSBYTE  :\ 'explode full font'
     
+
   
      if you want to leave the explosion state unchanged on the BBC and not
+
    If you want to leave the explosion state unchanged on the BBC and not
      overwrite memory at PAGE:
+
    overwrite memory at PAGE:
      LDA #25:LDX #0:JSR OSBYTE          :\ try 'reset all font'
+
    LDA #25:LDX #0:JSR OSBYTE          :\ try 'reset all font'
      LDA #182:LDX #0:LDY #&FF:JSR OSBYTE :\ Read current explosion state
+
    LDA #182:LDX #0:LDY #&FF:JSR OSBYTE :\ Read current explosion state
      LDA #20:JSR OSBYTE                  :\ 'explode full font'
+
    LDA #20:JSR OSBYTE                  :\ 'explode full font'
  
On the Master and later [[OSBYTE &B6|OSBYTE 182]] reads the NoIgnore status, but the value returned is ignored by the following [[OSBYTE &14|OSBYTE 20]].
+
On the Master and later [[OSBYTE &B6|OSBYTE 182]] reads the NoIgnore status,
 +
but the value returned is ignored by the following [[OSBYTE &14|OSBYTE 20]].
  
 
==OSBYTE &19 (25) - Watford Speech: Output a speech allophone==
 
==OSBYTE &19 (25) - Watford Speech: Output a speech allophone==
Line 66: Line 82:
 
     Y=3 X=word number - output a word from dictionary 3
 
     Y=3 X=word number - output a word from dictionary 3
 
     Y>3 - ignored, allowing other ROMs to respond to and pass to OSBYTE &19,x,0
 
     Y>3 - ignored, allowing other ROMs to respond to and pass to OSBYTE &19,x,0
 +
 +
==OSBYTE &19 (25) - Slogger Expansion ROM: KEYV handler==
 +
Not actually realistically callable via OSBYTE.
 +
 +
Used to support the
 +
[http://www.acornelectron.co.uk/info/electron/slogger/Switched-Joystick-Interface.html Slogger Switched Joystick Interface].
 +
The ROM can hook into [[KEYV]] and [[BYTEV]], which it does through
 +
[https://github.com/tom-seddon/SloggerElectronExpansion/blob/5c6115bd74a5cda4c884b4c58aee32b679b19ae6/Electron-Expansion-v2.02.s65#L536 a little routine]
 +
stored at a configurable address in memory, bypassing the extended vector
 +
mechanism in order to accommodate games that overwrite that region.
 +
 +
To keep the routine small, it funnels both KEYV and OSBYTE calls into the
 +
same entry point in the ROM, and &19 - unused on Electron - indicates that
 +
the call is being made through [[KEYV]] rather than [[BYTEV]].
  
 
==See Also==
 
==See Also==
 
* [[OSBYTE &14]] explode font
 
* [[OSBYTE &14]] explode font
 +
* [[OSBYTE &A3]] font support functions
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte00
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte00
 +
* http://mdfs.net/Apps/Font
  
 
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 00:21, 24 November 2022 (CET)
 
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 00:21, 24 November 2022 (CET)

Latest revision as of 22:34, 6 April 2024

OSBYTE &19 (25): Reset font groups
 On entry:
   X=&00+n    reset font group
 Extension:
   X=&10+n    soft Teletext font functions
   X=&08-&7F  set base address for font to use
   X=&80+n    set font group to RAM
 
 On exit:
   X=&FF:       OSBYTE &19 unsupported
   X=preserved: subcall unsupported
   X=&00:       subcall actioned
 
 Font groups:
   n=0  all font groups - CHR$32-CHR$255
   n=1  font group 1 - CHR$32-CHR$63
   n=2  font group 2 - CHR$64-CHR$95
   n=3  font group 3 - CHR$96-CHR$127
   n=4  font group 4 - CHR$128-CHR$159
   n=5  font group 5 - CHR$160-CHR$191
   n=6  font group 6 - CHR$192-CHR$223
   n=7  font group 7 - CHR$224-CHR$255

On MOS 3 and later each font group is reset by copying it from ROM into RAM. On earlier MOSs (Electron, BBC, BBC B+) a font group can be reset by clearing the appropriate bit of the FONTFLG VDU variable, b6 for font group 1 down to b0 for font group 7. This will result in that font group being read from ROM until any future VDU 23 to redefine a character in that font group.

Extensions

 On entry: X=&08-&7F
   Sets base address for full font to use to X*256.
 
 On entry: X=16
   Soft teletext font function
 
 On entry: X=&80+n
   Force font group to use RAM

Example code

On MOS 3 and later the font is always exploded, on earlier MOSs OSBYTE &19 does not exist and OSBYTE &14 only resets CHR$32-CHR$127. The following code will reset the whole font regardless of what machine the code is running on. OSBYTE 25 - if it exists - resets all characters, then *FX20,6 resets characters &20-&7F. OSBYTE 25 has to be called via OSBYTE as *FX25 will give an error if it is not present.

BASIC

   If you want to ensure the full font is exploded, this may change PAGE
   on the BBC:
   A%=FNbyte(25,0):*FX20,6
   
   If you want to leave the explosion state unchanged on the BBC and not
   overwrite memory at PAGE:
   A%=FNbyte(25,0):A%=FNbyte(20,FNbyte(182,&FF00))
   
   using:
   DEFFNbyte(A%,X%):LOCAL Y%:Y%=X%DIV256:=((USR&FFF4)AND&FF00)DIV256

6502

   If you want to ensure the full font is exploded, this may change PAGE:
   on the BBC:
   LDA #25:LDX #0:JSR OSBYTE  :\ try 'reset all font'
   LDA #20:LDX #6:JSR OSBYTE  :\ 'explode full font'
   
   If you want to leave the explosion state unchanged on the BBC and not
   overwrite memory at PAGE:
   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'

On the Master and later OSBYTE 182 reads the NoIgnore status, but the value returned is ignored by the following OSBYTE 20.

OSBYTE &19 (25) - Watford Speech: Output a speech allophone

 On entry:
   Y=0 X=allophone number - output allophone
   Y=1 X=word number - output a word from dictionary 1
   Y=2 X=word number - output a word from dictionary 2
   Y=3 X=word number - output a word from dictionary 3
   Y>3 - ignored, allowing other ROMs to respond to and pass to OSBYTE &19,x,0

OSBYTE &19 (25) - Slogger Expansion ROM: KEYV handler

Not actually realistically callable via OSBYTE.

Used to support the Slogger Switched Joystick Interface. The ROM can hook into KEYV and BYTEV, which it does through a little routine stored at a configurable address in memory, bypassing the extended vector mechanism in order to accommodate games that overwrite that region.

To keep the routine small, it funnels both KEYV and OSBYTE calls into the same entry point in the ROM, and &19 - unused on Electron - indicates that the call is being made through KEYV rather than BYTEV.

See Also

Jgharston (talk) 00:21, 24 November 2022 (CET)