2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
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.
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.
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
22 #include "SDL_config.h"
27 #include "SDL_stdinc.h"
28 #include "../SDL_sysvideo.h"
30 /* Hidden "this" pointer for the video functions */
31 #define _THIS SDL_VideoDevice *this
33 #define XBIOSMODE_DOUBLELINE (1<<0)
34 #define XBIOSMODE_C2P (1<<1)
38 Uint16 number; /* Video mode number */
39 Uint16 width; /* Size */
41 Uint16 depth; /* bits per plane */
45 /* Private display data */
46 #define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
48 struct SDL_PrivateVideoData {
50 long old_video_mode; /* Old video mode before entering SDL */
51 void *old_video_base; /* Old pointer to screen buffer */
52 void *old_palette; /* Old palette */
53 Uint32 old_num_colors; /* Nb of colors in saved palette */
55 void *screens[2]; /* Pointers to aligned screen buffer */
56 void *screensmem[2]; /* Pointers to screen buffer */
57 void *shadowscreen; /* Shadow screen for c2p conversion */
58 int frame_number; /* Number of frame for double buffer */
59 int pitch; /* Destination line width for C2P */
61 SDL_bool centscreen; /* Centscreen extension present ? */
63 xbiosmode_t *current; /* Current set mode */
64 int SDL_nummodes[NUM_MODELISTS];
65 SDL_Rect **SDL_modelist[NUM_MODELISTS];
66 xbiosmode_t **SDL_xbiosmode[NUM_MODELISTS];
69 /* _VDO cookie values */
87 #define ES_MODE 0x0700
89 /* TT shifter modes */
93 #define ST_HIGH 0x0200
96 #define TT_HIGH 0x0600
99 /* Hidden structure -> variables names */
100 #define SDL_nummodes (this->hidden->SDL_nummodes)
101 #define SDL_modelist (this->hidden->SDL_modelist)
102 #define SDL_xbiosmode (this->hidden->SDL_xbiosmode)
103 #define XBIOS_mutex (this->hidden->mutex)
104 #define XBIOS_cvdo (this->hidden->cookie_vdo)
105 #define XBIOS_oldpalette (this->hidden->old_palette)
106 #define XBIOS_oldnumcol (this->hidden->old_num_colors)
107 #define XBIOS_oldvbase (this->hidden->old_video_base)
108 #define XBIOS_oldvmode (this->hidden->old_video_mode)
109 #define XBIOS_screens (this->hidden->screens)
110 #define XBIOS_screensmem (this->hidden->screensmem)
111 #define XBIOS_shadowscreen (this->hidden->shadowscreen)
112 #define XBIOS_fbnum (this->hidden->frame_number)
113 #define XBIOS_pitch (this->hidden->pitch)
114 #define XBIOS_centscreen (this->hidden->centscreen)
115 #define XBIOS_current (this->hidden->current)
117 /*--- Functions prototypes ---*/
119 void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo);
121 #endif /* _SDL_xbios_h */