Disable XBIOS driver for mouse and joystick under MiNT. Will write a driver for /dev/mouse later.
authorPatrice Mandin <patmandin@gmail.com>
Fri, 06 Jan 2006 22:24:09 +0000
changeset 1237a8068adf156b
parent 1236 ed252764287a
child 1238 1901fea5edac
Disable XBIOS driver for mouse and joystick under MiNT. Will write a driver for /dev/mouse later.
README.MiNT
src/video/ataricommon/SDL_biosevents.c
src/video/ataricommon/SDL_gemdosevents.c
src/video/ataricommon/SDL_xbiosevents.c
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemvideo.c
     1.1 --- a/README.MiNT	Fri Jan 06 20:57:59 2006 +0000
     1.2 +++ b/README.MiNT	Fri Jan 06 22:24:09 2006 +0000
     1.3 @@ -68,9 +68,9 @@
     1.4  - Dependent driver combinations:
     1.5  Video   Kbd     Mouse   Timer   Joysticks
     1.6  xbios   ikbd    ikbd    vbl(2)  ikbd
     1.7 -xbios   gemdos  xbios   vbl(2)  xbios
     1.8 -xbios   bios    xbios   vbl(2)  xbios
     1.9 -gem     gem     gem(1)  vbl(2)  xbios
    1.10 +xbios   gemdos  xbios   vbl(2)  xbios(3)
    1.11 +xbios   bios    xbios   vbl(2)  xbios(3)
    1.12 +gem     gem     gem(1)  vbl(2)  xbios(3)
    1.13  
    1.14  Audio   O/S     Misc
    1.15  dma8    All     Uses MFP Timer A interrupt
    1.16 @@ -87,11 +87,14 @@
    1.17  OpenGL driver always uses OSMesa.
    1.18  
    1.19  (1) GEM does not report relative mouse motion, so xbios mouse driver is used
    1.20 -to report this type event.
    1.21 +to report this type event. Under MiNT, using XBIOS mouse driver is not possible.
    1.22  
    1.23  (2) If you build SDL with threads using the GNU pth library, timers are
    1.24  supported via the pth library.
    1.25  
    1.26 +(3) Redirecting XBIOS vectors does not work under MiNT, so it is disabled in
    1.27 +this case.
    1.28 +
    1.29  ==============================================================================
    1.30  V.  Environment variables:
    1.31  
     2.1 --- a/src/video/ataricommon/SDL_biosevents.c	Fri Jan 06 20:57:59 2006 +0000
     2.2 +++ b/src/video/ataricommon/SDL_biosevents.c	Fri Jan 06 22:24:09 2006 +0000
     2.3 @@ -35,6 +35,7 @@
     2.4  
     2.5  /* Mint includes */
     2.6  #include <mint/osbind.h>
     2.7 +#include <mint/cookie.h>
     2.8  
     2.9  #include "SDL.h"
    2.10  #include "SDL_sysevents.h"
    2.11 @@ -71,7 +72,8 @@
    2.12  
    2.13  void AtariBios_InitOSKeymap(_THIS)
    2.14  {
    2.15 -	int i;
    2.16 +	int i, vectors_mask;
    2.17 +	unsigned long dummy;
    2.18  
    2.19  	memset(bios_currentkeyboard, 0, sizeof(bios_currentkeyboard));
    2.20  	memset(bios_previouskeyboard, 0, sizeof(bios_previouskeyboard));
    2.21 @@ -106,7 +108,12 @@
    2.22  	keymap[SCANCODE_LEFTALT] = SDLK_LALT;
    2.23  	keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
    2.24  
    2.25 -	SDL_AtariXbios_InstallVectors(ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS);
    2.26 +	vectors_mask = ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS;
    2.27 +	if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
    2.28 +		vectors_mask = 0;
    2.29 +	}
    2.30 +
    2.31 +	SDL_AtariXbios_InstallVectors(vectors_mask);
    2.32  }
    2.33  
    2.34  void AtariBios_PumpEvents(_THIS)
     3.1 --- a/src/video/ataricommon/SDL_gemdosevents.c	Fri Jan 06 20:57:59 2006 +0000
     3.2 +++ b/src/video/ataricommon/SDL_gemdosevents.c	Fri Jan 06 22:24:09 2006 +0000
     3.3 @@ -35,6 +35,7 @@
     3.4  
     3.5  /* Mint includes */
     3.6  #include <mint/osbind.h>
     3.7 +#include <mint/cookie.h>
     3.8  
     3.9  #include "SDL.h"
    3.10  #include "SDL_sysevents.h"
    3.11 @@ -76,7 +77,8 @@
    3.12  
    3.13  void AtariGemdos_InitOSKeymap(_THIS)
    3.14  {
    3.15 -	int i;
    3.16 +	int i, vectors_mask;
    3.17 +	unsigned long dummy;
    3.18  
    3.19  	memset(gemdos_currentkeyboard, 0, sizeof(gemdos_currentkeyboard));
    3.20  	memset(gemdos_previouskeyboard, 0, sizeof(gemdos_previouskeyboard));
    3.21 @@ -111,7 +113,12 @@
    3.22  	keymap[SCANCODE_LEFTALT] = SDLK_LALT;
    3.23  	keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
    3.24  
    3.25 -	SDL_AtariXbios_InstallVectors(ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS);
    3.26 +	vectors_mask = ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS;
    3.27 +	if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
    3.28 +		vectors_mask = 0;
    3.29 +	}
    3.30 +
    3.31 +	SDL_AtariXbios_InstallVectors(vectors_mask);
    3.32  }
    3.33  
    3.34  void AtariGemdos_PumpEvents(_THIS)
     4.1 --- a/src/video/ataricommon/SDL_xbiosevents.c	Fri Jan 06 20:57:59 2006 +0000
     4.2 +++ b/src/video/ataricommon/SDL_xbiosevents.c	Fri Jan 06 22:24:09 2006 +0000
     4.3 @@ -63,6 +63,11 @@
     4.4  		SDL_AtariXbios_joystick =
     4.5  		atari_prevmouseb = 0;
     4.6  
     4.7 +	if (vectors_mask==0) {
     4.8 +		SDL_AtariXbios_enabled=0;
     4.9 +		return;
    4.10 +	}
    4.11 +
    4.12  	/* Read IKBD vectors base */
    4.13  	kbdvecs=Kbdvbase();
    4.14  
    4.15 @@ -86,6 +91,10 @@
    4.16  {
    4.17  	void *oldpile;
    4.18  
    4.19 +	if (SDL_AtariXbios_enabled==0) {
    4.20 +		return;
    4.21 +	}
    4.22 +
    4.23  	/* Read IKBD vectors base */
    4.24  	kbdvecs=Kbdvbase();
    4.25  
    4.26 @@ -115,6 +124,10 @@
    4.27  
    4.28  void SDL_AtariXbios_PostMouseEvents(_THIS)
    4.29  {
    4.30 +	if (SDL_AtariXbios_enabled==0) {
    4.31 +		return;
    4.32 +	}
    4.33 +
    4.34  	/* Mouse motion ? */
    4.35  	if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
    4.36  		SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
     5.1 --- a/src/video/gem/SDL_gemevents.c	Fri Jan 06 20:57:59 2006 +0000
     5.2 +++ b/src/video/gem/SDL_gemevents.c	Fri Jan 06 22:24:09 2006 +0000
     5.3 @@ -384,8 +384,10 @@
     5.4  	/* Mouse motion ? */
     5.5  	if ((prevmousex!=mx) || (prevmousey!=my)) {
     5.6  		if (GEM_mouse_relative) {
     5.7 -			SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
     5.8 -			SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
     5.9 +			if ((SDL_AtariXbios_mousex!=0) || (SDL_AtariXbios_mousey!=0)) {
    5.10 +				SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
    5.11 +				SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
    5.12 +			}
    5.13  		} else {
    5.14  			int posx, posy;
    5.15  
     6.1 --- a/src/video/gem/SDL_gemvideo.c	Fri Jan 06 20:57:59 2006 +0000
     6.2 +++ b/src/video/gem/SDL_gemvideo.c	Fri Jan 06 22:24:09 2006 +0000
     6.3 @@ -137,6 +137,8 @@
     6.4  static SDL_VideoDevice *GEM_CreateDevice(int devindex)
     6.5  {
     6.6  	SDL_VideoDevice *device;
     6.7 +	int vectors_mask;
     6.8 +	unsigned long dummy;
     6.9  
    6.10  	/* Initialize all variables that we clean on shutdown */
    6.11  	device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice));
    6.12 @@ -198,7 +200,12 @@
    6.13  #endif
    6.14  
    6.15  	/* Joystick + Mouse relative motion */
    6.16 -	SDL_AtariXbios_InstallVectors(ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS);
    6.17 +	vectors_mask = ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS;
    6.18 +	if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
    6.19 +		vectors_mask = 0;
    6.20 +	}
    6.21 +
    6.22 +	SDL_AtariXbios_InstallVectors(vectors_mask);
    6.23  
    6.24  	device->free = GEM_DeleteDevice;
    6.25