2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2012 Sam Lantinga
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.
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.
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
22 #include "SDL_config.h"
25 Milan Xbios video functions
30 #include <mint/cookie.h>
31 #include <mint/falcon.h>
33 #include "SDL_xbios.h"
34 #include "SDL_xbios_milan.h"
36 #define NUM_PREDEFINED_MODES 7
42 static const predefined_mode_t mode_list[NUM_PREDEFINED_MODES]={
52 static const Uint8 mode_bpp[4]={
58 static int enum_actually_add;
59 static SDL_VideoDevice *enum_this;
63 static unsigned long /*cdecl*/ enumfunc(SCREENINFO *inf, unsigned long flag)
67 modeinfo.number = inf->devID;
68 modeinfo.width = inf->scrWidth;
69 modeinfo.height = inf->scrHeight;
70 modeinfo.depth = inf->scrPlanes;
73 SDL_XBIOS_AddMode(enum_this, enum_actually_add, &modeinfo);
78 void SDL_XBIOS_ListMilanModes(_THIS, int actually_add)
82 /* Read validated predefined modes */
83 for (i=0; i<NUM_PREDEFINED_MODES; i++) {
85 Uint16 deviceid = 0x1000 + (i<<4);
88 if (Validmode(deviceid + j)) {
91 modeinfo.number = deviceid + j;
92 modeinfo.width = mode_list[i].width;
93 modeinfo.height = mode_list[i].height;
94 modeinfo.depth = mode_bpp[j-1];
97 SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
102 /* Read custom created modes */
104 enum_actually_add = actually_add;
105 VsetScreen(-1, &enumfunc, MI_MAGIC, CMD_ENUMMODES);