]> git.sur5r.net Git - cc65/blob - libsrc/supervision/joy/supervision-stdjoy.s
Removed IRQ support from joystick drivers.
[cc65] / libsrc / supervision / joy / supervision-stdjoy.s
1 ;
2 ; Standard joystick driver for the Supervision
3 ;
4
5         .include        "joy-kernel.inc"
6         .include        "joy-error.inc"
7         .include        "supervision.inc"
8
9         .macpack        module
10
11
12 ; ------------------------------------------------------------------------
13 ; Header. Includes jump table
14
15         module_header   _supervision_stdjoy_joy
16
17 ; Driver signature
18
19         .byte   $6A, $6F, $79           ; "joy"
20         .byte   JOY_API_VERSION         ; Driver API version number
21
22 ; Library reference
23
24         .addr   $0000
25
26 ; Jump table.
27
28         .addr   INSTALL
29         .addr   UNINSTALL
30         .addr   COUNT
31         .addr   READJOY
32
33 ; ------------------------------------------------------------------------
34 ; Constants
35
36 JOY_COUNT       = 1             ; Number of joysticks we support
37
38
39 .code
40
41 ; ------------------------------------------------------------------------
42 ; INSTALL routine. Is called after the driver is loaded into memory. If
43 ; possible, check if the hardware is present and determine the amount of
44 ; memory available.
45 ; Must return an JOY_ERR_xx code in a/x.
46 ;
47
48 INSTALL:
49         lda     #<JOY_ERR_OK
50         ldx     #>JOY_ERR_OK
51
52 ;        rts                     ; Run into UNINSTALL instead
53
54 ; ------------------------------------------------------------------------
55 ; DEINSTALL routine. Is called before the driver is removed from memory.
56 ; Can do cleanup or whatever. Must not return anything.
57 ;
58
59 UNINSTALL:
60         rts
61
62
63 ; ------------------------------------------------------------------------
64 ; COUNT: Return the total number of available joysticks in a/x.
65 ;
66 ;unsigned char __fastcall__ joy_count (void);
67
68 COUNT:
69         lda     #<JOY_COUNT
70         ldx     #>JOY_COUNT
71         rts
72
73 ; ------------------------------------------------------------------------
74 ; READ: Read a particular joystick passed in A.
75 ;
76 ;unsigned char __fastcall__ joy_read (unsigned char joystick);
77
78 READJOY:
79         lda     sv_control
80         ldx     #0
81         rts