Mercurial > sdl-ios-xcode
annotate src/video/xbios/SDL_xbios_sb3.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
rev | line source |
---|---|
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
1 /* |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
3 Copyright (C) 1997-2004 Sam Lantinga |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
4 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Library General Public |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
8 version 2 of the License, or (at your option) any later version. |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
9 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
13 Library General Public License for more details. |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
14 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Library General Public |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
18 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
19 Sam Lantinga |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
20 slouken@libsdl.org |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
21 */ |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
22 #include "SDL_config.h" |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
23 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
24 /* |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
25 ScreenBlaster 3 functions |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
26 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
27 Patrice Mandin |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
28 */ |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
29 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
30 /*--- Includes ---*/ |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
31 |
1358
c71e05b4dc2e
More header massaging... works great on Windows. ;-)
Sam Lantinga <slouken@libsdl.org>
parents:
1338
diff
changeset
|
32 #include "SDL_stdinc.h" |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
33 #include "SDL_xbios.h" |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
34 #include "SDL_xbios_sb3.h" |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
35 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
36 /*--- Defines ---*/ |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
37 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
38 const int SDL_XBIOS_scpn_planes_device[] = { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
39 SCPN_DEV_1BPP, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
40 SCPN_DEV_4BPP, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
41 SCPN_DEV_8BPP, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
42 SCPN_DEV_16BPP, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
43 SCPN_DEV_2BPP, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
44 SCPN_DEV_4BPP, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
45 SCPN_DEV_1BPP |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
46 }; |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
47 |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
48 /*--- Functions ---*/ |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
49 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
50 int |
1668
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
51 SDL_XBIOS_SB3Usable(scpn_cookie_t * cookie_scpn) |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
52 { |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
53 scpn_screeninfo_t *scrinfo; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
54 int bpp; |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
55 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
56 /* Check if current SB3 mode is usable, i.e. 8 or 16bpp */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
57 scrinfo = cookie_scpn->screen_info; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
58 bpp = 1 << (SDL_XBIOS_scpn_planes_device[scrinfo->device]); |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
59 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
60 if ((bpp == 8) || (bpp == 16)) { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
61 return 1; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
62 } |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
63 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
64 return 0; |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
65 } |
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
66 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
67 void |
1668
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
68 SDL_XBIOS_SB3Init(_THIS, scpn_cookie_t * cookie_scpn) |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
69 { |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
70 scpn_screeninfo_t *scrinfo; |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
71 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
72 /* SB3 prevent changing video modes, we can only use current one */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
73 if (XBIOS_modelist) { |
1668
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
74 SDL_free(XBIOS_modelist); |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
75 XBIOS_nummodes = 0; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
76 XBIOS_modelist = NULL; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
77 } |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
78 |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
79 scrinfo = cookie_scpn->screen_info; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
80 scrinfo->h_pos = scrinfo->v_pos = 0; |
1042
0e7218843cfb
Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents:
1040
diff
changeset
|
81 |
1668
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
82 SDL_XBIOS_AddMode(this, |
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
83 -1, |
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
84 scrinfo->virtual_width, scrinfo->virtual_height, |
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
85 1 << (SDL_XBIOS_scpn_planes_device[scrinfo->device]), |
4da1ee79c9af
more tweaking indent options
Sam Lantinga <slouken@libsdl.org>
parents:
1662
diff
changeset
|
86 SDL_FALSE); |
1040
c6ed27c7d47d
Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
87 } |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
88 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
89 /* vi: set ts=4 sw=4 expandtab: */ |