EasyManua.ls Logo

Atari ST series - Page 351

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The Intelligent Keyboard Controller
Communicating with the IKBD on the ST
As you have seen, the IKBD supports several different func
tions, each with several modes of operation. To select a func
tion and mode, merely send a message to the controller, us
ing the BIOS function Bconout(), or the XBIOS functions
Ikbdws() or Initmous(). Receiving input from the device is a
little more complex than sending output, however. That's be
cause the IKBD device connects to the system via an ACIA
serial interface chip, and the system must be ready to receive
information from this device at any time.
When the ACIA chip receives information from the
IKBD, it causes an interrupt to occur on the 68901 MFP chip.
If the interrupt handler determines that the source of the in
terrupt was the IKBD ACIA, it calls the main IKBD interrupt
routine, ikbdsys. The location of the ikbdsys routine can be
found via the XBIOS function Kbdvbase(), which returns a
pointer to all of the IKBD interrupt routines, including
ikbdsys.
The ikbdsys routine checks to see if the interrupt was
caused by the receipt of data, or by an error. If it was an er
ror, a routine called vkbderr is called to handle it. If a data
byte was received, the byte is checked to see if it was a key
code, or an IKBD packet header. If it's a keycode, ikdbsys
processes the code, and places the character information into
an input buffer, the location of which can be found with the
XBIOS Iorec() call. If the byte was a header from a mouse,
clock, status, or joystick packet, however, the main interrupt
routine routes execution through one of the four vectors set
up to handle these packet types (mousevec, clockvec, stat-
vec, or joyvec).
Of these four, the mousevec and clockvec vectors are
used by the system, and should generally be left alone (par
ticularly if you want your mouse and clock functions to con
tinue). The statvec and joyvec vectors are not used by the
system, however, and you may want to install you own han
dlers for these functions. For example, in order to use joys
ticks with your program, you must send a command to the
IKBD to return joystick information packets, then install your
joystick packet handler to process these packets. If you do
install your own handler, remember at the point that it is en-
343