comparison src/video/xbios/SDL_xbios.h @ 4194:05c9e942cc46 SDL-1.2

Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
author Patrice Mandin <patmandin@gmail.com>
date Sat, 19 Sep 2009 12:46:00 +0000
parents a1b03ba2fcd0
children 13de8ea401db
comparison
equal deleted inserted replaced
4193:430e6690c4cd 4194:05c9e942cc46
28 #include "../SDL_sysvideo.h" 28 #include "../SDL_sysvideo.h"
29 29
30 /* Hidden "this" pointer for the video functions */ 30 /* Hidden "this" pointer for the video functions */
31 #define _THIS SDL_VideoDevice *this 31 #define _THIS SDL_VideoDevice *this
32 32
33 /* TT video modes: 2
34 Falcon RVB: 16 (could be *2 by adding PAL/NTSC modes)
35 Falcon VGA: 6
36 ST low: 1
37 */
38 #define SDL_NUMMODES 16
39
40 typedef struct 33 typedef struct
41 { 34 {
42 Uint16 number; /* Video mode number */ 35 Uint16 number; /* Video mode number */
43 Uint16 width; /* Size */ 36 Uint16 width; /* Size */
44 Uint16 height; 37 Uint16 height;
45 Uint16 depth; /* bits per plane */ 38 Uint16 depth; /* bits per plane */
46 SDL_bool doubleline; /* Double the lines ? */ 39 SDL_bool doubleline; /* Double the lines ? */
47 } xbiosmode_t; 40 } xbiosmode_t;
48 41
49 /* Private display data */ 42 /* Private display data */
50 #define NUM_MODELISTS 2 /* 8 and 16 bits-per-pixel */ 43 #define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
51 44
52 struct SDL_PrivateVideoData { 45 struct SDL_PrivateVideoData {
53 long cookie_vdo; 46 long cookie_vdo;
54 int old_video_mode; /* Old video mode before entering SDL */ 47 int old_video_mode; /* Old video mode before entering SDL */
55 void *old_video_base; /* Old pointer to screen buffer */ 48 void *old_video_base; /* Old pointer to screen buffer */
56 void *old_palette; /* Old palette */ 49 void *old_palette; /* Old palette */
57 Uint32 old_num_colors; /* Nb of colors in saved palette */ 50 Uint32 old_num_colors; /* Nb of colors in saved palette */
58 int num_modes; /* Number of xbios video modes */
59 xbiosmode_t *mode_list; /* List of xbios video modes */
60 51
61 void *screens[2]; /* Pointers to aligned screen buffer */ 52 void *screens[2]; /* Pointers to aligned screen buffer */
62 void *screensmem[2]; /* Pointers to screen buffer */ 53 void *screensmem[2]; /* Pointers to screen buffer */
63 void *shadowscreen; /* Shadow screen for c2p conversion */ 54 void *shadowscreen; /* Shadow screen for c2p conversion */
64 int doubleline; /* Double line mode ? */ 55 int doubleline; /* Double line mode ? */
66 int pitch; /* Destination line width for C2P */ 57 int pitch; /* Destination line width for C2P */
67 int width, height; /* Screen size for centered C2P */ 58 int width, height; /* Screen size for centered C2P */
68 59
69 SDL_bool centscreen; /* Centscreen extension present ? */ 60 SDL_bool centscreen; /* Centscreen extension present ? */
70 61
71 SDL_Rect *SDL_modelist[NUM_MODELISTS][SDL_NUMMODES+1]; 62 int SDL_nummodes[NUM_MODELISTS];
72 xbiosmode_t *videomodes[NUM_MODELISTS][SDL_NUMMODES+1]; 63 SDL_Rect **SDL_modelist[NUM_MODELISTS];
64 xbiosmode_t **SDL_xbiosmode[NUM_MODELISTS];
73 }; 65 };
74 66
75 /* _VDO cookie values */ 67 /* _VDO cookie values */
76 enum { 68 enum {
77 VDO_ST=0, 69 VDO_ST=0,
100 #define TT_MED 0x0300 92 #define TT_MED 0x0300
101 #define TT_HIGH 0x0600 93 #define TT_HIGH 0x0600
102 #endif 94 #endif
103 95
104 /* Hidden structure -> variables names */ 96 /* Hidden structure -> variables names */
97 #define SDL_nummodes (this->hidden->SDL_nummodes)
105 #define SDL_modelist (this->hidden->SDL_modelist) 98 #define SDL_modelist (this->hidden->SDL_modelist)
99 #define SDL_xbiosmode (this->hidden->SDL_xbiosmode)
106 #define XBIOS_mutex (this->hidden->mutex) 100 #define XBIOS_mutex (this->hidden->mutex)
107 #define XBIOS_cvdo (this->hidden->cookie_vdo) 101 #define XBIOS_cvdo (this->hidden->cookie_vdo)
108 #define XBIOS_oldpalette (this->hidden->old_palette) 102 #define XBIOS_oldpalette (this->hidden->old_palette)
109 #define XBIOS_oldnumcol (this->hidden->old_num_colors) 103 #define XBIOS_oldnumcol (this->hidden->old_num_colors)
110 #define XBIOS_oldvbase (this->hidden->old_video_base) 104 #define XBIOS_oldvbase (this->hidden->old_video_base)
111 #define XBIOS_oldvmode (this->hidden->old_video_mode) 105 #define XBIOS_oldvmode (this->hidden->old_video_mode)
112 #define XBIOS_nummodes (this->hidden->num_modes)
113 #define XBIOS_modelist (this->hidden->mode_list)
114 #define XBIOS_screens (this->hidden->screens) 106 #define XBIOS_screens (this->hidden->screens)
115 #define XBIOS_screensmem (this->hidden->screensmem) 107 #define XBIOS_screensmem (this->hidden->screensmem)
116 #define XBIOS_shadowscreen (this->hidden->shadowscreen) 108 #define XBIOS_shadowscreen (this->hidden->shadowscreen)
117 #define XBIOS_videomodes (this->hidden->videomodes)
118 #define XBIOS_doubleline (this->hidden->doubleline) 109 #define XBIOS_doubleline (this->hidden->doubleline)
119 #define XBIOS_fbnum (this->hidden->frame_number) 110 #define XBIOS_fbnum (this->hidden->frame_number)
120 #define XBIOS_pitch (this->hidden->pitch) 111 #define XBIOS_pitch (this->hidden->pitch)
121 #define XBIOS_width (this->hidden->width) 112 #define XBIOS_width (this->hidden->width)
122 #define XBIOS_height (this->hidden->height) 113 #define XBIOS_height (this->hidden->height)
123 #define XBIOS_centscreen (this->hidden->centscreen) 114 #define XBIOS_centscreen (this->hidden->centscreen)
124 115
125 /*--- Functions prototypes ---*/ 116 /*--- Functions prototypes ---*/
126 117
127 void SDL_XBIOS_AddMode(_THIS, Uint16 modecode, Uint16 width, Uint16 height, 118 void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo);
128 Uint16 depth, SDL_bool flags);
129 119
130 #endif /* _SDL_xbios_h */ 120 #endif /* _SDL_xbios_h */