Difference between revisions of "83Plus:BCALLs:50E9"

From WikiTI
Jump to: navigation, search
m (wrong OS version)
(This is about the TI-Keyboard, folks)
Line 1: Line 1:
[[Category:83Plus:BCALLs:By Name|LinkReceive]]
+
[[Category:83Plus:BCALLs:By Name:Input|KeyboardGetKey]] [[Category:83Plus:BCALLs:By Name|KeyboardGetKey]] [[Category:83Plus:BCALLs:By Address|50E9 - KeyboardGetKey]]
[[Category:83Plus:BCALLs:By Address|50E9 - LinkReceive]]
+
 
== Synopsis ==
 
== Synopsis ==
'''Unofficial Name:''' LinkReceive
+
'''Unofficial Name:''' KeyboardGetKey
  
 
'''BCALL Address:''' 50E9
 
'''BCALL Address:''' 50E9
  
Receives a series of bytes from the serial I/O port using either port 0 or the link assist, whichever is supported.
+
'''Minimum OS Version:''' 1.15
 +
 
 +
Attempt to receive a keypress from the TI-Keyboard.
  
 
=== Inputs ===
 
=== Inputs ===
Line 13: Line 14:
 
=== Outputs ===
 
=== Outputs ===
 
* A contains status code
 
* A contains status code
 +
* The actual data retrieved from the keyboard appears to be trashed in the process of popping the error handler ?!
  
 
=== Destroys ===
 
=== Destroys ===
* Unknown
+
* AF, BC, DE, HL
  
 
== Comments ==
 
== Comments ==
I have no idea what this function does. Possible status codes returned are:
+
This B_CALL was introduced in OS 1.15.  Programs should check the OS version before attempting to use this routine.
* 00 = link transmission error, possibly timeout.
+
 
* 01 = byte received and was 0E0h.
+
Keep in mind that the keyboard communicates using a truly horrible perversion of the DBUS protocol, which works as follows:
* 02 = byte received and was not 0E0h.
+
* The keyboard sends the byte E0.
* 0F9h = busy receiving a byte.
+
* It pulls both link lines low simultaneously for a short time (i.e., flags a DBUS error.)
* 0FAh = byte received and was not 0E0h.
+
* It sends the byte 01h.
* 0FBh = byte received and was 0E0h.
+
* Finally, it sends the scancode or modifier mask.
* 0FEh = byte received and was not 0E0h.
+
As a result, there are a variety of possible error conditions.
* 0FFh = unknown error.
+
 
 +
Possible status codes returned are:
 +
* 00 = No link activity detected.
 +
* 01 = Success.
 +
* 02 = Link activity detected, but the first byte was not E0h, or E0h was not followed by a DBUS error.
 +
* 0F9h = Link assist error, and no buffered data or link activity.
 +
* 0FAh = Link assist error and buffered data detected, but the buffered byte was not E0h.
 +
* 0FBh = Link assist error and buffered byte E0h detected, and two more bytes might or might not have been read.
 +
* 0FEh = Second byte was not 01h (possibly unsupported future commands)
 +
* 0FFh = Protocol error other than the one expected.
  
 
== Links ==
 
== Links ==
 
A full disassembly of this entry point on OS 2.41 is [http://www.brandonw.net/calcstuff/50E9.txt here].
 
A full disassembly of this entry point on OS 2.41 is [http://www.brandonw.net/calcstuff/50E9.txt here].

Revision as of 14:03, 6 November 2006

Synopsis

Unofficial Name: KeyboardGetKey

BCALL Address: 50E9

Minimum OS Version: 1.15

Attempt to receive a keypress from the TI-Keyboard.

Inputs

  • None

Outputs

  • A contains status code
  • The actual data retrieved from the keyboard appears to be trashed in the process of popping the error handler ?!

Destroys

  • AF, BC, DE, HL

Comments

This B_CALL was introduced in OS 1.15. Programs should check the OS version before attempting to use this routine.

Keep in mind that the keyboard communicates using a truly horrible perversion of the DBUS protocol, which works as follows:

  • The keyboard sends the byte E0.
  • It pulls both link lines low simultaneously for a short time (i.e., flags a DBUS error.)
  • It sends the byte 01h.
  • Finally, it sends the scancode or modifier mask.

As a result, there are a variety of possible error conditions.

Possible status codes returned are:

  • 00 = No link activity detected.
  • 01 = Success.
  • 02 = Link activity detected, but the first byte was not E0h, or E0h was not followed by a DBUS error.
  • 0F9h = Link assist error, and no buffered data or link activity.
  • 0FAh = Link assist error and buffered data detected, but the buffered byte was not E0h.
  • 0FBh = Link assist error and buffered byte E0h detected, and two more bytes might or might not have been read.
  • 0FEh = Second byte was not 01h (possibly unsupported future commands)
  • 0FFh = Protocol error other than the one expected.

Links

A full disassembly of this entry point on OS 2.41 is here.