Add Falcon Centscreen extension support
authorPatrice Mandin <patmandin@gmail.com>
Wed, 18 May 2005 17:02:17 +0000
changeset 10615023cde12cbd
parent 1060 86885b40a53b
child 1062 3e637850c02b
Add Falcon Centscreen extension support
README.MiNT
src/video/xbios/Makefile.am
src/video/xbios/SDL_xbios.c
src/video/xbios/SDL_xbios_centscreen.c
src/video/xbios/SDL_xbios_centscreen.h
     1.1 --- a/README.MiNT	Mon May 16 08:23:34 2005 +0000
     1.2 +++ b/README.MiNT	Wed May 18 17:02:17 2005 +0000
     1.3 @@ -156,7 +156,8 @@
     1.4  		320x480x8 and 320x240x8 (software double-lined mode).
     1.5  	Falcon:
     1.6  		All modes supported by the current monitor (RVB or VGA).
     1.7 -		BlowUp extended modes, ScreenBlaster 3 current mode.
     1.8 +		BlowUp extended modes, ScreenBlaster 3 current mode, Centscreen current
     1.9 +		mode.
    1.10  	Clones and any machine with monochrome monitor:
    1.11  		Not supported.
    1.12  
     2.1 --- a/src/video/xbios/Makefile.am	Mon May 16 08:23:34 2005 +0000
     2.2 +++ b/src/video/xbios/Makefile.am	Wed May 18 17:02:17 2005 +0000
     2.3 @@ -10,5 +10,7 @@
     2.4  	SDL_xbios.h	\
     2.5  	SDL_xbios_blowup.c	\
     2.6  	SDL_xbios_blowup.h	\
     2.7 +	SDL_xbios_centscreen.c	\
     2.8 +	SDL_xbios_centscreen.h	\
     2.9  	SDL_xbios_sb3.c	\
    2.10  	SDL_xbios_sb3.h
     3.1 --- a/src/video/xbios/SDL_xbios.c	Mon May 16 08:23:34 2005 +0000
     3.2 +++ b/src/video/xbios/SDL_xbios.c	Wed May 18 17:02:17 2005 +0000
     3.3 @@ -56,6 +56,7 @@
     3.4  #include "SDL_atarigl_c.h"
     3.5  #include "SDL_xbios.h"
     3.6  #include "SDL_xbios_blowup.h"
     3.7 +#include "SDL_xbios_centscreen.h"
     3.8  #include "SDL_xbios_sb3.h"
     3.9  
    3.10  #define XBIOS_VID_DRIVER_NAME "xbios"
    3.11 @@ -261,7 +262,7 @@
    3.12  {
    3.13  	int i,j8,j16;
    3.14  	xbiosmode_t *current_mode;
    3.15 -	unsigned long cookie_blow, cookie_scpn;
    3.16 +	unsigned long cookie_blow, cookie_scpn, cookie_cnts;
    3.17  
    3.18  	/* Initialize all variables that we clean on shutdown */
    3.19  	memset (SDL_modelist, 0, sizeof(SDL_modelist));
    3.20 @@ -415,8 +416,9 @@
    3.21  				SDL_XBIOS_BlowupInit(this, (blow_cookie_t *)cookie_blow);
    3.22  			} else if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
    3.23  				SDL_XBIOS_SB3Init(this, (scpn_cookie_t *)cookie_scpn);
    3.24 +			} else if (Getcookie(C_CNTS, &cookie_cnts) == C_FOUND) {
    3.25 +				SDL_XBIOS_CentscreenInit(this);
    3.26  			}
    3.27 -
    3.28  			break;
    3.29  	}
    3.30  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/video/xbios/SDL_xbios_centscreen.c	Wed May 18 17:02:17 2005 +0000
     4.3 @@ -0,0 +1,53 @@
     4.4 +/*
     4.5 +    SDL - Simple DirectMedia Layer
     4.6 +    Copyright (C) 1997-2004 Sam Lantinga
     4.7 +
     4.8 +    This library is free software; you can redistribute it and/or
     4.9 +    modify it under the terms of the GNU Library General Public
    4.10 +    License as published by the Free Software Foundation; either
    4.11 +    version 2 of the License, or (at your option) any later version.
    4.12 +
    4.13 +    This library is distributed in the hope that it will be useful,
    4.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.16 +    Library General Public License for more details.
    4.17 +
    4.18 +    You should have received a copy of the GNU Library General Public
    4.19 +    License along with this library; if not, write to the Free
    4.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    4.21 +
    4.22 +    Sam Lantinga
    4.23 +    slouken@libsdl.org
    4.24 +*/
    4.25 +
    4.26 +/*
    4.27 +	Centscreen extension definitions
    4.28 +
    4.29 +	Patrice Mandin
    4.30 +*/
    4.31 +
    4.32 +#include <stdlib.h>
    4.33 +
    4.34 +#include <mint/falcon.h>
    4.35 +
    4.36 +#include "SDL_xbios.h"
    4.37 +#include "SDL_xbios_centscreen.h"
    4.38 +
    4.39 +void SDL_XBIOS_CentscreenInit(_THIS)
    4.40 +{
    4.41 +	centscreen_mode_t	curmode;
    4.42 +
    4.43 +	/* Reset current mode list */
    4.44 +	if (XBIOS_modelist) {
    4.45 +		free(XBIOS_modelist);
    4.46 +		XBIOS_nummodes = 0;
    4.47 +		XBIOS_modelist = NULL;
    4.48 +	}
    4.49 +
    4.50 +	/* Add current active mode */
    4.51 +	Vread(&curmode);
    4.52 +
    4.53 +	SDL_XBIOS_AddMode(this, -1, curmode.physx, curmode.physy, curmode.plan,
    4.54 +		SDL_FALSE
    4.55 +	);
    4.56 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/src/video/xbios/SDL_xbios_centscreen.h	Wed May 18 17:02:17 2005 +0000
     5.3 @@ -0,0 +1,115 @@
     5.4 +/*
     5.5 +    SDL - Simple DirectMedia Layer
     5.6 +    Copyright (C) 1997-2004 Sam Lantinga
     5.7 +
     5.8 +    This library is free software; you can redistribute it and/or
     5.9 +    modify it under the terms of the GNU Library General Public
    5.10 +    License as published by the Free Software Foundation; either
    5.11 +    version 2 of the License, or (at your option) any later version.
    5.12 +
    5.13 +    This library is distributed in the hope that it will be useful,
    5.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.16 +    Library General Public License for more details.
    5.17 +
    5.18 +    You should have received a copy of the GNU Library General Public
    5.19 +    License along with this library; if not, write to the Free
    5.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    5.21 +
    5.22 +    Sam Lantinga
    5.23 +    slouken@libsdl.org
    5.24 +*/
    5.25 +
    5.26 +/*
    5.27 +	Centscreen extension definitions
    5.28 +
    5.29 +	Patrice Mandin
    5.30 +*/
    5.31 +
    5.32 +#ifndef _SDL_xbios_centscreen_h
    5.33 +#define _SDL_xbios_centscreen_h
    5.34 +
    5.35 +#include <mint/falcon.h>	/* for trap_14_xxx macros */
    5.36 +
    5.37 +#include "SDL_xbios.h"
    5.38 +
    5.39 +/*--- Defines ---*/
    5.40 +
    5.41 +#ifndef C_CNTS
    5.42 +#define C_CNTS 0x434e5453L
    5.43 +#endif
    5.44 +
    5.45 +#define CSCREEN_ENERGYSTAR		(1<<9)
    5.46 +#define CSCREEN_SAVER			(1<<10)
    5.47 +#define CSCREEN_VIRTUAL			(1<<11)
    5.48 +#define CSCREEN_EXTCLOCK_CT2	(1<<12)
    5.49 +#define CSCREEN_EXTCLOCK		(1<<13)
    5.50 +#define CSCREEN_STANDARD		(1<<14)
    5.51 +#define CSCREEN_DEFAULT			(1<<15)
    5.52 +
    5.53 +/*--- Structures ---*/
    5.54 +
    5.55 +typedef struct {
    5.56 +	unsigned short	handle;	/* videomode handle */
    5.57 +	unsigned short	mode;	/* Falcon videomode code */
    5.58 +	unsigned short	physx;	/* visible width */
    5.59 +	unsigned short	physy;	/* visible height */
    5.60 +	unsigned short	plan;	/* bitplanes */
    5.61 +	unsigned short	logx;	/* virtual width */
    5.62 +	unsigned short	logy;	/* virtual height */
    5.63 +	unsigned short	eco;	/* screen saver delay */
    5.64 +	unsigned short	eco2;	/* energy star screen saver delay */
    5.65 +	unsigned short	wsize;	/* screen width (mm) */
    5.66 +	unsigned short	hsize;	/* screen height (mm) */
    5.67 +	unsigned short	dummy[21];
    5.68 +	unsigned char	name[32];	/* videomode name */
    5.69 +} __attribute__((packed)) centscreen_mode_t;
    5.70 +
    5.71 +/*--- Functions prototypes ---*/
    5.72 +
    5.73 +#define Vread(current_mode)	\
    5.74 +	(void)trap_14_wl((short)0x41,(long)(current_mode))
    5.75 +#define Vwrite(init_vdi, inparam, outparam)	\
    5.76 +	(long)trap_14_wwll((short)0x42,(short)(init_vdi),(long)(inparam),(long)(outparam))
    5.77 +#define Vattrib(inparam, outparam)	\
    5.78 +	(void)trap_14_wll((short)0x43,(long)(inparam),(long)(outparam))
    5.79 +#define Vcreate(inparam, outparam)	\
    5.80 +	(void)trap_14_wll((short)0x44,(long)(inparam),(long)(outparam))
    5.81 +#define Vdelete(handle)	\
    5.82 +	(long)trap_14_ww((short)0x45,(short)(handle))
    5.83 +#define Vfirst(mask,mode)	\
    5.84 +	(long)trap_14_wll((short)0x46,(long)(mask),(long)(mode))
    5.85 +#define Vnext(mask,mode)	\
    5.86 +	(long)trap_14_wll((short)0x47,(long)(mask),(long)(mode))
    5.87 +#define Vvalid(handle)	\
    5.88 +	(long)trap_14_ww((short)0x48,(short)(handle))
    5.89 +#define Vload()	\
    5.90 +	(long)trap_14_w((short)0x49)
    5.91 +#define Vsave()	\
    5.92 +	(long)trap_14_w((short)0x4a)
    5.93 +#define Vopen()	\
    5.94 +	(long)trap_14_w((short)0x4b)
    5.95 +#define Vclose()	\
    5.96 +	(long)trap_14_w((short)0x4c)
    5.97 +#define Vscroll(scrollmode)	\
    5.98 +	(long)trap_14_ww((short)0x4d,(short)(scrollmode))
    5.99 +#define Voffset()	\
   5.100 +	(long)trap_14_w((short)0x4e)
   5.101 +#define Vseek()	\
   5.102 +	(long)trap_14_w((short)0x4f)
   5.103 +#define Vlock(cmd)	\
   5.104 +	(long)trap_14_ww((short)0x50,(short)(cmd))
   5.105 +#define SetMon(montype)	\
   5.106 +	(long)trap_14_ww((short)0x51,(short)(montype))
   5.107 +#define MultiMon(cmd)	\
   5.108 +	(long)trap_14_ww((short)0x52,(short)(cmd))
   5.109 +#define VSizeComp()	\
   5.110 +	(long)trap_14_w((short)0x53)
   5.111 +#define Vsize(mode)	\
   5.112 +	(long)trap_14_wl((short)0x54,(long)(mode))
   5.113 +
   5.114 +/*--- Functions prototypes ---*/
   5.115 +
   5.116 +void SDL_XBIOS_CentscreenInit(_THIS);
   5.117 +
   5.118 +#endif /* _SDL_xbios_centscreen_h */