]> git.sur5r.net Git - cc65/blob - asminc/mouse-kernel.inc
Make _mouse_geterrormsg public
[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
50         MOUSE_ERR_COUNT                 ; Special: Number of error codes
51 .endenum
52
53 ;------------------------------------------------------------------------------
54 ; The driver header
55
56 .struct MOUSE_HDR
57         ID              .byte   3       ; Contains 0x6D, 0x6F, 0x75 ("mou")
58         VERSION         .byte   1       ; Interface version
59         JUMPTAB         .struct
60             INSTALL     .addr
61             UNINSTALL   .addr
62             HIDE        .addr
63             SHOW        .addr
64             BOX         .addr
65             MOVE        .addr
66             BUTTONS     .addr
67             POS         .addr
68             INFO        .addr
69             IOCTL       .addr
70             IRQ         .addr
71         .endstruct
72         CALLBACKS .struct               ; Jump instructions
73                         .byte           ; JMP opcode
74             CHIDE       .addr           ; Jump address
75                         .byte
76             CSHOW       .addr
77                         .byte
78             CMOVEX      .addr
79                         .byte
80             CMOVEY      .addr
81         .endstruct
82 .endstruct
83
84 ;------------------------------------------------------------------------------
85 ; The mouse callback structure
86
87 .struct MOUSE_CALLBACKS
88         HIDE    .addr                   ; Hide the mouse cursor
89         SHOW    .addr                   ; Show the mouse cursor
90         MOVEX   .addr                   ; Move the mouse cursor
91         MOVEY   .addr                   ; Dito for Y
92 .endstruct
93
94 ;------------------------------------------------------------------------------
95 ; The mouse API version, stored in MOUSE_HDR::VERSION
96
97 MOUSE_API_VERSION       = $00
98
99 ;------------------------------------------------------------------------------
100 ; Mouse button definitions
101
102 MOUSE_BTN_LEFT          = $10
103 MOUSE_BTN_RIGHT         = $01
104
105 ;------------------------------------------------------------------------------
106 ; Structures used to return data from the mouse driver
107
108 .struct MOUSE_POS
109         XCOORD  .word
110         YCOORD  .word
111 .endstruct
112
113 .struct MOUSE_INFO
114         POS     .tag    MOUSE_POS
115         BUTTONS .byte
116 .endstruct
117
118
119 ;------------------------------------------------------------------------------
120 ; Variables
121
122         .global _mouse_drv              ; Pointer to driver
123         .global _mouse_hidden           ; Counter, 0 = mouse is visible
124
125 ;------------------------------------------------------------------------------
126 ; C callable functions
127
128         .global _mouse_load_driver
129         .global _mouse_unload
130         .global _mouse_install
131         .global _mouse_uninstall
132         .global _mouse_geterrormsg
133         .global _mouse_hide
134         .global _mouse_show
135         .global _mouse_box
136         .global _mouse_move
137         .global _mouse_buttons
138         .global _mouse_pos
139         .global _mouse_info
140         .global _mouse_ioctl
141
142 ;------------------------------------------------------------------------------
143 ; Driver entry points
144
145         .global mouse_install
146         .global mouse_uninstall
147         .global mouse_hide
148         .global mouse_show
149         .global mouse_box
150         .global mouse_move
151         .global mouse_buttons
152         .global mouse_pos
153         .global mouse_info
154         .global mouse_ioctl
155
156