Skip to content
Permalink
Browse files

Disable XBIOS driver for mouse and joystick under MiNT. Will write a …

…driver for /dev/mouse later.
  • Loading branch information
pmandin committed Jan 6, 2006
1 parent dc689b2 commit 85ec83a1d330c6e74df9a69af7c27da23fedb9ed
@@ -68,9 +68,9 @@ OpenGL (using Mesa offscreen rendering driver)
- 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 @@ Joypad driver always uses hardware access.
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:

@@ -35,6 +35,7 @@ static char rcsid =

/* Mint includes */
#include <mint/osbind.h>
#include <mint/cookie.h>

#include "SDL.h"
#include "SDL_sysevents.h"
@@ -71,7 +72,8 @@ static void UpdateSpecialKeys(int special_keys_state);

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 @@ void AtariBios_InitOSKeymap(_THIS)
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)
@@ -35,6 +35,7 @@ static char rcsid =

/* Mint includes */
#include <mint/osbind.h>
#include <mint/cookie.h>

#include "SDL.h"
#include "SDL_sysevents.h"
@@ -76,7 +77,8 @@ static void UpdateSpecialKeys(int special_keys_state);

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 @@ void AtariGemdos_InitOSKeymap(_THIS)
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)
@@ -63,6 +63,11 @@ void SDL_AtariXbios_InstallVectors(int vectors_mask)
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 SDL_AtariXbios_RestoreVectors(void)
{
void *oldpile;

if (SDL_AtariXbios_enabled==0) {
return;
}

/* Read IKBD vectors base */
kbdvecs=Kbdvbase();

@@ -115,6 +124,10 @@ static int atari_GetButton(int button)

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);
@@ -384,8 +384,10 @@ static void do_mouse(_THIS, short mx, short my, short mb, short ks)
/* 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;

@@ -137,6 +137,8 @@ static void GEM_DeleteDevice(SDL_VideoDevice *device)
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 @@ static SDL_VideoDevice *GEM_CreateDevice(int devindex)
#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;

0 comments on commit 85ec83a

Please sign in to comment.