annotate src/video/xbios/SDL_xbiosmodes.c @ 2633:6b0d1f494c10 gsoc2008_force_feedback

Fixed typo.
author Edgar Simo <bobbens@gmail.com>
date Wed, 06 Aug 2008 11:10:44 +0000
parents 2c835d58faad
children e1da92da346c
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
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
31 typedef struct
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
32 {
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
33 int width, height, bpp;
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
34 int modecode;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
35 int doubleline;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
36 } xbios_mode_t;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
37
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
38 static xbios_mode_t falcon_rgb_modes[] = {
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
39 {768, 480, 16, BPS16 | COL80 | OVERSCAN | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
40 {768, 240, 16, BPS16 | COL80 | OVERSCAN},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
41 {640, 400, 16, BPS16 | COL80 | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
42 {640, 200, 16, BPS16 | COL80},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
43 {384, 480, 16, BPS16 | OVERSCAN | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
44 {384, 240, 16, BPS16 | OVERSCAN},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
45 {320, 400, 16, BPS16 | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
46 {320, 200, 16, BPS16},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
47 {768, 480, 8, BPS8 | COL80 | OVERSCAN | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
48 {768, 240, 8, BPS8 | COL80 | OVERSCAN},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
49 {640, 400, 8, BPS8 | COL80 | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
50 {640, 200, 8, BPS8 | COL80},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
51 {384, 480, 8, BPS8 | OVERSCAN | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
52 {384, 240, 8, BPS8 | OVERSCAN},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
53 {320, 400, 8, BPS8 | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
54 {320, 200, 8, BPS8}
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
55 };
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
56
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
57 static xbios_mode_t falcon_vga_modes[] = {
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
58 {320, 480, 16, BPS16},
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
59 {320, 240, 16, BPS16 | VERTFLAG},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
60 {640, 480, 8, BPS8 | COL80},
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
61 {640, 240, 8, BPS8 | COL80 | VERTFLAG},
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
62 {320, 480, 8, BPS8},
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
63 {320, 240, 8, BPS8 | VERTFLAG}
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
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
66 static void
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
67 SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode,
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
68 SDL_bool doubleline)
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
69 {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
70 SDL_VideoDisplay display;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
71 SDL_DisplayData *displaydata;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
72 SDL_DisplayMode mode;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
73 Uint32 Rmask, Gmask, Bmask, Amask;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
74 int orig_bpp;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
75
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
76 Rmask = Gmask = Bmask = Amask = 0;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
77 if (bpp == 16) {
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
78 Rmask = 31 << 11;
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
79 Gmask = 63 << 5;
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
80 Bmask = 31;
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
81 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
82 /* Memorize for c2p4 operation */
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
83 orig_bpp = bpp;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
84 if (bpp == 4) {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
85 bpp = 8;
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
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
88 mode.format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
89 mode.w = width;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
90 mode.h = height;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
91 mode.refresh_rate = 0;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
92 mode.driverdata = NULL;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
93
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
94 displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
95 if (!displaydata) {
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
96 return;
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
97 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
98 displaydata->modecode = modecode;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
99 displaydata->doubleline = doubleline;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
100 displaydata->c2p4 = (orig_bpp == 4);
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
101
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
102 SDL_zero(display);
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
103 display.desktop_mode = mode;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
104 display.current_mode = mode;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
105 display.driverdata = displaydata;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
106 SDL_AddVideoDisplay(&display);
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
107 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
108
2073
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
109 /* Current video mode save/restore */
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
110
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
111 static void
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
112 SDL_XBIOS_ModeSave(_THIS)
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
113 {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
114 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
115
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
116 data->old_vbase = Physbase();
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
117
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
118 switch (data->cookie_vdo >> 16) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
119 case VDO_ST:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
120 case VDO_STE:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
121 data->old_modecode = Getrez();
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
122 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
123 case VDO_TT:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
124 data->old_modecode = EgetShift();
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
125 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
126 case VDO_F30:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
127 data->old_modecode = VsetMode(-1);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
128 break;
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
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
132 static void
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
133 SDL_XBIOS_ModeRestore(_THIS)
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
134 {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
135 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
136
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
137 switch (data->cookie_vdo >> 16) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
138 case VDO_ST:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
139 case VDO_STE:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
140 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
141 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
142 case VDO_TT:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
143 Setscreen(-1, data->old_vbase, -1);
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
144 EsetShift(data->old_modecode);
2073
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
145 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
146 case VDO_F30:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
147 Setscreen(-1, data->old_vbase, -1);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
148 VsetMode(data->old_modecode);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
149 break;
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
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
153 /* Current palette save/restore */
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
154
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
155 static void
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
156 SDL_XBIOS_PaletteSave(_THIS)
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
157 {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
158 int i;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
159 Uint16 *palette;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
160 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
161
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
162 data->old_numcol = 0;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
163
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
164 switch (data->cookie_vdo >> 16) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
165 case VDO_ST:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
166 case VDO_STE:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
167 switch (data->old_modecode << 8) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
168 case ST_LOW:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
169 data->old_numcol = 16;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
170 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
171 case ST_MED:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
172 data->old_numcol = 4;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
173 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
174 case ST_HIGH:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
175 data->old_numcol = 2;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
176 break;
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
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
179 palette = (Uint16 *) data->old_palette;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
180 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
181 *palette++ = Setcolor(i, -1);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
182 }
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
183 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
184 case VDO_TT:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
185 switch (data->old_modecode & ES_MODE) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
186 case TT_LOW:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
187 data->old_numcol = 256;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
188 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
189 case ST_LOW:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
190 case TT_MED:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
191 data->old_numcol = 16;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
192 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
193 case ST_MED:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
194 data->old_numcol = 4;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
195 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
196 case ST_HIGH:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
197 case TT_HIGH:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
198 data->old_numcol = 2;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
199 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
200 }
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
201 if (data->old_numcol) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
202 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
203 }
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
204 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
205 case VDO_F30:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
206 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
207 if (data->old_numcol > 256) {
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
208 data->old_numcol = 0;
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
209 } else {
2073
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
210 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
211 }
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
212 break;
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
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
216 static void
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
217 SDL_XBIOS_PaletteRestore(_THIS)
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
218 {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
219 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
220
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
221 if (data->old_numcol == 0) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
222 return;
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
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
225 switch (data->cookie_vdo >> 16) {
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
226 case VDO_ST:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
227 case VDO_STE:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
228 Setpalette(data->old_palette);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
229 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
230 case VDO_TT:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
231 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
232 break;
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
233 case VDO_F30:
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
234 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
235 break;
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
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
239 /* Public functions for use by the driver */
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
240
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
241 void
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
242 SDL_XBIOS_InitModes(_THIS)
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
243 {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
244 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
245
2073
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
246 SDL_XBIOS_PaletteSave(_this);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
247 SDL_XBIOS_ModeSave(_this);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
248
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
249 switch (data->cookie_vdo >> 16) {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
250 case VDO_ST:
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
251 case VDO_STE:
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
252 {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
253 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
254 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
255 break;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
256 case VDO_TT:
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
257 {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
258 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
259 /* Software double-lined mode */
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
260 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
261 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
262 break;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
263 case VDO_F30:
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
264 {
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
265 Uint16 modecodemask = data->old_modecode & (VGA | PAL);
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
266 int i;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
267
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
268 switch (VgetMonitor()) {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
269 case MONITOR_MONO:
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
270 /* Not usable */
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
271 break;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
272 case MONITOR_RGB:
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
273 case MONITOR_TV:
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
274 for (i = 0;
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
275 i < sizeof(falcon_rgb_modes) / sizeof(xbios_mode_t);
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
276 i++) {
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
277 SDL_XBIOS_AddMode(_this, falcon_rgb_modes[i].width,
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
278 falcon_rgb_modes[i].height,
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
279 falcon_rgb_modes[i].bpp,
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
280 falcon_rgb_modes[i].
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
281 modecode & modecodemask, SDL_FALSE);
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
282 }
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
283 break;
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
284 case MONITOR_VGA:
2120
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
285 for (i = 0;
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
286 i < sizeof(falcon_vga_modes) / sizeof(xbios_mode_t);
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
287 i++) {
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
288 SDL_XBIOS_AddMode(_this, falcon_vga_modes[i].width,
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
289 falcon_vga_modes[i].height,
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
290 falcon_vga_modes[i].bpp,
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
291 falcon_vga_modes[i].
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
292 modecode & modecodemask, SDL_FALSE);
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
293 }
2c835d58faad make indent
Sam Lantinga <slouken@libsdl.org>
parents: 2073
diff changeset
294 break;
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
295 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
296 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
297 break;
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
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
301 void
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
302 SDL_XBIOS_GetDisplayModes(_THIS)
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
303 {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
304 SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
305 SDL_DisplayMode mode;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
306 //SDL_AddDisplayMode(_this->current_display, &mode);
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
307 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
308
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
309 int
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
310 SDL_XBIOS_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
311 {
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
312 //SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata;
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
313 return -1;
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
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
316 void
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
317 SDL_XBIOS_QuitModes(_THIS)
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
318 {
2073
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
319 SDL_XBIOS_ModeRestore(_this);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
320 SDL_XBIOS_PaletteRestore(_this);
790726541708 Save/restore current video mode and palette
Patrice Mandin <patmandin@gmail.com>
parents: 2072
diff changeset
321 Vsync();
2072
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
322 }
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
323
4b3f98a9a2c1 xbios: preliminary video mode init
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
324 /* vi: set ts=4 sw=4 expandtab: */