atari:xbios: Add NOVA video card support for TT machines SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sat, 04 Nov 2017 23:25:48 +0100
branchSDL-1.2
changeset 11681462d7ea5d108
parent 11680 9517c54ab59c
child 11691 ec421fd512ba
atari:xbios: Add NOVA video card support for TT machines
README.MiNT
src/video/xbios/SDL_xbios_nova.c
src/video/xbios/SDL_xbios_nova.h
src/video/xbios/SDL_xbios_tt.c
     1.1 --- a/README.MiNT	Sat Nov 04 23:16:08 2017 +0100
     1.2 +++ b/README.MiNT	Sat Nov 04 23:25:48 2017 +0100
     1.3 @@ -5,7 +5,7 @@
     1.4  
     1.5      If you want to build SDL from sources to create SDL programs on Atari:
     1.6          see sections I - II.
     1.7 -	
     1.8 +
     1.9      If you want to create SDL programs on Atari using SDL binary build,
    1.10          download it from my web site (URL at end of this file).
    1.11  
    1.12 @@ -50,7 +50,7 @@
    1.13    can use the web interface:
    1.14  
    1.15  	http://www.libsdl.org/mailman/listinfo/sdl
    1.16 -  
    1.17 +
    1.18  ==============================================================================
    1.19  IV.  What is supported:
    1.20  
    1.21 @@ -185,6 +185,7 @@
    1.22  		of testing SDL.
    1.23  	TT:
    1.24  		320x480x8 and 320x240x8 (software double-lined mode).
    1.25 +		NOVA video card: All modes with 8 bits or higher depth.
    1.26  	Falcon:
    1.27  		All modes supported by the current monitor (RVB or VGA).
    1.28  		BlowUp and Centscreen: Extended modes.
    1.29 @@ -248,6 +249,6 @@
    1.30  	X-Sound driver (GSXB compatible):
    1.31  		http://www.uni-ulm.de/~s_thuth/atari/xsound_e.html
    1.32  
    1.33 --- 
    1.34 +--
    1.35  Patrice Mandin <patmandin@gmail.com>
    1.36  http://pmandin.atari.org/
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/video/xbios/SDL_xbios_nova.c	Sat Nov 04 23:25:48 2017 +0100
     2.3 @@ -0,0 +1,345 @@
     2.4 +/*
     2.5 +    SDL - Simple DirectMedia Layer
     2.6 +    Copyright (C) 1997-2012 Sam Lantinga
     2.7 +
     2.8 +    This library is free software; you can redistribute it and/or
     2.9 +    modify it under the terms of the GNU Library General Public
    2.10 +    License as published by the Free Software Foundation; either
    2.11 +    version 2 of the License, or (at your option) any later version.
    2.12 +
    2.13 +    This library is distributed in the hope that it will be useful,
    2.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.16 +    Library General Public License for more details.
    2.17 +
    2.18 +    You should have received a copy of the GNU Library General Public
    2.19 +    License along with this library; if not, write to the Free
    2.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2.21 +
    2.22 +    Sam Lantinga
    2.23 +    slouken@libsdl.org
    2.24 +*/
    2.25 +#include "SDL_config.h"
    2.26 +
    2.27 +/*
    2.28 +	Nova video card driver
    2.29 +
    2.30 +	Patrice Mandin
    2.31 +*/
    2.32 +
    2.33 +#include <sys/stat.h>
    2.34 +#include <unistd.h>
    2.35 +#include <fcntl.h>
    2.36 +
    2.37 +/* Mint includes */
    2.38 +#include <mint/cookie.h>
    2.39 +#include <mint/sysvars.h>
    2.40 +#include <mint/osbind.h>
    2.41 +
    2.42 +#include "SDL_video.h"
    2.43 +
    2.44 +#include "../ataricommon/SDL_atarimxalloc_c.h"
    2.45 +#include "../ataricommon/SDL_atarisuper.h"
    2.46 +#include "SDL_xbios.h"
    2.47 +#include "SDL_xbios_nova.h"
    2.48 +
    2.49 +#define NOVA_FILENAME	"\\auto\\sta_vdi.bib"
    2.50 +
    2.51 +/*--- ---*/
    2.52 +
    2.53 +static nova_xcb_t *NOVA_xcb;			/* Pointer to Nova infos */
    2.54 +static nova_resolution_t *NOVA_modes;	/* Video modes loaded from a file */
    2.55 +static int NOVA_modecount;				/* Number of loaded modes */
    2.56 +
    2.57 +/*--- Functions ---*/
    2.58 +
    2.59 +static void XBIOS_DeleteDevice_NOVA(_THIS);
    2.60 +
    2.61 +static void listModes(_THIS, int actually_add);
    2.62 +static void saveMode(_THIS, SDL_PixelFormat *vformat);
    2.63 +static void setMode(_THIS, xbiosmode_t *new_video_mode);
    2.64 +static void restoreMode(_THIS);
    2.65 +static void vsync_NOVA(_THIS);
    2.66 +static void getScreenFormat(_THIS, int bpp, Uint32 *rmask, Uint32 *gmask, Uint32 *bmask, Uint32 *amask);
    2.67 +static int getLineWidth(_THIS, xbiosmode_t *new_video_mode, int width, int bpp);
    2.68 +static void swapVbuffers(_THIS);
    2.69 +static int allocVbuffers(_THIS, int num_buffers, int bufsize);
    2.70 +static void freeVbuffers(_THIS);
    2.71 +static int setColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
    2.72 +
    2.73 +/* Internal functions */
    2.74 +
    2.75 +static void NOVA_SetMode(_THIS, int num_mode);
    2.76 +static void NOVA_SetScreen(_THIS, void *screen);
    2.77 +static void NOVA_SetColor(_THIS, int index, int r, int g, int b);
    2.78 +static nova_resolution_t *NOVA_LoadModes(int *num_modes);
    2.79 +
    2.80 +/* Nova driver bootstrap functions */
    2.81 +
    2.82 +void SDL_XBIOS_VideoInit_Nova(_THIS, void *cookie_nova)
    2.83 +{
    2.84 +	NOVA_xcb = (nova_xcb_t *) cookie_nova;
    2.85 +	NOVA_modes = NULL;
    2.86 +	NOVA_modecount = 0;
    2.87 +
    2.88 +	this->free = XBIOS_DeleteDevice_NOVA;
    2.89 +
    2.90 +	/* Initialize video mode list */
    2.91 +	NOVA_modes = NOVA_LoadModes(&NOVA_modecount);
    2.92 +	if (!NOVA_modes) {
    2.93 +		return;
    2.94 +	}
    2.95 +
    2.96 +	XBIOS_listModes = listModes;
    2.97 +	XBIOS_saveMode = saveMode;
    2.98 +	XBIOS_setMode = setMode;
    2.99 +	XBIOS_restoreMode = restoreMode;
   2.100 +	XBIOS_vsync = vsync_NOVA;
   2.101 +	XBIOS_getScreenFormat = getScreenFormat;
   2.102 +	XBIOS_getLineWidth = getLineWidth;
   2.103 +	XBIOS_swapVbuffers = swapVbuffers;
   2.104 +	XBIOS_allocVbuffers = allocVbuffers;
   2.105 +	XBIOS_freeVbuffers = freeVbuffers;
   2.106 +
   2.107 +	this->SetColors = setColors;
   2.108 +}
   2.109 +
   2.110 +static void XBIOS_DeleteDevice_NOVA(_THIS)
   2.111 +{
   2.112 +	if (NOVA_modes) {
   2.113 +		SDL_free(NOVA_modes);
   2.114 +	}
   2.115 +
   2.116 +	SDL_free(this->hidden);
   2.117 +	SDL_free(this);
   2.118 +}
   2.119 +
   2.120 +static void listModes(_THIS, int actually_add)
   2.121 +{
   2.122 +	int i;
   2.123 +	xbiosmode_t modeinfo;
   2.124 +
   2.125 +	for (i=0; i<NOVA_modecount; i++) {
   2.126 +		int width = NOVA_modes[i].max_x + 1;
   2.127 +		int height = NOVA_modes[i].max_y + 1;
   2.128 +		int bpp = NOVA_modes[i].planes;
   2.129 +
   2.130 +		/* Only 8, 16, 24, 32,bpp modes */
   2.131 +		if ((NOVA_modes[i].mode <= 1 ) || (NOVA_modes[i].mode == 3 ))
   2.132 +			continue;
   2.133 +
   2.134 +		modeinfo.number = i;
   2.135 +		modeinfo.width = width;
   2.136 +		modeinfo.height = height;
   2.137 +		modeinfo.depth = bpp;
   2.138 +		modeinfo.flags = 0;
   2.139 +
   2.140 +		SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
   2.141 +	}
   2.142 +}
   2.143 +
   2.144 +static void saveMode(_THIS, SDL_PixelFormat *vformat)
   2.145 +{
   2.146 +	int curwidth, curheight, curbpp;
   2.147 +
   2.148 +	curwidth = NOVA_xcb->max_x + 1;
   2.149 +	curheight = NOVA_xcb->max_y + 1;
   2.150 +	curbpp = NOVA_xcb->planes;
   2.151 +	if (NOVA_xcb->mode == 3 ) {
   2.152 +		curbpp = 15;
   2.153 +	}
   2.154 +
   2.155 +	/* Determine the current screen size */
   2.156 +	this->info.current_w = curwidth;
   2.157 +	this->info.current_h = curheight;
   2.158 +
   2.159 +	/* Determine the screen depth (use default 8-bit depth) */
   2.160 +	vformat->BitsPerPixel = curbpp;
   2.161 +
   2.162 +	/* Update hardware info */
   2.163 +	this->info.hw_available = 1;
   2.164 +	this->info.video_mem = NOVA_xcb->mem_size;
   2.165 +
   2.166 +	XBIOS_oldvmode = NOVA_xcb->resolution;
   2.167 +	XBIOS_oldvbase = NOVA_xcb->base;
   2.168 +
   2.169 +	/* TODO: save palette ? */
   2.170 +}
   2.171 +
   2.172 +static void setMode(_THIS, xbiosmode_t *new_video_mode)
   2.173 +{
   2.174 +	NOVA_SetMode(this, new_video_mode->number);
   2.175 +}
   2.176 +
   2.177 +static void restoreMode(_THIS)
   2.178 +{
   2.179 +	NOVA_SetScreen(this, XBIOS_oldvbase);
   2.180 +	NOVA_SetMode(this, XBIOS_oldvmode);
   2.181 +
   2.182 +	/* TODO: restore palette ? */
   2.183 +}
   2.184 +
   2.185 +static void vsync_NOVA(_THIS)
   2.186 +{
   2.187 +	NOVA_xcb->p_vsync();
   2.188 +}
   2.189 +
   2.190 +static void getScreenFormat(_THIS, int bpp, Uint32 *rmask, Uint32 *gmask, Uint32 *bmask, Uint32 *amask)
   2.191 +{
   2.192 +	*rmask = *gmask = *bmask = *amask = 0;
   2.193 +
   2.194 +	switch(bpp) {
   2.195 +		case 15:
   2.196 +			*rmask = 31<<2;
   2.197 +			*gmask = 3;
   2.198 +			*bmask = 31<<8;
   2.199 +			*amask = 1<<7;
   2.200 +			break;
   2.201 +		case 16:
   2.202 +			*rmask = 31<<3;
   2.203 +			*gmask = 7;
   2.204 +			*bmask = 31<<8;
   2.205 +			break;
   2.206 +		case 24:
   2.207 +			*rmask = 255;
   2.208 +			*gmask = 255<<8;
   2.209 +			*bmask = 255<<16;
   2.210 +			break;
   2.211 +		case 32:
   2.212 +			*rmask = 255<<24;
   2.213 +			*gmask = 255<<16;
   2.214 +			*bmask = 255<<8;
   2.215 +			*amask = 255;
   2.216 +			break;
   2.217 +	}
   2.218 +}
   2.219 +
   2.220 +static int getLineWidth(_THIS, xbiosmode_t *new_video_mode, int width, int bpp)
   2.221 +{
   2.222 +	return (NOVA_modes[new_video_mode->number].pitch);
   2.223 +}
   2.224 +
   2.225 +static void swapVbuffers(_THIS)
   2.226 +{
   2.227 +	NOVA_SetScreen(this, XBIOS_screens[XBIOS_fbnum]);
   2.228 +}
   2.229 +
   2.230 +static int allocVbuffers(_THIS, int num_buffers, int bufsize)
   2.231 +{
   2.232 +	XBIOS_screens[0] = NOVA_xcb->base;
   2.233 +	if (num_buffers>1) {
   2.234 +		XBIOS_screens[1] = XBIOS_screens[0] + NOVA_xcb->scrn_sze;
   2.235 +	}
   2.236 +
   2.237 +	return(1);
   2.238 +}
   2.239 +
   2.240 +static void freeVbuffers(_THIS)
   2.241 +{
   2.242 +}
   2.243 +
   2.244 +static int setColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
   2.245 +{
   2.246 +	int i;
   2.247 +
   2.248 +	for (i=0; i<ncolors; i++) {
   2.249 +		NOVA_SetColor(this, firstcolor+i,  colors[i].r, colors[i].g, colors[i].b);
   2.250 +	}
   2.251 +
   2.252 +	return(1);
   2.253 +}
   2.254 +
   2.255 +static void NOVA_SetMode(_THIS, int num_mode)
   2.256 +{
   2.257 +	if ((num_mode<0) || (num_mode>=NOVA_modecount)) {
   2.258 +		return;
   2.259 +	}
   2.260 +
   2.261 +	__asm__ __volatile__ (
   2.262 +			"moveql	#0,d0\n\t"
   2.263 +			"movel	%0,a0\n\t"
   2.264 +			"movel	%1,a1\n\t"
   2.265 +			"jsr	a1@"
   2.266 +		: /* no return value */
   2.267 +		: /* input */
   2.268 +			"g"(&NOVA_modes[num_mode]), "g"(NOVA_xcb->p_chres)
   2.269 +		: /* clobbered registers */
   2.270 +			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
   2.271 +	);
   2.272 +}
   2.273 +
   2.274 +static void NOVA_SetScreen(_THIS, void *screen)
   2.275 +{
   2.276 +	__asm__ __volatile__ (
   2.277 +			"movel	%0,a0\n\t"
   2.278 +			"movel	%1,a1\n\t"
   2.279 +			"jsr	a1@"
   2.280 +		: /* no return value */
   2.281 +		: /* input */
   2.282 +			"g"(screen), "g"(NOVA_xcb->p_setscr)
   2.283 +		: /* clobbered registers */
   2.284 +			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
   2.285 +	);
   2.286 +}
   2.287 +
   2.288 +static void NOVA_SetColor(_THIS, int index, int r, int g, int b)
   2.289 +{
   2.290 +	Uint8 color[3];
   2.291 +
   2.292 +	color[0] = r;
   2.293 +	color[1] = g;
   2.294 +	color[2] = b;
   2.295 +
   2.296 +	__asm__ __volatile__ (
   2.297 +			"movel	%0,d0\n\t"
   2.298 +			"movel	%1,a0\n\t"
   2.299 +			"movel	%2,a1\n\t"
   2.300 +			"jsr	a1@"
   2.301 +		: /* no return value */
   2.302 +		: /* input */
   2.303 +			"g"(index), "g"(color), "g"(NOVA_xcb->p_setcol)
   2.304 +		: /* clobbered registers */
   2.305 +			"d0", "d1", "d2", "a0", "a1", "cc", "memory"
   2.306 +	);
   2.307 +}
   2.308 +
   2.309 +static nova_resolution_t *NOVA_LoadModes(int *num_modes)
   2.310 +{
   2.311 +	char filename[32];
   2.312 +	unsigned char bootdrive;
   2.313 +	void *oldstack;
   2.314 +	int handle, length;
   2.315 +	nova_resolution_t *buffer;
   2.316 +
   2.317 +	/* Find boot drive */
   2.318 +	oldstack = (void *)Super(NULL);
   2.319 +	bootdrive='A'+ *((volatile unsigned short *)_bootdev);
   2.320 +	SuperToUser(oldstack);
   2.321 +
   2.322 +	sprintf(&filename[0], "%c:" NOVA_FILENAME, bootdrive);
   2.323 +
   2.324 +	/* Load file */
   2.325 +	handle = open(filename, O_RDONLY);
   2.326 +	if (handle<0) {
   2.327 +		SDL_SetError("Unable to open %s\n", filename);
   2.328 +		return NULL;
   2.329 +	}
   2.330 +
   2.331 +	length = lseek(handle, 0, SEEK_END);
   2.332 +	lseek(handle, 0, SEEK_SET);
   2.333 +
   2.334 +	buffer = (nova_resolution_t *)SDL_malloc(length);
   2.335 +	if (buffer==NULL) {
   2.336 +		SDL_SetError("Unable to allocate %d bytes\n", length);
   2.337 +		return NULL;
   2.338 +	}
   2.339 +
   2.340 +	read(handle, buffer, length);
   2.341 +	close(handle);
   2.342 +
   2.343 +	if (num_modes!=NULL) {
   2.344 +		*num_modes=length/sizeof(nova_resolution_t);
   2.345 +	}
   2.346 +
   2.347 +	return buffer;
   2.348 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/video/xbios/SDL_xbios_nova.h	Sat Nov 04 23:25:48 2017 +0100
     3.3 @@ -0,0 +1,120 @@
     3.4 +/*
     3.5 +    SDL - Simple DirectMedia Layer
     3.6 +    Copyright (C) 1997-2012 Sam Lantinga
     3.7 +
     3.8 +    This library is free software; you can redistribute it and/or
     3.9 +    modify it under the terms of the GNU Library General Public
    3.10 +    License as published by the Free Software Foundation; either
    3.11 +    version 2 of the License, or (at your option) any later version.
    3.12 +
    3.13 +    This library is distributed in the hope that it will be useful,
    3.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.16 +    Library General Public License for more details.
    3.17 +
    3.18 +    You should have received a copy of the GNU Library General Public
    3.19 +    License along with this library; if not, write to the Free
    3.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    3.21 +
    3.22 +    Sam Lantinga
    3.23 +    slouken@libsdl.org
    3.24 +*/
    3.25 +#include "SDL_config.h"
    3.26 +
    3.27 +/*
    3.28 +	NOVA video card definitions
    3.29 +
    3.30 +	Patrice Mandin
    3.31 +*/
    3.32 +
    3.33 +#ifndef _SDL_xbios_nova_h
    3.34 +#define _SDL_xbios_nova_h
    3.35 +
    3.36 +/*--- Types ---*/
    3.37 +
    3.38 +typedef struct {
    3.39 +	unsigned char	name[33];	/* Video mode name */
    3.40 +	unsigned char	dummy1;
    3.41 +
    3.42 +	unsigned short	mode;		/* Video mode type */
    3.43 +								/*  0=4 bpp */
    3.44 +								/*  1=1 bpp */
    3.45 +								/*  2=8 bpp */
    3.46 +								/*  3=15 bpp (little endian) */
    3.47 +								/*  4=16 bpp (little endian) */
    3.48 +								/*  5=24 bpp (BGR) */
    3.49 +								/*  6=32 bpp (RGBA) */
    3.50 +	unsigned short	pitch;		/* bpp<8: words/plane /line */
    3.51 +								/*  bpp>=8: bytes /line */
    3.52 +	unsigned short	planes;		/* Bits per pixel */
    3.53 +	unsigned short	colors;		/* Number of colours */
    3.54 +	unsigned short	hc_mode;	/* Hardcopy mode */
    3.55 +								/*  0=1 pixel screen -> 1x1 printer screen */
    3.56 +								/*  1=1 pixel screen -> 2x2 printer screen */
    3.57 +								/*  2=1 pixel screen -> 4x4 printer screen */
    3.58 +	unsigned short	max_x;		/* Max x,y coordinates, values-1 */
    3.59 +	unsigned short	max_y;
    3.60 +	unsigned short	real_x;		/* Real max x,y coordinates, values-1 */
    3.61 +	unsigned short	real_y;
    3.62 +
    3.63 +	unsigned short	freq;		/* Pixel clock */
    3.64 +	unsigned char	freq2;		/* Another pixel clock */
    3.65 +	unsigned char	low_res;	/* Half of pixel clock */
    3.66 +	unsigned char	r_3c2;
    3.67 +	unsigned char	r_3d4[25];
    3.68 +	unsigned char	extended[3];
    3.69 +	unsigned char	dummy2;
    3.70 +} nova_resolution_t;
    3.71 +
    3.72 +/* cookie NOVA points to this */
    3.73 +typedef struct {
    3.74 +	unsigned char	version[4];	/* Version number */
    3.75 +	unsigned char	resolution;	/* Resolution number */
    3.76 +	unsigned char	blnk_time;	/* Time before blanking */
    3.77 +	unsigned char	ms_speed;	/* Mouse speed */
    3.78 +	unsigned char	old_res;
    3.79 +
    3.80 +	/* Pointer to routine to change resolution */
    3.81 +	void			(*p_chres)(nova_resolution_t *nova_res, unsigned long offset);
    3.82 +	
    3.83 +	unsigned short	mode;		/* Video mode type: */
    3.84 +								/*  0=4 bpp */
    3.85 +								/*  1=1 bpp */
    3.86 +								/*  2=8 bpp */
    3.87 +								/*  3=15 bpp (little endian) */
    3.88 +								/*  4=16 bpp (little endian) */
    3.89 +								/*  5=24 bpp (BGR) */
    3.90 +								/*  6=32 bpp (RGBA) */
    3.91 +	unsigned short	pitch;		/* bpp<8: bytes per plane, per line */
    3.92 +								/*  bpp>=8: bytes per line */
    3.93 +	unsigned short	planes;		/* Bits per pixel */
    3.94 +	unsigned short	colours;	/* Number of colours, unused */
    3.95 +	unsigned short	hc;			/* Hardcopy mode */
    3.96 +								/*  0=1 pixel screen -> 1x1 printer screen */
    3.97 +								/*  1=1 pixel screen -> 2x2 printer screen */
    3.98 +								/*  2=1 pixel screen -> 4x4 printer screen */
    3.99 +	unsigned short	max_x, max_y;		/* Resolution, values-1 */
   3.100 +	unsigned short	rmn_x, rmx_x;
   3.101 +	unsigned short	rmn_y, rmx_y;
   3.102 +	unsigned short	v_top, v_bottom;
   3.103 +	unsigned short	v_left, v_right;
   3.104 +
   3.105 +	/* Pointer to routine to set colours */
   3.106 +	void			(*p_setcol)(unsigned short index, unsigned char *colors);	
   3.107 +
   3.108 +	void			(*chng_vrt)(unsigned short x, unsigned short y);
   3.109 +	void			(*inst_xbios)(unsigned short on);
   3.110 +	void			(*pic_on)(unsigned short on);
   3.111 +	void			(*chng_pos)(nova_resolution_t *nova_res, unsigned short direction, unsigned short offset);
   3.112 +	void			(*p_setscr)(void *adr);	/* Pointer to routine to change screen address */
   3.113 +	void			*base;		/* Address of screen #0 in video RAM */
   3.114 +	void			*scr_base;	/* Adress of video RAM */
   3.115 +	unsigned short	scrn_cnt;	/* Number of possible screens in video RAM */
   3.116 +	unsigned long	scrn_sze;	/* Size of a screen */
   3.117 +	void			*reg_base;	/* Video card I/O registers base */
   3.118 +	void			(*p_vsync)(void);	/* Pointer to routine to vsync */
   3.119 +	unsigned char	name[36];	/* Video mode name */
   3.120 +	unsigned long	mem_size;	/* Global size of video memory */
   3.121 +} nova_xcb_t;
   3.122 +
   3.123 +#endif /* _SDL_xbios_nova_h */
     4.1 --- a/src/video/xbios/SDL_xbios_tt.c	Sat Nov 04 23:16:08 2017 +0100
     4.2 +++ b/src/video/xbios/SDL_xbios_tt.c	Sat Nov 04 23:25:48 2017 +0100
     4.3 @@ -33,6 +33,7 @@
     4.4  #include "../SDL_sysvideo.h"
     4.5  
     4.6  #include "SDL_xbios.h"
     4.7 +#include "SDL_xbios_nova.h"
     4.8  
     4.9  static const xbiosmode_t ttmodes[]={
    4.10  	{TT_LOW,320,480,8, XBIOSMODE_C2P},
    4.11 @@ -47,12 +48,19 @@
    4.12  
    4.13  void SDL_XBIOS_VideoInit_TT(_THIS)
    4.14  {
    4.15 +	long cookie_nova;
    4.16 +
    4.17  	XBIOS_listModes = listModes;
    4.18  	XBIOS_saveMode = saveMode;
    4.19  	XBIOS_setMode = setMode;
    4.20  	XBIOS_restoreMode = restoreMode;
    4.21  
    4.22  	this->SetColors = setColors;
    4.23 +
    4.24 +	/* NOVA card ? */
    4.25 +	if (Getcookie(C_NOVA, &cookie_nova) == C_FOUND) {
    4.26 +		SDL_XBIOS_VideoInit_Nova(this, (void *) cookie_nova);
    4.27 +	}
    4.28  }
    4.29  
    4.30  static void listModes(_THIS, int actually_add)