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