annotate src/video/xbios/SDL_xbios.c @ 4202:7ec1d9a34164 SDL-1.2

Make the list NULL terminated.
author Patrice Mandin <patmandin@gmail.com>
date Sun, 20 Sep 2009 18:14:35 +0000
parents b10a73ebd7fd
children 7b27a7fc4fdf
rev   line source
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 /*
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
4159
a1b03ba2fcd0 Updated copyright date
Sam Lantinga <slouken@libsdl.org>
parents: 4155
diff changeset
3 Copyright (C) 1997-2009 Sam Lantinga
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1256
diff changeset
6 modify it under the terms of the GNU Lesser General Public
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1256
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1256
diff changeset
13 Lesser General Public License for more details.
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1256
diff changeset
15 You should have received a copy of the GNU Lesser General Public
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1256
diff changeset
16 License along with this library; if not, write to the Free Software
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1256
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 Sam Lantinga
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 slouken@libsdl.org
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 */
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
22 #include "SDL_config.h"
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 /*
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 * Xbios SDL video driver
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26 *
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27 * Patrice Mandin
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28 */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
30 #include <sys/stat.h>
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31 #include <unistd.h>
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
32
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33 /* Mint includes */
557
0ce5a68278fd Updated Atari port for new system headers (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents: 508
diff changeset
34 #include <mint/cookie.h>
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 #include <mint/osbind.h>
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
36 #include <mint/falcon.h>
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
37
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
38 #include "SDL_video.h"
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
39 #include "SDL_mouse.h"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
40 #include "../SDL_sysvideo.h"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
41 #include "../SDL_pixels_c.h"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
42 #include "../../events/SDL_events_c.h"
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43
1412
a8181c4040b8 Fixed include files
Patrice Mandin <patmandin@gmail.com>
parents: 1402
diff changeset
44 #include "../ataricommon/SDL_ataric2p_s.h"
a8181c4040b8 Fixed include files
Patrice Mandin <patmandin@gmail.com>
parents: 1402
diff changeset
45 #include "../ataricommon/SDL_atarievents_c.h"
a8181c4040b8 Fixed include files
Patrice Mandin <patmandin@gmail.com>
parents: 1402
diff changeset
46 #include "../ataricommon/SDL_atarimxalloc_c.h"
a8181c4040b8 Fixed include files
Patrice Mandin <patmandin@gmail.com>
parents: 1402
diff changeset
47 #include "../ataricommon/SDL_atarigl_c.h"
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48 #include "SDL_xbios.h"
1040
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
49 #include "SDL_xbios_blowup.h"
1061
5023cde12cbd Add Falcon Centscreen extension support
Patrice Mandin <patmandin@gmail.com>
parents: 1043
diff changeset
50 #include "SDL_xbios_centscreen.h"
1040
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
51 #include "SDL_xbios_sb3.h"
3904
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
52 #include "SDL_xbios_tveille.h"
4195
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
53 #include "SDL_xbios_milan.h"
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 #define XBIOS_VID_DRIVER_NAME "xbios"
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
56
4155
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
57 #ifndef C_fVDI
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
58 #define C_fVDI 0x66564449L
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
59 #endif
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
60
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
61 /* Debug print info */
1043
21d1d05aad39 Disable debug code
Patrice Mandin <patmandin@gmail.com>
parents: 1042
diff changeset
62 #if 0
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
63 #define DEBUG_PRINT(what) \
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
64 { \
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
65 printf what; \
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
66 }
1043
21d1d05aad39 Disable debug code
Patrice Mandin <patmandin@gmail.com>
parents: 1042
diff changeset
67 #define DEBUG_VIDEO_XBIOS 1
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
68 #else
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
69 #define DEBUG_PRINT(what)
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
70 #undef DEBUG_VIDEO_XBIOS
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
71 #endif
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
72
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
73 /* Initialization/Query functions */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 static int XBIOS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78 static void XBIOS_VideoQuit(_THIS);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
79
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80 /* Hardware surface functions */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
81 static int XBIOS_AllocHWSurface(_THIS, SDL_Surface *surface);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82 static int XBIOS_LockHWSurface(_THIS, SDL_Surface *surface);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84 static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
85 static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
86 static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
87
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
88 #if SDL_VIDEO_OPENGL
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
89 /* OpenGL functions */
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
90 static void XBIOS_GL_SwapBuffers(_THIS);
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
91 #endif
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
92
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
93 /* To setup palette */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
94
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
95 static unsigned short TT_palette[256];
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
96 static unsigned long F30_palette[256];
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
97
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
98 /* Default list of video modes */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
99
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
100 static const xbiosmode_t stmodes[1]={
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
101 {ST_LOW>>8,320,200,4, XBIOSMODE_C2P}
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
102 };
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
103
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
104 static const xbiosmode_t ttmodes[2]={
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
105 {TT_LOW,320,480,8, XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
106 {TT_LOW,320,240,8, XBIOSMODE_C2P|XBIOSMODE_DOUBLELINE}
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
107 };
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
108
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
109 static const xbiosmode_t falconrgbmodes[16]={
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
110 {BPS16|COL80|OVERSCAN|VERTFLAG,768,480,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
111 {BPS16|COL80|OVERSCAN,768,240,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
112 {BPS16|COL80|VERTFLAG,640,400,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
113 {BPS16|COL80,640,200,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
114 {BPS16|OVERSCAN|VERTFLAG,384,480,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
115 {BPS16|OVERSCAN,384,240,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
116 {BPS16|VERTFLAG,320,400,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
117 {BPS16,320,200,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
118 {BPS8|COL80|OVERSCAN|VERTFLAG,768,480,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
119 {BPS8|COL80|OVERSCAN,768,240,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
120 {BPS8|COL80|VERTFLAG,640,400,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
121 {BPS8|COL80,640,200,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
122 {BPS8|OVERSCAN|VERTFLAG,384,480,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
123 {BPS8|OVERSCAN,384,240,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
124 {BPS8|VERTFLAG,320,400,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
125 {BPS8,320,200,8,XBIOSMODE_C2P}
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
126 };
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
127
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
128 static const xbiosmode_t falconvgamodes[6]={
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
129 {BPS16,320,480,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
130 {BPS16|VERTFLAG,320,240,16,0},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
131 {BPS8|COL80,640,480,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
132 {BPS8|COL80|VERTFLAG,640,240,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
133 {BPS8,320,480,8,XBIOSMODE_C2P},
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
134 {BPS8|VERTFLAG,320,240,8,XBIOSMODE_C2P}
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
135 };
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
136
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
137 /* Xbios driver bootstrap functions */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
138
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
139 static int XBIOS_Available(void)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
140 {
1040
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
141 unsigned long cookie_vdo, cookie_mil, cookie_hade, cookie_scpn;
4155
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
142 unsigned long cookie_fvdi;
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
143 const char *envr = SDL_getenv("SDL_VIDEODRIVER");
797
d0f1e34290d6 Milan and Hades Atari clones do not have an Atari video chip
Patrice Mandin <patmandin@gmail.com>
parents: 769
diff changeset
144
d0f1e34290d6 Milan and Hades Atari clones do not have an Atari video chip
Patrice Mandin <patmandin@gmail.com>
parents: 769
diff changeset
145 /* Milan/Hades Atari clones do not have an Atari video chip */
4199
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
146 if ( /*(Getcookie(C__MIL, &cookie_mil) == C_FOUND) ||*/
797
d0f1e34290d6 Milan and Hades Atari clones do not have an Atari video chip
Patrice Mandin <patmandin@gmail.com>
parents: 769
diff changeset
147 (Getcookie(C_hade, &cookie_hade) == C_FOUND) ) {
d0f1e34290d6 Milan and Hades Atari clones do not have an Atari video chip
Patrice Mandin <patmandin@gmail.com>
parents: 769
diff changeset
148 return 0;
d0f1e34290d6 Milan and Hades Atari clones do not have an Atari video chip
Patrice Mandin <patmandin@gmail.com>
parents: 769
diff changeset
149 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
150
4155
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
151 /* fVDI means graphic card, so no Xbios with it */
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
152 if (Getcookie(C_fVDI, &cookie_fvdi) == C_FOUND) {
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
153 if (!envr) {
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
154 return 0;
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
155 }
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
156 if (SDL_strcmp(envr, XBIOS_VID_DRIVER_NAME)!=0) {
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
157 return 0;
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
158 }
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
159 /* Except if we force Xbios usage, through env var */
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
160 }
4d743a3d0bc1 Disable Xbios video driver if FVDI present, but still allow it to be used when setting SDL_VIDEODRIVER
Patrice Mandin <patmandin@gmail.com>
parents: 3904
diff changeset
161
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
162 /* Cookie _VDO present ? if not, assume ST machine */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
163 if (Getcookie(C__VDO, &cookie_vdo) != C_FOUND) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
164 cookie_vdo = VDO_ST << 16;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
165 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
166
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
167 /* Test if we have a monochrome monitor plugged in */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
168 switch( cookie_vdo >>16) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
169 case VDO_ST:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
170 case VDO_STE:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
171 if ( Getrez() == (ST_HIGH>>8) )
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
172 return 0;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
173 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
174 case VDO_TT:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
175 if ( (EgetShift() & ES_MODE) == TT_HIGH)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
176 return 0;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
177 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
178 case VDO_F30:
1322
a4566d07718f Update for mintlib 0.57.6 (m68k-atari-mint libc)
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
179 if ( VgetMonitor() == MONITOR_MONO)
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
180 return 0;
1040
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
181 if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
182 if (!SDL_XBIOS_SB3Usable((scpn_cookie_t *)cookie_scpn)) {
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
183 return 0;
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
184 }
c6ed27c7d47d Preliminary support for Blowup and Screen Blaster 3 extensions on Atari Falcon 030
Patrice Mandin <patmandin@gmail.com>
parents: 993
diff changeset
185 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
186 break;
4195
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
187 case VDO_MILAN:
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
188 break;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
189 default:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
190 return 0;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
191 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
192
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
193 return 1;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
194 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
195
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
196 static void XBIOS_DeleteDevice(SDL_VideoDevice *device)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
197 {
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
198 SDL_free(device->hidden);
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
199 SDL_free(device);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
200 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
201
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
202 static SDL_VideoDevice *XBIOS_CreateDevice(int devindex)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
203 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
204 SDL_VideoDevice *device;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
205
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
206 /* Initialize all variables that we clean on shutdown */
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
207 device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
208 if ( device ) {
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
209 SDL_memset(device, 0, (sizeof *device));
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
210 device->hidden = (struct SDL_PrivateVideoData *)
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
211 SDL_malloc((sizeof *device->hidden));
989
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
212 device->gl_data = (struct SDL_PrivateGLData *)
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
213 SDL_malloc((sizeof *device->gl_data));
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
214 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
215 if ( (device == NULL) || (device->hidden == NULL) ) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
216 SDL_OutOfMemory();
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
217 if ( device ) {
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
218 SDL_free(device);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
219 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
220 return(0);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
221 }
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
222 SDL_memset(device->hidden, 0, (sizeof *device->hidden));
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
223 SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
224
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
225 /* Video functions */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
226 device->VideoInit = XBIOS_VideoInit;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
227 device->ListModes = XBIOS_ListModes;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
228 device->SetVideoMode = XBIOS_SetVideoMode;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
229 device->SetColors = XBIOS_SetColors;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
230 device->UpdateRects = NULL;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
231 device->VideoQuit = XBIOS_VideoQuit;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
232 device->AllocHWSurface = XBIOS_AllocHWSurface;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
233 device->LockHWSurface = XBIOS_LockHWSurface;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
234 device->UnlockHWSurface = XBIOS_UnlockHWSurface;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
235 device->FlipHWSurface = XBIOS_FlipHWSurface;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
236 device->FreeHWSurface = XBIOS_FreeHWSurface;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
237
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
238 #if SDL_VIDEO_OPENGL
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
239 /* OpenGL functions */
989
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
240 device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary;
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
241 device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress;
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
242 device->GL_GetAttribute = SDL_AtariGL_GetAttribute;
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
243 device->GL_MakeCurrent = SDL_AtariGL_MakeCurrent;
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
244 device->GL_SwapBuffers = XBIOS_GL_SwapBuffers;
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
245 #endif
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
246
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
247 /* Events */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
248 device->InitOSKeymap = Atari_InitOSKeymap;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
249 device->PumpEvents = Atari_PumpEvents;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
250
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
251 device->free = XBIOS_DeleteDevice;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
252
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
253 return device;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
254 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
255
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
256 VideoBootStrap XBIOS_bootstrap = {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
257 XBIOS_VID_DRIVER_NAME, "Atari Xbios driver",
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
258 XBIOS_Available, XBIOS_CreateDevice
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
259 };
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
260
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
261 void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo)
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
262 {
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
263 int i = 0;
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
264
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
265 switch(modeinfo->depth) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
266 case 15:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
267 case 16:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
268 i = 1;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
269 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
270 case 24:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
271 i = 2;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
272 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
273 case 32:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
274 i = 3;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
275 break;
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
276 }
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
277
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
278 if ( actually_add ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
279 SDL_Rect saved_rect[2];
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
280 xbiosmode_t saved_mode[2];
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
281 int b, j;
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
282
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
283 /* Add the mode, sorted largest to smallest */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
284 b = 0;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
285 j = 0;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
286 while ( (SDL_modelist[i][j]->w > modeinfo->width) ||
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
287 (SDL_modelist[i][j]->h > modeinfo->height) ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
288 ++j;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
289 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
290 /* Skip modes that are already in our list */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
291 if ( (SDL_modelist[i][j]->w == modeinfo->width) &&
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
292 (SDL_modelist[i][j]->h == modeinfo->height) ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
293 return;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
294 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
295 /* Insert the new mode */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
296 saved_rect[b] = *SDL_modelist[i][j];
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
297 SDL_memcpy(&saved_mode[b], SDL_xbiosmode[i][j], sizeof(xbiosmode_t));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
298 SDL_modelist[i][j]->w = modeinfo->width;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
299 SDL_modelist[i][j]->h = modeinfo->height;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
300 SDL_memcpy(SDL_xbiosmode[i][j], modeinfo, sizeof(xbiosmode_t));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
301 /* Everybody scoot down! */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
302 if ( saved_rect[b].w && saved_rect[b].h ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
303 for ( ++j; SDL_modelist[i][j]->w; ++j ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
304 saved_rect[!b] = *SDL_modelist[i][j];
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
305 memcpy(&saved_mode[!b], SDL_xbiosmode[i][j], sizeof(xbiosmode_t));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
306 *SDL_modelist[i][j] = saved_rect[b];
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
307 SDL_memcpy(SDL_xbiosmode[i][j], &saved_mode[b], sizeof(xbiosmode_t));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
308 b = !b;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
309 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
310 *SDL_modelist[i][j] = saved_rect[b];
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
311 SDL_memcpy(SDL_xbiosmode[i][j], &saved_mode[b], sizeof(xbiosmode_t));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
312 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
313 } else {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
314 ++SDL_nummodes[i];
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
315 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
316 }
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
317
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
318 static void XBIOS_ListSTModes(_THIS, int actually_add)
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
319 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
320 SDL_XBIOS_AddMode(this, actually_add, &stmodes[0]);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
321 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
322
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
323 static void XBIOS_ListTTModes(_THIS, int actually_add)
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
324 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
325 int i;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
326
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
327 for (i=0; i<2; i++) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
328 SDL_XBIOS_AddMode(this, actually_add, &ttmodes[i]);
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
329 }
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
330 }
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
331
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
332 static void XBIOS_ListFalconRgbModes(_THIS, int actually_add)
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
333 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
334 int i;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
335
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
336 for (i=0; i<16; i++) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
337 xbiosmode_t modeinfo;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
338
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
339 SDL_memcpy(&modeinfo, &falconrgbmodes[i], sizeof(xbiosmode_t));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
340 modeinfo.number &= ~(VGA|PAL);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
341 modeinfo.number |= XBIOS_oldvmode & (VGA|PAL);
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
342
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
343 SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
344 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
345 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
346
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
347 static void XBIOS_ListFalconVgaModes(_THIS, int actually_add)
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
348 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
349 int i;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
350
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
351 for (i=0; i<6; i++) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
352 xbiosmode_t modeinfo;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
353
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
354 SDL_memcpy(&modeinfo, &falconvgamodes[i], sizeof(xbiosmode_t));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
355 modeinfo.number &= ~(VGA|PAL);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
356 modeinfo.number |= XBIOS_oldvmode & (VGA|PAL);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
357
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
358 SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
359 }
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
360 }
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
361
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
362 static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
363 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
364 int i,j8,j16;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
365 xbiosmode_t *current_mode;
1061
5023cde12cbd Add Falcon Centscreen extension support
Patrice Mandin <patmandin@gmail.com>
parents: 1043
diff changeset
366 unsigned long cookie_blow, cookie_scpn, cookie_cnts;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
367
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
368 /* Initialize all variables that we clean on shutdown */
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
369 for ( i=0; i<NUM_MODELISTS; ++i ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
370 SDL_nummodes[i] = 0;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
371 SDL_modelist[i] = NULL;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
372 SDL_xbiosmode[i] = NULL;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
373 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
374
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
375 /* Cookie _VDO present ? if not, assume ST machine */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
376 if (Getcookie(C__VDO, &XBIOS_cvdo) != C_FOUND) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
377 XBIOS_cvdo = VDO_ST << 16;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
378 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
379
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
380 /* Allocate memory for old palette */
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
381 XBIOS_oldpalette = (void *)SDL_malloc(256*sizeof(long));
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
382 if ( !XBIOS_oldpalette ) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
383 SDL_SetError("Unable to allocate memory for old palette\n");
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
384 return(-1);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
385 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
386
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
387 /* Initialize video mode list */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
388 /* and save current screen status (palette, screen address, video mode) */
1064
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
389 XBIOS_centscreen = SDL_FALSE;
4199
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
390 XBIOS_oldvbase = Physbase();
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
391
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
392 /* Determine the current screen size */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
393 this->info.current_w = 0;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
394 this->info.current_h = 0;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
395
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
396 /* Determine the screen depth (use default 8-bit depth) */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
397 vformat->BitsPerPixel = 8;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
398
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
399 /* First allocate room for needed video modes */
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
400 switch (XBIOS_cvdo >>16) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
401 case VDO_ST:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
402 case VDO_STE:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
403 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
404 short *oldpalette;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
405
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
406 XBIOS_oldvmode=Getrez();
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
407 switch(XBIOS_oldvmode << 8) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
408 case ST_LOW:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
409 XBIOS_oldnumcol=16;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
410 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
411 case ST_MED:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
412 XBIOS_oldnumcol=4;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
413 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
414 case ST_HIGH:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
415 XBIOS_oldnumcol=2;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
416 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
417 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
418
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
419 oldpalette= (short *) XBIOS_oldpalette;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
420 for (i=0;i<XBIOS_oldnumcol;i++) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
421 *oldpalette++=Setcolor(i,-1);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
422 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
423
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
424 XBIOS_ListSTModes(this, 0);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
425 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
426 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
427 case VDO_TT:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
428 XBIOS_oldvmode=EgetShift();
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
429
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
430 switch(XBIOS_oldvmode & ES_MODE) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
431 case TT_LOW:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
432 XBIOS_oldnumcol=256;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
433 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
434 case ST_LOW:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
435 case TT_MED:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
436 XBIOS_oldnumcol=16;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
437 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
438 case ST_MED:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
439 XBIOS_oldnumcol=4;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
440 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
441 case ST_HIGH:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
442 case TT_HIGH:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
443 XBIOS_oldnumcol=2;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
444 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
445 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
446 if (XBIOS_oldnumcol) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
447 EgetPalette(0, XBIOS_oldnumcol, XBIOS_oldpalette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
448 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
449
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
450 XBIOS_ListTTModes(this, 0);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
451 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
452 case VDO_F30:
1322
a4566d07718f Update for mintlib 0.57.6 (m68k-atari-mint libc)
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
453 XBIOS_oldvmode=VsetMode(-1);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
454
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
455 XBIOS_oldnumcol= 1<< (1 << (XBIOS_oldvmode & NUMCOLS));
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
456 if (XBIOS_oldnumcol > 256) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
457 XBIOS_oldnumcol = 0;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
458 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
459 if (XBIOS_oldnumcol) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
460 VgetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
461 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
462
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
463 vformat->BitsPerPixel = 16;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
464
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
465 /* ScreenBlaster 3 ? */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
466 if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
467 SDL_XBIOS_ListSB3Modes(this, 0, (scpn_cookie_t *)cookie_scpn);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
468 } else
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
469 /* Centscreen ? */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
470 if (Getcookie(C_CNTS, &cookie_cnts) == C_FOUND) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
471 XBIOS_oldvmode = SDL_XBIOS_ListCentscreenModes(this, 0);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
472 XBIOS_centscreen = SDL_TRUE;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
473 } else
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
474 /* Standard, with or without Blowup */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
475 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
476 switch (VgetMonitor())
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
477 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
478 case MONITOR_RGB:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
479 case MONITOR_TV:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
480 XBIOS_ListFalconRgbModes(this, 0);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
481 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
482 case MONITOR_VGA:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
483 XBIOS_ListFalconVgaModes(this, 0);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
484 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
485 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
486
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
487 if (Getcookie(C_BLOW, &cookie_blow) == C_FOUND) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
488 SDL_XBIOS_ListBlowupModes(this, 0, (blow_cookie_t *)cookie_blow);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
489 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
490 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
491 break;
4195
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
492 case VDO_MILAN:
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
493 {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
494 SCREENINFO si;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
495
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
496 /* Read infos about current mode */
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
497 VsetScreen(-1, &XBIOS_oldvmode, MI_MAGIC, CMD_GETMODE);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
498 this->info.current_w = si.scrWidth;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
499 this->info.current_h = si.scrHeight;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
500
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
501 si.size = sizeof(SCREENINFO);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
502 si.devID = XBIOS_oldvmode;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
503 si.scrFlags = 0;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
504 VsetScreen(-1, &si, MI_MAGIC, CMD_GETINFO);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
505
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
506 XBIOS_oldnumcol = 0;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
507 if (si.scrFlags & SCRINFO_OK) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
508 if (si.scrPlanes <= 8) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
509 XBIOS_oldnumcol = 1<<si.scrPlanes;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
510 }
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
511 }
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
512 if (XBIOS_oldnumcol) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
513 VgetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
514 }
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
515
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
516 SDL_XBIOS_ListMilanModes(this, 0);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
517 }
4195
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
518 break;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
519 }
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
520
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
521 for ( i=0; i<NUM_MODELISTS; ++i ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
522 int j;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
523
4201
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
524 SDL_xbiosmode[i] = (xbiosmode_t **)
4202
7ec1d9a34164 Make the list NULL terminated.
Patrice Mandin <patmandin@gmail.com>
parents: 4201
diff changeset
525 SDL_malloc((SDL_nummodes[i]+1)*sizeof(xbiosmode_t *));
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
526 if ( SDL_xbiosmode[i] == NULL ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
527 SDL_OutOfMemory();
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
528 return(-1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
529 }
4201
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
530 for ( j=0; j<SDL_nummodes[i]; ++j ) {
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
531 SDL_xbiosmode[i][j]=(xbiosmode_t *)SDL_malloc(sizeof(xbiosmode_t));
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
532 if ( SDL_xbiosmode[i][j] == NULL ) {
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
533 SDL_OutOfMemory();
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
534 return(-1);
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
535 }
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
536 SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t));
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
537 }
4202
7ec1d9a34164 Make the list NULL terminated.
Patrice Mandin <patmandin@gmail.com>
parents: 4201
diff changeset
538 SDL_xbiosmode[i][j] = NULL;
4201
b10a73ebd7fd Forgot to allocate memory for native video mode data.
Patrice Mandin <patmandin@gmail.com>
parents: 4200
diff changeset
539
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
540 SDL_modelist[i] = (SDL_Rect **)
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
541 SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
542 if ( SDL_modelist[i] == NULL ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
543 SDL_OutOfMemory();
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
544 return(-1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
545 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
546 for ( j=0; j<SDL_nummodes[i]; ++j ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
547 SDL_modelist[i][j]=(SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
548 if ( SDL_modelist[i][j] == NULL ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
549 SDL_OutOfMemory();
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
550 return(-1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
551 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
552 SDL_memset(SDL_modelist[i][j], 0, sizeof(SDL_Rect));
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
553 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
554 SDL_modelist[i][j] = NULL;
1545
8d9bb0cf2c2a Added current_w and current_h to the SDL_VideoInfo structure, which is set to the desktop resolution during video intialization, and then set to the current resolution when a video mode is set.
Sam Lantinga <slouken@libsdl.org>
parents: 1412
diff changeset
555 }
8d9bb0cf2c2a Added current_w and current_h to the SDL_VideoInfo structure, which is set to the desktop resolution during video intialization, and then set to the current resolution when a video mode is set.
Sam Lantinga <slouken@libsdl.org>
parents: 1412
diff changeset
556
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
557 /* Now fill the mode list */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
558 switch (XBIOS_cvdo >>16) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
559 case VDO_ST:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
560 case VDO_STE:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
561 XBIOS_ListSTModes(this, 1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
562 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
563 case VDO_TT:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
564 XBIOS_ListTTModes(this, 1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
565 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
566 case VDO_F30:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
567 /* ScreenBlaster 3 ? */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
568 if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
569 SDL_XBIOS_ListSB3Modes(this, 1, (scpn_cookie_t *)cookie_scpn);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
570 } else
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
571 /* Centscreen ? */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
572 if (Getcookie(C_CNTS, &cookie_cnts) == C_FOUND) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
573 XBIOS_oldvmode = SDL_XBIOS_ListCentscreenModes(this, 1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
574 XBIOS_centscreen = SDL_TRUE;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
575 } else
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
576 /* Standard, with or without Blowup */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
577 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
578 switch (VgetMonitor())
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
579 {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
580 case MONITOR_RGB:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
581 case MONITOR_TV:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
582 XBIOS_ListFalconRgbModes(this, 1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
583 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
584 case MONITOR_VGA:
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
585 XBIOS_ListFalconVgaModes(this, 1);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
586 break;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
587 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
588
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
589 if (Getcookie(C_BLOW, &cookie_blow) == C_FOUND) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
590 SDL_XBIOS_ListBlowupModes(this, 1, (blow_cookie_t *)cookie_blow);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
591 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
592 }
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
593 break;
4195
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
594 case VDO_MILAN:
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
595 SDL_XBIOS_ListMilanModes(this, 1);
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
596 break;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
597 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
598
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
599 XBIOS_screens[0]=NULL;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
600 XBIOS_screens[1]=NULL;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
601 XBIOS_shadowscreen=NULL;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
602
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
603 /* Update hardware info */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
604 this->info.hw_available = 1;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
605 this->info.video_mem = (Uint32) Atari_SysMalloc(-1L, MX_STRAM);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
606
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
607 /* Init chunky to planar routine */
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
608 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
609
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
610 #if SDL_VIDEO_OPENGL
991
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 989
diff changeset
611 SDL_AtariGL_InitPointers(this);
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 989
diff changeset
612 #endif
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 989
diff changeset
613
3904
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
614 /* Disable screensavers */
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
615 if (SDL_XBIOS_TveillePresent(this)) {
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
616 SDL_XBIOS_TveilleDisable(this);
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
617 }
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
618
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
619 /* We're done! */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
620 return(0);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
621 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
622
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
623 static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
624 {
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
625 return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
626 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
627
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
628 static void XBIOS_FreeBuffers(_THIS)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
629 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
630 int i;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
631
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
632 for (i=0;i<2;i++) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
633 if (XBIOS_screensmem[i]!=NULL) {
4200
907624b7a72c Oops, need to compile first, before commit.
Patrice Mandin <patmandin@gmail.com>
parents: 4199
diff changeset
634 if ((XBIOS_cvdo>>16) == VDO_MILAN) {
4199
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
635 if (i==1) {
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
636 VsetScreen(-1, -1, MI_MAGIC, CMD_FREEPAGE);
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
637 }
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
638 } else {
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
639 Mfree(XBIOS_screensmem[i]);
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
640 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
641 XBIOS_screensmem[i]=NULL;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
642 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
643 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
644
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
645 if (XBIOS_shadowscreen!=NULL) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
646 Mfree(XBIOS_shadowscreen);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
647 XBIOS_shadowscreen=NULL;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
648 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
649 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
650
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
651 static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current,
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
652 int width, int height, int bpp, Uint32 flags)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
653 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
654 int mode, new_depth;
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
655 int i, num_buffers;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
656 xbiosmode_t *new_video_mode;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
657 Uint32 new_screen_size;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
658 Uint32 modeflags;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
659
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
660 /* Free current buffers */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
661 XBIOS_FreeBuffers(this);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
662
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
663 /* Try to set the requested linear video mode */
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
664 bpp = (bpp+7)/8-1;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
665 for ( mode=0; SDL_modelist[bpp][mode]; ++mode ) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
666 if ( (SDL_modelist[bpp][mode]->w == width) &&
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
667 (SDL_modelist[bpp][mode]->h == height) ) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
668 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
669 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
670 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
671 if ( SDL_modelist[bpp][mode] == NULL ) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
672 SDL_SetError("Couldn't find requested mode in list");
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
673 return(NULL);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
674 }
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
675 new_video_mode = SDL_xbiosmode[bpp][mode];
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
676
1103
18e5babe266e Tell SDL to notfree my video surfaces (Damn, no how-to write a SDL driver)
Patrice Mandin <patmandin@gmail.com>
parents: 1102
diff changeset
677 modeflags = SDL_FULLSCREEN | SDL_PREALLOC;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
678
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
679 /* Allocate needed buffers: simple/double buffer and shadow surface */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
680 new_depth = new_video_mode->depth;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
681 if (new_depth == 4) {
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
682 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert4;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
683 new_depth=8;
1085
49d154d0c56e 4bits screen also has hardware palette
Patrice Mandin <patmandin@gmail.com>
parents: 1084
diff changeset
684 modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
685 } else if (new_depth == 8) {
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
686 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
508
9ff7e90aaa94 Fixed gamma correction in Atari video drivers (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents: 319
diff changeset
687 modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
688 } else {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
689 modeflags |= SDL_HWSURFACE;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
690 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
691
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
692 new_screen_size = width * height * ((new_depth)>>3);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
693 new_screen_size += 256; /* To align on a 256 byte adress */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
694
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
695 if (new_video_mode->flags & XBIOSMODE_C2P) {
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
696 XBIOS_shadowscreen = Atari_SysMalloc(new_screen_size, MX_PREFTTRAM);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
697
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
698 if (XBIOS_shadowscreen == NULL) {
1104
bf145eaf76ef Tell user how many bytes are needed
Patrice Mandin <patmandin@gmail.com>
parents: 1103
diff changeset
699 SDL_SetError("Can not allocate %d KB for shadow buffer", new_screen_size>>10);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
700 return (NULL);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
701 }
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
702 SDL_memset(XBIOS_shadowscreen, 0, new_screen_size);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
703 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
704
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
705 /* Output buffer needs to be twice in size for the software double-line mode */
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
706 if (new_video_mode->flags & XBIOSMODE_DOUBLELINE) {
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
707 new_screen_size <<= 1;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
708 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
709
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
710 /* Double buffer ? */
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
711 num_buffers = 1;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
712
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
713 #if SDL_VIDEO_OPENGL
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
714 if (flags & SDL_OPENGL) {
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
715 if (this->gl_config.double_buffer) {
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
716 flags |= SDL_DOUBLEBUF;
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
717 }
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
718 }
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
719 #endif
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
720 if (flags & SDL_DOUBLEBUF) {
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
721 num_buffers = 2;
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
722 modeflags |= SDL_DOUBLEBUF;
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
723 }
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
724
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
725 /* Allocate buffers */
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
726 for (i=0; i<num_buffers; i++) {
4199
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
727 if ((XBIOS_cvdo>>16) == VDO_MILAN) {
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
728 if (i==0) {
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
729 XBIOS_screensmem[i] = XBIOS_oldvbase;
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
730 } else {
4200
907624b7a72c Oops, need to compile first, before commit.
Patrice Mandin <patmandin@gmail.com>
parents: 4199
diff changeset
731 VsetScreen(-1, &XBIOS_screensmem[i], MI_MAGIC, CMD_ALLOCPAGE);
4199
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
732 }
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
733 } else {
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
734 XBIOS_screensmem[i] = Atari_SysMalloc(new_screen_size, MX_STRAM);
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
735 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
736
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
737 if (XBIOS_screensmem[i]==NULL) {
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
738 XBIOS_FreeBuffers(this);
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
739 SDL_SetError("Can not allocate %d KB for buffer %d", new_screen_size>>10, i);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
740 return (NULL);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
741 }
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
742 SDL_memset(XBIOS_screensmem[i], 0, new_screen_size);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
743
4197
1bf6585720e9 Use loop to allocate needed buffers, instead of code duplication. Add missing header.
Patrice Mandin <patmandin@gmail.com>
parents: 4195
diff changeset
744 XBIOS_screens[i]=(void *) (( (long) XBIOS_screensmem[i]+256) & 0xFFFFFF00UL);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
745 }
4195
13de8ea401db Start Milan video support
Patrice Mandin <patmandin@gmail.com>
parents: 4194
diff changeset
746
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
747 /* Allocate the new pixel format for the screen */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
748 if ( ! SDL_ReallocFormat(current, new_depth, 0, 0, 0, 0) ) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
749 XBIOS_FreeBuffers(this);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
750 SDL_SetError("Couldn't allocate new pixel format for requested mode");
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
751 return(NULL);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
752 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
753
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
754 XBIOS_current = new_video_mode;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
755 current->w = width;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
756 current->h = height;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
757 current->pitch = (width * new_depth)>>3;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
758
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
759 /* this is for C2P conversion */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
760 XBIOS_pitch = (new_video_mode->width * new_video_mode->depth)>>3;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
761
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
762 if (new_video_mode->flags & XBIOSMODE_C2P)
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
763 current->pixels = XBIOS_shadowscreen;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
764 else
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
765 current->pixels = XBIOS_screens[0];
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
766
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
767 XBIOS_fbnum = 0;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
768
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
769 #if SDL_VIDEO_OPENGL
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
770 if (flags & SDL_OPENGL) {
989
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
771 if (!SDL_AtariGL_Init(this, current)) {
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
772 XBIOS_FreeBuffers(this);
989
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
773 SDL_SetError("Can not create OpenGL context");
475166d13b44 Factorize OSMesa OpenGL code for Atari drivers
Patrice Mandin <patmandin@gmail.com>
parents: 980
diff changeset
774 return NULL;
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
775 }
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
776
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
777 modeflags |= SDL_OPENGL;
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
778 }
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
779 #endif
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
780
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
781 current->flags = modeflags;
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
782
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
783 #ifndef DEBUG_VIDEO_XBIOS
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
784 /* Now set the video mode */
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
785 if ((XBIOS_cvdo>>16) == VDO_MILAN) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
786 VsetScreen(-1, XBIOS_screens[0], MI_MAGIC, CMD_SETADR);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
787 } else {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
788 Setscreen(-1,XBIOS_screens[0],-1);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
789 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
790
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
791 switch(XBIOS_cvdo >> 16) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
792 case VDO_ST:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
793 Setscreen(-1,-1,new_video_mode->number);
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
794
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
795 /* Reset palette */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
796 for (i=0;i<16;i++) {
1085
49d154d0c56e 4bits screen also has hardware palette
Patrice Mandin <patmandin@gmail.com>
parents: 1084
diff changeset
797 TT_palette[i]= ((i>>1)<<8) | (((i*8)/17)<<4) | (i>>1);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
798 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
799 Setpalette(TT_palette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
800 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
801 case VDO_STE:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
802 Setscreen(-1,-1,new_video_mode->number);
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
803
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
804 /* Reset palette */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
805 for (i=0;i<16;i++)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
806 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
807 int c;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
808
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
809 c=((i&1)<<3)|((i>>1)&7);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
810 TT_palette[i]=(c<<8)|(c<<4)|c;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
811 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
812 Setpalette(TT_palette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
813 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
814 case VDO_TT:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
815 EsetShift(new_video_mode->number);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
816 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
817 case VDO_F30:
1064
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
818 if (XBIOS_centscreen) {
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
819 SDL_XBIOS_CentscreenSetmode(this, width, height, new_depth);
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
820 } else {
1350
adc8ff3c9597 Fixes for new SDL embedded libc stuff
Patrice Mandin <patmandin@gmail.com>
parents: 1338
diff changeset
821 VsetMode(new_video_mode->number);
1064
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
822 }
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
823
1094
5012b97142ac Set hardware palette to black in True Colour mode
Patrice Mandin <patmandin@gmail.com>
parents: 1085
diff changeset
824 /* Set hardware palette to black in True Colour */
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
825 if (new_depth > 8) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
826 SDL_memset(F30_palette, 0, sizeof(F30_palette));
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
827 VsetRGB(0,256,F30_palette);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
828 }
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
829 break;
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
830 case VDO_MILAN:
4199
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
831 VsetScreen(-1, new_video_mode->number, MI_MAGIC, CMD_SETMODE);
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
832
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
833 /* Set hardware palette to black in True Colour */
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
834 if (new_depth > 8) {
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
835 SDL_memset(F30_palette, 0, sizeof(F30_palette));
1094
5012b97142ac Set hardware palette to black in True Colour mode
Patrice Mandin <patmandin@gmail.com>
parents: 1085
diff changeset
836 VsetRGB(0,256,F30_palette);
5012b97142ac Set hardware palette to black in True Colour mode
Patrice Mandin <patmandin@gmail.com>
parents: 1085
diff changeset
837 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
838 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
839 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
840
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
841 Vsync();
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
842 #endif
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
843
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
844 this->UpdateRects = XBIOS_UpdateRects;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
845
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
846 return (current);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
847 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
848
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
849 /* We don't actually allow hardware surfaces other than the main one */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
850 static int XBIOS_AllocHWSurface(_THIS, SDL_Surface *surface)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
851 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
852 return(-1);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
853 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
854
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
855 static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
856 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
857 return;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
858 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
859
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
860 static int XBIOS_LockHWSurface(_THIS, SDL_Surface *surface)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
861 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
862 return(0);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
863 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
864
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
865 static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
866 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
867 return;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
868 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
869
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
870 static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
871 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
872 SDL_Surface *surface;
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
873
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
874 surface = this->screen;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
875
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
876 if (XBIOS_current->flags & XBIOSMODE_C2P) {
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
877 int i;
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
878 int doubleline = (XBIOS_current->flags & XBIOSMODE_DOUBLELINE ? 1 : 0);
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
879
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
880 for (i=0;i<numrects;i++) {
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
881 void *source,*destination;
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
882 int x1,x2;
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
883
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
884 x1 = rects[i].x & ~15;
319
189a6a3416c7 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 314
diff changeset
885 x2 = rects[i].x+rects[i].w;
189a6a3416c7 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 314
diff changeset
886 if (x2 & 15) {
189a6a3416c7 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 314
diff changeset
887 x2 = (x2 | 15) +1;
189a6a3416c7 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 314
diff changeset
888 }
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
889
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
890 source = surface->pixels;
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
891 source += surface->pitch * rects[i].y;
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
892 source += x1;
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
893
1256
3cfb04f6e726 Rollback 1.28 change, but only for UpdateRects function this time
Patrice Mandin <patmandin@gmail.com>
parents: 1239
diff changeset
894 destination = XBIOS_screens[XBIOS_fbnum];
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
895 destination += XBIOS_pitch * rects[i].y;
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
896 destination += x1;
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
897
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
898 /* Convert chunky to planar screen */
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
899 SDL_Atari_C2pConvert(
1101
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
900 source,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
901 destination,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
902 x2-x1,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
903 rects[i].h,
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
904 doubleline,
1101
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
905 surface->pitch,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
906 XBIOS_pitch
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
907 );
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
908 }
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
909 }
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
910
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
911 #ifndef DEBUG_VIDEO_XBIOS
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
912 if ((XBIOS_cvdo>>16) == VDO_MILAN) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
913 VsetScreen(-1, XBIOS_screens[XBIOS_fbnum], MI_MAGIC, CMD_SETADR);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
914 } else {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
915 Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
916 }
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
917
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
918 Vsync();
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
919 #endif
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
920
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
921 if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
922 XBIOS_fbnum ^= 1;
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
923 if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) {
314
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
924 surface->pixels=XBIOS_screens[XBIOS_fbnum];
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
925 }
bff64eba7721 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 311
diff changeset
926 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
927 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
928
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
929 static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
930 {
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
931 if (XBIOS_current->flags & XBIOSMODE_C2P) {
1101
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
932 void *destscr;
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
933 int destx;
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
934 int doubleline = (XBIOS_current->flags & XBIOSMODE_DOUBLELINE ? 1 : 0);
1101
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
935
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
936 /* Center on destination screen */
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
937 destscr = XBIOS_screens[XBIOS_fbnum];
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
938 destscr += XBIOS_pitch * ((XBIOS_current->height - surface->h) >> 1);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
939 destx = (XBIOS_current->width - surface->w) >> 1;
1101
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
940 destx &= ~15;
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
941 destscr += destx;
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
942
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
943 /* Convert chunky to planar screen */
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
944 SDL_Atari_C2pConvert(
1101
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
945 surface->pixels,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
946 destscr,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
947 surface->w,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
948 surface->h,
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
949 doubleline,
1101
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
950 surface->pitch,
c8a51d169579 Revert back screen centering when using c2p
Patrice Mandin <patmandin@gmail.com>
parents: 1094
diff changeset
951 XBIOS_pitch
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
952 );
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
953 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
954
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
955 #ifndef DEBUG_VIDEO_XBIOS
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
956 if ((XBIOS_cvdo>>16) == VDO_MILAN) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
957 VsetScreen(-1, XBIOS_screens[XBIOS_fbnum], MI_MAGIC, CMD_SETADR);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
958 } else {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
959 Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
960 }
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
961
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
962 Vsync();
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
963 #endif
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
964
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
965 if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
311
2847fd83f115 Date: Fri, 15 Mar 2002 18:24:59 GMT+1
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
966 XBIOS_fbnum ^= 1;
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
967 if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) {
311
2847fd83f115 Date: Fri, 15 Mar 2002 18:24:59 GMT+1
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
968 surface->pixels=XBIOS_screens[XBIOS_fbnum];
2847fd83f115 Date: Fri, 15 Mar 2002 18:24:59 GMT+1
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
969 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
970 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
971
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
972 return(0);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
973 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
974
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
975 static int XBIOS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
976 {
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
977 #ifndef DEBUG_VIDEO_XBIOS
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
978 int i;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
979 int r,v,b;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
980
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
981 switch( XBIOS_cvdo >> 16) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
982 case VDO_ST:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
983 case VDO_STE:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
984 for (i=0;i<ncolors;i++)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
985 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
986 r = colors[i].r;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
987 v = colors[i].g;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
988 b = colors[i].b;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
989
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
990 TT_palette[firstcolor+i]=((r*30)+(v*59)+(b*11))/100;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
991 }
735
abec2a842d11 Use new C2P routine
Patrice Mandin <patmandin@gmail.com>
parents: 712
diff changeset
992 SDL_Atari_C2pConvert4_pal(TT_palette); /* convert the lighting */
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
993 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
994 case VDO_TT:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
995 for(i = 0; i < ncolors; i++)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
996 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
997 r = colors[i].r;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
998 v = colors[i].g;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
999 b = colors[i].b;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1000
1102
f0919504adfd Revert back change between 1.29 and 1.30
Patrice Mandin <patmandin@gmail.com>
parents: 1101
diff changeset
1001 TT_palette[i]=((r>>4)<<8)|((v>>4)<<4)|(b>>4);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1002 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1003 EsetPalette(firstcolor,ncolors,TT_palette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1004 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1005 case VDO_F30:
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
1006 case VDO_MILAN:
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1007 for(i = 0; i < ncolors; i++)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1008 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1009 r = colors[i].r;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1010 v = colors[i].g;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1011 b = colors[i].b;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1012
1102
f0919504adfd Revert back change between 1.29 and 1.30
Patrice Mandin <patmandin@gmail.com>
parents: 1101
diff changeset
1013 F30_palette[i]=(r<<16)|(v<<8)|b;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1014 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1015 VsetRGB(firstcolor,ncolors,F30_palette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1016 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1017 }
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1018 #endif
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1019
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1020 return(1);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1021 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1022
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1023 /* Note: If we are terminated, this could be called in the middle of
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1024 another SDL video routine -- notably UpdateRects.
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1025 */
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1026 static void XBIOS_VideoQuit(_THIS)
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1027 {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1028 int i,j;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1029
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1030 Atari_ShutdownEvents();
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1031
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1032 /* Restore video mode and palette */
801
ff1058d642dc Video modes must be sorted by Y size, for SDL_GetVideoMode() to operate properly
Patrice Mandin <patmandin@gmail.com>
parents: 797
diff changeset
1033 #ifndef DEBUG_VIDEO_XBIOS
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1034 switch(XBIOS_cvdo >> 16) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1035 case VDO_ST:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1036 case VDO_STE:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1037 Setscreen(-1,XBIOS_oldvbase,XBIOS_oldvmode);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1038 if (XBIOS_oldnumcol) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1039 Setpalette(XBIOS_oldpalette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1040 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1041 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1042 case VDO_TT:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1043 Setscreen(-1,XBIOS_oldvbase,-1);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1044 EsetShift(XBIOS_oldvmode);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1045 if (XBIOS_oldnumcol) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1046 EsetPalette(0, XBIOS_oldnumcol, XBIOS_oldpalette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1047 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1048 break;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1049 case VDO_F30:
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1050 Setscreen(-1, XBIOS_oldvbase, -1);
1064
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
1051 if (XBIOS_centscreen) {
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
1052 SDL_XBIOS_CentscreenRestore(this, XBIOS_oldvmode);
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
1053 } else {
1350
adc8ff3c9597 Fixes for new SDL embedded libc stuff
Patrice Mandin <patmandin@gmail.com>
parents: 1338
diff changeset
1054 VsetMode(XBIOS_oldvmode);
1064
fba6b67b4d60 Add Centscreen extended modes support
Patrice Mandin <patmandin@gmail.com>
parents: 1061
diff changeset
1055 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1056 if (XBIOS_oldnumcol) {
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1057 VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1058 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1059 break;
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
1060 case VDO_MILAN:
4199
4c92a3d196f1 Set video mode, allocate buffers, and enable new Milan video xbios support, need a tester now :).
Patrice Mandin <patmandin@gmail.com>
parents: 4198
diff changeset
1061 VsetScreen(-1, &XBIOS_oldvbase, MI_MAGIC, CMD_SETADR);
4198
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
1062 VsetScreen(-1, &XBIOS_oldvmode, MI_MAGIC, CMD_SETMODE);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
1063 if (XBIOS_oldnumcol) {
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
1064 VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
1065 }
6405314a7c07 Define flags for double line and c2p operations. More Milan video work.
Patrice Mandin <patmandin@gmail.com>
parents: 4197
diff changeset
1066 break;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1067 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1068 Vsync();
801
ff1058d642dc Video modes must be sorted by Y size, for SDL_GetVideoMode() to operate properly
Patrice Mandin <patmandin@gmail.com>
parents: 797
diff changeset
1069 #endif
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1070
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
1071 #if SDL_VIDEO_OPENGL
992
0324ce32b2d9 Keep current OpenGL context when possible
Patrice Mandin <patmandin@gmail.com>
parents: 991
diff changeset
1072 if (gl_active) {
0324ce32b2d9 Keep current OpenGL context when possible
Patrice Mandin <patmandin@gmail.com>
parents: 991
diff changeset
1073 SDL_AtariGL_Quit(this, SDL_TRUE);
0324ce32b2d9 Keep current OpenGL context when possible
Patrice Mandin <patmandin@gmail.com>
parents: 991
diff changeset
1074 }
0324ce32b2d9 Keep current OpenGL context when possible
Patrice Mandin <patmandin@gmail.com>
parents: 991
diff changeset
1075 #endif
0324ce32b2d9 Keep current OpenGL context when possible
Patrice Mandin <patmandin@gmail.com>
parents: 991
diff changeset
1076
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1077 if (XBIOS_oldpalette) {
1336
3692456e7b0f Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents: 1322
diff changeset
1078 SDL_free(XBIOS_oldpalette);
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1079 XBIOS_oldpalette=NULL;
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1080 }
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1081 XBIOS_FreeBuffers(this);
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1082
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1083 /* Free mode list */
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1084 for ( i=0; i<NUM_MODELISTS; ++i ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1085 if ( SDL_modelist[i] != NULL ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1086 for ( j=0; SDL_modelist[i][j]; ++j )
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1087 SDL_free(SDL_modelist[i][j]);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1088 SDL_free(SDL_modelist[i]);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1089 SDL_modelist[i] = NULL;
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1090 }
4194
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1091 if ( SDL_xbiosmode[i] != NULL ) {
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1092 for ( j=0; SDL_xbiosmode[i][j]; ++j )
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1093 SDL_free(SDL_xbiosmode[i][j]);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1094 SDL_free(SDL_xbiosmode[i]);
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1095 SDL_xbiosmode[i] = NULL;
05c9e942cc46 Preliminary work to support the Milan video bios, that will gives access to 24 or 32 bpp modes. I used the svga driver as model to dynamically build video modes list.
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
1096 }
1042
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
1097 }
0e7218843cfb Dynamically create list of video modes, easier to add new ones
Patrice Mandin <patmandin@gmail.com>
parents: 1040
diff changeset
1098
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1099 this->screen->pixels = NULL;
3904
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
1100
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
1101 /* Restore screensavers */
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
1102 if (SDL_XBIOS_TveillePresent(this)) {
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
1103 SDL_XBIOS_TveilleRestore(this);
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents: 1830
diff changeset
1104 }
281
c5010ab8ba35 Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1105 }
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
1106
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
1107 #if SDL_VIDEO_OPENGL
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
1108
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
1109 static void XBIOS_GL_SwapBuffers(_THIS)
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
1110 {
993
2662da16d668 Forgot to flush OpenGL buffer using glFinish
Patrice Mandin <patmandin@gmail.com>
parents: 992
diff changeset
1111 SDL_AtariGL_SwapBuffers(this);
2662da16d668 Forgot to flush OpenGL buffer using glFinish
Patrice Mandin <patmandin@gmail.com>
parents: 992
diff changeset
1112 XBIOS_FlipHWSurface(this, this->screen);
2662da16d668 Forgot to flush OpenGL buffer using glFinish
Patrice Mandin <patmandin@gmail.com>
parents: 992
diff changeset
1113 SDL_AtariGL_MakeCurrent(this);
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
1114 }
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
1115
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 972
diff changeset
1116 #endif