comparison src/video/xbios/SDL_xbios.c @ 4155:4d743a3d0bc1 SDL-1.2

Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
author Patrice Mandin <patmandin@gmail.com>
date Mon, 13 Oct 2008 20:50:20 +0000
parents d8371d2dc524
children a1b03ba2fcd0
comparison
equal deleted inserted replaced
4154:db4007f17bc8 4155:4d743a3d0bc1
51 #include "SDL_xbios_sb3.h" 51 #include "SDL_xbios_sb3.h"
52 #include "SDL_xbios_tveille.h" 52 #include "SDL_xbios_tveille.h"
53 53
54 #define XBIOS_VID_DRIVER_NAME "xbios" 54 #define XBIOS_VID_DRIVER_NAME "xbios"
55 55
56 #ifndef C_fVDI
57 #define C_fVDI 0x66564449L
58 #endif
59
56 /* Debug print info */ 60 /* Debug print info */
57 #if 0 61 #if 0
58 #define DEBUG_PRINT(what) \ 62 #define DEBUG_PRINT(what) \
59 { \ 63 { \
60 printf what; \ 64 printf what; \
93 /* Xbios driver bootstrap functions */ 97 /* Xbios driver bootstrap functions */
94 98
95 static int XBIOS_Available(void) 99 static int XBIOS_Available(void)
96 { 100 {
97 unsigned long cookie_vdo, cookie_mil, cookie_hade, cookie_scpn; 101 unsigned long cookie_vdo, cookie_mil, cookie_hade, cookie_scpn;
102 unsigned long cookie_fvdi;
103 const char *envr = SDL_getenv("SDL_VIDEODRIVER");
98 104
99 /* Milan/Hades Atari clones do not have an Atari video chip */ 105 /* Milan/Hades Atari clones do not have an Atari video chip */
100 if ( (Getcookie(C__MIL, &cookie_mil) == C_FOUND) || 106 if ( (Getcookie(C__MIL, &cookie_mil) == C_FOUND) ||
101 (Getcookie(C_hade, &cookie_hade) == C_FOUND) ) { 107 (Getcookie(C_hade, &cookie_hade) == C_FOUND) ) {
102 return 0; 108 return 0;
109 }
110
111 /* fVDI means graphic card, so no Xbios with it */
112 if (Getcookie(C_fVDI, &cookie_fvdi) == C_FOUND) {
113 if (!envr) {
114 return 0;
115 }
116 if (SDL_strcmp(envr, XBIOS_VID_DRIVER_NAME)!=0) {
117 return 0;
118 }
119 /* Except if we force Xbios usage, through env var */
103 } 120 }
104 121
105 /* Cookie _VDO present ? if not, assume ST machine */ 122 /* Cookie _VDO present ? if not, assume ST machine */
106 if (Getcookie(C__VDO, &cookie_vdo) != C_FOUND) { 123 if (Getcookie(C__VDO, &cookie_vdo) != C_FOUND) {
107 cookie_vdo = VDO_ST << 16; 124 cookie_vdo = VDO_ST << 16;