static.c
10.2 KB
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
/********************************************************************************
NINTENDO64 Disk Drive IPL4
static data module
January 6, 1997
********************************************************************************/
#include <ultra64.h>
#include "static.h"
#include "mark_texture.inc"
#include "ncube_texture.inc"
#include "clock_texture.inc"
/********************************************************************************/
/* */
/* Identity matrix */
/* */
/********************************************************************************/
Mtx IdentMatrix = {
0x00010000, 0x00000000, 0x00000001, 0x00000000,
0x00000000, 0x00010000, 0x00000000, 0x00000001,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000
};
/********************************************************************************/
/* */
/* View port record. */
/* */
/********************************************************************************/
Vp ViewPort = {
640, 480, G_MAXZ/2, 0,
640, 480, G_MAXZ/2, 0
};
/********************************************************************************/
/* */
/* Light records. */
/* */
/********************************************************************************/
Light CubeDiffuseLight = { 255,255,255,0, 255,255,255,0, 24, 70, 66,0 };
Light CubeAmbientLight = { 127,127,127,0, 127,127,127,0, 0, 0, 0,0 };
Light WaveDiffuseLight = { 255,255,255,0, 255,255,255,0, 24, 56, 66,0 };
Light WaveAmbientLight = { 72, 72, 72,0, 72, 72, 72,0, 0, 0, 0,0 };
/********************************************************************************/
/* */
/* Wave plane. */
/* */
/********************************************************************************/
Gfx Gfx_WavePlaneA[] = {
gsSP2Triangles( 0,13, 1, 0, 13,14, 1, 0),
gsSP2Triangles( 1,15, 2, 0, 14,15, 1, 0),
gsSP2Triangles( 2,15, 3, 0, 15,16, 3, 0),
gsSP2Triangles( 3,17, 4, 0, 16,17, 3, 0),
gsSP2Triangles( 4,17, 5, 0, 17,18, 5, 0),
gsSP2Triangles( 5,19, 6, 0, 18,19, 5, 0),
gsSP2Triangles( 6,19, 7, 0, 19,20, 7, 0),
gsSP2Triangles( 7,21, 8, 0, 20,21, 7, 0),
gsSP2Triangles( 8,21, 9, 0, 21,22, 9, 0),
gsSP2Triangles( 9,23,10, 0, 22,23, 9, 0),
gsSP2Triangles(10,23,11, 0, 23,24,11, 0),
gsSP2Triangles(11,25,12, 0, 24,25,11, 0),
gsSPEndDisplayList()
};
Gfx Gfx_WavePlaneB[] = {
gsSP2Triangles( 0, 1,13, 0, 13, 1,14, 0),
gsSP2Triangles( 1, 2,15, 0, 14, 1,15, 0),
gsSP2Triangles( 2, 3,15, 0, 15, 3,16, 0),
gsSP2Triangles( 3, 4,17, 0, 16, 3,17, 0),
gsSP2Triangles( 4, 5,17, 0, 17, 5,18, 0),
gsSP2Triangles( 5, 6,19, 0, 18, 5,19, 0),
gsSP2Triangles( 6, 7,19, 0, 19, 7,20, 0),
gsSP2Triangles( 7, 8,21, 0, 20, 7,21, 0),
gsSP2Triangles( 8, 9,21, 0, 21, 9,22, 0),
gsSP2Triangles( 9,10,23, 0, 22, 9,23, 0),
gsSP2Triangles(10,11,23, 0, 23,11,24, 0),
gsSP2Triangles(11,12,25, 0, 24,11,25, 0),
gsSPEndDisplayList()
};
/********************************************************************************/
/* */
/* Flat plane */
/* */
/********************************************************************************/
static Vtx Vtx_FlatPlane[] = {
{ -2896, 0, -2896-1326, 0,0, 0, 0,127,0, 255 },
{ -2896, 0, 2896-1326, 0,0, 0, 0,127,0, 255 },
{ 2896, 0, 2896-1326, 0,0, 0, 0,127,0, 255 },
{ 2896, 0, -2896-1326, 0,0, 0, 0,127,0, 255 }
};
Gfx Gfx_FlatPlane[] = {
gsDPSetRenderMode (G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2),
gsDPSetCombineMode(G_CC_ENVSHADE, G_CC_ENVSHADE),
gsSPMatrix (&IdentMatrix, G_MTX_MODELVIEW|G_MTX_LOAD|G_MTX_NOPUSH),
gsSPVertex (Vtx_FlatPlane, 4, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsSPEndDisplayList()
};
/********************************************************************************/
/* */
/* Mask plane */
/* */
/********************************************************************************/
static Vtx Vtx_MaskPlane[] = {
{ -160, 120, 0, 0,0, 0, 0,127,0, 128 },
{ -160, -120, 0, 0,0, 0, 0,127,0, 128 },
{ 160, -120, 0, 0,0, 0, 0,127,0, 128 },
{ 160, 120, 0, 0,0, 0, 0,127,0, 128 }
};
Gfx Gfx_MaskPlane[] = {
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode (G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
gsDPSetCombineMode(G_CC_FADER, G_CC_FADER),
gsSPMatrix (&IdentMatrix, G_MTX_MODELVIEW|G_MTX_LOAD|G_MTX_NOPUSH),
gsSPVertex (Vtx_MaskPlane, 4, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsSPEndDisplayList()
};
/********************************************************************************/
/* */
/* Leaf data. */
/* */
/********************************************************************************/
static Vtx Vtx_Leaf[] = {
{ -120, -120, 0, 0, 0<<5, 15<<5, 255, 255, 255, 255 },
{ 120, -120, 0, 0, 15<<5, 15<<5, 255, 255, 255, 255 },
{ 120, 120, 0, 0, 15<<5, 0<<5, 255, 255, 255, 255 },
{ -120, 120, 0, 0, 0<<5, 0<<5, 255, 255, 255, 255 },
};
static unsigned short LeafTexture[] = {
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0483, 0x0483, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0483, 0x03c1, 0x0401, 0x0483, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0c85, 0x03c1, 0x0403, 0x0441, 0x0403, 0x0cc3, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0c85, 0x0383, 0x0403, 0x0443, 0x0483, 0x0443, 0x0c03, 0x1d09, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0381, 0x0c03, 0x0443, 0x0443, 0x0483, 0x0503, 0x0443, 0x0c85, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0c85, 0x03c3, 0x0483, 0x04c3, 0x0483, 0x0483, 0x0543, 0x0503, 0x0483, 0x0c85, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b43, 0x0483, 0x0543, 0x0583, 0x04c3, 0x0483, 0x0543, 0x0583, 0x0543, 0x0403, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0383, 0x0503, 0x05c3, 0x05c5, 0x04c3, 0x0483, 0x0503, 0x0583, 0x0583, 0x0443, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0bc3, 0x0583, 0x05c5, 0x05c3, 0x0483, 0x0403, 0x0503, 0x0543, 0x0583, 0x0483, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0bc5, 0x0503, 0x05c5, 0x0543, 0x04c3, 0x03c3, 0x04c3, 0x0543, 0x0543, 0x0c85, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b43, 0x0403, 0x0503, 0x04c3, 0x0403, 0x0383, 0x0483, 0x04c3, 0x0c43, 0x1407, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0341, 0x0381, 0x03c1, 0x03c3, 0x0383, 0x0401, 0x03c1, 0x0b85, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0281, 0x02c1, 0x0301, 0x0343, 0x02c1, 0x0ac3, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x02c1, 0x02c1, 0x02c1, 0x02c1, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42, 0x0b42,
};
Gfx Gfx_Leaf[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
gsDPSetRenderMode (G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsSPTexture(0xffff, 0xffff, 0, G_TX_RENDERTILE, G_ON),
gsDPLoadTextureBlock(LeafTexture, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 16, 0,
G_TX_CLAMP|G_TX_NOMIRROR, G_TX_CLAMP|G_TX_NOMIRROR,
4, 4, G_TX_NOLOD, G_TX_NOLOD
),
gsSPVertex(&Vtx_Leaf[0], 4, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSPTexture (0xffff, 0xffff, 0, G_TX_RENDERTILE, G_OFF),
gsSPSetGeometryMode(G_LIGHTING | G_CULL_BACK),
gsSPEndDisplayList()
};
/********************************************************************************/
/* */
/* Begin kanji */
/* */
/********************************************************************************/
Gfx Gfx_BeginKanji[] = {
gsDPPipeSync (),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureFilter(G_TF_BILERP),
// gsDPSetTextureFilter(G_TF_POINT),
gsDPSetEnvColor(255,255,255,255),
gsSPTexture (0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_INTENVCOL, G_CC_INTENVCOL),
gsDPSetRenderMode (G_RM_XLU_SURF, G_RM_XLU_SURF2),
gsSPEndDisplayList()
};
/********************************************************************************/
/* */
/* End kanji */
/* */
/********************************************************************************/
Gfx Gfx_EndKanji[] = {
gsDPPipeSync (),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureFilter(G_TF_BILERP),
gsSPTexture (0xffff, 0xffff, 0, 0, G_OFF),
gsSPEndDisplayList()
};
/********************************************************************************/
/* */
/* Begin message window */
/* */
/********************************************************************************/
Gfx Gfx_BeginWindow[] = {
gsDPPipeSync(),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureFilter(G_TF_POINT),
gsDPSetPrimColor(0,0,0,0,0,180),
gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
gsSPEndDisplayList()
};
/********************************************************************************/
/* */
/* End message window */
/* */
/********************************************************************************/
Gfx Gfx_EndWindow[] = {
gsDPPipeSync(),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureFilter(G_TF_BILERP),
gsSPEndDisplayList()
};