File: h3regs.h

package info (click to toggle)
glide 2002.04.10ds1-11
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 59,552 kB
  • ctags: 59,883
  • sloc: ansic: 290,125; asm: 23,305; sh: 8,117; pascal: 3,854; makefile: 1,301; perl: 168
file content (394 lines) | stat: -rw-r--r-- 10,330 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
#ifndef __H3REGS_H__
#define __H3REGS_H__

/* -*-c++-*- */
/* $Header: /cvsroot/glide/glide3x/h3/incsrc/h3regs.h,v 1.1.1.1 1999/11/24 21:45:03 joseph Exp $ */
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
** 
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.  
** 
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Revision: 1.1.1.1 $
** $Date: 1999/11/24 21:45:03 $
**
** $History: h3regs.h $
** 
** *****************  Version 1  *****************
** User: Sapphire     Date: 3/16/99    Time: 7:28p
** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/incsrc
** 
** *****************  Version 21  *****************
** User: Stb_srogers  Date: 2/09/99    Time: 9:55a
** Updated in $/devel/h3/win95/dx/inc
** 
** *****************  Version 20  *****************
** User: Michael      Date: 9/08/98    Time: 4:16p
** Updated in $/devel/h3/Win95/dx/inc
** MarkL's fix for 2281.  Modify members of "stats" structure from ints to
** longs.
*/

// STB Begin Changes
// STB-SR 1/13/98 Adding code for bj
#ifdef _H2INC
typedef unsigned long   FxU32;
#endif
// STB End Changes

//----------------- SST chip I/O layout -------------------------
// I/O registers remapped into memory space
// Includes init, dac/pll, video, and VGA registers
typedef volatile struct sstioregs {     

  // Init Registers
    FxU32 status;                       // aliased status register
    FxU32 pciInit0;
    FxU32 sipMonitor;
    FxU32 lfbMemoryConfig;
    FxU32 miscInit0;
    FxU32 miscInit1;
    FxU32 dramInit0;
    FxU32 dramInit1;
    FxU32 agpInit;
    FxU32 tmuGbeInit;
    FxU32 vgaInit0;
    FxU32 vgaInit1;
    FxU32 dramCommand;
    FxU32 dramData;
    FxU32 reservedZ[2];

  // PLL Registers
    FxU32 pllCtrl0;
    FxU32 pllCtrl1;
    FxU32 pllCtrl2;

  // DAC Registers
    FxU32 dacMode;
    FxU32 dacAddr;
    FxU32 dacData;

  // Video Registers I
    FxU32 vidMaxRGBDelta;
    FxU32 vidProcCfg;
    FxU32 hwCurPatAddr;
    FxU32 hwCurLoc;
    FxU32 hwCurC0;
    FxU32 hwCurC1;
    FxU32 vidInFormat;
    FxU32 vidInStatus;
    FxU32 vidSerialParallelPort;
    FxU32 vidInXDecimDeltas;
    FxU32 vidInDecimInitErrs;
    FxU32 vidInYDecimDeltas;
    FxU32 vidPixelBufThold;
    FxU32 vidChromaMin;
    FxU32 vidChromaMax;
    FxU32 vidCurrentLine;
    FxU32 vidScreenSize;
    FxU32 vidOverlayStartCoords;
    FxU32 vidOverlayEndScreenCoord;
    FxU32 vidOverlayDudx;
    FxU32 vidOverlayDudxOffsetSrcWidth;
    FxU32 vidOverlayDvdy;

  // VGA Registers
    FxU32 vgaRegister[12];

  // Video Registers II
    FxU32 vidOverlayDvdyOffset;
    FxU32 vidDesktopStartAddr;
    FxU32 vidDesktopOverlayStride;
    FxU32 vidInAddr0;
    FxU32 vidInAddr1;
    FxU32 vidInAddr2;
    FxU32 vidInStride;
    FxU32 vidCurrOverlayStartAddr;
} SstIORegs;

typedef volatile struct cmdfifo {
    FxU32 baseAddrL;
    FxU32 baseSize;
    FxU32 bump;
    FxU32 readPtrL;
    FxU32 readPtrH;
    FxU32 aMin;
    FxU32 unusedA;
    FxU32 aMax;
    FxU32 unusedB;
    FxU32 depth;
    FxU32 holeCount;
    FxU32 reserved;
} CmdFifo;

//---------- SST chip AGP/CMD Transfer/Misc Register layout ------------------
typedef volatile struct sstcregs {
  // AGP
    FxU32 agpReqSize;
    FxU32 hostAddrLow;
    FxU32 hostAddrHigh;
    FxU32 graphicsAddr;
    FxU32 graphicsStride;
    FxU32 moveCMD;
    FxU32 reservedL[2];

  // CMD FIFO 0,1
    CmdFifo cmdFifo0;
    CmdFifo cmdFifo1;

    FxU32 cmdFifoThresh;
    FxU32 cmdHoleInit;
    FxU32 reservedO[6];
    FxU32 reservedP[8];
    FxU32 reservedQ[8];
    FxU32 reservedR[8];
  // misc
    FxU32 yuvBaseAddr;
    FxU32 yuvStride;
    FxU32 reservedS[6];
    FxU32 crc1;
    FxU32 reservedT[3];
    FxU32 crc2;
} SstCRegs;

//----------------- SST chip 2D layout -------------------------
typedef volatile struct sstgregs {      // THE 2D CHIP
    FxU32 status;                       // aliased status register
    FxU32 unused0;
    FxU32 clip0min;
    FxU32 clip0max;
    FxU32 dstBaseAddr;
    FxU32 dstFormat;
    FxU32 srcColorkeyMin;
    FxU32 srcColorkeyMax;
    FxU32 dstColorkeyMin;
    FxU32 dstColorkeyMax;
    FxU32 bresError0;
    FxU32 bresError1;
    FxU32 rop;
    FxU32 srcBaseAddr;
    FxU32 commandEx;
    FxU32 lineStipple;
    FxU32 lineStyle;
    FxU32 pattern0alias;
    FxU32 pattern1alias;
    FxU32 clip1min;
    FxU32 clip1max;
    FxU32 srcFormat;
    FxU32 srcSize;
    FxU32 srcXY;
    FxU32 colorBack;
    FxU32 colorFore;
    FxU32 dstSize;
    FxU32 dstXY;
    FxU32 command;
    FxU32 reserved[3];
    FxU32 launch[32];
    FxU32 colorPattern[64];
#if COLORTRANSLUT
    FxU32 colorTransLut[256];
#endif
} SstGRegs;

// STB Begin changes
// STB-SR 1/13/99 Adding code for bj
#ifndef _H2INC
// STB End changes

#if defined(__alpha__) || defined(__LP64__)
typedef unsigned int Reg32u;
typedef int Reg32;
#else
typedef unsigned long Reg32u;
typedef long Reg32;
#endif

//----------------- SST chip 3D layout -------------------------
// registers are in groups of 8 for easy decode
typedef struct vertex_Rec {
    Reg32u x;            // 12.4 format
    Reg32u y;            // 12.4
} vtxRec;

typedef volatile struct sstregs {       // THE 3D CHIP
                                        // EXTERNAL registers
    FxU32 status;               // chip status, Read Only
    FxU32 intrCtrl;             // interrupt control
    vtxRec vA;                  // Vertex A,B,C
    vtxRec vB;
    vtxRec vC;

    Reg32 r;             // 12.12        Parameters
    Reg32 g;             // 12.12
    Reg32 b;             // 12.12
    Reg32 z;             // 20.12
    Reg32 a;             // 12.12
    Reg32 s;             // 14.18
    Reg32 t;             // 14.18
    Reg32 w;             //  2.30

    Reg32 drdx;                  // X Gradients
    Reg32 dgdx;
    Reg32 dbdx;
    Reg32 dzdx;
    Reg32 dadx;
    Reg32 dsdx;
    Reg32 dtdx;
    Reg32 dwdx;

    Reg32 drdy;                  // Y Gradients
    Reg32 dgdy;
    Reg32 dbdy;
    Reg32 dzdy;
    Reg32 dady;
    Reg32 dsdy;
    Reg32 dtdy;
    Reg32 dwdy;

    Reg32u triangleCMD;  // execute a triangle command (float)
    Reg32u reservedA;
    vtxRec FvA;                 // floating point version
    vtxRec FvB;
    vtxRec FvC;

    Reg32 Fr;                    // floating point version
    Reg32 Fg;
    Reg32 Fb;
    Reg32 Fz;
    Reg32 Fa;
    Reg32 Fs;
    Reg32 Ft;
    Reg32 Fw;

    Reg32 Fdrdx;
    Reg32 Fdgdx;
    Reg32 Fdbdx;
    Reg32 Fdzdx;
    Reg32 Fdadx;
    Reg32 Fdsdx;
    Reg32 Fdtdx;
    Reg32 Fdwdx;

    Reg32 Fdrdy;
    Reg32 Fdgdy;
    Reg32 Fdbdy;
    Reg32 Fdzdy;
    Reg32 Fdady;
    Reg32 Fdsdy;
    Reg32 Fdtdy;
    Reg32 Fdwdy;

    Reg32u FtriangleCMD;         // execute a triangle command
    Reg32u fbzColorPath;         // color select and combine
    Reg32u fogMode;              // fog Mode
    Reg32u alphaMode;            // alpha Mode
    Reg32u fbzMode;              // framebuffer and Z mode
    Reg32u lfbMode;              // linear framebuffer Mode
    Reg32u clipLeftRight;        // (6)10(6)10
    Reg32u clipBottomTop;        // (6)10(6)10

    Reg32u nopCMD;       // execute a nop command
    Reg32u fastfillCMD;  // execute a fast fill command
    Reg32u swapbufferCMD;// execute a swapbuffer command
    Reg32u fogColor;             // (8)888
    Reg32u zaColor;              // 8(8)16
    Reg32u chromaKey;            // (8)888
    Reg32u chromaRange;
    Reg32u userIntrCmd;

    Reg32u stipple;              // 32 bits, MSB masks pixels
    Reg32u c0;                   // 8.8.8.8 (ARGB)
    Reg32u c1;                   // 8.8.8.8 (ARGB)
    struct {                            // statistic gathering variables
        Reg32u fbiPixelsIn;
        Reg32u fbiChromaFail;
        Reg32u fbiZfuncFail;
        Reg32u fbiAfuncFail;
        Reg32u fbiPixelsOut;
    } stats;

    Reg32u fogTable[32];         // 64 entries, 2 per word, 2 bytes each

    Reg32u reservedB[3];

    Reg32u colBufferAddr;
    Reg32u colBufferStride;
    Reg32u auxBufferAddr;
    Reg32u auxBufferStride;
    Reg32u reservedC;

    Reg32u clipLeftRight1;
    Reg32u clipBottomTop1;
    Reg32u reservedD[6];         // NOTE: used to store TMUprivate ptr
                                        

    Reg32u reservedE[8];

    Reg32u reservedF[3];  
    Reg32u swapBufferPend;
    Reg32u leftOverlayBuf;
    Reg32u rightOverlayBuf;
    Reg32u fbiSwapHistory;
    Reg32u fbiTrianglesOut;      // triangles out counter

    FxU32 sSetupMode;
    FxU32 sVx;
    FxU32 sVy;
    FxU32 sARGB;
    FxU32 sRed;
    FxU32 sGreen;
    FxU32 sBlue;
    FxU32 sAlpha;

    FxU32 sVz;
    FxU32 sOowfbi;
    FxU32 sOow0;
    FxU32 sSow0;
    FxU32 sTow0;
    FxU32 sOow1;
    FxU32 sSow1;
    FxU32 sTow1;

    FxU32 sDrawTriCMD;
    FxU32 sBeginTriCMD;
    Reg32u reservedG[6];

    Reg32u reservedH[8];

    Reg32u reservedI[8];

    Reg32u textureMode;          // texture Mode
    Reg32u tLOD;                 // texture LOD settings
    Reg32u tDetail;              // texture detail settings
    Reg32u texBaseAddr;          // current texture base address
    Reg32u texBaseAddr1;
    Reg32u texBaseAddr2;
    Reg32u texBaseAddr38;
    Reg32u trexInit0;            // hardware init bits
    Reg32u trexInit1;            // hardware init bits
   
    Reg32u nccTable0[12];        // NCC decode tables, bits are packed
    Reg32u nccTable1[12];        // 4 words Y, 4 words I, 4 words Q

    Reg32u tChromaKeyMin;
    Reg32u tChromaKeyMax;
} SstRegs;

// STB Begin changes
#endif // #ifndef _H2INC
// STB End changes

#endif /* !__H3REGS_H__ */