1 ;/*****************************************************************************/
3 ;/* mouse-kernel.inc */
9 ;/* (C) 2003-2009, Ullrich von Bassewitz */
10 ;/* Roemerstrasse 52 */
11 ;/* D-70794 Filderstadt */
12 ;/* EMail: uz@cc65.org */
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. */
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: */
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 */
34 ;/*****************************************************************************/
39 ;------------------------------------------------------------------------------
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
50 MOUSE_ERR_COUNT ; Special: Number of error codes
53 ;------------------------------------------------------------------------------
57 ID .byte 3 ; Contains 0x6D, 0x6F, 0x75 ("mou")
58 VERSION .byte 1 ; Interface version
73 FLAGS .byte ; Mouse driver flags
74 CALLBACKS .struct ; Jump instructions
76 CHIDE .addr ; Jump address
86 ;------------------------------------------------------------------------------
87 ; The mouse callback structure
89 .struct MOUSE_CALLBACKS
90 HIDE .addr ; Hide the mouse cursor
91 SHOW .addr ; Show the mouse cursor
92 MOVEX .addr ; Move the mouse cursor
93 MOVEY .addr ; Dito for Y
96 ;------------------------------------------------------------------------------
97 ; The mouse API version, stored in MOUSE_HDR::VERSION
99 MOUSE_API_VERSION = $02
101 ;------------------------------------------------------------------------------
102 ; Bitmapped mouse driver flags, stored in MOUSE_HDR::FLAGS.
103 ; Note: If neither of MOUSE_FLAG_XXX_IRQ is set, no interrupts are supplied
104 ; to the driver. If one of the bits is set, the interrupt vector MUST be
106 ; Beware: Some of the bits are tested using the BIT instruction, so do not
107 ; change the values without checking the code!
109 MOUSE_FLAG_EARLY_IRQ = $40 ; Enable IRQ *before* calling INSTALL
110 MOUSE_FLAG_LATE_IRQ = $80 ; Enable IRQ *after* calling INSTALL
112 ;------------------------------------------------------------------------------
113 ; Mouse button definitions
116 MOUSE_BTN_RIGHT = $01
118 ;------------------------------------------------------------------------------
119 ; Structures used to return data from the mouse driver
138 ;------------------------------------------------------------------------------
141 .global _mouse_drv ; Pointer to driver
142 .global _mouse_hidden ; Counter, 0 = mouse is visible
144 ;------------------------------------------------------------------------------
145 ; C callable functions
147 .global _mouse_load_driver
148 .global _mouse_unload
149 .global _mouse_install
150 .global _mouse_uninstall
151 .global _mouse_geterrormsg
154 .global _mouse_setbox
155 .global _mouse_getbox
157 .global _mouse_buttons
162 .global _mouse_clear_ptr
164 ;------------------------------------------------------------------------------
165 ; Driver entry points (asm callable)
167 .global mouse_install
168 .global mouse_uninstall
174 .global mouse_buttons