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

Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
author Patrice Mandin <patmandin@gmail.com>
date Tue, 22 Feb 2005 17:57:40 +0000
parents
children 0e7218843cfb
comparison
equal deleted inserted replaced
1039:68f2b997758e 1040:c6ed27c7d47d
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2004 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22
23 /*
24 Blowup extension definitions
25
26 Patrice Mandin
27 */
28
29 #include "SDL_xbios.h"
30 #include "SDL_xbios_blowup.h"
31
32 void SDL_XBIOS_BlowupInit(_THIS, blow_cookie_t *cookie_blow)
33 {
34 int i, num_mode, bank, keep_old;
35 xbiosmode_t *current_mode;
36 blow_mode_t *blow_mode;
37
38 current_mode = XBIOS_modelist;
39 for (i=0;i<XBIOS_nummodes;i++) {
40 keep_old=1; /* use default mode */
41 blow_mode = NULL;
42 switch (current_mode->depth) {
43 case 1:
44 num_mode=0;
45 break;
46 case 2:
47 num_mode=1;
48 break;
49 case 4:
50 num_mode=2;
51 break;
52 case 8:
53 num_mode=3;
54 break;
55 case 16:
56 num_mode=4;
57 break;
58 default:
59 num_mode=-1;
60 break;
61 }
62
63 /* Check which bank of modes to use */
64 if (num_mode>=0) {
65 bank = cookie_blow->num_mode[num_mode];
66 blow_mode = &(cookie_blow->blowup_modes[num_mode+(bank*5)]);
67
68 /* Check extended mode enabled */
69 if (blow_mode->enabled == 0) {
70 /* Check monitor needed for this mode */
71 if ((blow_mode->monitor == cookie_blow->montype)
72 || ((blow_mode->monitor == MONITOR_TV)
73 && (cookie_blow->montype == MONITOR_RGB))
74 || ((blow_mode->monitor == MONITOR_RGB)
75 && (cookie_blow->montype == MONITOR_TV)))
76 {
77 keep_old = 0; /* we can use this extended mode */
78 }
79 }
80 }
81
82 if (keep_old) {
83 /* disable blowup for this mode */
84 current_mode->number |= (1<<15);
85 } else {
86 /* Update mode size */
87 current_mode->width = blow_mode->width +1;
88 current_mode->height = blow_mode->height +1;
89 }
90
91 current_mode++;
92 }
93 }