comparison src/video/xbios/SDL_xbios.h @ 281:c5010ab8ba35

Added initial support for Atari (thanks Patrice!)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 17 Feb 2002 19:54:28 +0000
parents
children f6ffac90895c
comparison
equal deleted inserted replaced
280:0ddcea45d829 281:c5010ab8ba35
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 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 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22
23 #ifdef SAVE_RCSID
24 static char rcsid =
25 "@(#) $Id$";
26 #endif
27
28 #ifndef _SDL_xbios_h
29 #define _SDL_xbios_h
30
31 #include "SDL_types.h"
32 #include "SDL_sysvideo.h"
33
34 /* Hidden "this" pointer for the video functions */
35 #define _THIS SDL_VideoDevice *this
36
37 /* TT video modes: 2
38 Falcon RVB: 16 (could be *2 by adding PAL/NTSC modes)
39 Falcon VGA: 6
40 ST low: 1
41 */
42 #define SDL_NUMMODES 16
43
44 typedef struct
45 {
46 Uint16 number; /* Video mode number */
47 Uint16 width; /* Size */
48 Uint16 height;
49 Uint16 depth; /* bits per plane */
50 SDL_bool doubleline; /* Double the lines ? */
51 } xbiosmode_t;
52
53 /* Private display data */
54 #define NUM_MODELISTS 2 /* 8 and 16 bits-per-pixel */
55
56 struct SDL_PrivateVideoData {
57 long cookie_vdo;
58 int old_video_mode; /* Old video mode before entering SDL */
59 void *old_video_base; /* Old pointer to screen buffer */
60 void *old_palette; /* Old palette */
61 Uint32 old_num_colors; /* Nb of colors in saved palette */
62 int num_modes; /* Number of xbios video modes */
63 xbiosmode_t *mode_list; /* List of xbios video modes */
64
65 void *screens[2]; /* Pointers to aligned screen buffer */
66 void *screensmem[2]; /* Pointers to screen buffer */
67 void *shadowscreen; /* Shadow screen for c2p conversion */
68 int doubleline; /* Double line mode ? */
69 int frame_number; /* Number of frame for double buffer */
70 int pitch; /* Destination line width for C2P */
71 int width, height; /* Screen size for centered C2P */
72
73 SDL_Rect *SDL_modelist[NUM_MODELISTS][SDL_NUMMODES+1];
74 xbiosmode_t *videomodes[NUM_MODELISTS][SDL_NUMMODES+1];
75 };
76
77 /* _VDO cookie values */
78 enum {
79 VDO_ST=0,
80 VDO_STE,
81 VDO_TT,
82 VDO_F30
83 };
84
85 /* Monitor types */
86 enum {
87 MONITOR_MONO=0,
88 MONITOR_TV,
89 MONITOR_VGA,
90 MONITOR_RGB
91 };
92
93 /* EgetShift masks */
94 #define ES_BANK 0x000f
95 #define ES_MODE 0x0700
96 #define ES_GRAY 0x1000
97 #define ES_SMEAR 0x8000
98
99 /* TT shifter modes */
100 #define ST_LOW 0x0000
101 #define ST_MED 0x0100
102 #define ST_HIGH 0x0200
103 #define TT_LOW 0x0700
104 #define TT_MED 0x0300
105 #define TT_HIGH 0x0600
106
107 /* Hidden structure -> variables names */
108 #define SDL_modelist (this->hidden->SDL_modelist)
109 #define XBIOS_mutex (this->hidden->mutex)
110 #define XBIOS_cvdo (this->hidden->cookie_vdo)
111 #define XBIOS_oldpalette (this->hidden->old_palette)
112 #define XBIOS_oldnumcol (this->hidden->old_num_colors)
113 #define XBIOS_oldvbase (this->hidden->old_video_base)
114 #define XBIOS_oldvmode (this->hidden->old_video_mode)
115 #define XBIOS_nummodes (this->hidden->num_modes)
116 #define XBIOS_modelist (this->hidden->mode_list)
117 #define XBIOS_screens (this->hidden->screens)
118 #define XBIOS_screensmem (this->hidden->screensmem)
119 #define XBIOS_shadowscreen (this->hidden->shadowscreen)
120 #define XBIOS_videomodes (this->hidden->videomodes)
121 #define XBIOS_doubleline (this->hidden->doubleline)
122 #define XBIOS_fbnum (this->hidden->frame_number)
123 #define XBIOS_pitch (this->hidden->pitch)
124 #define XBIOS_width (this->hidden->width)
125 #define XBIOS_height (this->hidden->height)
126
127 #endif /* _SDL_xbios_h */