Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Started update for 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Sep 20, 2006
1 parent e9ae8b7 commit ef531f2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 39 deletions.
23 changes: 8 additions & 15 deletions src/video/xbios/SDL_xbios.c
Expand Up @@ -50,8 +50,6 @@
#include "SDL_xbios_centscreen.h"
#include "SDL_xbios_sb3.h"

#define XBIOS_VID_DRIVER_NAME "xbios"

/* Debug print info */
#if 0
#define DEBUG_PRINT(what) \
Expand Down Expand Up @@ -141,41 +139,37 @@ XBIOS_Available(void)
static void
XBIOS_DeleteDevice(SDL_VideoDevice * device)
{
SDL_free(device->hidden);
SDL_free(device->driverdata);
SDL_free(device);
}

static SDL_VideoDevice *
XBIOS_CreateDevice(int devindex)
{
SDL_VideoDevice *device;
SDL_VideoData *data;

/* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
if (device) {
SDL_memset(device, 0, (sizeof *device));
device->hidden = (struct SDL_PrivateVideoData *)
SDL_malloc((sizeof *device->hidden));
device->gl_data = (struct SDL_PrivateGLData *)
SDL_malloc((sizeof *device->gl_data));
data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
}
if ((device == NULL) || (device->hidden == NULL)) {
if (!device || !data) {
SDL_OutOfMemory();
if (device) {
SDL_free(device);
}
return (0);
return NULL;
}
SDL_memset(device->hidden, 0, (sizeof *device->hidden));
SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
device->driverdata = data;

/* Video functions */
device->VideoInit = XBIOS_VideoInit;
device->VideoQuit = XBIOS_VideoQuit;
device->ListModes = XBIOS_ListModes;
device->SetVideoMode = XBIOS_SetVideoMode;
device->SetColors = XBIOS_SetColors;
device->UpdateRects = NULL;
device->VideoQuit = XBIOS_VideoQuit;
device->AllocHWSurface = XBIOS_AllocHWSurface;
device->LockHWSurface = XBIOS_LockHWSurface;
device->UnlockHWSurface = XBIOS_UnlockHWSurface;
Expand All @@ -192,7 +186,6 @@ XBIOS_CreateDevice(int devindex)
#endif

/* Events */
device->InitOSKeymap = Atari_InitOSKeymap;
device->PumpEvents = Atari_PumpEvents;

device->free = XBIOS_DeleteDevice;
Expand All @@ -201,7 +194,7 @@ XBIOS_CreateDevice(int devindex)
}

VideoBootStrap XBIOS_bootstrap = {
XBIOS_VID_DRIVER_NAME, "Atari Xbios driver",
"xbios", "Atari Xbios driver",
XBIOS_Available, XBIOS_CreateDevice
};

Expand Down
45 changes: 21 additions & 24 deletions src/video/xbios/SDL_xbios.h
Expand Up @@ -27,9 +27,6 @@
#include "SDL_stdinc.h"
#include "../SDL_sysvideo.h"

/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this

/* TT video modes: 2
Falcon RVB: 16 (could be *2 by adding PAL/NTSC modes)
Falcon VGA: 6
Expand All @@ -49,7 +46,7 @@ typedef struct
/* Private display data */
#define NUM_MODELISTS 2 /* 8 and 16 bits-per-pixel */

struct SDL_PrivateVideoData
struct SDL_VideoData
{
long cookie_vdo;
int old_video_mode; /* Old video mode before entering SDL */
Expand All @@ -71,7 +68,7 @@ struct SDL_PrivateVideoData

SDL_Rect *SDL_modelist[NUM_MODELISTS][SDL_NUMMODES + 1];
xbiosmode_t *videomodes[NUM_MODELISTS][SDL_NUMMODES + 1];
};
} SDL_VideoData;

/* _VDO cookie values */
enum
Expand Down Expand Up @@ -106,25 +103,25 @@ enum
#define TT_HIGH 0x0600

/* Hidden structure -> variables names */
#define SDL_modelist (this->hidden->SDL_modelist)
#define XBIOS_mutex (this->hidden->mutex)
#define XBIOS_cvdo (this->hidden->cookie_vdo)
#define XBIOS_oldpalette (this->hidden->old_palette)
#define XBIOS_oldnumcol (this->hidden->old_num_colors)
#define XBIOS_oldvbase (this->hidden->old_video_base)
#define XBIOS_oldvmode (this->hidden->old_video_mode)
#define XBIOS_nummodes (this->hidden->num_modes)
#define XBIOS_modelist (this->hidden->mode_list)
#define XBIOS_screens (this->hidden->screens)
#define XBIOS_screensmem (this->hidden->screensmem)
#define XBIOS_shadowscreen (this->hidden->shadowscreen)
#define XBIOS_videomodes (this->hidden->videomodes)
#define XBIOS_doubleline (this->hidden->doubleline)
#define XBIOS_fbnum (this->hidden->frame_number)
#define XBIOS_pitch (this->hidden->pitch)
#define XBIOS_width (this->hidden->width)
#define XBIOS_height (this->hidden->height)
#define XBIOS_centscreen (this->hidden->centscreen)
#define SDL_modelist (_this->driverdata->SDL_modelist)
#define XBIOS_mutex (_this->driverdata->mutex)
#define XBIOS_cvdo (_this->driverdata->cookie_vdo)
#define XBIOS_oldpalette (_this->driverdata->old_palette)
#define XBIOS_oldnumcol (_this->driverdata->old_num_colors)
#define XBIOS_oldvbase (_this->driverdata->old_video_base)
#define XBIOS_oldvmode (_this->driverdata->old_video_mode)
#define XBIOS_nummodes (_this->driverdata->num_modes)
#define XBIOS_modelist (_this->driverdata->mode_list)
#define XBIOS_screens (_this->driverdata->screens)
#define XBIOS_screensmem (_this->driverdata->screensmem)
#define XBIOS_shadowscreen (_this->driverdata->shadowscreen)
#define XBIOS_videomodes (_this->driverdata->videomodes)
#define XBIOS_doubleline (_this->driverdata->doubleline)
#define XBIOS_fbnum (_this->driverdata->frame_number)
#define XBIOS_pitch (_this->driverdata->pitch)
#define XBIOS_width (_this->driverdata->width)
#define XBIOS_height (_this->driverdata->height)
#define XBIOS_centscreen (_this->driverdata->centscreen)

/*--- Functions prototypes ---*/

Expand Down

0 comments on commit ef531f2

Please sign in to comment.