Allow mouse to be locked when grabbed with GEM driver
authorPatrice Mandin <patmandin@gmail.com>
Tue, 12 Sep 2006 19:43:29 +0000
changeset 2023b7d426b28c18
parent 2022 649e9ac39f74
child 2024 cb0fd9cdd2a9
Allow mouse to be locked when grabbed with GEM driver
src/video/ataricommon/SDL_xbiosevents.c
src/video/ataricommon/SDL_xbiosevents_c.h
src/video/ataricommon/SDL_xbiosinterrupt.S
src/video/ataricommon/SDL_xbiosinterrupt_s.h
     1.1 --- a/src/video/ataricommon/SDL_xbiosevents.c	Tue Sep 12 19:23:51 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_xbiosevents.c	Tue Sep 12 19:43:29 2006 +0000
     1.3 @@ -50,7 +50,8 @@
     1.4      void *oldpile;
     1.5  
     1.6      /* Clear variables */
     1.7 -    SDL_AtariXbios_mouseb =
     1.8 +    SDL_AtariXbios_mouselock =
     1.9 +        SDL_AtariXbios_mouseb =
    1.10          SDL_AtariXbios_mousex =
    1.11          SDL_AtariXbios_mousey =
    1.12          SDL_AtariXbios_joystick = atari_prevmouseb = 0;
    1.13 @@ -151,4 +152,8 @@
    1.14      }
    1.15  }
    1.16  
    1.17 +void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition)
    1.18 +{
    1.19 +    SDL_AtariXbios_mouselock = lockPosition;
    1.20 +}
    1.21  /* vi: set ts=4 sw=4 expandtab: */
     2.1 --- a/src/video/ataricommon/SDL_xbiosevents_c.h	Tue Sep 12 19:23:51 2006 +0000
     2.2 +++ b/src/video/ataricommon/SDL_xbiosevents_c.h	Tue Sep 12 19:43:29 2006 +0000
     2.3 @@ -43,6 +43,7 @@
     2.4  extern void SDL_AtariXbios_InstallVectors(int vectors_mask);
     2.5  extern void SDL_AtariXbios_RestoreVectors(void);
     2.6  extern void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents);
     2.7 +extern void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition);
     2.8  
     2.9  #endif /* _SDL_XBIOSEVENTS_H_ */
    2.10  /* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/src/video/ataricommon/SDL_xbiosinterrupt.S	Tue Sep 12 19:23:51 2006 +0000
     3.2 +++ b/src/video/ataricommon/SDL_xbiosinterrupt.S	Tue Sep 12 19:43:29 2006 +0000
     3.3 @@ -33,6 +33,7 @@
     3.4  	.globl	_SDL_AtariXbios_MouseVector
     3.5  	.globl	_SDL_AtariXbios_JoystickVector
     3.6  
     3.7 +	.globl	_SDL_AtariXbios_mouselock
     3.8  	.globl	_SDL_AtariXbios_mouseb
     3.9  	.globl	_SDL_AtariXbios_mousex
    3.10  	.globl	_SDL_AtariXbios_mousey
    3.11 @@ -125,6 +126,13 @@
    3.12  	extw	d0
    3.13  	addw	d0,_SDL_AtariXbios_mousey
    3.14  
    3.15 +	/* Lock mouse position ? */
    3.16 +	tstw	_SDL_AtariXbios_mouselock
    3.17 +	beq.s	no_mouse_lock
    3.18 +	clrb	a0@(1)
    3.19 +	clrb	a0@(2)
    3.20 +no_mouse_lock:
    3.21 +
    3.22  	/* Jump through old vector */
    3.23  	movel	sp@+,d0
    3.24  
    3.25 @@ -133,10 +141,9 @@
    3.26  
    3.27  	.data
    3.28  	.even
    3.29 +	.comm	_SDL_AtariXbios_mouselock,2*1
    3.30  	.comm	_SDL_AtariXbios_mousex,2*1
    3.31 -	.even
    3.32  	.comm	_SDL_AtariXbios_mousey,2*1
    3.33 -	.even
    3.34  	.comm	_SDL_AtariXbios_mouseb,2*1
    3.35  
    3.36  /*--- Our joystick vector ---*/
     4.1 --- a/src/video/ataricommon/SDL_xbiosinterrupt_s.h	Tue Sep 12 19:23:51 2006 +0000
     4.2 +++ b/src/video/ataricommon/SDL_xbiosinterrupt_s.h	Tue Sep 12 19:43:29 2006 +0000
     4.3 @@ -36,6 +36,7 @@
     4.4  
     4.5  /* Variables */
     4.6  
     4.7 +extern volatile Uint16 SDL_AtariXbios_mouselock;   /* mouse lock position */
     4.8  extern volatile Uint16 SDL_AtariXbios_mouseb;   /* buttons */
     4.9  extern volatile Sint16 SDL_AtariXbios_mousex;   /* X relative motion */
    4.10  extern volatile Sint16 SDL_AtariXbios_mousey;   /* Y relative motion */