changeset 1237:a8068adf156b

Disable XBIOS driver for mouse and joystick under MiNT. Will write a driver for /dev/mouse later.
author Patrice Mandin <patmandin@gmail.com>
date Fri, 06 Jan 2006 22:24:09 +0000
parents ed252764287a
children 1901fea5edac
files 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
diffstat 6 files changed, 50 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/README.MiNT	Fri Jan 06 20:57:59 2006 +0000
+++ b/README.MiNT	Fri Jan 06 22:24:09 2006 +0000
@@ -68,9 +68,9 @@
 - Dependent driver combinations:
 Video   Kbd     Mouse   Timer   Joysticks
 xbios   ikbd    ikbd    vbl(2)  ikbd
-xbios   gemdos  xbios   vbl(2)  xbios
-xbios   bios    xbios   vbl(2)  xbios
-gem     gem     gem(1)  vbl(2)  xbios
+xbios   gemdos  xbios   vbl(2)  xbios(3)
+xbios   bios    xbios   vbl(2)  xbios(3)
+gem     gem     gem(1)  vbl(2)  xbios(3)
 
 Audio   O/S     Misc
 dma8    All     Uses MFP Timer A interrupt
@@ -87,11 +87,14 @@
 OpenGL driver always uses OSMesa.
 
 (1) GEM does not report relative mouse motion, so xbios mouse driver is used
-to report this type event.
+to report this type event. Under MiNT, using XBIOS mouse driver is not possible.
 
 (2) If you build SDL with threads using the GNU pth library, timers are
 supported via the pth library.
 
+(3) Redirecting XBIOS vectors does not work under MiNT, so it is disabled in
+this case.
+
 ==============================================================================
 V.  Environment variables:
 
--- a/src/video/ataricommon/SDL_biosevents.c	Fri Jan 06 20:57:59 2006 +0000
+++ b/src/video/ataricommon/SDL_biosevents.c	Fri Jan 06 22:24:09 2006 +0000
@@ -35,6 +35,7 @@
 
 /* Mint includes */
 #include <mint/osbind.h>
+#include <mint/cookie.h>
 
 #include "SDL.h"
 #include "SDL_sysevents.h"
@@ -71,7 +72,8 @@
 
 void AtariBios_InitOSKeymap(_THIS)
 {
-	int i;
+	int i, vectors_mask;
+	unsigned long dummy;
 
 	memset(bios_currentkeyboard, 0, sizeof(bios_currentkeyboard));
 	memset(bios_previouskeyboard, 0, sizeof(bios_previouskeyboard));
@@ -106,7 +108,12 @@
 	keymap[SCANCODE_LEFTALT] = SDLK_LALT;
 	keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
 
-	SDL_AtariXbios_InstallVectors(ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS);
+	vectors_mask = ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS;
+	if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
+		vectors_mask = 0;
+	}
+
+	SDL_AtariXbios_InstallVectors(vectors_mask);
 }
 
 void AtariBios_PumpEvents(_THIS)
--- a/src/video/ataricommon/SDL_gemdosevents.c	Fri Jan 06 20:57:59 2006 +0000
+++ b/src/video/ataricommon/SDL_gemdosevents.c	Fri Jan 06 22:24:09 2006 +0000
@@ -35,6 +35,7 @@
 
 /* Mint includes */
 #include <mint/osbind.h>
+#include <mint/cookie.h>
 
 #include "SDL.h"
 #include "SDL_sysevents.h"
@@ -76,7 +77,8 @@
 
 void AtariGemdos_InitOSKeymap(_THIS)
 {
-	int i;
+	int i, vectors_mask;
+	unsigned long dummy;
 
 	memset(gemdos_currentkeyboard, 0, sizeof(gemdos_currentkeyboard));
 	memset(gemdos_previouskeyboard, 0, sizeof(gemdos_previouskeyboard));
@@ -111,7 +113,12 @@
 	keymap[SCANCODE_LEFTALT] = SDLK_LALT;
 	keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
 
-	SDL_AtariXbios_InstallVectors(ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS);
+	vectors_mask = ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS;
+	if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
+		vectors_mask = 0;
+	}
+
+	SDL_AtariXbios_InstallVectors(vectors_mask);
 }
 
 void AtariGemdos_PumpEvents(_THIS)
--- a/src/video/ataricommon/SDL_xbiosevents.c	Fri Jan 06 20:57:59 2006 +0000
+++ b/src/video/ataricommon/SDL_xbiosevents.c	Fri Jan 06 22:24:09 2006 +0000
@@ -63,6 +63,11 @@
 		SDL_AtariXbios_joystick =
 		atari_prevmouseb = 0;
 
+	if (vectors_mask==0) {
+		SDL_AtariXbios_enabled=0;
+		return;
+	}
+
 	/* Read IKBD vectors base */
 	kbdvecs=Kbdvbase();
 
@@ -86,6 +91,10 @@
 {
 	void *oldpile;
 
+	if (SDL_AtariXbios_enabled==0) {
+		return;
+	}
+
 	/* Read IKBD vectors base */
 	kbdvecs=Kbdvbase();
 
@@ -115,6 +124,10 @@
 
 void SDL_AtariXbios_PostMouseEvents(_THIS)
 {
+	if (SDL_AtariXbios_enabled==0) {
+		return;
+	}
+
 	/* Mouse motion ? */
 	if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
 		SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
--- a/src/video/gem/SDL_gemevents.c	Fri Jan 06 20:57:59 2006 +0000
+++ b/src/video/gem/SDL_gemevents.c	Fri Jan 06 22:24:09 2006 +0000
@@ -384,8 +384,10 @@
 	/* Mouse motion ? */
 	if ((prevmousex!=mx) || (prevmousey!=my)) {
 		if (GEM_mouse_relative) {
-			SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
-			SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
+			if ((SDL_AtariXbios_mousex!=0) || (SDL_AtariXbios_mousey!=0)) {
+				SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
+				SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
+			}
 		} else {
 			int posx, posy;
 
--- a/src/video/gem/SDL_gemvideo.c	Fri Jan 06 20:57:59 2006 +0000
+++ b/src/video/gem/SDL_gemvideo.c	Fri Jan 06 22:24:09 2006 +0000
@@ -137,6 +137,8 @@
 static SDL_VideoDevice *GEM_CreateDevice(int devindex)
 {
 	SDL_VideoDevice *device;
+	int vectors_mask;
+	unsigned long dummy;
 
 	/* Initialize all variables that we clean on shutdown */
 	device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice));
@@ -198,7 +200,12 @@
 #endif
 
 	/* Joystick + Mouse relative motion */
-	SDL_AtariXbios_InstallVectors(ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS);
+	vectors_mask = ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS;
+	if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
+		vectors_mask = 0;
+	}
+
+	SDL_AtariXbios_InstallVectors(vectors_mask);
 
 	device->free = GEM_DeleteDevice;