Int 15H [AT] [PS/2] Function 84H (132) Read joystick

Returns the joystick switch settings and potentiometer values.

Call with:

AH = 84H

DX = subfunction

00H to read switch settings

01H to read resistive inputs

Returns:

If function successful

Carry flag = clear

and, if called with DX = 00H

AL = switch settings (bits 4—7)

or, if called with DX = 01H

AX = A(x) value

BX = A(y) value

CX = B(x) value

DX = B(y) value

If function unsuccessful

Carry flag = set

Notes:

An error condition is returned if DX does not contain a valid subfunction number.

If no game adapter is installed, AL is returned as 00H for Subfunction 00H (i.e., all switches open); AX, BX, CX, and DX are returned containing 00H for Subfunction 01H.

Using a 250 KOhm joystick, the potentiometer values usually lie within the srange 0—416 (0000—01A0H).