1 /*---------------------------------------------------------------------------*
2   Project:  Dolphin GX library
3   File:     GXStruct.h
4 
5   Copyright 1998- 2002 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Log: GXStruct.h,v $
14   Revision 1.2  2006/02/04 11:56:46  hashida
15   (none)
16 
17   Revision 1.1.1.1  2005/12/29 06:53:28  hiratsu
18   Initial import.
19 
20   Revision 1.1.1.1  2005/05/12 02:41:07  yasuh-to
21   Ported from dolphin source tree.
22 
23 
24     11    2002/08/12 17:01 Hirose
25     Turned off padding warnings in this header file.
26 
27     10    2002/07/24 9:07 Hirose
28     Resolved version conflicts.
29 
30     9     2001/05/10 9:43p Hirose
31     added tag for each structure definition
32 
33     8     2001/01/24 5:09p Carl
34     Fixed texobj, texregion for emulator.
35 
36     7     2001/01/19 7:54p Carl
37     Optimized TexObjs and TexRegions.
38 
39     6     2000/10/30 6:26p Carl
40     Had to enlarge GXTlutRegion to accommodate change in tlut data.
41 
42     5    2000/04/04 11:17a Alligator
43     Moved constants from GXStruct.h to GXEnum.h since they are dependent on
44     enumerated values.
45 
46     4     2000/03/13 6:18p Danm
47     Fixed AA sampling locations to use x,y pairs.
48 
49     3     2000/01/26 4:06p Hashida
50     Include vitypes.h instead of vi.h
51 
52     2     2000/01/13 5:55p Alligator
53     Integrated with ArtX GX library code
54 
55     18    1999/11/17 10:23p Hirose
56     Changed size of some structures
57 
58     17    1999/11/16 6:17p Alligator
59 
60     16    1999/11/15 4:42p Hirose
61     Changed size of GXTexObj and GXTexRegion
62 
63     15    1999/10/26 8:04p Alligator
64     Added s10-bit color
65 
66     14    1999/10/24 7:42a Yasu
67     Added GX_MAX_TEXMAP
68 
69     13    1999/10/22 4:07p Yasu
70     Added definitions of HW information
71 
72     12    1999/10/11 10:20a Hirose
73     Changed size of GXTexObj
74 
75     11    1999/10/04 2:42p Yasu
76     Added GXInitFogAdjTable
77 
78     10    1999/09/21 2:33p Alligator
79     Added aa flag, if aa set 16b pix format
80 
81     9     1999/09/21 11:49a Hirose
82     Changed GXTlutRegion size
83 
84     8     1999/09/17 3:38p Hirose
85     Changed GXTlutObj size
86 
87     7     1999/09/16 3:49p Alligator
88 
89     6     1999/09/16 3:42p Alligator
90     update render mode api
91 
92     5     1999/09/09 3:04p Alligator
93     Moved GXSetRenderMode to GX lib from emu
94 
95     4     1999/09/02 3:18p Ryan
96     Made Frame Buffer Api changes
97 
98     3     1999/09/01 2:27p Ryan
99     Added temp GXTesRegion and GXTlutRegion structs
100 
101     2     1999/07/20 6:10p Alligator
102     Added GXGetVtxDescv, GXGetVtxAttrFmtv
103 
104     1     1999/07/14 4:20p Alligator
105     Split gx.h into individual header files for each major section of API
106   $NoKeywords: $
107  *---------------------------------------------------------------------------*/
108 
109 #ifndef __GXSTRUCT_H__
110 #define __GXSTRUCT_H__
111 
112 /********************************/
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116 
117 /********************************/
118 #include <revolution/types.h>
119 #include <revolution/gx/GXEnum.h>
120 #include <revolution/vi/vitypes.h>
121 
122 /*---------------------------------------------------------------------------*/
123 
124 #ifdef __MWERKS__
125 #pragma warn_padding    off
126 #endif // __MWERKS__
127 
128 /*---------------------------------------------------------------------------*/
129 
130 /********************************/
131 typedef struct _GXColor
132 {
133     u8  r,
134         g,
135         b,
136         a;
137 
138 } GXColor;
139 
140 typedef struct _GXColorS10
141 {
142     s16    r, g, b, a; // s10-bit components for Tev constant color
143 } GXColorS10;
144 
145 /********************************/
146 typedef struct _GXTexObj
147 {
148 #ifdef EMU
149     u32 dummy[16]; // Emulator version
150 #else
151     u32 dummy[8];  // Real hardware version
152 #endif
153 } GXTexObj;
154 
155 /********************************/
156 typedef struct _GXTlutObj
157 {
158     u32 dummy[3];
159 
160 } GXTlutObj;
161 
162 /********************************/
163 typedef struct _GXLightObj
164 {
165     u32 dummy[16];
166 
167 } GXLightObj;
168 
169 /********************************/
170 typedef struct _GXVtxAttrFmtList
171 {
172     GXAttr        attr;
173     GXCompCnt     cnt;
174     GXCompType    type;
175     u8            frac;
176 
177 } GXVtxAttrFmtList;
178 
179 /********************************/
180 typedef struct _GXTexRegion
181 {
182 #ifdef EMU
183     u32 dummy[8]; // Emulator version
184 #else
185     u32 dummy[4]; // Real hardware version
186 #endif
187 } GXTexRegion;
188 
189 /********************************/
190 typedef struct _GXTlutRegion
191 {
192     u32 dummy[4];
193 
194 } GXTlutRegion;
195 
196 /********************************/
197 typedef struct _GXVtxDescList
198 {
199     GXAttr        attr;
200     GXAttrType    type;
201 
202 } GXVtxDescList;
203 
204 /********************************/
205 typedef struct _GXRenderModeObj
206 {
207     VITVMode          viTVmode;
208     u16               fbWidth;   // No xscale from efb to xfb
209     u16               efbHeight; // embedded frame buffer
210     u16               xfbHeight; // external frame buffer, may yscale efb
211     u16               viXOrigin;
212     u16               viYOrigin;
213     u16               viWidth;
214     u16               viHeight;
215     VIXFBMode         xFBmode;   // Whether single-field or double-field in
216                                  // XFB.
217     u8                field_rendering;    // Rendering fields or frames?
218     u8                aa;                 // Anti-aliasing on?
219     u8                sample_pattern[12][2]; // aa sample pattern
220     u8                vfilter[7];         // Vertical filter coefficients
221 } GXRenderModeObj;
222 
223 /********************************/
224 typedef struct _GXFogAdjTable
225 {
226     u16			r[10];
227 } GXFogAdjTable;
228 
229 /********************************/
230 
231 /*---------------------------------------------------------------------------*/
232 
233 #ifdef __MWERKS__
234 #pragma warn_padding    reset
235 #endif // __MWERKS__
236 
237 /*---------------------------------------------------------------------------*/
238 #ifdef __cplusplus
239 }
240 #endif
241 
242 #endif
243