Skip to content

Commit

Permalink
Disable Xbios video driver if FVDI present, but still allow it to be …
Browse files Browse the repository at this point in the history
…used when setting SDL_VIDEODRIVER
  • Loading branch information
pmandin committed Oct 13, 2008
1 parent 76f0c86 commit 702a7ad
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/video/xbios/SDL_xbios.c
Expand Up @@ -53,6 +53,10 @@

#define XBIOS_VID_DRIVER_NAME "xbios"

#ifndef C_fVDI
#define C_fVDI 0x66564449L
#endif

/* Debug print info */
#if 0
#define DEBUG_PRINT(what) \
Expand Down Expand Up @@ -95,13 +99,26 @@ static unsigned long F30_palette[256];
static int XBIOS_Available(void)
{
unsigned long cookie_vdo, cookie_mil, cookie_hade, cookie_scpn;
unsigned long cookie_fvdi;
const char *envr = SDL_getenv("SDL_VIDEODRIVER");

/* Milan/Hades Atari clones do not have an Atari video chip */
if ( (Getcookie(C__MIL, &cookie_mil) == C_FOUND) ||
(Getcookie(C_hade, &cookie_hade) == C_FOUND) ) {
return 0;
}

/* fVDI means graphic card, so no Xbios with it */
if (Getcookie(C_fVDI, &cookie_fvdi) == C_FOUND) {
if (!envr) {
return 0;
}
if (SDL_strcmp(envr, XBIOS_VID_DRIVER_NAME)!=0) {
return 0;
}
/* Except if we force Xbios usage, through env var */
}

/* Cookie _VDO present ? if not, assume ST machine */
if (Getcookie(C__VDO, &cookie_vdo) != C_FOUND) {
cookie_vdo = VDO_ST << 16;
Expand Down

0 comments on commit 702a7ad

Please sign in to comment.