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
38 ; Button state masks (8 values)
45 .byte $00 ; JOY_FIRE2 not available
46 .byte $00 ; Future expansion
47 .byte $00 ; Future expansion
55 .addr 0 ; IRQ entry not used
57 ; ------------------------------------------------------------------------
60 JOY_COUNT = 8 ; Number of joysticks we support
63 ; ------------------------------------------------------------------------
69 ; ------------------------------------------------------------------------
70 ; INSTALL routine. Is called after the driver is loaded into memory. If
71 ; possible, check if the hardware is present and determine the amount of
73 ; Must return an JOY_ERR_xx code in a/x.
85 ; rts ; Run into UNINSTALL instead
87 ; ------------------------------------------------------------------------
88 ; UNINSTALL routine. Is called before the driver is removed from memory.
89 ; Can do cleanup or whatever. Must not return anything.
96 ; ------------------------------------------------------------------------
97 ; COUNT: Return the total number of available joysticks in a/x.
105 ; ------------------------------------------------------------------------
106 ; READ: Read a particular joystick passed in A.
118 lda PORTA ; get position
121 ora TRIG0 ; add button information