gfxstatic.c
5.76 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
/**************************************************************************
* *
* Copyright (C) 1995, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
/*
* File: gfxstatic.c
*
* This file holds display list segments that are 'static' data.
*
*/
#include <ultra64.h>
#include "boot.h"
#include "game.h"
#include "texture.h"
/*
* Cube
*/
static Vtx cube_vtx1[] = {
{ -50, -50, -50, 0, 00<<8, 00<<8, 0xff, 0x00, 0x00, 0xff},
{ 50, -50, -50, 0, 32<<8, 00<<8, 0x00, 0xff, 0x00, 0xff},
{ 50, 50, -50, 0, 32<<8, 32<<8, 0x00, 0x00, 0xff, 0xff},
{ -50, 50, -50, 0, 00<<8, 32<<8, 0xff, 0xff, 0xff, 0xff},
{ -50, -50, 50, 0, 32<<8, 32<<8, 0xff, 0xff, 0x00, 0xff},
{ 50, -50, 50, 0, 00<<8, 32<<8, 0x00, 0x00, 0x00, 0xff},
{ 50, 50, 50, 0, 00<<8, 00<<8, 0x00, 0xff, 0xff, 0xff},
{ -50, 50, 50, 0, 32<<8, 00<<8, 0xff, 0x00, 0xff, 0xff},
};
static Vtx cube_vtx2[] = {
{ -50, -50, -50, 0, 00<<8, 00<<8, 0xff, 0x00, 0x00, 0xff},
{ 50, -50, -50, 0, 00<<8, 32<<8, 0x00, 0xff, 0x00, 0xff},
{ 50, 50, -50, 0, 00<<8, 00<<8, 0x00, 0x00, 0xff, 0xff},
{ -50, 50, -50, 0, 00<<8, 32<<8, 0xff, 0xff, 0xff, 0xff},
{ -50, -50, 50, 0, 32<<8, 00<<8, 0xff, 0xff, 0x00, 0xff},
{ 50, -50, 50, 0, 32<<8, 32<<8, 0x00, 0x00, 0x00, 0xff},
{ 50, 50, 50, 0, 32<<8, 00<<8, 0x00, 0xff, 0xff, 0xff},
{ -50, 50, 50, 0, 32<<8, 32<<8, 0xff, 0x00, 0xff, 0xff},
};
/*
* runway */
static Vtx runway_vtx[] = {
{ -100, -100, -400, 0, 00<<9, 00<<9, 0xff, 0x00, 0x00, 0xff},
{ -100, 200, -400, 0, 00<<9, 32<<9, 0x00, 0xff, 0x00, 0xff},
{ -100, 200, 400, 0, 32<<9, 32<<9, 0x00, 0x00, 0xff, 0xff},
{ -100, -100, 400, 0, 32<<9, 00<<9, 0xff, 0xff, 0xff, 0xff},
{ 100, -100, -400, 0, 00<<9, 32<<9, 0xff, 0x00, 0x00, 0xff},
{ 100, -100, 400, 0, 32<<9, 32<<9, 0xff, 0xff, 0xff, 0xff},
};
Gfx cube_texture_setup_dl[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH | G_ZBUFFER | G_CULL_BACK),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsSPEndDisplayList(),
};
Gfx cube_textureMM_setup_dl[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH | G_ZBUFFER | G_CULL_BACK),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail (G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_LOD),
gsSPEndDisplayList(),
};
Gfx cube_textureMM3_setup_dl[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_2CYCLE),
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH | G_ZBUFFER | G_CULL_BACK),
gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineMode(G_CC_TRILERP, G_CC_DECALRGB2),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail (G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_LOD),
gsSPEndDisplayList(),
};
Gfx load_tex_brick_dl[] = {
gsDPLoadTextureBlock(
RGBA16brick, G_IM_FMT_RGBA, G_IM_SIZ_16b,
32, 32, 0,
G_TX_WRAP, G_TX_WRAP,
5, 5, G_TX_NOLOD, G_TX_NOLOD),
gsSPEndDisplayList(),
};
Gfx load_tex_checker_dl[] = {
gsDPLoadTextureBlock(
RGBA16checker, G_IM_FMT_RGBA, G_IM_SIZ_16b,
32, 32, 0,
G_TX_WRAP, G_TX_WRAP,
5, 5, G_TX_NOLOD, G_TX_NOLOD),
gsSPEndDisplayList(),
};
Gfx load_tex_molecule_dl[] = {
gsDPLoadTextureBlock(
RGBA16molecule, G_IM_FMT_RGBA, G_IM_SIZ_16b,
32, 32, 0,
G_TX_WRAP, G_TX_WRAP,
5, 5, G_TX_NOLOD, G_TX_NOLOD),
gsSPEndDisplayList(),
};
Gfx load_tex_chainlink_dl[] = {
gsDPLoadTextureBlock(
RGBA16chainlink, G_IM_FMT_RGBA, G_IM_SIZ_16b,
16, 16, 0,
G_TX_WRAP, G_TX_WRAP,
4, 4, G_TX_NOLOD, G_TX_NOLOD),
gsSPEndDisplayList(),
};
Gfx load_tex_mymip_dl[] = {
gsDPLoadTextureBlock(
RGBA16mymip, G_IM_FMT_RGBA, G_IM_SIZ_16b,
16, 16, 0,
G_TX_WRAP, G_TX_WRAP,
4, 4, G_TX_NOLOD, G_TX_NOLOD),
gsSPEndDisplayList(),
};
Gfx border_dl[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_FILL),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF),
gsDPSetFillColor(GPACK_RGBA5551(255,255,0,1) << 16 |
GPACK_RGBA5551(255,255,0,1)),
gsDPFillRectangle(0, 119, SCREEN_WD-1, 122),
gsDPFillRectangle(156, 0, 159, SCREEN_HT-1),
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPEndDisplayList(),
};
Gfx cube_dl[] = {
gsSPVertex(&(cube_vtx1[0]), 8, 0),
gsSP1Triangle(0, 2, 1, 0),
gsSP1Triangle(2, 0, 3, 0),
gsSP1Triangle(4, 5, 6, 0),
gsSP1Triangle(6, 7, 4, 0),
gsSPVertex(&(cube_vtx2[0]), 8, 0),
gsSP1Triangle(1, 6, 5, 0),
gsSP1Triangle(1, 2, 6, 0),
gsSP1Triangle(0, 5, 4, 0),
gsSP1Triangle(0, 1, 5, 0),
gsSP1Triangle(3, 4, 7, 0),
gsSP1Triangle(3, 0, 4, 0),
gsSP1Triangle(2, 3, 7, 0),
gsSP1Triangle(2, 7, 6, 0),
gsSPEndDisplayList(),
};
Gfx runway_dl[] = {
gsSPVertex(&(runway_vtx[0]), 6, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(2, 3, 0, 0),
gsSP1Triangle(0, 5, 4, 0),
gsSP1Triangle(0, 3, 5, 0),
gsSPEndDisplayList(),
};