1 |
/* |
2 |
* video_defs.h - MacOS types and structures for video |
3 |
* |
4 |
* SheepShaver (C) 1997-2002 Marc Hellwig and Christian Bauer |
5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* (at your option) any later version. |
10 |
* |
11 |
* This program is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
#ifndef VIDEO_DEFS_H |
22 |
#define VIDEO_DEFS_H |
23 |
|
24 |
#include "macos_util.h" |
25 |
|
26 |
|
27 |
/* |
28 |
* Definitions for Display Manager |
29 |
*/ |
30 |
|
31 |
/* csMode values describing pixel depth in VDSwitchInfo */ |
32 |
enum { |
33 |
firstVidMode=128, // first depth mode, representing lowest supported |
34 |
// pixel depth |
35 |
secondVidMode, thirdVidMode, fourthVidMode, fifthVidMode, sixthVidMode |
36 |
// following modes represent pixel depths in ascending |
37 |
// order |
38 |
}; |
39 |
|
40 |
/* csDisplayType values in VDDisplayConnectInfoRec */ |
41 |
enum { |
42 |
kUnknownConnect=1, // reserved |
43 |
kPanelTFTConnect, // fixed-in-place LCS (TFT, aka "active matrix") panels |
44 |
kFixedModeCRTConnect, // very limited displays |
45 |
kMultiModeCRT1Connect, // 12" optional, 13" default, 16" required |
46 |
kMultiModeCRT2Connect, // 12" optional, 13" req., 16" def., 19" req. |
47 |
kMultiModeCRT3Connect, // 12" optional, 13" req., 16" req., 19" req.,21" def. |
48 |
kMultiModeCRT4Connect, // expansion to large multimode (not yet implemented) |
49 |
kModelessConnect, // expansion to modeless model (not yet implemented) |
50 |
kFullPageConnect, // 640x818 (to get 8bpp in 512K case) and |
51 |
// 640x870 (nothing else supported) |
52 |
kVGAConnect, // 640x480 VGA default -- nothing else req. |
53 |
kNTSCConnect, // NTSC ST(default), FF, STconv, FFconv |
54 |
kPALConnect, // PAL ST(default), FF, STconv, FFconv |
55 |
kHRConnect, // 640x400 (to get 8bpp in 256K case) and |
56 |
// 640x480 (nothing else supported) |
57 |
kPanelFSTNConnect // fixed-in-place LCD FSTN (aka "supertwist") panels |
58 |
}; |
59 |
|
60 |
/* csConnectFlags values in VDDisplayConnectInfoRec */ |
61 |
enum { |
62 |
kAllModesValid=0, // all display modes not deleted by PrimaryInit code |
63 |
// are optional |
64 |
kAllModesSafe, // all display modes not deleted by PrimaryInit code |
65 |
// are required; is you set this bit, set the |
66 |
// kAllModesValid bit, too |
67 |
kHasDirectConnect=3, // for future expansions, setting this bit means that |
68 |
// your driver can talk directly to the display |
69 |
// (e.g. there is a serial data link via sense lines) |
70 |
kIsMonoDev, // this display does not support color |
71 |
kUncertainConnect // there may not be a display; Monitors control panel |
72 |
// makes the user confirm some operations--like moving |
73 |
// the menu bar-- when this bit is set |
74 |
}; |
75 |
|
76 |
/* csTimingFormat value in VDTimingInfoRec */ |
77 |
#define kDeclROMtables FOURCC('d','e','c','l') // use information in this record instead of looking |
78 |
// in the decl. ROM for timing info; used for patching |
79 |
// existing card without updating declaration ROM |
80 |
|
81 |
/* csTimingData values in VDTimingInfoRec */ |
82 |
enum { |
83 |
timingUnknown = 0, // unknown timing |
84 |
timingApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */ |
85 |
timingApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */ |
86 |
timingApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */ |
87 |
timingApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */ |
88 |
timingVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */ |
89 |
timingVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */ |
90 |
timingVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */ |
91 |
timingVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */ |
92 |
timingGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */ |
93 |
timingApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/ |
94 |
timingApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ |
95 |
timingApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/ |
96 |
timingVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */ |
97 |
timingVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */ |
98 |
timingVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */ |
99 |
timingVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */ |
100 |
timingVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */ |
101 |
timingVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */ |
102 |
timingVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */ |
103 |
timingVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to timingApple_1024x768_75hz). */ |
104 |
timingVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */ |
105 |
timingApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */ |
106 |
timingApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */ |
107 |
timingVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */ |
108 |
timingVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */ |
109 |
timingVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */ |
110 |
timingVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */ |
111 |
timingVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */ |
112 |
timingVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */ |
113 |
timingVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA proposed timing. */ |
114 |
timingVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA proposed timing. */ |
115 |
timingVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA proposed timing. */ |
116 |
timingVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA proposed timing. */ |
117 |
timingVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA proposed timing (pixel clock is 216 Mhz dot clock). */ |
118 |
timingSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */ |
119 |
timingFilmRate_48hz = 410 /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */ |
120 |
}; |
121 |
|
122 |
/* csTimingFlags values in VDTimingInfoRec */ |
123 |
enum { |
124 |
kModeValid=0, // this display mode is optional |
125 |
kModeSafe, // this display mode is required; if you set this |
126 |
// bit, you should also set the kModeValid bit |
127 |
kModeDefault, // this display mode is the default for the attached |
128 |
// display; if you set this bit, you should also set |
129 |
// the kModeSafe and kModeValid bits |
130 |
kShowModeNow, // show this mode in Monitors control panel; useful |
131 |
// for SVGA modes |
132 |
kModeNotResize, |
133 |
kModeRequiresPan |
134 |
}; |
135 |
|
136 |
/* code for Display Manager control request */ |
137 |
enum { |
138 |
cscReset=0, |
139 |
cscKillIO, |
140 |
cscSetMode, |
141 |
cscSetEntries, |
142 |
cscSetGamma, |
143 |
cscGrayPage, |
144 |
cscGrayScreen=5, |
145 |
cscSetGray, |
146 |
cscSetInterrupt, |
147 |
cscDirectSetEntries, |
148 |
cscSetDefaultMode, |
149 |
cscSwitchMode, // switch to another display mode |
150 |
cscSetSync, |
151 |
cscSavePreferredConfiguration=16, |
152 |
cscSetHardwareCursor=22, |
153 |
cscDrawHardwareCursor, |
154 |
cscSetConvolution, |
155 |
cscSetPowerState, |
156 |
cscPrivateControlCall, // Takes a VDPrivateSelectorDataRec |
157 |
cscSetMultiConnect, // From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core. |
158 |
cscSetClutBehavior, // Takes a VDClutBehavior |
159 |
cscUnusedCall=127 // This call used to expend the scrn resource. Its imbedded data contains more control info |
160 |
}; |
161 |
|
162 |
/* Constants for the GetNextResolution call */ |
163 |
|
164 |
enum { |
165 |
kDisplayModeIDCurrent = 0x00, /* Reference the Current DisplayModeID */ |
166 |
kDisplayModeIDInvalid = (long)0xFFFFFFFF, /* A bogus DisplayModeID in all cases */ |
167 |
kDisplayModeIDFindFirstResolution = (long)0xFFFFFFFE, /* Used in cscGetNextResolution to reset iterator */ |
168 |
kDisplayModeIDNoMoreResolutions = (long)0xFFFFFFFD /* Used in cscGetNextResolution to indicate End Of List */ |
169 |
}; |
170 |
|
171 |
/* codes for Display Manager status requests */ |
172 |
enum { |
173 |
cscGetMode=2, |
174 |
cscGetEntries, |
175 |
cscGetPageCnt, |
176 |
cscGetPages=4, // This is what C&D 2 calls it. |
177 |
cscGetPageBase, |
178 |
cscGetBaseAddr=5, // This is what C&D 2 calls it. |
179 |
cscGetGray, |
180 |
cscGetInterrupt, |
181 |
cscGetGamma, |
182 |
cscGetDefaultMode, |
183 |
cscGetCurMode, // save the current display mode |
184 |
cscGetSync, |
185 |
cscGetConnection, // return information about display capabilities of |
186 |
// connected display |
187 |
cscGetModeTiming, // return scan timings data for a display mode |
188 |
cscGetModeBaseAddress, // Return base address information about a particular mode |
189 |
cscGetScanProc, // QuickTime scan chasing routine |
190 |
cscGetPreferredConfiguration, |
191 |
cscGetNextResolution, |
192 |
cscGetVideoParameters, |
193 |
cscGetGammaInfoList =20, |
194 |
cscRetrieveGammaTable, |
195 |
cscSupportsHardwareCursor, |
196 |
cscGetHardwareCursorDrawState, |
197 |
cscGetConvolution, |
198 |
cscGetPowerState, |
199 |
cscPrivateStatusCall, // Takes a VDPrivateSelectorDataRec |
200 |
cscGetDDCBlock, // Takes a VDDDCBlockRec |
201 |
cscGetMultiConnect, // From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core. |
202 |
cscGetClutBehavior // Takes a VDClutBehavior |
203 |
}; |
204 |
|
205 |
enum { // VDSwitchInfo struct |
206 |
csMode = 0, |
207 |
csData = 2, |
208 |
csPage = 6, |
209 |
csBaseAddr = 8 |
210 |
}; |
211 |
|
212 |
enum { // VDSetEntry struct |
213 |
csTable = 0, // Pointer to ColorSpec[] |
214 |
csStart = 4, |
215 |
csCount = 6 |
216 |
}; |
217 |
|
218 |
struct ColorSpec { |
219 |
uint16 value; |
220 |
uint16 red; |
221 |
uint16 green; |
222 |
uint16 blue; |
223 |
}; |
224 |
|
225 |
enum { // VDVideoParametersInfo struct |
226 |
csDisplayModeID = 0, |
227 |
csDepthMode = 4, |
228 |
csVPBlockPtr = 6, |
229 |
csPageCount = 10, |
230 |
csDeviceType = 14 |
231 |
}; |
232 |
|
233 |
enum { // VPBlock struct |
234 |
vpBaseOffset = 0, |
235 |
vpRowBytes = 4, |
236 |
vpBounds = 6, |
237 |
vpVersion = 14, |
238 |
vpPackType = 16, |
239 |
vpPackSize = 18, |
240 |
vpHRes = 22, |
241 |
vpVRes = 26, |
242 |
vpPixelType = 30, |
243 |
vpPixelSize = 32, |
244 |
vpCmpCount = 34, |
245 |
vpCmpSize = 36, |
246 |
vpPlaneBytes = 38 |
247 |
}; |
248 |
|
249 |
enum { // VDDisplayConnectInfo struct |
250 |
csDisplayType = 0, |
251 |
csConnectTaggedType = 2, |
252 |
csConnectTaggedData = 3, |
253 |
csConnectFlags = 4, |
254 |
csDisplayComponent = 8, |
255 |
csConnectReserved = 12 |
256 |
}; |
257 |
|
258 |
enum { // VDTimingInfo struct |
259 |
csTimingMode = 0, |
260 |
csTimingReserved = 4, |
261 |
csTimingFormat = 8, |
262 |
csTimingData = 12, |
263 |
csTimingFlags = 16 |
264 |
}; |
265 |
|
266 |
enum { // VDResolutionInfo struct |
267 |
csPreviousDisplayModeID = 0, |
268 |
csRIDisplayModeID = 4, |
269 |
csHorizontalPixels = 8, |
270 |
csVerticalLines = 12, |
271 |
csRefreshRate = 16, |
272 |
csMaxDepthMode = 20, |
273 |
csResolutionFlags = 22 |
274 |
}; |
275 |
|
276 |
enum { // VDDrawHardwareCursor/VDHardwareCursorDrawState struct |
277 |
csCursorX = 0, |
278 |
csCursorY = 4, |
279 |
csCursorVisible = 8, |
280 |
csCursorSet = 12 |
281 |
}; |
282 |
|
283 |
struct GammaTbl { |
284 |
uint16 gVersion; |
285 |
uint16 gType; |
286 |
uint16 gFormulaSize; |
287 |
uint16 gChanCnt; |
288 |
uint16 gDataCnt; |
289 |
uint16 gDataWidth; |
290 |
uint16 gFormulaData[1]; |
291 |
}; |
292 |
|
293 |
enum { |
294 |
kCursorImageMajorVersion = 0x0001, |
295 |
kCursorImageMinorVersion = 0x0000 |
296 |
}; |
297 |
|
298 |
enum { // CursorImage struct |
299 |
ciMajorVersion = 0, |
300 |
ciMinorVersion = 2, |
301 |
ciCursorPixMap = 4, // Handle to PixMap |
302 |
ciCursorBitMask = 8 // Handle to BitMap |
303 |
}; |
304 |
|
305 |
|
306 |
/* |
307 |
* Structures for graphics acceleration |
308 |
*/ |
309 |
|
310 |
typedef void *CTabHandle; |
311 |
|
312 |
// Parameter block passed to acceleration hooks |
313 |
struct accl_params { |
314 |
uint32 unknown0[3]; |
315 |
|
316 |
uint32 transfer_mode; |
317 |
uint32 pen_mode; |
318 |
|
319 |
uint32 unknown1[2]; |
320 |
|
321 |
uint32 fore_pen; |
322 |
uint32 back_pen; |
323 |
|
324 |
uint32 unknown2[3]; |
325 |
|
326 |
uint32 src_base_addr; |
327 |
uint32 src_row_bytes; |
328 |
int16 src_bounds[4]; |
329 |
uint32 src_unknown1; |
330 |
uint32 src_pixel_type; |
331 |
uint32 src_pixel_size; |
332 |
uint32 src_cmp_count; |
333 |
uint32 src_cmp_size; |
334 |
CTabHandle src_pm_table; |
335 |
uint32 src_unknown2; |
336 |
uint32 src_unknown3; |
337 |
uint32 src_unknown4; |
338 |
|
339 |
uint32 dest_base_addr; |
340 |
uint32 dest_row_bytes; |
341 |
int16 dest_bounds[4]; |
342 |
uint32 dest_unknown1; |
343 |
uint32 dest_pixel_type; |
344 |
uint32 dest_pixel_size; |
345 |
uint32 dest_cmp_count; |
346 |
uint32 dest_cmp_size; |
347 |
CTabHandle dest_pm_table; |
348 |
uint32 dest_unknown2; |
349 |
uint32 dest_unknown3; |
350 |
uint32 dest_unknown4; |
351 |
|
352 |
uint32 unknown3[13]; |
353 |
|
354 |
int16 src_rect[4]; |
355 |
int16 dest_rect[4]; |
356 |
|
357 |
uint32 unknown4[38]; |
358 |
|
359 |
void (*draw_proc)(accl_params *); |
360 |
// Argument for accl_sync_hook at offset 0x4f8 |
361 |
}; |
362 |
|
363 |
// Hook info for NQDMisc |
364 |
struct accl_hook_info { |
365 |
bool (*draw_func)(accl_params *); |
366 |
bool (*sync_func)(void *); |
367 |
uint32 code; |
368 |
}; |
369 |
|
370 |
// Hook function index |
371 |
enum { |
372 |
ACCL_BITBLT, |
373 |
ACCL_BLTMASK, |
374 |
ACCL_FILLRECT, |
375 |
ACCL_FILLMASK |
376 |
// 4: bitblt |
377 |
// 5: lines |
378 |
// 6: fill |
379 |
}; |
380 |
|
381 |
#endif |