The standard PC joystick has a stick which can be moved on two axes, with the position on one axis being independent of the position on the other. When released the stick generally springs back to the 'center' position. The standard joystick also has two buttons with two states (pressed or released). A PC allows the connection of up to two joysticks through the use of two 'game ports'. Note that some PCs are not fitted with any game ports, and many have only one. Information on non-standard joysticks follows.
The buttons status can be found by examining the appropriate bits; a 0 value indicates a depressed button. No dummy byte need be sent in this case.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| BB2 | BB1 | AB2 | AB1 | BAY | BAX | AAY | AAX |
The first letter (either A or B) indicates the joystick; The second letter (A or B) stands for 'Axis' or 'Button'. The third letter is either the axis (X or Y) or button number.
Note that the exact values for center & corners varies from joystick to joystick, computer to computer and port to port.
Information about non-standard joysticks follows:
The WE has four buttons & a 'cooly' atop the stick. The cooly can be moved up, down, left or right, or may be centered. It is read as the 2nd joystick Y-Axis; approximate values (as returned by BIOS):
|
| Values do vary on different reads (eg may return 7, 8, 5 for up) also different WE's / different ports will return different values (so the top switch ultimately requires calibration). Third and fourth buttons are read as 2nd stick button 1 & 2. |
| [2]
|
-----+----- [1] [3]
|
| [4]
The Gravis Gamepad is not really a joystick; the values returned for X/Y axis are not relative to the amount the pad is depressed, just whether a direction is depressed at all. To the programmer the Gamepad appears as a standard four button joystick.
--1-2-
\ |
3 -|
| |
| |
| |
--4--+-+--5--
+-----------+