]> git.sur5r.net Git - cc65/blob - asminc/mouse-kernel.inc
New ioctl function
[cc65] / asminc / mouse-kernel.inc
1 ;/*****************************************************************************/
2 ;/*                                                                           */
3 ;/*                            mouse-kernel.inc                               */
4 ;/*                                                                           */
5 ;/*                                Mouse API                                  */
6 ;/*                                                                           */
7 ;/*                                                                           */
8 ;/*                                                                           */
9 ;/* (C) 2003      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 .endstruct
71
72 ;------------------------------------------------------------------------------
73 ; The mouse API version, stored in MOUSE_HDR::VERSION
74
75 MOUSE_API_VERSION       = $00
76
77 ;------------------------------------------------------------------------------
78 ; Mouse button definitions
79
80 MOUSE_BTN_LEFT          = $10
81 MOUSE_BTN_RIGHT         = $01
82
83 ;------------------------------------------------------------------------------
84 ; Structures used to return data from the mouse driver
85
86 .struct MOUSE_POS
87         XCOORD  .word
88         YCOORD  .word
89 .endstruct
90
91 .struct MOUSE_INFO
92         POS     .tag    MOUSE_POS
93         BUTTONS .byte
94 .endstruct
95
96
97 ;------------------------------------------------------------------------------
98 ; Variables
99
100         .global _mouse_drv                      ; Pointer to driver
101
102 ;------------------------------------------------------------------------------
103 ; C callable functions
104
105         .global _mouse_set_callbacks
106         .global _mouse_load_driver
107         .global _mouse_unload
108         .global _mouse_install
109         .global _mouse_uninstall
110         .global _mouse_hide
111         .global _mouse_show
112         .global _mouse_box
113         .global _mouse_move
114         .global _mouse_buttons
115         .global _mouse_pos
116         .global _mouse_info   
117         .global _mouse_ioctl
118
119 ;------------------------------------------------------------------------------
120 ; Driver entry points
121
122         .global mouse_install
123         .global mouse_uninstall
124         .global mouse_hide
125         .global mouse_show
126         .global mouse_box
127         .global mouse_move
128         .global mouse_buttons
129         .global mouse_pos
130         .global mouse_info  
131         .global mouse_ioctl
132
133