]> icculus.org git repositories - taylor/freespace2.git/blob - include/glidesys.h
Initial revision
[taylor/freespace2.git] / include / glidesys.h
1 /*
2 ** Copyright (c) 1995, 3Dfx Interactive, Inc.
3 ** All Rights Reserved.
4 **
5 ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
6 ** the contents of this file may not be disclosed to third parties, copied or
7 ** duplicated in any form, in whole or in part, without the prior written
8 ** permission of 3Dfx Interactive, Inc.
9 **
10 ** RESTRICTED RIGHTS LEGEND:
11 ** Use, duplication or disclosure by the Government is subject to restrictions
12 n** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
13 ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
14 ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
15 ** rights reserved under the Copyright Laws of the United States.
16 **
17 ** $Header$
18 ** $Log$
19 ** Revision 1.1  2002/05/03 03:28:12  root
20 ** Initial revision
21 **
22  * 
23  * 2     10/07/98 10:52a Dave
24  * Initial checkin.
25  * 
26  * 1     10/07/98 10:48a Dave
27  * 
28  * 2     2/27/98 3:25p Frank
29  * (John/Frank K.) updated to 2.43 headers
30  * 
31  * 1     10/16/97 11:51a Klier
32 */
33 #ifndef __GLIDESYS_H__
34 #define __GLIDESYS_H__
35
36 /*
37 n** -----------------------------------------------------------------------
38 ** COMPILER/ENVIRONMENT CONFIGURATION
39 ** -----------------------------------------------------------------------
40 */
41
42 /* Endianness is stored in bits [30:31] */
43 #define GLIDE_ENDIAN_SHIFT      30
44 #define GLIDE_ENDIAN_LITTLE     (0x1 << GLIDE_ENDIAN_SHIFT)
45 #define GLIDE_ENDIAN_BIG        (0x2 << GLIDE_ENDIAN_SHIFT)
46
47 /* OS is stored in bits [0:6] */
48 #define GLIDE_OS_SHIFT          0
49 #define GLIDE_OS_UNIX           0x1
50 #define GLIDE_OS_DOS32          0x2
51 #define GLIDE_OS_WIN32          0x4
52 #define GLIDE_OS_SYSTEM7        0x8
53 #define GLIDE_OS_OS2            0x10
54 #define GLIDE_OS_OTHER          0x20 /* For Proprietary Arcade HW */
55
56 /* Sim vs. Hardware is stored in bits [7:8] */
57 #define GLIDE_SST_SHIFT         7
58 #define GLIDE_SST_SIM           (0x1 << GLIDE_SST_SHIFT)
59 #define GLIDE_SST_HW            (0x2 << GLIDE_SST_SHIFT )
60
61 /* Hardware Type is stored in bits [9:12] */
62 #define GLIDE_HW_SHIFT          9
63 #define GLIDE_HW_SST1           (0x1 << GLIDE_HW_SHIFT)
64 #define GLIDE_HW_SST96          (0x2 << GLIDE_HW_SHIFT)
65 #define GLIDE_HW_SSTH3          (0x4 << GLIDE_HW_SHIFT)
66 #define GLIDE_HW_SST2           (0x8 << GLIDE_HW_SHIFT)
67
68 /*
69 ** Make sure we handle all instances of WIN32
70 */
71 #ifndef __WIN32__
72 #  if defined ( _WIN32 ) || defined (WIN32) || defined(__NT__)
73 #    define __WIN32__
74 #  endif
75 #endif
76
77 /* We need two checks on the OS: one for endian, the other for OS */
78 /* Check for endianness */
79 #if defined(__IRIX__) || defined(__sparc__) || defined(MACOS)
80 #  define GLIDE_ENDIAN    GLIDE_ENDIAN_BIG
81 #else
82 #  define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE
83 #endif
84
85 /* Check for OS */
86 #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__)
87 #  define GLIDE_OS        GLIDE_OS_UNIX
88 #elif defined(__DOS__)
89 #  define GLIDE_OS        GLIDE_OS_DOS32
90 #elif defined(__WIN32__)
91 #  define GLIDE_OS        GLIDE_OS_WIN32
92 #endif
93
94 /* Check for Simulator vs. Hardware */
95 #ifdef GLIDE_SIMULATOR
96 #  define GLIDE_SST       GLIDE_SST_SIM
97 #else
98 #  define GLIDE_SST     GLIDE_SST_HW
99 #endif
100
101 /* Check for type of hardware */
102 #ifdef SST96
103 #  define GLIDE_HW        GLIDE_HW_SST96
104 #elif defined(SSTH3)
105 #  define GLIDE_HW        GLIDE_HW_SSTH3
106 #elif defined(SST2)
107 #  define GLIDE_HW        GLIDE_HW_SST2
108 #else /* Default to SST1 */
109 #  define GLIDE_HW        GLIDE_HW_SST1
110 #endif
111
112
113 #define GLIDE_PLATFORM (GLIDE_ENDIAN | GLIDE_OS | GLIDE_SST | GLIDE_HW)
114
115 /*
116 ** Control the number of TMUs
117 */
118 #ifndef GLIDE_NUM_TMU
119 #  define GLIDE_NUM_TMU 2
120 #endif
121
122
123 #if ( ( GLIDE_NUM_TMU < 0 ) && ( GLIDE_NUM_TMU > 3 ) )
124 #  error "GLIDE_NUM_TMU set to an invalid value"
125 #endif
126
127 #endif /* __GLIDESYS_H__ */
128