Difference between revisions of "OSBYTE &19"

From BeebWiki
Jump to: navigation, search
m (Added Watford Electronics Speech.)
Line 1: Line 1:
 
[[Category:OSBYTE]]
 
[[Category:OSBYTE]]
OSBYTE &19 (25) - Reset a group of font definitions
+
__TOC__
 
+
  OSBYTE &19 (25) - Reset a group of font definitions
 +
  On entry:
 
     X=0 resets 32-255
 
     X=0 resets 32-255
 
     X=1 resets 32-63
 
     X=1 resets 32-63
Line 10: Line 11:
 
     X=6 resets 192-223
 
     X=6 resets 192-223
 
     X=7 resets 224-255
 
     X=7 resets 224-255
 +
  On exit:
 +
    X=&FF:      OSBYTE &19 unsupported
 +
    X=preserved: subcall unsupported
 +
    X=&00:      subcall actioned
  
&19 (Watford Speech)
+
  OSBYTE &19 (25) - Watford Speech: Output a speech allophone
    Output a speech allophone
+
  On entry:
    Y=0 X=allophone number - output allophone
+
    Y=0 X=allophone number - output allophone
    Y=1 X=word number - output a word from dictionary 1
+
    Y=1 X=word number - output a word from dictionary 1
    Y=2 X=word number - output a word from dictionary 1
+
    Y=2 X=word number - output a word from dictionary 1
    Y=3 X=word number - output a word from dictionary 1
+
    Y=3 X=word number - output a word from dictionary 1
    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
 +
 
 +
==Example code==
 +
On MOS 3 and later the font is always exploded, on earlier MOSs (Electron, BBC, BBC B+) OSBYTE &19 does not exist, [[OSBYTE &14]] explodes the font and resets it. The following code will reset the whole font regardless of what machine the code is running on.
 +
 
 +
===BASIC===
 +
      IFFNbyte(25,0,0):FORB%=1TO6:A%=FNbyte(20,B%,0):NEXT
 +
     
 +
      using the following function to call OSBYTE:
 +
      DEFFNbyte(A%,X%,Y%)=((USR&FFF4)AND&FF00)DIV256
 +
 
 +
===6502===
 +
      LDA #25:LDX #0:JSR OSBYTE  :\ try 'reset all font'
 +
      TXA:BEQ resetDone          :\ X=0 if done
 +
      LDX #6                    :\ loop through 'explode font' calls
 +
      .resetLoop
 +
      TXA:PHA                    :\ save current font block
 +
      LDA #20:JSR OSBYTE        :\ explode block X
 +
      PLA:TAX                    :\ get block number back
 +
      DEX:BNE resetLoop          :\ loop until X=0
 +
      .resetDone
  
 
==See Also==
 
==See Also==
 +
* [[OSBYTE &14]] explode fonts
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte00
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte00
 
[[User:Jgharston|Jgharston]] 21:33, 26 May 2009 (UTC)
 

Revision as of 14:43, 31 August 2015

 OSBYTE &19 (25) - Reset a group of font definitions
 On entry:
   X=0 resets 32-255
   X=1 resets 32-63
   X=2 resets 64-95
   X=3 resets 96-127
   X=4 resets 128-159
   X=5 resets 160-191
   X=6 resets 192-223
   X=7 resets 224-255
 On exit:
   X=&FF:       OSBYTE &19 unsupported
   X=preserved: subcall unsupported
   X=&00:       subcall actioned
 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 1
   Y=3 X=word number - output a word from dictionary 1
   Y>3 - ignored, allowing other ROMs to respond to and pass to OSBYTE &19,x,0

Example code

On MOS 3 and later the font is always exploded, on earlier MOSs (Electron, BBC, BBC B+) OSBYTE &19 does not exist, OSBYTE &14 explodes the font and resets it. The following code will reset the whole font regardless of what machine the code is running on.

BASIC

     IFFNbyte(25,0,0):FORB%=1TO6:A%=FNbyte(20,B%,0):NEXT
     
     using the following function to call OSBYTE:
     DEFFNbyte(A%,X%,Y%)=((USR&FFF4)AND&FF00)DIV256

6502

     LDA #25:LDX #0:JSR OSBYTE  :\ try 'reset all font'
     TXA:BEQ resetDone          :\ X=0 if done
     LDX #6                     :\ loop through 'explode font' calls
     .resetLoop
     TXA:PHA                    :\ save current font block
     LDA #20:JSR OSBYTE         :\ explode block X
     PLA:TAX                    :\ get block number back
     DEX:BNE resetLoop          :\ loop until X=0
     .resetDone

See Also