2 ; MultiJoy joystick driver for the Atari. May be used multiple times when linked
3 ; to the statically application.
5 ; Ullrich von Bassewitz, 2002-12-21
6 ; Stefan Haubenthal, 2009-04-10
7 ; Using code from Carsten Strotmann and help from Christian Groessler
10 .include "zeropage.inc"
12 .include "joy-kernel.inc"
13 .include "joy-error.inc"
20 ; ------------------------------------------------------------------------
21 ; Header. Includes jump table
24 module_header _atrxmj8_joy
26 module_header _atrmj8_joy
31 .byte $6A, $6F, $79 ; "joy"
32 .byte JOY_API_VERSION ; Driver API version number
45 ; ------------------------------------------------------------------------
48 JOY_COUNT = 8 ; Number of joysticks we support
51 ; ------------------------------------------------------------------------
57 ; ------------------------------------------------------------------------
58 ; INSTALL routine. Is called after the driver is loaded into memory. If
59 ; possible, check if the hardware is present and determine the amount of
61 ; Must return an JOY_ERR_xx code in a/x.
73 ; rts ; Run into UNINSTALL instead
75 ; ------------------------------------------------------------------------
76 ; UNINSTALL routine. Is called before the driver is removed from memory.
77 ; Can do cleanup or whatever. Must not return anything.
84 ; ------------------------------------------------------------------------
85 ; COUNT: Return the total number of available joysticks in a/x.
93 ; ------------------------------------------------------------------------
94 ; READ: Read a particular joystick passed in A.
98 and #JOY_COUNT-1 ; fix joystick number
99 tax ; Joystick number into X
108 lda STRIG0 ; get button
113 ora PORTA ; add position information
119 stx ATRACT ; we have interaction, disable "attract mode"
125 oldval: .res JOY_COUNT