comparison src/video/gem/SDL_gemvideo.c @ 800:60a4293ffea9

When commiting code, cleanup before doing it
author Patrice Mandin <patmandin@gmail.com>
date Fri, 06 Feb 2004 22:53:32 +0000
parents 85960507bd2e
children 99f439d6ee4a
comparison
equal deleted inserted replaced
799:85960507bd2e 800:60a4293ffea9
61 #include "SDL_gemwm_c.h" 61 #include "SDL_gemwm_c.h"
62 #include "SDL_xbiosevents_c.h" 62 #include "SDL_xbiosevents_c.h"
63 63
64 /* Defines */ 64 /* Defines */
65 65
66 #define DEBUG_VIDEO_GEM 0 66 /* #define DEBUG_VIDEO_GEM 1 */
67 67
68 #define GEM_VID_DRIVER_NAME "gem" 68 #define GEM_VID_DRIVER_NAME "gem"
69 69
70 #undef MIN 70 #undef MIN
71 #define MIN(a,b) (((a)<(b)) ? (a) : (b)) 71 #define MIN(a,b) (((a)<(b)) ? (a) : (b))
214 * so we can directly write to screen without using vro_cpyfm 214 * so we can directly write to screen without using vro_cpyfm
215 */ 215 */
216 if (EdDI_version >= EDDI_11) { 216 if (EdDI_version >= EDDI_11) {
217 VDI_pitch = work_out[5]; 217 VDI_pitch = work_out[5];
218 VDI_screen = (void *) *((unsigned long *) &work_out[6]); 218 VDI_screen = (void *) *((unsigned long *) &work_out[6]);
219
220 #if 0 /* lecoat */
221 switch(num_colours) {
222 case 32768UL:
223 if (work_out[14] & (1<<7)) {
224 /* Little endian */
225 if (work_out[14] & (1<<1)) {
226 VDI_FBMASK(1<<13, 31<<3, (3<<14)|7, 31<<8);
227 } else {
228 VDI_FBMASK(1<<7, 31<<2, (7<<13)|3, 31<<8);
229 }
230 } else {
231 /* Big endian */
232 if (work_out[14] & (1<<1)) {
233 VDI_FBMASK(1<<5, 31<<11, 31<<6, 31);
234 } else {
235 VDI_FBMASK(1<<15, 31<<10, 31<<5, 31);
236 }
237 }
238 break;
239 case 65536UL:
240 if (work_out[14] & (1<<7)) {
241 /* Little endian */
242 VDI_FBMASK(0, 31<<3, (7<<13)|7, 31<<8);
243 } else {
244 /* Big endian */
245 VDI_FBMASK(0, 31<<11, 63<<5, 31);
246 }
247 break;
248 case 16777216UL:
249 if (work_out[14] & (1<<7)) {
250 /* Little endian */
251 switch(num_bits) {
252 case 24:
253 VDI_FBMASK(0, 255, 255<<8, 255<<16);
254 break;
255 case 32:
256 VDI_FBMASK(255, 255<<8, 255<<16, 255<<24);
257 break;
258 }
259 } else {
260 /* Big endian */
261 switch(num_bits) {
262 case 24:
263 VDI_FBMASK(0, 255<<16, 255<<8, 255);
264 break;
265 case 32:
266 VDI_FBMASK(255<<24, 255<<16, 255<<8, 255);
267 break;
268 }
269 }
270 break;
271 }
272 #endif
273 } 219 }
274 220
275 switch(clut_type) { 221 switch(clut_type) {
276 case VDI_CLUT_HARDWARE: 222 case VDI_CLUT_HARDWARE:
277 { 223 {
284 vdi_index[*tmp_p++] = i; 230 vdi_index[*tmp_p++] = i;
285 } 231 }
286 } 232 }
287 break; 233 break;
288 case VDI_CLUT_SOFTWARE: 234 case VDI_CLUT_SOFTWARE:
289 /* lecoat if (EdDI_version < EDDI_11) */ { 235 {
290 int component; /* red, green, blue, alpha, overlay */ 236 int component; /* red, green, blue, alpha, overlay */
291 int num_bit; 237 int num_bit;
292 unsigned short *tmp_p; 238 unsigned short *tmp_p;
293 239
294 /* We can build masks with info here */ 240 /* We can build masks with info here */
454 GEM_handle = -1; 400 GEM_handle = -1;
455 GEM_locked = SDL_FALSE; 401 GEM_locked = SDL_FALSE;
456 GEM_win_fulled = SDL_FALSE; 402 GEM_win_fulled = SDL_FALSE;
457 403
458 VDI_screen = NULL; 404 VDI_screen = NULL;
459 #if 1 /* lecoat */
460 VDI_pitch = VDI_w * VDI_pixelsize; 405 VDI_pitch = VDI_w * VDI_pixelsize;
461 VDI_format = ( (VDI_bpp <= 8) ? VDI_FORMAT_INTER : VDI_FORMAT_PACK); 406 VDI_format = ( (VDI_bpp <= 8) ? VDI_FORMAT_INTER : VDI_FORMAT_PACK);
462 VDI_redmask = VDI_greenmask = VDI_bluemask = VDI_alphamask = 0; 407 VDI_redmask = VDI_greenmask = VDI_bluemask = VDI_alphamask = 0;
463 VDI_ReadExtInfo(this, work_out); 408 VDI_ReadExtInfo(this, work_out);
464 #else
465 VDI_ReadExtInfo(this, work_out);
466 if (VDI_screen == NULL) {
467 VDI_pitch = VDI_w * VDI_pixelsize;
468 VDI_format = ( (VDI_bpp <= 8) ? VDI_FORMAT_INTER : VDI_FORMAT_PACK);
469 VDI_redmask = VDI_greenmask = VDI_bluemask = VDI_alphamask = 0;
470 }
471 #endif
472 409
473 #ifdef DEBUG_VIDEO_GEM 410 #ifdef DEBUG_VIDEO_GEM
474 printf("sdl:video:gem: screen: address=0x%08x, pitch=%d\n", VDI_screen, VDI_pitch); 411 printf("sdl:video:gem: screen: address=0x%08x, pitch=%d\n", VDI_screen, VDI_pitch);
475 printf("sdl:video:gem: format=%d\n", VDI_format); 412 printf("sdl:video:gem: format=%d\n", VDI_format);
476 printf("sdl:video:gem: masks: 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", 413 printf("sdl:video:gem: masks: 0x%08x, 0x%08x, 0x%08x, 0x%08x\n",
773 710
774 static int GEM_AllocHWSurface(_THIS, SDL_Surface *surface) 711 static int GEM_AllocHWSurface(_THIS, SDL_Surface *surface)
775 { 712 {
776 return -1; 713 return -1;
777 } 714 }
715
778 static void GEM_FreeHWSurface(_THIS, SDL_Surface *surface) 716 static void GEM_FreeHWSurface(_THIS, SDL_Surface *surface)
779 { 717 {
780 return; 718 return;
781 } 719 }
782 720
1121 1059
1122 /* Update finished */ 1060 /* Update finished */
1123 wind_update(END_UPDATE); 1061 wind_update(END_UPDATE);
1124 1062
1125 v_show_c(VDI_handle,1); 1063 v_show_c(VDI_handle,1);
1126
1127 #if 0 /*DEBUG_VIDEO_GEM*/
1128 fflush(stdout);
1129 #endif
1130 } 1064 }
1131 1065
1132 static void refresh_window(_THIS, int winhandle, short *rect) 1066 static void refresh_window(_THIS, int winhandle, short *rect)
1133 { 1067 {
1134 MFDB mfdb_src; 1068 MFDB mfdb_src;