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