Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Allow mouse to be locked when grabbed with GEM driver
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Sep 12, 2006
1 parent 9459cb2 commit 2aadfac
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/video/ataricommon/SDL_xbiosevents.c
Expand Up @@ -50,7 +50,8 @@ SDL_AtariXbios_InstallVectors(int vectors_mask)
void *oldpile;

/* Clear variables */
SDL_AtariXbios_mouseb =
SDL_AtariXbios_mouselock =
SDL_AtariXbios_mouseb =
SDL_AtariXbios_mousex =
SDL_AtariXbios_mousey =
SDL_AtariXbios_joystick = atari_prevmouseb = 0;
Expand Down Expand Up @@ -151,4 +152,8 @@ SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
}
}

void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition)
{
SDL_AtariXbios_mouselock = lockPosition;
}
/* vi: set ts=4 sw=4 expandtab: */
1 change: 1 addition & 0 deletions src/video/ataricommon/SDL_xbiosevents_c.h
Expand Up @@ -43,6 +43,7 @@ extern int SDL_AtariXbios_enabled;
extern void SDL_AtariXbios_InstallVectors(int vectors_mask);
extern void SDL_AtariXbios_RestoreVectors(void);
extern void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents);
extern void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition);

#endif /* _SDL_XBIOSEVENTS_H_ */
/* vi: set ts=4 sw=4 expandtab: */
11 changes: 9 additions & 2 deletions src/video/ataricommon/SDL_xbiosinterrupt.S
Expand Up @@ -33,6 +33,7 @@
.globl _SDL_AtariXbios_MouseVector
.globl _SDL_AtariXbios_JoystickVector

.globl _SDL_AtariXbios_mouselock
.globl _SDL_AtariXbios_mouseb
.globl _SDL_AtariXbios_mousex
.globl _SDL_AtariXbios_mousey
Expand Down Expand Up @@ -125,6 +126,13 @@ _SDL_AtariXbios_MouseVector:
extw d0
addw d0,_SDL_AtariXbios_mousey

/* Lock mouse position ? */
tstw _SDL_AtariXbios_mouselock
beq.s no_mouse_lock
clrb a0@(1)
clrb a0@(2)
no_mouse_lock:

/* Jump through old vector */
movel sp@+,d0

Expand All @@ -133,10 +141,9 @@ _SDL_AtariXbios_MouseVector:

.data
.even
.comm _SDL_AtariXbios_mouselock,2*1
.comm _SDL_AtariXbios_mousex,2*1
.even
.comm _SDL_AtariXbios_mousey,2*1
.even
.comm _SDL_AtariXbios_mouseb,2*1

/*--- Our joystick vector ---*/
Expand Down
1 change: 1 addition & 0 deletions src/video/ataricommon/SDL_xbiosinterrupt_s.h
Expand Up @@ -36,6 +36,7 @@

/* Variables */

extern volatile Uint16 SDL_AtariXbios_mouselock; /* mouse lock position */
extern volatile Uint16 SDL_AtariXbios_mouseb; /* buttons */
extern volatile Sint16 SDL_AtariXbios_mousex; /* X relative motion */
extern volatile Sint16 SDL_AtariXbios_mousey; /* Y relative motion */
Expand Down

0 comments on commit 2aadfac

Please sign in to comment.