ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/include/video_defs.h
Revision: 1.5
Committed: 2004-04-22T21:45:17Z (20 years, 2 months ago) by gbeauche
Content type: text/plain
Branch: MAIN
Changes since 1.4: +27 -0 lines
Log Message:
NQD: use ReadMacInt*() and WriteMacInt*() accessors, i.e. code should now
be little-endian and 64-bit safe.

File Contents

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