Difference between revisions of "OSBYTE &AC"

From BeebWiki
Jump to: navigation, search
m (Added See Also links.)
 
Line 1: Line 1:
 
[[Category:OSBYTE]]__NOTOC__
 
[[Category:OSBYTE]]__NOTOC__
==OSBYTE &AC (172) - Read/Write address of keyboard translation table==
+
{{PageTitle|OSBYTE &AC (172) - Read/Write keyboard driver variables}}
 
''On entry:'' '''newvalue''' = ('''oldvalue''' AND Y) EOR X
 
''On entry:'' '''newvalue''' = ('''oldvalue''' AND Y) EOR X
  

Latest revision as of 20:49, 29 December 2020

OSBYTE &AC (172) - Read/Write keyboard driver variables

On entry: newvalue = (oldvalue AND Y) EOR X

On exit: YX=address of keyboard transation table. The top bits indicate if the MOS keyboard driver is being used or an alternative keyboard driver is being used.

  • If Y=%11xxxxxx, MOS keyboard driver
  • If Y=%10xxxxxx, sideways ROM keyboard driver
  • If Y=%0xxxxxxx, International keyboard driver.

MOS keyboard driver

With the MOS keyboard driver, the address is the base of the internal keyboard table. The offsets into the table are the internal scan codes, being the negative INKEY number EOR 255, so 'Q' is key number &10, etc.

An entry of &00 is translated to the current TAB character set with OSBYTE 219. The entries for CAPSLOCK and SHIFTLOCK hold &01 and &02, but these are never used as the MOS checks for these two keys explicitly.

The MOS never uses the values returned by OSBYTE &AC and &AD, so changing them does not change the action of the MOS keyboard driver.

Communicator

The Communicator uses this location to select between .= and *# keys on the numeric keypad.

Sideways ROM keyboard driver

A keyboard driver in sideways ROM can use these two locations for its own use by setting OSBYTE &AD to %10xxxxxx. These locations then hold:

  • OSBYTE &AC the current keypress
  • OSBYTE &AD the keyboard number in b5-b0

International keyboard driver

With MOS 3.50 and MOS 5, if Y bit 7 is clear (implying a keyboard table in low memory), the MOS keyboard handler issues Service Call &30 to translate keypresses. With an International Keyboard Driver present:

  • OSBYTE &AC holds the translated keypress on return from Service Call &30
  • OSBYTE &AD holds the keyboard number in b4-b0, and returns the 'NULL needed' flag in b6.

See Also

Jgharston 22:23, 26 May 2009 (UTC) Jgharston (talk) 21:50, 13 September 2019 (CEST) Jgharston (talk) 06:40, 12 April 2020 (CEST) Jgharston (talk) 23:22, 18 October 2020 (CEST)