Input Drivers
Input drivers exist in memory from $FE80 to $FFF9. They do
not have a start address since they are not executable programs.
The default input driver (JOYSTICK) is built into the GEOS
KERNAL; GEOS will always boot up with the joystick as the input
device. The user must select another one if it is so desired.
They have three entry points in the very beginning. These entry
points are a jump table from $FE80-$FE88.
$FE80: InitMouse
The first entry point at $FE80 is the master reset vector.
This routine must set the mouse speed (Location $8507) to zero,
as well as reset the mouse's position to 0,0 (Locations $3A-$3C
mouseXPosition, mouseYPosition). It must also clear the
direction byte (Location $8506 inputData).
$FE83: SlowMouse
The second vector must reset the speed to zero (Location
$8507).
$FE86: UpdateMouse
The third vector actually performs the input. It must also
modify the appropriate flags, adjust the mouse's speed and
position. These include mouseXPosition, mouseYPosition, mouseData,
pressFlag, and inputData.
The following is a small memory map of locations of interest
to input drivers:
$30 mouseOn: Mouse control flag
Bit 7 - Mouse is visible, do not modify the mouse's
position if it is not visible.
$39 pressFlag: Input status flag
Bit 7 - There is data in the keyboard queue, this is
not used by the input driver.
Bit 6 - Mouse has changed direction.
Bit 5 - Button status has changed, either the button
has been released or pushed since last checked.
$3A-$3B mouseXPosition: Mouse's X position (0-319), range
checking is not necessary.
$3C mouseYPosition: Mouse's Y position (0-199), range
checking is not necessary.
$8501 maxMouseSpeed: Mouse's maximum speed.
$8502 minMouseSpeed: Mouse's minimum speed.
$8503 mouseAccel: Acceleration factor; added or subtracted
each time the input drive is scanned and the direction
has not changed.
$8505 mouseData: Button status: $00-pressed, $80-not pressed.
$8506 inputData: Direction; $FF if no direction is specified;
otherwise a number from 0 to 7:
3 2 1
* + *
4 -- * -- 0
* + *
5 6 7
This location is needed by the scroll feature for
GEOpaint. If not used, for example by a Koalapad, this
feature of GEOpaint will not work, but nothing else
will be affected.
$8507 Mouse's current speed.