Skip to content

Commit 6ac662b

Browse files
author
Brian Holdsworth
committed
Update apiref for aceConGamepad routine.
1 parent 71e7fe5 commit 6ac662b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/apiref.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,26 @@ ALTERS : <nothing>
911911

912912
The kernel will remap the meanings of "joy1" and "joy2" according to the system configuration. You will normally want to use "joy1" if you are running a single-joystick application.
913913

914+
```
915+
NAME : aceConGamepad
916+
PURPOSE: read/configure the inputs of up to two usb gamepad controllers
917+
ARGS : .AY = ptr to byte array
918+
.CC = read controller
919+
.CS = configure controller
920+
RETURNS: 4-byte array with controller button bits
921+
ALTERS : .A, .X, .Y
922+
```
923+
924+
For reading the controllers, pass a pointer to a 4-byte array in .AY. The first two bytes of the array are for js0 and the last two bytes are for js1. For each gamepad, the low-order nybble of the low-order byte has the direction (e.g. D-pad) bits, and the high-order byte has the bits for the 8 supported buttons. The buttons are translated through a configuration option specific to each gamepad. Configuration is done in the idun-shell using the 'joys' command.
925+
926+
The mapping of the standard directions/buttons to the value returned from this procedure is as follows:
927+
```
928+
button X X X X Left Right Up Down Strt Sel L-Tr R-Tr Y X B A
929+
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
930+
```
931+
932+
In the case of configuring a gamepad, the carry-bit must be set, and the returned values are button numbers rather than a bitmask. For more details, [see: cmd/joys.asm.](../cbm/cmd/joys.asm)
933+
914934
```
915935
NAME : aceConOption
916936
PURPOSE: read/modify console configuration settings

0 commit comments

Comments
 (0)