Started work to update for 1.3 api
authorPatrice Mandin <patmandin@gmail.com>
Wed, 20 Sep 2006 21:22:08 +0000
changeset 2032ddf89133aebc
parent 2031 f54073d86c82
child 2033 b657f0bc72c2
Started work to update for 1.3 api
src/video/ataricommon/SDL_atarievents.c
src/video/ataricommon/SDL_atarievents_c.h
src/video/ataricommon/SDL_biosevents_c.h
src/video/ataricommon/SDL_gemdosevents_c.h
src/video/ataricommon/SDL_ikbdevents_c.h
     1.1 --- a/src/video/ataricommon/SDL_atarievents.c	Wed Sep 20 19:49:23 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_atarievents.c	Wed Sep 20 21:22:08 2006 +0000
     1.3 @@ -60,10 +60,10 @@
     1.4  static SDLKey keymap[ATARIBIOS_MAXKEYS];
     1.5  static unsigned char *keytab_normal;
     1.6  
     1.7 -void (*Atari_ShutdownEvents) (void);
     1.8 +void (*SDL_Atari_ShutdownEvents) (void);
     1.9  
    1.10  static void
    1.11 -Atari_InitializeEvents(_THIS)
    1.12 +SDL_Atari_InitializeEvents(_THIS)
    1.13  {
    1.14      const char *envr;
    1.15      unsigned long cookie_mch;
    1.16 @@ -81,14 +81,12 @@
    1.17      case MCH_TT:
    1.18      case MCH_F30:
    1.19      case MCH_ARANYM:
    1.20 -        this->InitOSKeymap = AtariIkbd_InitOSKeymap;
    1.21 -        this->PumpEvents = AtariIkbd_PumpEvents;
    1.22 -        Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
    1.23 +        _this->PumpEvents = AtariIkbd_PumpEvents;
    1.24 +        SDL_Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
    1.25          break;
    1.26      default:
    1.27 -        this->InitOSKeymap = AtariGemdos_InitOSKeymap;
    1.28 -        this->PumpEvents = AtariGemdos_PumpEvents;
    1.29 -        Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
    1.30 +        _this->PumpEvents = AtariGemdos_PumpEvents;
    1.31 +        SDL_Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
    1.32          break;
    1.33      }
    1.34  
    1.35 @@ -99,42 +97,34 @@
    1.36      }
    1.37  
    1.38      if (SDL_strcmp(envr, "ikbd") == 0) {
    1.39 -        this->InitOSKeymap = AtariIkbd_InitOSKeymap;
    1.40 -        this->PumpEvents = AtariIkbd_PumpEvents;
    1.41 -        Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
    1.42 +        _this->PumpEvents = AtariIkbd_PumpEvents;
    1.43 +        SDL_Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
    1.44      }
    1.45  
    1.46      if (SDL_strcmp(envr, "gemdos") == 0) {
    1.47 -        this->InitOSKeymap = AtariGemdos_InitOSKeymap;
    1.48 -        this->PumpEvents = AtariGemdos_PumpEvents;
    1.49 -        Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
    1.50 +        _this->PumpEvents = AtariGemdos_PumpEvents;
    1.51 +        SDL_Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
    1.52      }
    1.53  
    1.54      if (SDL_strcmp(envr, "bios") == 0) {
    1.55 -        this->InitOSKeymap = AtariBios_InitOSKeymap;
    1.56 -        this->PumpEvents = AtariBios_PumpEvents;
    1.57 -        Atari_ShutdownEvents = AtariBios_ShutdownEvents;
    1.58 +        _this->PumpEvents = AtariBios_PumpEvents;
    1.59 +        SDL_Atari_ShutdownEvents = AtariBios_ShutdownEvents;
    1.60      }
    1.61 -}
    1.62  
    1.63 -void
    1.64 -Atari_InitOSKeymap(_THIS)
    1.65 -{
    1.66 -    Atari_InitializeEvents(this);
    1.67 -
    1.68 -    SDL_Atari_InitInternalKeymap(this);
    1.69 -
    1.70 -    /* Call choosen routine */
    1.71 -    this->InitOSKeymap(this);
    1.72 +    SDL_Atari_InitInternalKeymap(_this);
    1.73  }
    1.74  
    1.75  void
    1.76  Atari_PumpEvents(_THIS)
    1.77  {
    1.78 -    Atari_InitializeEvents(this);
    1.79 +    static int first_time = 1;
    1.80 +    if (first_time) {
    1.81 +        Atari_InitializeEvents(_this);
    1.82 +        first_time = 0;
    1.83 +    }
    1.84  
    1.85      /* Call choosen routine */
    1.86 -    this->PumpEvents(this);
    1.87 +    _this->PumpEvents(_this);
    1.88  }
    1.89  
    1.90  void
     2.1 --- a/src/video/ataricommon/SDL_atarievents_c.h	Wed Sep 20 19:49:23 2006 +0000
     2.2 +++ b/src/video/ataricommon/SDL_atarievents_c.h	Wed Sep 20 21:22:08 2006 +0000
     2.3 @@ -32,9 +32,6 @@
     2.4  
     2.5  #include "../SDL_sysvideo.h"
     2.6  
     2.7 -/* Hidden "this" pointer for the video functions */
     2.8 -#define _THIS	SDL_VideoDevice *this
     2.9 -
    2.10  #define ATARIBIOS_MAXKEYS 128
    2.11  
    2.12  /* Special keys state */
    2.13 @@ -50,10 +47,9 @@
    2.14  };
    2.15  #endif
    2.16  
    2.17 -extern void (*Atari_ShutdownEvents) (void);
    2.18 +extern void (*SDL_Atari_ShutdownEvents) (void);
    2.19  
    2.20 -extern void Atari_InitOSKeymap(_THIS);
    2.21 -extern void Atari_PumpEvents(_THIS);
    2.22 +extern void SDL_Atari_PumpEvents(_THIS);
    2.23  
    2.24  extern void SDL_Atari_InitInternalKeymap(_THIS);
    2.25  
     3.1 --- a/src/video/ataricommon/SDL_biosevents_c.h	Wed Sep 20 19:49:23 2006 +0000
     3.2 +++ b/src/video/ataricommon/SDL_biosevents_c.h	Wed Sep 20 21:22:08 2006 +0000
     3.3 @@ -32,9 +32,6 @@
     3.4  
     3.5  #include "../SDL_sysvideo.h"
     3.6  
     3.7 -/* Hidden "this" pointer for the video functions */
     3.8 -#define _THIS	SDL_VideoDevice *this
     3.9 -
    3.10  extern void AtariBios_InitOSKeymap(_THIS);
    3.11  extern void AtariBios_PumpEvents(_THIS);
    3.12  extern void AtariBios_ShutdownEvents(void);
     4.1 --- a/src/video/ataricommon/SDL_gemdosevents_c.h	Wed Sep 20 19:49:23 2006 +0000
     4.2 +++ b/src/video/ataricommon/SDL_gemdosevents_c.h	Wed Sep 20 21:22:08 2006 +0000
     4.3 @@ -32,9 +32,6 @@
     4.4  
     4.5  #include "../SDL_sysvideo.h"
     4.6  
     4.7 -/* Hidden "this" pointer for the video functions */
     4.8 -#define _THIS	SDL_VideoDevice *this
     4.9 -
    4.10  extern void AtariGemdos_InitOSKeymap(_THIS);
    4.11  extern void AtariGemdos_PumpEvents(_THIS);
    4.12  extern void AtariGemdos_ShutdownEvents(void);
     5.1 --- a/src/video/ataricommon/SDL_ikbdevents_c.h	Wed Sep 20 19:49:23 2006 +0000
     5.2 +++ b/src/video/ataricommon/SDL_ikbdevents_c.h	Wed Sep 20 21:22:08 2006 +0000
     5.3 @@ -32,9 +32,6 @@
     5.4  
     5.5  #include "../SDL_sysvideo.h"
     5.6  
     5.7 -/* Hidden "this" pointer for the video functions */
     5.8 -#define _THIS	SDL_VideoDevice *this
     5.9 -
    5.10  extern void AtariIkbd_InitOSKeymap(_THIS);
    5.11  extern void AtariIkbd_PumpEvents(_THIS);
    5.12  extern void AtariIkbd_ShutdownEvents(void);