Started update for 1.3
authorPatrice Mandin <patmandin@gmail.com>
Wed, 20 Sep 2006 22:09:19 +0000
changeset 2035c848c18684ab
parent 2034 59e1a50193aa
child 2036 12ef90a41631
Started update for 1.3
src/video/xbios/SDL_xbios.c
src/video/xbios/SDL_xbios.h
     1.1 --- a/src/video/xbios/SDL_xbios.c	Wed Sep 20 21:38:06 2006 +0000
     1.2 +++ b/src/video/xbios/SDL_xbios.c	Wed Sep 20 22:09:19 2006 +0000
     1.3 @@ -50,8 +50,6 @@
     1.4  #include "SDL_xbios_centscreen.h"
     1.5  #include "SDL_xbios_sb3.h"
     1.6  
     1.7 -#define XBIOS_VID_DRIVER_NAME "xbios"
     1.8 -
     1.9  /* Debug print info */
    1.10  #if 0
    1.11  #define DEBUG_PRINT(what) \
    1.12 @@ -141,7 +139,7 @@
    1.13  static void
    1.14  XBIOS_DeleteDevice(SDL_VideoDevice * device)
    1.15  {
    1.16 -    SDL_free(device->hidden);
    1.17 +    SDL_free(device->driverdata);
    1.18      SDL_free(device);
    1.19  }
    1.20  
    1.21 @@ -149,33 +147,29 @@
    1.22  XBIOS_CreateDevice(int devindex)
    1.23  {
    1.24      SDL_VideoDevice *device;
    1.25 +    SDL_VideoData *data;
    1.26  
    1.27      /* Initialize all variables that we clean on shutdown */
    1.28      device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
    1.29      if (device) {
    1.30 -        SDL_memset(device, 0, (sizeof *device));
    1.31 -        device->hidden = (struct SDL_PrivateVideoData *)
    1.32 -            SDL_malloc((sizeof *device->hidden));
    1.33 -        device->gl_data = (struct SDL_PrivateGLData *)
    1.34 -            SDL_malloc((sizeof *device->gl_data));
    1.35 +        data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
    1.36      }
    1.37 -    if ((device == NULL) || (device->hidden == NULL)) {
    1.38 +    if (!device || !data) {
    1.39          SDL_OutOfMemory();
    1.40          if (device) {
    1.41              SDL_free(device);
    1.42          }
    1.43 -        return (0);
    1.44 +        return NULL;
    1.45      }
    1.46 -    SDL_memset(device->hidden, 0, (sizeof *device->hidden));
    1.47 -    SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
    1.48 +    device->driverdata = data;
    1.49  
    1.50      /* Video functions */
    1.51      device->VideoInit = XBIOS_VideoInit;
    1.52 +    device->VideoQuit = XBIOS_VideoQuit;
    1.53      device->ListModes = XBIOS_ListModes;
    1.54      device->SetVideoMode = XBIOS_SetVideoMode;
    1.55      device->SetColors = XBIOS_SetColors;
    1.56      device->UpdateRects = NULL;
    1.57 -    device->VideoQuit = XBIOS_VideoQuit;
    1.58      device->AllocHWSurface = XBIOS_AllocHWSurface;
    1.59      device->LockHWSurface = XBIOS_LockHWSurface;
    1.60      device->UnlockHWSurface = XBIOS_UnlockHWSurface;
    1.61 @@ -192,7 +186,6 @@
    1.62  #endif
    1.63  
    1.64      /* Events */
    1.65 -    device->InitOSKeymap = Atari_InitOSKeymap;
    1.66      device->PumpEvents = Atari_PumpEvents;
    1.67  
    1.68      device->free = XBIOS_DeleteDevice;
    1.69 @@ -201,7 +194,7 @@
    1.70  }
    1.71  
    1.72  VideoBootStrap XBIOS_bootstrap = {
    1.73 -    XBIOS_VID_DRIVER_NAME, "Atari Xbios driver",
    1.74 +    "xbios", "Atari Xbios driver",
    1.75      XBIOS_Available, XBIOS_CreateDevice
    1.76  };
    1.77  
     2.1 --- a/src/video/xbios/SDL_xbios.h	Wed Sep 20 21:38:06 2006 +0000
     2.2 +++ b/src/video/xbios/SDL_xbios.h	Wed Sep 20 22:09:19 2006 +0000
     2.3 @@ -27,9 +27,6 @@
     2.4  #include "SDL_stdinc.h"
     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  /* TT video modes:	2
    2.11     Falcon RVB:		16 (could be *2 by adding PAL/NTSC modes)
    2.12     Falcon VGA:		6
    2.13 @@ -49,7 +46,7 @@
    2.14  /* Private display data */
    2.15  #define NUM_MODELISTS	2       /* 8 and 16 bits-per-pixel */
    2.16  
    2.17 -struct SDL_PrivateVideoData
    2.18 +struct SDL_VideoData
    2.19  {
    2.20      long cookie_vdo;
    2.21      int old_video_mode;         /* Old video mode before entering SDL */
    2.22 @@ -71,7 +68,7 @@
    2.23  
    2.24      SDL_Rect *SDL_modelist[NUM_MODELISTS][SDL_NUMMODES + 1];
    2.25      xbiosmode_t *videomodes[NUM_MODELISTS][SDL_NUMMODES + 1];
    2.26 -};
    2.27 +} SDL_VideoData;
    2.28  
    2.29  /* _VDO cookie values */
    2.30  enum
    2.31 @@ -106,25 +103,25 @@
    2.32  #define TT_HIGH	0x0600
    2.33  
    2.34  /* Hidden structure -> variables names */
    2.35 -#define SDL_modelist		(this->hidden->SDL_modelist)
    2.36 -#define XBIOS_mutex		    (this->hidden->mutex)
    2.37 -#define XBIOS_cvdo		    (this->hidden->cookie_vdo)
    2.38 -#define XBIOS_oldpalette	(this->hidden->old_palette)
    2.39 -#define XBIOS_oldnumcol		(this->hidden->old_num_colors)
    2.40 -#define XBIOS_oldvbase		(this->hidden->old_video_base)
    2.41 -#define XBIOS_oldvmode		(this->hidden->old_video_mode)
    2.42 -#define XBIOS_nummodes		(this->hidden->num_modes)
    2.43 -#define XBIOS_modelist		(this->hidden->mode_list)
    2.44 -#define XBIOS_screens		(this->hidden->screens)
    2.45 -#define XBIOS_screensmem	(this->hidden->screensmem)
    2.46 -#define XBIOS_shadowscreen	(this->hidden->shadowscreen)
    2.47 -#define XBIOS_videomodes	(this->hidden->videomodes)
    2.48 -#define XBIOS_doubleline	(this->hidden->doubleline)
    2.49 -#define XBIOS_fbnum			(this->hidden->frame_number)
    2.50 -#define XBIOS_pitch			(this->hidden->pitch)
    2.51 -#define XBIOS_width			(this->hidden->width)
    2.52 -#define XBIOS_height		(this->hidden->height)
    2.53 -#define XBIOS_centscreen	(this->hidden->centscreen)
    2.54 +#define SDL_modelist		(_this->driverdata->SDL_modelist)
    2.55 +#define XBIOS_mutex		    (_this->driverdata->mutex)
    2.56 +#define XBIOS_cvdo		    (_this->driverdata->cookie_vdo)
    2.57 +#define XBIOS_oldpalette	(_this->driverdata->old_palette)
    2.58 +#define XBIOS_oldnumcol		(_this->driverdata->old_num_colors)
    2.59 +#define XBIOS_oldvbase		(_this->driverdata->old_video_base)
    2.60 +#define XBIOS_oldvmode		(_this->driverdata->old_video_mode)
    2.61 +#define XBIOS_nummodes		(_this->driverdata->num_modes)
    2.62 +#define XBIOS_modelist		(_this->driverdata->mode_list)
    2.63 +#define XBIOS_screens		(_this->driverdata->screens)
    2.64 +#define XBIOS_screensmem	(_this->driverdata->screensmem)
    2.65 +#define XBIOS_shadowscreen	(_this->driverdata->shadowscreen)
    2.66 +#define XBIOS_videomodes	(_this->driverdata->videomodes)
    2.67 +#define XBIOS_doubleline	(_this->driverdata->doubleline)
    2.68 +#define XBIOS_fbnum			(_this->driverdata->frame_number)
    2.69 +#define XBIOS_pitch			(_this->driverdata->pitch)
    2.70 +#define XBIOS_width			(_this->driverdata->width)
    2.71 +#define XBIOS_height		(_this->driverdata->height)
    2.72 +#define XBIOS_centscreen	(_this->driverdata->centscreen)
    2.73  
    2.74  /*--- Functions prototypes ---*/
    2.75