Mercurial > sdl-ios-xcode
annotate src/video/xbios/SDL_xbiosmodes.c @ 2079:1ed2155b7ee4
From: Torsten Giebl
Subject: ALLOCA Patch for SDL-1.2
Newsgroups: gmane.comp.lib.sdl
Date: 2006-10-24 00:31:16 GMT
Hello !
As alloca.h is not available on CYGWIN and MinGW32
it should not be checked there or it should be checked
with -mno-cygwin using.
I am a total configure.in newbie, but i found the way
that things are handled in configure.in pretty bad for the
case CYGWIN with MinGW Mode or not.
Maybe this is not possible but i would like to
have a way to detect at the start for example CYGWIN
and then add. ask if configure was called with --enable-cygwin
for example. --enable-cygwin should be optional and disabled
by default as we want to have MinGW Mode by default.
Only if the user wants it he should be able to use it.
Then the whole configure.in would get add. questions
okay the system is CYGWIN with or without MinGW Mode.
The alloca.h thing for example is only
available under CYGWIN ( without MinGW Mode ).
CU
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 01 Dec 2006 20:25:03 +0000 |
parents | 790726541708 |
children | 2c835d58faad |
rev | line source |
---|---|
2072
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
1 /* |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
4 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
9 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
14 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
18 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
19 Sam Lantinga |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
20 slouken@libsdl.org |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
21 */ |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
22 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
23 #include <mint/osbind.h> |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
24 #include <mint/falcon.h> |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
25 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
26 #include "SDL_config.h" |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
27 #include "SDL_xbios.h" |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
28 #include "SDL_xbiosmodes.h" |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
29 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
30 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
31 typedef struct { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
32 int width,height,bpp; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
33 int modecode; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
34 int doubleline; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
35 } xbios_mode_t; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
36 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
37 static xbios_mode_t falcon_rgb_modes[]={ |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
38 {768, 480, 16, BPS16 | COL80 | OVERSCAN | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
39 {768, 240, 16, BPS16 | COL80 | OVERSCAN}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
40 {640, 400, 16, BPS16 | COL80 | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
41 {640, 200, 16, BPS16 | COL80}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
42 {384, 480, 16, BPS16 | OVERSCAN | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
43 {384, 240, 16, BPS16 | OVERSCAN}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
44 {320, 400, 16, BPS16 | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
45 {320, 200, 16, BPS16}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
46 {768, 480, 8, BPS8 | COL80 | OVERSCAN | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
47 {768, 240, 8, BPS8 | COL80 | OVERSCAN}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
48 {640, 400, 8, BPS8 | COL80 | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
49 {640, 200, 8, BPS8 | COL80}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
50 {384, 480, 8, BPS8 | OVERSCAN | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
51 {384, 240, 8, BPS8 | OVERSCAN}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
52 {320, 400, 8, BPS8 | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
53 {320, 200, 8, BPS8} |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
54 }; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
55 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
56 static xbios_mode_t falcon_vga_modes[]={ |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
57 {320, 480, 16, BPS16 }, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
58 {320, 240, 16, BPS16 | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
59 {640, 480, 8, BPS8 | COL80}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
60 {640, 240, 8, BPS8 | COL80 | VERTFLAG}, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
61 {320, 480, 8, BPS8 }, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
62 {320, 240, 8, BPS8 | VERTFLAG} |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
63 }; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
64 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
65 static void |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
66 SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
67 SDL_bool doubleline) |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
68 { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
69 SDL_VideoDisplay display; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
70 SDL_DisplayData *displaydata; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
71 SDL_DisplayMode mode; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
72 Uint32 Rmask, Gmask, Bmask, Amask; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
73 int orig_bpp; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
74 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
75 Rmask = Gmask = Bmask = Amask = 0; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
76 if (bpp == 16) { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
77 Rmask = 31<<11; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
78 Gmask = 63<<5; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
79 Bmask = 31; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
80 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
81 /* Memorize for c2p4 operation */ |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
82 orig_bpp = bpp; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
83 if (bpp == 4) { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
84 bpp = 8; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
85 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
86 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
87 mode.format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
88 mode.w = width; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
89 mode.h = height; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
90 mode.refresh_rate = 0; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
91 mode.driverdata = NULL; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
92 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
93 displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata)); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
94 if (!displaydata) { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
95 return; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
96 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
97 displaydata->modecode = modecode; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
98 displaydata->doubleline = doubleline; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
99 displaydata->c2p4 = (orig_bpp == 4); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
100 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
101 SDL_zero(display); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
102 display.desktop_mode = mode; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
103 display.current_mode = mode; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
104 display.driverdata = displaydata; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
105 SDL_AddVideoDisplay(&display); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
106 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
107 |
2073
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
108 /* Current video mode save/restore */ |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
109 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
110 static void |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
111 SDL_XBIOS_ModeSave(_THIS) |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
112 { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
113 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
114 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
115 data->old_vbase = Physbase(); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
116 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
117 switch (data->cookie_vdo >> 16) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
118 case VDO_ST: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
119 case VDO_STE: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
120 data->old_modecode = Getrez(); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
121 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
122 case VDO_TT: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
123 data->old_modecode = EgetShift(); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
124 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
125 case VDO_F30: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
126 data->old_modecode = VsetMode(-1); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
127 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
128 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
129 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
130 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
131 static void |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
132 SDL_XBIOS_ModeRestore(_THIS) |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
133 { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
134 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
135 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
136 switch (data->cookie_vdo >> 16) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
137 case VDO_ST: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
138 case VDO_STE: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
139 Setscreen(-1, data->old_vbase, data->old_modecode); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
140 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
141 case VDO_TT: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
142 Setscreen(-1, data->old_vbase, -1); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
143 EsetShift(data->old_modecode); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
144 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
145 case VDO_F30: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
146 Setscreen(-1, data->old_vbase, -1); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
147 VsetMode(data->old_modecode); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
148 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
149 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
150 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
151 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
152 /* Current palette save/restore */ |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
153 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
154 static void |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
155 SDL_XBIOS_PaletteSave(_THIS) |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
156 { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
157 int i; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
158 Uint16 *palette; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
159 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
160 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
161 data->old_numcol = 0; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
162 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
163 switch (data->cookie_vdo >> 16) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
164 case VDO_ST: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
165 case VDO_STE: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
166 switch (data->old_modecode << 8) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
167 case ST_LOW: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
168 data->old_numcol = 16; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
169 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
170 case ST_MED: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
171 data->old_numcol = 4; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
172 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
173 case ST_HIGH: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
174 data->old_numcol = 2; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
175 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
176 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
177 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
178 palette = (Uint16 *) data->old_palette; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
179 for (i = 0; i < data->old_numcol; i++) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
180 *palette++ = Setcolor(i, -1); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
181 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
182 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
183 case VDO_TT: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
184 switch (data->old_modecode & ES_MODE) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
185 case TT_LOW: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
186 data->old_numcol = 256; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
187 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
188 case ST_LOW: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
189 case TT_MED: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
190 data->old_numcol = 16; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
191 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
192 case ST_MED: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
193 data->old_numcol = 4; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
194 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
195 case ST_HIGH: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
196 case TT_HIGH: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
197 data->old_numcol = 2; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
198 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
199 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
200 if (data->old_numcol) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
201 EgetPalette(0, data->old_numcol, data->old_palette); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
202 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
203 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
204 case VDO_F30: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
205 data->old_numcol = 1 << (1 << (data->old_modecode & NUMCOLS)); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
206 if (data->old_numcol > 256) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
207 data->old_numcol = 0; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
208 } else { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
209 VgetRGB(0, data->old_numcol, data->old_palette); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
210 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
211 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
212 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
213 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
214 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
215 static void |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
216 SDL_XBIOS_PaletteRestore(_THIS) |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
217 { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
218 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
219 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
220 if (data->old_numcol == 0) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
221 return; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
222 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
223 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
224 switch (data->cookie_vdo >> 16) { |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
225 case VDO_ST: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
226 case VDO_STE: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
227 Setpalette(data->old_palette); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
228 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
229 case VDO_TT: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
230 EsetPalette(0, data->old_numcol, data->old_palette); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
231 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
232 case VDO_F30: |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
233 VsetRGB(0, data->old_numcol, data->old_palette); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
234 break; |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
235 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
236 } |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
237 |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
238 /* Public functions for use by the driver */ |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
239 |
2072
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
240 void |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
241 SDL_XBIOS_InitModes(_THIS) |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
242 { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
243 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
244 |
2073
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
245 SDL_XBIOS_PaletteSave(_this); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
246 SDL_XBIOS_ModeSave(_this); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
247 |
2072
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
248 switch (data->cookie_vdo >> 16) { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
249 case VDO_ST: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
250 case VDO_STE: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
251 { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
252 SDL_XBIOS_AddMode(_this, 320, 200, 4, ST_LOW >> 8, SDL_FALSE); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
253 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
254 break; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
255 case VDO_TT: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
256 { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
257 SDL_XBIOS_AddMode(_this, 320, 480, 8, TT_LOW, SDL_FALSE); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
258 /* Software double-lined mode */ |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
259 SDL_XBIOS_AddMode(_this, 320, 240, 8, TT_LOW, SDL_TRUE); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
260 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
261 break; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
262 case VDO_F30: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
263 { |
2073
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
264 Uint16 modecodemask = data->old_modecode & (VGA | PAL); |
2072
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
265 int i; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
266 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
267 switch (VgetMonitor()) { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
268 case MONITOR_MONO: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
269 /* Not usable */ |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
270 break; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
271 case MONITOR_RGB: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
272 case MONITOR_TV: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
273 for (i=0; i<sizeof(falcon_rgb_modes)/sizeof(xbios_mode_t); i++) { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
274 SDL_XBIOS_AddMode(_this, falcon_rgb_modes[i].width, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
275 falcon_rgb_modes[i].height, falcon_rgb_modes[i].bpp, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
276 falcon_rgb_modes[i].modecode & modecodemask, SDL_FALSE); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
277 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
278 break; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
279 case MONITOR_VGA: |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
280 for (i=0; i<sizeof(falcon_vga_modes)/sizeof(xbios_mode_t); i++) { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
281 SDL_XBIOS_AddMode(_this, falcon_vga_modes[i].width, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
282 falcon_vga_modes[i].height, falcon_vga_modes[i].bpp, |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
283 falcon_vga_modes[i].modecode & modecodemask, SDL_FALSE); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
284 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
285 break; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
286 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
287 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
288 break; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
289 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
290 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
291 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
292 void |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
293 SDL_XBIOS_GetDisplayModes(_THIS) |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
294 { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
295 SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
296 SDL_DisplayMode mode; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
297 //SDL_AddDisplayMode(_this->current_display, &mode); |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
298 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
299 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
300 int |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
301 SDL_XBIOS_SetDisplayMode(_THIS, SDL_DisplayMode * mode) |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
302 { |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
303 //SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
304 return -1; |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
305 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
306 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
307 void |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
308 SDL_XBIOS_QuitModes(_THIS) |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
309 { |
2073
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
310 SDL_XBIOS_ModeRestore(_this); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
311 SDL_XBIOS_PaletteRestore(_this); |
790726541708
Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents:
2072
diff
changeset
|
312 Vsync(); |
2072
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
313 } |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
314 |
4b3f98a9a2c1
xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff
changeset
|
315 /* vi: set ts=4 sw=4 expandtab: */ |