1/*
2    SDL - Simple DirectMedia Layer
3    Copyright (C) 1997-2012 Sam Lantinga
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public
7    License as published by the Free Software Foundation; either
8    version 2 of the License, or (at your option) any later version.
9
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14
15    You should have received a copy of the GNU Library General Public
16    License along with this library; if not, write to the Free
17    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19    Sam Lantinga
20    slouken@libsdl.org
21*/
22#include "SDL_config.h"
23
24/*
25	Centscreen extension definitions
26
27	Patrice Mandin
28*/
29
30#ifndef _SDL_xbios_centscreen_h
31#define _SDL_xbios_centscreen_h
32
33#include <mint/falcon.h>	/* for trap_14_xxx macros */
34
35#include "SDL_xbios.h"
36
37/*--- Defines ---*/
38
39#define CSCREEN_ENERGYSTAR		(1<<9)
40#define CSCREEN_SAVER			(1<<10)
41#define CSCREEN_VIRTUAL			(1<<11)
42#define CSCREEN_EXTCLOCK_CT2	(1<<12)
43#define CSCREEN_EXTCLOCK		(1<<13)
44#define CSCREEN_STANDARD		(1<<14)
45#define CSCREEN_DEFAULT			(1<<15)
46
47/*--- Structures ---*/
48
49typedef struct {
50	unsigned short	handle;	/* videomode handle */
51	unsigned short	mode;	/* Falcon videomode code */
52	unsigned short	physx;	/* visible width */
53	unsigned short	physy;	/* visible height */
54	unsigned short	plan;	/* bitplanes */
55	unsigned short	logx;	/* virtual width */
56	unsigned short	logy;	/* virtual height */
57	unsigned short	eco;	/* screen saver delay */
58	unsigned short	eco2;	/* energy star screen saver delay */
59	unsigned short	wsize;	/* screen width (mm) */
60	unsigned short	hsize;	/* screen height (mm) */
61	unsigned short	dummy[21];
62	unsigned char	name[32];	/* videomode name */
63} centscreen_mode_t;
64
65/*--- Functions prototypes ---*/
66
67#define Vread(current_mode)	\
68	(void)trap_14_wl((short)0x41,(long)(current_mode))
69#define Vwrite(init_vdi, inparam, outparam)	\
70	(long)trap_14_wwll((short)0x42,(short)(init_vdi),(long)(inparam),(long)(outparam))
71#define Vattrib(inparam, outparam)	\
72	(void)trap_14_wll((short)0x43,(long)(inparam),(long)(outparam))
73#define Vcreate(inparam, outparam)	\
74	(void)trap_14_wll((short)0x44,(long)(inparam),(long)(outparam))
75#define Vdelete(handle)	\
76	(long)trap_14_ww((short)0x45,(short)(handle))
77#define Vfirst(mask,mode)	\
78	(long)trap_14_wll((short)0x46,(long)(mask),(long)(mode))
79#define Vnext(mask,mode)	\
80	(long)trap_14_wll((short)0x47,(long)(mask),(long)(mode))
81#define Vvalid(handle)	\
82	(long)trap_14_ww((short)0x48,(short)(handle))
83#define Vload()	\
84	(long)trap_14_w((short)0x49)
85#define Vsave()	\
86	(long)trap_14_w((short)0x4a)
87#define Vopen()	\
88	(long)trap_14_w((short)0x4b)
89#define Vclose()	\
90	(long)trap_14_w((short)0x4c)
91#define Vscroll(scrollmode)	\
92	(long)trap_14_ww((short)0x4d,(short)(scrollmode))
93#define Voffset()	\
94	(long)trap_14_w((short)0x4e)
95#define Vseek()	\
96	(long)trap_14_w((short)0x4f)
97#define Vlock(cmd)	\
98	(long)trap_14_ww((short)0x50,(short)(cmd))
99#define SetMon(montype)	\
100	(long)trap_14_ww((short)0x51,(short)(montype))
101#define MultiMon(cmd)	\
102	(long)trap_14_ww((short)0x52,(short)(cmd))
103#define VSizeComp()	\
104	(long)trap_14_w((short)0x53)
105#define Vsize(mode)	\
106	(long)trap_14_wl((short)0x54,(long)(mode))
107
108/*--- Functions prototypes ---*/
109
110int SDL_XBIOS_ListCentscreenModes(_THIS, int actually_add);
111void SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes);
112void SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle);
113
114#endif /* _SDL_xbios_centscreen_h */
115