src/video/xbios/SDL_xbios.h
author Patrice Mandin <patmandin@gmail.com>
Sat, 19 Sep 2009 13:21:05 +0000
branchSDL-1.2
changeset 4195 13de8ea401db
parent 4194 05c9e942cc46
child 4198 6405314a7c07
permissions -rw-r--r--
Start Milan video support
slouken@281
     1
/*
slouken@281
     2
    SDL - Simple DirectMedia Layer
slouken@4159
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@281
     4
slouken@281
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@281
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@281
     9
slouken@281
    10
    This library is distributed in the hope that it will be useful,
slouken@281
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@281
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@281
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@281
    18
slouken@281
    19
    Sam Lantinga
slouken@281
    20
    slouken@libsdl.org
slouken@281
    21
*/
slouken@1402
    22
#include "SDL_config.h"
slouken@281
    23
slouken@281
    24
#ifndef _SDL_xbios_h
slouken@281
    25
#define _SDL_xbios_h
slouken@281
    26
slouken@1358
    27
#include "SDL_stdinc.h"
slouken@1361
    28
#include "../SDL_sysvideo.h"
slouken@281
    29
slouken@281
    30
/* Hidden "this" pointer for the video functions */
slouken@281
    31
#define _THIS	SDL_VideoDevice *this
slouken@281
    32
slouken@281
    33
typedef struct
slouken@281
    34
{
slouken@281
    35
	Uint16 number;		/* Video mode number */
slouken@281
    36
	Uint16 width;		/* Size */	
slouken@281
    37
	Uint16 height;
slouken@281
    38
	Uint16 depth;		/* bits per plane */
slouken@281
    39
	SDL_bool doubleline;	/* Double the lines ? */
slouken@281
    40
} xbiosmode_t;
slouken@281
    41
slouken@281
    42
/* Private display data */
patmandin@4194
    43
#define NUM_MODELISTS	4		/* 8, 16, 24, and 32 bits-per-pixel */
slouken@281
    44
slouken@281
    45
struct SDL_PrivateVideoData {
slouken@281
    46
	long cookie_vdo;
slouken@281
    47
	int old_video_mode;				/* Old video mode before entering SDL */
slouken@281
    48
	void *old_video_base;			/* Old pointer to screen buffer */
slouken@281
    49
	void *old_palette;				/* Old palette */
slouken@281
    50
	Uint32 old_num_colors;			/* Nb of colors in saved palette */
slouken@281
    51
slouken@281
    52
	void *screens[2];		/* Pointers to aligned screen buffer */
slouken@281
    53
	void *screensmem[2];	/* Pointers to screen buffer */
slouken@281
    54
	void *shadowscreen;		/* Shadow screen for c2p conversion */
slouken@281
    55
	int doubleline;			/* Double line mode ? */
slouken@281
    56
	int frame_number;		/* Number of frame for double buffer */
slouken@281
    57
	int pitch;				/* Destination line width for C2P */
slouken@281
    58
	int width, height;		/* Screen size for centered C2P */
slouken@281
    59
patmandin@1064
    60
	SDL_bool centscreen;	/* Centscreen extension present ? */
patmandin@1064
    61
patmandin@4194
    62
	int SDL_nummodes[NUM_MODELISTS];
patmandin@4194
    63
	SDL_Rect **SDL_modelist[NUM_MODELISTS];
patmandin@4194
    64
	xbiosmode_t **SDL_xbiosmode[NUM_MODELISTS];
slouken@281
    65
};
slouken@281
    66
slouken@281
    67
/* _VDO cookie values */
slouken@281
    68
enum {
slouken@281
    69
	VDO_ST=0,
slouken@281
    70
	VDO_STE,
slouken@281
    71
	VDO_TT,
patmandin@4195
    72
	VDO_F30,
patmandin@4195
    73
	VDO_MILAN
slouken@281
    74
};
slouken@281
    75
slouken@281
    76
/* Monitor types */
slouken@281
    77
enum {
slouken@281
    78
	MONITOR_MONO=0,
slouken@281
    79
	MONITOR_TV,
slouken@281
    80
	MONITOR_VGA,
slouken@281
    81
	MONITOR_RGB
slouken@281
    82
};
slouken@281
    83
slouken@281
    84
/* EgetShift masks */
slouken@281
    85
#define ES_MODE		0x0700
slouken@281
    86
slouken@281
    87
/* TT shifter modes */
patmandin@4150
    88
#ifndef ST_LOW
slouken@281
    89
#define ST_LOW	0x0000
slouken@281
    90
#define ST_MED	0x0100
slouken@281
    91
#define ST_HIGH	0x0200
slouken@281
    92
#define TT_LOW	0x0700
slouken@281
    93
#define TT_MED	0x0300
slouken@281
    94
#define TT_HIGH	0x0600
patmandin@4150
    95
#endif
slouken@281
    96
slouken@281
    97
/* Hidden structure -> variables names */
patmandin@4194
    98
#define SDL_nummodes		(this->hidden->SDL_nummodes)
slouken@281
    99
#define SDL_modelist		(this->hidden->SDL_modelist)
patmandin@4194
   100
#define SDL_xbiosmode		(this->hidden->SDL_xbiosmode)
slouken@281
   101
#define XBIOS_mutex		    (this->hidden->mutex)
slouken@281
   102
#define XBIOS_cvdo		    (this->hidden->cookie_vdo)
slouken@281
   103
#define XBIOS_oldpalette	(this->hidden->old_palette)
slouken@281
   104
#define XBIOS_oldnumcol		(this->hidden->old_num_colors)
slouken@281
   105
#define XBIOS_oldvbase		(this->hidden->old_video_base)
slouken@281
   106
#define XBIOS_oldvmode		(this->hidden->old_video_mode)
slouken@281
   107
#define XBIOS_screens		(this->hidden->screens)
slouken@281
   108
#define XBIOS_screensmem	(this->hidden->screensmem)
slouken@281
   109
#define XBIOS_shadowscreen	(this->hidden->shadowscreen)
slouken@281
   110
#define XBIOS_doubleline	(this->hidden->doubleline)
slouken@281
   111
#define XBIOS_fbnum			(this->hidden->frame_number)
slouken@281
   112
#define XBIOS_pitch			(this->hidden->pitch)
slouken@281
   113
#define XBIOS_width			(this->hidden->width)
slouken@281
   114
#define XBIOS_height		(this->hidden->height)
patmandin@1064
   115
#define XBIOS_centscreen	(this->hidden->centscreen)
slouken@281
   116
patmandin@1042
   117
/*--- Functions prototypes ---*/
patmandin@1042
   118
patmandin@4194
   119
void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo);
patmandin@1042
   120
slouken@281
   121
#endif /* _SDL_xbios_h */