Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Mon, 13 Oct 2008 20:50:20 +0000
branchSDL-1.2
changeset 41554d743a3d0bc1
parent 4154 db4007f17bc8
child 4156 de46a1bfcbdb
Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
src/video/xbios/SDL_xbios.c
     1.1 --- a/src/video/xbios/SDL_xbios.c	Mon Sep 15 20:47:55 2008 +0000
     1.2 +++ b/src/video/xbios/SDL_xbios.c	Mon Oct 13 20:50:20 2008 +0000
     1.3 @@ -53,6 +53,10 @@
     1.4  
     1.5  #define XBIOS_VID_DRIVER_NAME "xbios"
     1.6  
     1.7 +#ifndef C_fVDI
     1.8 +#define C_fVDI 0x66564449L
     1.9 +#endif
    1.10 +
    1.11  /* Debug print info */
    1.12  #if 0
    1.13  #define DEBUG_PRINT(what) \
    1.14 @@ -95,6 +99,8 @@
    1.15  static int XBIOS_Available(void)
    1.16  {
    1.17  	unsigned long cookie_vdo, cookie_mil, cookie_hade, cookie_scpn;
    1.18 +	unsigned long cookie_fvdi;
    1.19 +	const char *envr = SDL_getenv("SDL_VIDEODRIVER");
    1.20  
    1.21  	/* Milan/Hades Atari clones do not have an Atari video chip */
    1.22  	if ( (Getcookie(C__MIL, &cookie_mil) == C_FOUND) ||
    1.23 @@ -102,6 +108,17 @@
    1.24  		return 0;
    1.25  	}
    1.26  
    1.27 +	/* fVDI means graphic card, so no Xbios with it */
    1.28 +	if (Getcookie(C_fVDI, &cookie_fvdi) == C_FOUND) {
    1.29 +		if (!envr) {
    1.30 +			return 0;
    1.31 +		}
    1.32 +		if (SDL_strcmp(envr, XBIOS_VID_DRIVER_NAME)!=0) {
    1.33 +			return 0;
    1.34 +		}
    1.35 +		/* Except if we force Xbios usage, through env var */
    1.36 +	}
    1.37 +
    1.38  	/* Cookie _VDO present ? if not, assume ST machine */
    1.39  	if (Getcookie(C__VDO, &cookie_vdo) != C_FOUND) {
    1.40  		cookie_vdo = VDO_ST << 16;