2 ; Standard joystick driver for the Atari Lynx.
3 ; The Lynx has two fire buttons. So it is not quite "standard".
5 ; Modified by Karri Kaksonen, 2004-09-16
6 ; Ullrich von Bassewitz, 2002-12-20
7 ; Using code from Steve Schmidtke
10 .include "zeropage.inc"
12 .include "joy-kernel.inc"
13 .include "joy-error.inc"
20 ; ------------------------------------------------------------------------
21 ; Header. Includes jump table
27 .byte $6A, $6F, $79 ; "joy"
28 .byte JOY_API_VERSION ; Driver API version number
30 ; Button state masks (8 values)
48 .addr 0 ; IRQ entry unused
50 ; ------------------------------------------------------------------------
53 JOY_COUNT = 1 ; Number of joysticks we support
56 ; ------------------------------------------------------------------------
62 ; ------------------------------------------------------------------------
63 ; INSTALL routine. Is called after the driver is loaded into memory. If
64 ; possible, check if the hardware is present and determine the amount of
66 ; Must return an JOY_ERR_xx code in a/x.
72 ; rts ; Run into UNINSTALL instead
74 ; ------------------------------------------------------------------------
75 ; UNINSTALL routine. Is called before the driver is removed from memory.
76 ; Can do cleanup or whatever. Must not return anything.
83 ; ------------------------------------------------------------------------
84 ; COUNT: Return the total number of available joysticks in a/x.
92 ; ------------------------------------------------------------------------
93 ; READ: Read a particular joystick passed in A.
96 ldx #$00 ; Clear high byte
97 lda JOYSTICK ; Read joystick
98 and #$F3 ; Mask relevant keys