source: trunk/src/opengl/glide/cvg/incsrc/fxhal.h

Last change on this file was 2888, checked in by sandervl, 26 years ago

Created Voodoo 2 dir

File size: 5.9 KB
Line 
1/*-*-c++-*-*/
2#ifndef __FXHAL_H__
3#define __FXHAL_H__
4
5/*
6** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
7** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
8** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
9** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
10** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
11** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
12** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
13** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
14**
15** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
16** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
17** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
18** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
19** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
20** THE UNITED STATES.
21**
22** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
23**
24** $Revision: 1.1 $
25** $Date: 2000-02-25 00:37:49 $
26*/
27
28#if defined(BUILD_HAL)
29#define FX_DLL_DEFINITION
30#endif
31#include <fxdll.h>
32
33#include <cvginfo.h>
34
35// Allow SourceSafe to track Revision values
36#define HAL_H_REV "$Revision: 1.1 $"
37
38// Just to unconfuse myself:
39//
40// CHIP FBI-REV TMU-REV DEV-ID
41// SST1-0.6u 1 0 1
42// SST1-0.5u 2 1 1
43// SST-96 2 (1) 2
44// H3 3 4 4
45// H4 ? ? 4?
46#define SST_DEVICE_ID_SST1 1
47#define SST_DEVICE_ID_SST96 2
48#define SST_DEVICE_ID_H3 3
49
50#define MBYTE(n) (((FxU32)(n))<<20)
51#define DEAD 0xDEAD
52
53// Maximum number of boards and TMUs supported
54#define HAL_MAX_BOARDS 16
55
56//----------------------------------------------------------------------
57// the root of all Hal information
58//----------------------------------------------------------------------
59typedef struct {
60 int csim;
61 int hsim;
62 int hw;
63 FxU32 boardsFound; // number of boards found
64 FxDeviceInfo boardInfo[HAL_MAX_BOARDS];
65
66 int pollLimit; // number of pixels to poll msg Q after
67 int pollCount; // current pixel counter
68 int video; // video output enabled
69 FxU32 csimLastRead;
70} HalInfo;
71
72//----------------------------------------------------------------------
73/*
74** SST Hardware Initialization routine protypes
75**
76** If all initialization routines are called, it is assumed they are called
77** in the following order:
78** 0. fxHalInit();
79** 1. fxHalMapBoard();
80** 2. fxHalInitRegisters();
81** 3. fxHalInitGamma();
82** 4. fxHalInitVideo();
83** 5. fxHalShutdown();
84**
85** fxHalShutdown() is called at the end of an application to turn off
86** the graphics subsystem
87**
88*/
89
90FX_ENTRY void FX_CALL fxHalPutenv(char *buf);
91FX_ENTRY HalInfo * FX_CALL fxHalInit(FxU32 flags);
92FX_ENTRY FxU32 FX_CALL fxHalNumBoardsInSystem(void);
93FX_ENTRY SstRegs * FX_CALL fxHalMapBoard(FxU32 boardNum);
94FX_ENTRY FxBool FX_CALL fxHalInitCmdFifo( SstRegs *sst, int which,
95 FxU32 fifoStart, FxU32 size,
96 FxBool directExec, FxBool disableHoles,
97 FxSet32Proc set32);
98FX_ENTRY FxBool FX_CALL fxHalInitRegisters(SstRegs *sst);
99FX_ENTRY FxBool FX_CALL fxHalInitRenderingRegisters(SstRegs *sst);
100FX_ENTRY FxBool FX_CALL fxHalInitGamma(SstRegs *sst, FxFloat gamma);
101FX_ENTRY FxBool FX_CALL fxHalInitGammaRGB(SstRegs *sst, FxFloat r, FxFloat g, FxFloat b);
102FX_ENTRY FxBool FX_CALL fxHalInitVideo(SstRegs *sst, FxU32 resolution,
103 FxU32 refresh, sst1VideoTimingStruct *);
104FX_ENTRY FxBool FX_CALL fxHalIdle(SstRegs *sst);
105FX_ENTRY FxBool FX_CALL fxHalIdleNoNOP(SstRegs *sst);
106FX_ENTRY FxBool FX_CALL fxHalIdleFBINoNOP( SstRegs *sst );
107FX_ENTRY FxBool FX_CALL fxHalShutdown(SstRegs *sst);
108FX_ENTRY FxBool FX_CALL fxHalInitUSWC(SstRegs *sst);
109FX_ENTRY void FX_CALL fxHalShutdownAll(void);
110FX_ENTRY FxBool FX_CALL fxHalGetDeviceInfo(SstRegs *sst, FxDeviceInfo *);
111FX_ENTRY FxBool FX_CALL fxHalInitSLI(SstRegs *sst, SstRegs *sst1);
112
113FX_ENTRY FxBool FX_CALL fxHalVsync(SstRegs *sst);
114FX_ENTRY FxBool FX_CALL fxHalVsyncNot(SstRegs *sst);
115
116
117 #define GET8(s) s
118 #define GET16(s) s
119 #define GET(s) s
120 #define SET8(d,s) d = s
121 #define SET16(d,s) d = s
122 #define SET(d,s) d = s
123 #define SETF(d,s) (*(float *)&(d)) = s
124
125//---------------------------------------------------------------------------
126// internal HAL stuff not meant for external use
127//---------------------------------------------------------------------------
128#if defined(BUILD_HAL) || defined(BUILD_DIAGS)
129
130// GMT: Init code SET/GET always go thru subroutines (allows for P6 fencing)
131#define IGET(A) fxHalRead32((FxU32 *) &(A))
132#define ISET(A,D) fxHalWrite32((FxU32 *) &(A), D)
133
134// this is the FAKE address where the hardware lives
135// we use a large address so attempts to write to it get an access violation
136// and it has 28 zero bits so that we can easily figure out the board number
137// and the offset into the board
138#define SST_FAKE_ADDRESS_MAKE(i) (SstRegs *)((i+1)<<28)
139#define SST_FAKE_ADDRESS_GET_BOARD(a) ((((FxU32)a>>28)&0xF)-1)
140#define SST_FAKE_ADDRESS_GET_OFFSET(a) ((FxU32)a&0x0FFFFFFF)
141#define SST_FAKE_ADDRESS_GET_BASE(a) ((FxI32)a&~0x0FFFFFFF)
142
143extern HalInfo halInfo;
144
145// internal HAL routines
146FxU32 fxHalRead32(FxU32 *addr);
147void fxHalWrite32(FxU32 *addr, FxU32 data);
148
149FxBool fxHalIdleFBI( SstRegs *sst );
150
151void fxHalResetBoardInfo( FxDeviceInfo *info );
152FxBool fxHalFillDeviceInfo( SstRegs *sst );
153// FxBool fxHalGetFbiInfo( SstRegs *sst, FxDeviceInfo *info );
154// FxBool fxHalGetTmuInfo( SstRegs *sst, FxDeviceInfo *info );
155FxBool fxHalVaddrToBoardNumber( SstRegs *sst, FxU32 *boardNumber );
156
157// GUI interface
158FX_ENTRY void FX_CALL guiNewViewWindow(FxU32 boardNumber, const char *name);
159void guiReadMessageQueue(void);
160FxBool guiOpen( FxU32 boardNumber );
161void guiShutdown( SstRegs *sst );
162
163#endif /* BUILD_HAL */
164
165#endif /* !__FXHAL_H__ */
Note: See TracBrowser for help on using the repository browser.