]> git.sur5r.net Git - cc65/commitdiff
Changed the mouse API: mouse_box is gone, there are now mouse_getbox and
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 26 Sep 2009 11:11:14 +0000 (11:11 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 26 Sep 2009 11:11:14 +0000 (11:11 +0000)
mouse_setbox instead. Beware: Current drivers will crash until they're
changed!

git-svn-id: svn://svn.cc65.org/cc65/trunk@4230 b7a2c559-68d2-44c3-8de9-860c34a00d81

asminc/mouse-kernel.inc
include/mouse.h
libsrc/mouse/Makefile
libsrc/mouse/mouse-kernel.s
libsrc/mouse/mouse_box.s [deleted file]

index 9e8662895df07f4b57857c29f1a3e8b7f84752fa..91d84e06e19e31f03753f153f91076d4dca13949 100644 (file)
@@ -6,10 +6,10 @@
 ;/*                                                                           */
 ;/*                                                                           */
 ;/*                                                                           */
-;/* (C) 2003-2006 Ullrich von Bassewitz                                       */
-;/*               Römerstraße 52                                              */
-;/*               D-70794 Filderstadt                                         */
-;/* EMail:        uz@cc65.org                                                 */
+;/* (C) 2003-2009, Ullrich von Bassewitz                                      */
+;/*                Roemerstrasse 52                                           */
+;/*                D-70794 Filderstadt                                        */
+;/* EMail:         uz@cc65.org                                                */
 ;/*                                                                           */
 ;/*                                                                           */
 ;/*                                                                           */
@@ -61,7 +61,8 @@
            UNINSTALL   .addr
                    HIDE        .addr
            SHOW        .addr
-           BOX         .addr
+                   SETBOX      .addr
+           GETBOX      .addr
            MOVE        .addr
            BUTTONS     .addr
            POS         .addr
@@ -95,7 +96,7 @@
 ;------------------------------------------------------------------------------
 ; The mouse API version, stored in MOUSE_HDR::VERSION
 
-MOUSE_API_VERSION       = $01
+MOUSE_API_VERSION       = $02
 
 ;------------------------------------------------------------------------------
 ; Bitmapped mouse driver flags, stored in MOUSE_HDR::FLAGS.
@@ -127,6 +128,12 @@ MOUSE_BTN_RIGHT         = $01
         BUTTONS .byte
 .endstruct
 
+.struct MOUSE_BOX
+       MINX    .word
+       MINY    .word
+       MAXX    .word
+       MAXY    .word
+.endstruct
 
 ;------------------------------------------------------------------------------
 ; Variables
@@ -144,7 +151,8 @@ MOUSE_BTN_RIGHT         = $01
         .global _mouse_geterrormsg
         .global _mouse_hide
         .global _mouse_show
-        .global _mouse_box
+        .global _mouse_setbox
+       .global _mouse_getbox
         .global _mouse_move
         .global _mouse_buttons
         .global _mouse_pos
@@ -160,7 +168,8 @@ MOUSE_BTN_RIGHT         = $01
         .global mouse_uninstall
         .global mouse_hide
         .global mouse_show
-        .global mouse_box
+        .global mouse_setbox                    
+       .global mouse_getbox
         .global mouse_move
         .global mouse_buttons
         .global mouse_pos
index 136bfd15e7b04ceb6d43a4a7ab12bd4838620017..3d62261851546377e787f6b12343b42719fdf5b6 100644 (file)
@@ -60,8 +60,8 @@
 
 /* Structure containing the mouse coordinates */
 struct mouse_pos {
-    int x;
-    int y;
+    int                x;
+    int                y;
 };
 
 /* Structure containing information about the mouse */
@@ -70,6 +70,14 @@ struct mouse_info {
     unsigned char       buttons;       /* Mouse button mask */
 };
 
+/* Structure used for getbox/setbox */
+struct mouse_box {
+    int                minx;
+    int                miny;
+    int                maxx;
+    int                maxy;
+};
+
 /* Structure containing mouse callback functions. These functions are declared
  * in C notation here, but they cannot be C functions (at least not easily),
  * since they may be called from within an interrupt.
@@ -133,7 +141,7 @@ void __fastcall__ mouse_hide (void);
 void __fastcall__ mouse_show (void);
 /* Show the mouse. See mouse_hide for more information. */
 
-void __fastcall__ mouse_box (int minx, int miny, int maxx, int maxy);
+void __fastcall__ mouse_setbox (const struct mouse_box* box);
 /* Set the bounding box for the mouse pointer movement. The mouse X and Y
  * coordinates will never go outside the given box.
  * NOTE: The function does *not* check if the mouse is currently inside the
@@ -149,6 +157,9 @@ void __fastcall__ mouse_box (int minx, int miny, int maxx, int maxy);
  * are really what you want, you have to use your own cursor routines.
  */
 
+void __fastcall__ mouse_getbox (struct mouse_box* box);
+/* Get the current bounding box for the mouse pointer movement. */
+
 void __fastcall__ mouse_move (int x, int y);
 /* Set the mouse cursor to the given position. If a mouse cursor is defined
  * and currently visible, the mouse cursor is also moved.
index 47841ab8f76fbd9eac0fcc86d136cf12c4e3f905..cc0deca33f6cf5737b27a48eed8bf1d16eb9895b 100644 (file)
@@ -13,7 +13,7 @@ AS    = ../../src/ca65/ca65
 CC     = ../../src/cc65/cc65
 LD     = ../../src/ld65/ld65
 
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc       
 CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
 
 #--------------------------------------------------------------------------
@@ -32,8 +32,8 @@ CFLAGS        = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
 C_OBJS =
 
 S_OBJS =        mouse-kernel.o          \
-                mouse_box.o             \
                 mouse_buttons.o         \
+               mouse_getbox.o          \
                 mouse_geterrormsg.o     \
                 mouse_hide.o            \
                 mouse_info.o            \
@@ -41,6 +41,7 @@ S_OBJS =        mouse-kernel.o          \
                 mouse_load.o            \
                 mouse_move.o            \
                 mouse_pos.o             \
+                mouse_setbox.o          \
                 mouse_show.o            \
                 mouse_unload.o
 
index eb82698a01ffc886747c0984edb28a57618cf4f1..b8d1db185eecf6f20f686281e8d5948579c2b142 100644 (file)
@@ -1,5 +1,5 @@
 ;
-; Ullrich von Bassewitz, 2003-12-28
+; Ullrich von Bassewitz, 2003-12-28, 2009-09-26
 ;
 ; Common functions of the mouse driver API.
 ;
@@ -28,7 +28,8 @@ mouse_install:  jmp     return0
 mouse_uninstall:jmp     return0
 mouse_hide:     jmp     return0
 mouse_show:     jmp     return0
-mouse_box:      jmp     return0
+mouse_setbox:   jmp     return0
+mouse_getbox:  jmp     return0
 mouse_move:     jmp     return0
 mouse_buttons:  jmp     return0
 mouse_pos:      jmp     return0
diff --git a/libsrc/mouse/mouse_box.s b/libsrc/mouse/mouse_box.s
deleted file mode 100644 (file)
index e94feda..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-;
-; Ullrich von Bassewitz, 2004-03-23
-;
-; void __fastcall__ mouse_box (int minx, int miny, int maxx, int maxy);
-; /* Set the bounding box for the mouse pointer movement. The mouse X and Y
-;  * coordinates will never go outside the given box.
-;  * NOTE: The function does *not* check if the mouse is currently inside the
-;  * given margins. The proper way to use this function therefore is:
-;  *
-;  *   - Hide the mouse
-;  *   - Set the bounding box
-;  *   - Place the mouse at the desired position
-;  *   - Show the mouse again.
-;  *
-;  * NOTE2: When setting the box to something that is larger than the actual
-;  * screen, the positioning of the mouse cursor can fail. If such margins
-;  * are really what you want, you have to use your own cursor routines.
-;  */
-;
-
-        .import         incsp6
-
-        .include        "mouse-kernel.inc"
-
-.proc   _mouse_box
-
-        jsr     mouse_box               ; Call the driver
-        jmp     incsp6                  ; Cleanup the stack
-
-.endproc
-
-
-