comparison src/video/xbios/SDL_xbios_sb3.c @ 1040:c6ed27c7d47d

Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
author Patrice Mandin <patmandin@gmail.com>
date Tue, 22 Feb 2005 17:57:40 +0000
parents
children 0e7218843cfb
comparison
equal deleted inserted replaced
1039:68f2b997758e 1040:c6ed27c7d47d
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2004 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
23 /*
24 ScreenBlaster 3 functions
25
26 Patrice Mandin
27 */
28
29 /*--- Includes ---*/
30
31 #include "SDL_xbios.h"
32 #include "SDL_xbios_sb3.h"
33
34 /*--- Defines ---*/
35
36 const int SDL_XBIOS_scpn_planes_device[]={
37 SCPN_DEV_1BPP,
38 SCPN_DEV_4BPP,
39 SCPN_DEV_8BPP,
40 SCPN_DEV_16BPP,
41 SCPN_DEV_2BPP,
42 SCPN_DEV_4BPP,
43 SCPN_DEV_1BPP
44 };
45
46 /*--- Functions ---*/
47
48 int SDL_XBIOS_SB3Usable(scpn_cookie_t *cookie_scpn)
49 {
50 scpn_screeninfo_t *scrinfo;
51 int bpp;
52
53 /* Check if current SB3 mode is usable, i.e. 8 or 16bpp */
54 scrinfo = cookie_scpn->screen_info;
55 bpp = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]);
56
57 if ((bpp==8) || (bpp==16)) {
58 return 1;
59 }
60
61 return 0;
62 }
63
64 void SDL_XBIOS_SB3Init(_THIS, scpn_cookie_t *cookie_scpn)
65 {
66 xbiosmode_t *current_mode;
67 scpn_screeninfo_t *scrinfo;
68
69 /* SB3 prevent changing video modes, we can only use current one */
70
71 XBIOS_nummodes = 1;
72 current_mode = XBIOS_modelist;
73 current_mode->number = -1;
74
75 scrinfo = cookie_scpn->screen_info;
76 current_mode->width = scrinfo->virtual_width;
77 current_mode->height = scrinfo->virtual_height;
78 current_mode->depth = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]);
79 scrinfo->h_pos = scrinfo->v_pos = 0;
80 }