# HG changeset patch # User Sam Lantinga # Date 1017164251 0 # Node ID 189a6a3416c7baab103e4905fd3f06e6b9799eea # Parent 0910a3034576ab988f1157f2e1cb6976121b4b48 *** empty log message *** diff -r 0910a3034576 -r 189a6a3416c7 README.MiNT --- a/README.MiNT Sun Mar 24 21:44:06 2002 +0000 +++ b/README.MiNT Tue Mar 26 17:37:31 2002 +0000 @@ -45,7 +45,7 @@ ============================================================================== IV. What is supported: -Keyboard (GEMDOS, BIOS, Ikbd) +Keyboard (GEMDOS, BIOS, GEM, Ikbd) Mouse (XBIOS, GEM, Ikbd) Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen)) Timer (VBL vector) @@ -61,7 +61,10 @@ xbios ikbd ikbd vbl ikbd hardware xbios gemdos xbios vbl xbios hardware xbios bios xbios vbl xbios hardware -gem gem gem vbl xbios hardware +gem gem gem(*) vbl xbios hardware + +(*) GEM does not report relative mouse motion, so xbios mouse driver is used +to report this type event. ============================================================================== V. Environment variables: @@ -108,6 +111,48 @@ Lightpen and analog paddle are 2 buttons, 2 axis controllers. The 2 buttons are those affected to 1 button joysticks on the same port. +============================================================================== +VI. More informations about drivers: + +Xbios video: + Video chip is detected using the _VDO cookie. + Screen enhancers are not supported, but could be if you know how to + use them. + + ST, STE, Mega ST, Mega STE: + 320x200x4 bits, shades of grey, available only for the purpose + of testing SDL. + TT: + 320x480x8 and 320x240x8 (software double-lined mode). + Falcon: + All modes supported by the current monitor (RVB or VGA). + Clones and any machine with monochrome monitor: + Not supported. + +Gem video: + Automatically used if xbios not available. + + All machines: + Only the current resolution, if 8 bits or higher depth. + +IKBD keyboard, mouse and joystick driver: + Available if _MCH cookie is ST, Mega ST, STE, Mega STE, TT or Falcon. + + Hades has an IKBD, but xbios is not available for video, so IKBD + driver is disabled. + +Gemdos and bios keyboard driver: + Available on all machines. + +Mouse and joystick xbios driver: + Available on all machines (I think). + +Joypad driver: + Available if _MCH cookie is STE or Falcon. + +VBL timer driver: + Available all machines (I think). + -- Patrice Mandin http://membres.lycos.fr/pmandin/ diff -r 0910a3034576 -r 189a6a3416c7 src/video/gem/SDL_gemevents.c --- a/src/video/gem/SDL_gemevents.c Sun Mar 24 21:44:06 2002 +0000 +++ b/src/video/gem/SDL_gemevents.c Tue Mar 26 17:37:31 2002 +0000 @@ -43,7 +43,8 @@ #include "SDL_events_c.h" #include "SDL_gemvideo.h" #include "SDL_gemevents_c.h" -#include "../ataricommon/SDL_atarikeys.h" /* for keyboard scancodes */ +#include "SDL_atarikeys.h" /* for keyboard scancodes */ +#include "SDL_xbiosinterrupt_s.h" /* Defines */ @@ -55,8 +56,6 @@ static unsigned char gem_previouskeyboard[ATARIBIOS_MAXKEYS]; static unsigned char gem_currentascii[ATARIBIOS_MAXKEYS]; -static short prevmousex, prevmousey, prevmouseb; - /* The translation tables from a console scancode to a SDL keysym */ static SDLKey keymap[ATARIBIOS_MAXKEYS]; @@ -65,7 +64,7 @@ static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym); static int do_messages(_THIS, short *message); static void do_keyboard(short kc, short ks); -static void do_mouse(_THIS, short mx, short my, short mb); +static void do_mouse(_THIS, short mx, short my, short mb, short ks); /* Functions */ @@ -124,22 +123,23 @@ keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK; /* Mouse init */ - prevmousex = prevmousey = prevmouseb = 0; GEM_mouse_relative = SDL_FALSE; } void GEM_PumpEvents(_THIS) { - short mx, my, mb, dummy; + short mousex, mousey, mouseb, dummy; + short kstate, prevkc, prevks; int i; SDL_keysym keysym; memset(gem_currentkeyboard,0,sizeof(gem_currentkeyboard)); + prevkc = prevks = 0; for (;;) { int quit, resultat; - short buffer[8], kc, ks; + short buffer[8], kc; quit = 0; @@ -150,7 +150,7 @@ 0,0,0,0,0, buffer, 10, - &dummy,&dummy,&dummy,&ks,&kc,&dummy + &dummy,&dummy,&dummy,&kstate,&kc,&dummy ); /* Message event ? */ @@ -158,10 +158,14 @@ quit = do_messages(this, buffer); /* Keyboard event ? */ - if (resultat & MU_KEYBD) - do_keyboard(kc,ks); - else - do_keyboard(0,0); + if (resultat & MU_KEYBD) { + if ((prevkc != kc) || (prevks != kstate)) { + do_keyboard(kc,kstate); + } else { + /* Avoid looping, if repeating same key */ + break; + } + } /* Timer event ? */ if ((resultat & MU_TIMER) || quit) @@ -169,10 +173,10 @@ } /* Update mouse */ - graf_mkstate(&mx, &my, &mb, &dummy); - do_mouse(this, mx, my, mb); + graf_mkstate(&mousex, &mousey, &mouseb, &kstate); + do_mouse(this, mousex, mousey, mouseb, kstate); - /* Now generates keyboard events */ + /* Now generate keyboard events */ for (i=0; i>8) & 127; @@ -269,9 +272,6 @@ gem_currentascii[scancode]=asciicode; } - if (!ks) - graf_mkstate(&dummy, &dummy, &dummy, &ks); - /* Read special keys */ if (ks & K_RSHIFT) gem_currentkeyboard[SCANCODE_RIGHTSHIFT]=0xFF; @@ -283,16 +283,15 @@ gem_currentkeyboard[SCANCODE_LEFTALT]=0xFF; } -static void do_mouse(_THIS, short mx, short my, short mb) +static void do_mouse(_THIS, short mx, short my, short mb, short ks) { + static short prevmousex=0, prevmousey=0, prevmouseb=0; + /* Mouse motion ? */ if ((prevmousex!=mx) || (prevmousey!=my)) { if (GEM_mouse_relative) { - short wind_pxy[8]; - - wind_get(GEM_handle, WF_WORKXYWH, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3]); - - SDL_PrivateMouseMotion(0, 1, mx-wind_pxy[0], my-wind_pxy[1]); + SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey); + SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0; } else { SDL_PrivateMouseMotion(0, 1, mx, my); } @@ -304,19 +303,29 @@ if (prevmouseb!=mb) { int i; - for (i=0;i<3;i++) { + for (i=0;i<2;i++) { int curbutton, prevbutton; curbutton = mb & (1<