Skip to content

Commit

Permalink
Disable XBIOS driver for mouse and joystick under MiNT. Will write a …
Browse files Browse the repository at this point in the history
…driver for /dev/mouse later.
  • Loading branch information
pmandin committed Jan 6, 2006
1 parent dc689b2 commit 85ec83a
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 11 deletions.
11 changes: 7 additions & 4 deletions README.MiNT
Expand Up @@ -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
Expand All @@ -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:

Expand Down
11 changes: 9 additions & 2 deletions src/video/ataricommon/SDL_biosevents.c
Expand Up @@ -35,6 +35,7 @@ static char rcsid =

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

#include "SDL.h"
#include "SDL_sysevents.h"
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 9 additions & 2 deletions src/video/ataricommon/SDL_gemdosevents.c
Expand Up @@ -35,6 +35,7 @@ static char rcsid =

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

#include "SDL.h"
#include "SDL_sysevents.h"
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions src/video/ataricommon/SDL_xbiosevents.c
Expand Up @@ -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();

Expand All @@ -86,6 +91,10 @@ void SDL_AtariXbios_RestoreVectors(void)
{
void *oldpile;

if (SDL_AtariXbios_enabled==0) {
return;
}

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

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions src/video/gem/SDL_gemevents.c
Expand Up @@ -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;

Expand Down
9 changes: 8 additions & 1 deletion src/video/gem/SDL_gemvideo.c
Expand Up @@ -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));
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 85ec83a

Please sign in to comment.