]> git.sur5r.net Git - cc65/blob - asminc/mouse-kernel.inc
Mouse position no longer contained in the header
[cc65] / asminc / mouse-kernel.inc
1 ;/*****************************************************************************/
2 ;/*                                                                           */
3 ;/*                            mouse-kernel.inc                               */
4 ;/*                                                                           */
5 ;/*                                Mouse API                                  */
6 ;/*                                                                           */
7 ;/*                                                                           */
8 ;/*                                                                           */
9 ;/* (C) 2003-2004 Ullrich von Bassewitz                                       */
10 ;/*               Römerstraße 52                                              */
11 ;/*               D-70794 Filderstadt                                         */
12 ;/* EMail:        uz@cc65.org                                                 */
13 ;/*                                                                           */
14 ;/*                                                                           */
15 ;/*                                                                           */
16 ;/*                                                                           */
17 ;/* This software is provided 'as-is', without any expressed or implied       */
18 ;/* warranty.  In no event will the authors be held liable for any damages    */
19 ;/* arising from the use of this software.                                    */
20 ;/*                                                                           */
21 ;/* Permission is granted to anyone to use this software for any purpose,     */
22 ;/* including commercial applications, and to alter it and redistribute it    */
23 ;/* freely, subject to the following restrictions:                            */
24 ;/*                                                                           */
25 ;/* 1. The origin of this software must not be misrepresented; you must not   */
26 ;/*    claim that you wrote the original software. If you use this software   */
27 ;/*    in a product, an acknowledgment in the product documentation would be  */
28 ;/*    appreciated but is not required.                                       */
29 ;/* 2. Altered source versions must be plainly marked as such, and must not   */
30 ;/*    be misrepresented as being the original software.                      */
31 ;/* 3. This notice may not be removed or altered from any source              */
32 ;/*    distribution.                                                          */
33 ;/*                                                                           */
34 ;/*****************************************************************************/
35
36
37
38
39 ;------------------------------------------------------------------------------
40 ; Error codes
41
42 .enum
43         MOUSE_ERR_OK                    ; No error
44         MOUSE_ERR_NO_DRIVER             ; No driver available
45         MOUSE_ERR_CANNOT_LOAD           ; Error loading driver
46         MOUSE_ERR_INV_DRIVER            ; Invalid driver
47         MOUSE_ERR_NO_DEVICE             ; Mouse hardware not found
48         MOUSE_ERR_INV_IOCTL             ; Invalid ioctl code
49 .endenum
50
51 ;------------------------------------------------------------------------------
52 ; The driver header
53
54 .struct MOUSE_HDR
55         ID              .byte   3       ; Contains 0x6D, 0x6F, 0x75 ("mou")
56         VERSION         .byte   1       ; Interface version
57         JUMPTAB         .struct
58             INSTALL     .addr
59             UNINSTALL   .addr
60             HIDE        .addr
61             SHOW        .addr
62             BOX         .addr
63             MOVE        .addr
64             BUTTONS     .addr
65             POS         .addr
66             INFO        .addr
67             IOCTL       .addr
68             IRQ         .addr
69         .endstruct
70         CALLBACKS .struct               ; Jump instructions
71                         .byte           ; JMP opcode
72             CHIDE       .addr           ; Jump address
73                         .byte
74             CSHOW       .addr
75                         .byte
76             CMOVEX      .addr
77                         .byte
78             CMOVEY      .addr
79         .endstruct
80 .endstruct
81
82 ;------------------------------------------------------------------------------
83 ; The mouse callback structure
84
85 .struct MOUSE_CALLBACKS
86         HIDE    .addr                   ; Hide the mouse cursor
87         SHOW    .addr                   ; Show the mouse cursor
88         MOVEX   .addr                   ; Move the mouse cursor
89         MOVEY   .addr                   ; Dito for Y
90 .endstruct
91
92 ;------------------------------------------------------------------------------
93 ; The mouse API version, stored in MOUSE_HDR::VERSION
94
95 MOUSE_API_VERSION       = $00
96
97 ;------------------------------------------------------------------------------
98 ; Mouse button definitions
99
100 MOUSE_BTN_LEFT          = $10
101 MOUSE_BTN_RIGHT         = $01
102
103 ;------------------------------------------------------------------------------
104 ; Structures used to return data from the mouse driver
105
106 .struct MOUSE_POS
107         XCOORD  .word
108         YCOORD  .word
109 .endstruct
110
111 .struct MOUSE_INFO
112         POS     .tag    MOUSE_POS
113         BUTTONS .byte
114 .endstruct
115
116
117 ;------------------------------------------------------------------------------
118 ; Variables
119
120         .global _mouse_drv              ; Pointer to driver
121         .global _mouse_hidden           ; Counter, 0 = mouse is visible
122
123 ;------------------------------------------------------------------------------
124 ; C callable functions
125
126         .global _mouse_load_driver
127         .global _mouse_unload
128         .global _mouse_install
129         .global _mouse_uninstall
130         .global _mouse_hide
131         .global _mouse_show
132         .global _mouse_box
133         .global _mouse_move
134         .global _mouse_buttons
135         .global _mouse_pos
136         .global _mouse_info
137         .global _mouse_ioctl
138
139 ;------------------------------------------------------------------------------
140 ; Driver entry points
141
142         .global mouse_install
143         .global mouse_uninstall
144         .global mouse_hide
145         .global mouse_show
146         .global mouse_box
147         .global mouse_move
148         .global mouse_buttons
149         .global mouse_pos
150         .global mouse_info
151         .global mouse_ioctl
152
153