Home | History | Annotate | Download | only in xbios
      1 /*
      2     SDL - Simple DirectMedia Layer
      3     Copyright (C) 1997-2012 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 (at) 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 #define XBIOSMODE_DOUBLELINE (1<<0)
     34 #define XBIOSMODE_C2P (1<<1)
     35 
     36 typedef struct
     37 {
     38 	Uint16 number;		/* Video mode number */
     39 	Uint16 width;		/* Size */
     40 	Uint16 height;
     41 	Uint16 depth;		/* bits per plane */
     42 	Uint16 flags;
     43 } xbiosmode_t;
     44 
     45 /* Private display data */
     46 #define NUM_MODELISTS	4		/* 8, 16, 24, and 32 bits-per-pixel */
     47 
     48 struct SDL_PrivateVideoData {
     49 	long cookie_vdo;
     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 */
     54 
     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 */
     60 
     61 	SDL_bool centscreen;	/* Centscreen extension present ? */
     62 
     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];
     67 };
     68 
     69 /* _VDO cookie values */
     70 enum {
     71 	VDO_ST=0,
     72 	VDO_STE,
     73 	VDO_TT,
     74 	VDO_F30,
     75 	VDO_MILAN
     76 };
     77 
     78 /* Monitor types */
     79 enum {
     80 	MONITOR_MONO=0,
     81 	MONITOR_TV,
     82 	MONITOR_VGA,
     83 	MONITOR_RGB
     84 };
     85 
     86 /* EgetShift masks */
     87 #define ES_MODE		0x0700
     88 
     89 /* Hidden structure -> variables names */
     90 #define SDL_nummodes		(this->hidden->SDL_nummodes)
     91 #define SDL_modelist		(this->hidden->SDL_modelist)
     92 #define SDL_xbiosmode		(this->hidden->SDL_xbiosmode)
     93 #define XBIOS_mutex		    (this->hidden->mutex)
     94 #define XBIOS_cvdo		    (this->hidden->cookie_vdo)
     95 #define XBIOS_oldpalette	(this->hidden->old_palette)
     96 #define XBIOS_oldnumcol		(this->hidden->old_num_colors)
     97 #define XBIOS_oldvbase		(this->hidden->old_video_base)
     98 #define XBIOS_oldvmode		(this->hidden->old_video_mode)
     99 #define XBIOS_screens		(this->hidden->screens)
    100 #define XBIOS_screensmem	(this->hidden->screensmem)
    101 #define XBIOS_shadowscreen	(this->hidden->shadowscreen)
    102 #define XBIOS_fbnum			(this->hidden->frame_number)
    103 #define XBIOS_pitch			(this->hidden->pitch)
    104 #define XBIOS_centscreen	(this->hidden->centscreen)
    105 #define XBIOS_current		(this->hidden->current)
    106 
    107 /*--- Functions prototypes ---*/
    108 
    109 void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo);
    110 
    111 #endif /* _SDL_xbios_h */
    112