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"
19 ; ------------------------------------------------------------------------
20 ; Header. Includes jump table
26 .byte $6A, $6F, $79 ; "joy"
27 .byte JOY_API_VERSION ; Driver API version number
29 ; Button state masks (8 values)
36 .byte $00 ; JOY_FIRE2 not available
37 .byte $00 ; Future expansion
38 .byte $00 ; Future expansion
46 .addr 0 ; IRQ entry not used
48 ; ------------------------------------------------------------------------
51 JOY_COUNT = 8 ; Number of joysticks we support
54 ; ------------------------------------------------------------------------
60 ; ------------------------------------------------------------------------
61 ; INSTALL routine. Is called after the driver is loaded into memory. If
62 ; possible, check if the hardware is present and determine the amount of
64 ; Must return an JOY_ERR_xx code in a/x.
76 ; rts ; Run into UNINSTALL instead
78 ; ------------------------------------------------------------------------
79 ; UNINSTALL routine. Is called before the driver is removed from memory.
80 ; Can do cleanup or whatever. Must not return anything.
87 ; ------------------------------------------------------------------------
88 ; COUNT: Return the total number of available joysticks in a/x.
96 ; ------------------------------------------------------------------------
97 ; READ: Read a particular joystick passed in A.
109 lda PORTA ; get position
112 ora TRIG0 ; add button information