fixed logging and more
[retroray] / libs / glide / 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: /engr/DEVEL/SST1/GLIDE/DOS/SRC/GLIDESYS.H 2     6/08/96 4:16p Dow $
18 ** $Log: /engr/DEVEL/SST1/GLIDE/DOS/SRC/GLIDESYS.H $
19 */
20 #ifndef __GLIDESYS_H__
21 #define __GLIDESYS_H__
22
23 /*
24 n** -----------------------------------------------------------------------
25 ** COMPILER/ENVIRONMENT CONFIGURATION
26 ** -----------------------------------------------------------------------
27 */
28
29 /* Endianness is stored in bits [30:31] */
30 #define GLIDE_ENDIAN_SHIFT      30
31 #define GLIDE_ENDIAN_LITTLE     (0x1 << GLIDE_ENDIAN_SHIFT)
32 #define GLIDE_ENDIAN_BIG        (0x2 << GLIDE_ENDIAN_SHIFT)
33
34 /* OS is stored in bits [0:6] */
35 #define GLIDE_OS_SHIFT          0
36 #define GLIDE_OS_UNIX           0x1
37 #define GLIDE_OS_DOS32          0x2
38 #define GLIDE_OS_WIN32          0x4
39 #define GLIDE_OS_SYSTEM7        0x8
40 #define GLIDE_OS_OS2            0x10
41 #define GLIDE_OS_OTHER          0x20 /* For Proprietary Arcade HW */
42
43 /* Sim vs. Hardware is stored in bits [7:8] */
44 #define GLIDE_SST_SHIFT         7
45 #define GLIDE_SST_SIM           (0x1 << GLIDE_SST_SHIFT)
46 #define GLIDE_SST_HW            (0x2 << GLIDE_SST_SHIFT )
47
48 /* Hardware Type is stored in bits [9:12] */
49 #define GLIDE_HW_SHIFT          9
50 #define GLIDE_HW_SST1           (0x1 << GLIDE_HW_SHIFT)
51 #define GLIDE_HW_SST96          (0x2 << GLIDE_HW_SHIFT)
52 #define GLIDE_HW_SSTH3          (0x4 << GLIDE_HW_SHIFT)
53 #define GLIDE_HW_SST2           (0x8 << GLIDE_HW_SHIFT)
54
55 /*
56 ** Make sure we handle all instances of WIN32
57 */
58 #ifndef __WIN32__
59 #  if defined ( _WIN32 ) || defined (WIN32) || defined(__NT__)
60 #    define __WIN32__
61 #  endif
62 #endif
63
64 /* We need two checks on the OS: one for endian, the other for OS */
65 /* Check for endianness */
66 #if defined(__IRIX__) || defined(__sparc__) || defined(MACOS)
67 #  define GLIDE_ENDIAN    GLIDE_ENDIAN_BIG
68 #else
69 #  define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE
70 #endif
71
72 /* Check for OS */
73 #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__)
74 #  define GLIDE_OS        GLIDE_OS_UNIX
75 #elif defined(__DOS__)
76 #  define GLIDE_OS        GLIDE_OS_DOS32
77 #elif defined(__WIN32__)
78 #  define GLIDE_OS        GLIDE_OS_WIN32
79 #endif
80
81 /* Check for Simulator vs. Hardware */
82 #ifdef GLIDE_SIMULATOR
83 #  define GLIDE_SST       GLIDE_SST_SIM
84 #else
85 #  define GLIDE_SST     GLIDE_SST_HW
86 #endif
87
88 /* Check for type of hardware */
89 #ifdef SST96
90 #  define GLIDE_HW        GLIDE_HW_SST96
91 #elif defined(SSTH3)
92 #  define GLIDE_HW        GLIDE_HW_SSTH3
93 #elif defined(SST2)
94 #  define GLIDE_HW        GLIDE_HW_SST2
95 #else /* Default to SST1 */
96 #  define GLIDE_HW        GLIDE_HW_SST1
97 #endif
98
99
100 #define GLIDE_PLATFORM (GLIDE_ENDIAN | GLIDE_OS | GLIDE_SST | GLIDE_HW)
101
102 /*
103 ** Control the number of TMUs
104 */
105 #ifndef GLIDE_NUM_TMU
106 #  define GLIDE_NUM_TMU 2
107 #endif
108
109
110 #if ( ( GLIDE_NUM_TMU < 0 ) && ( GLIDE_NUM_TMU > 3 ) )
111 #  error "GLIDE_NUM_TMU set to an invalid value"
112 #endif
113
114 #endif /* __GLIDESYS_H__ */