154 {
157 s32 x, y;
158 s32 dxRight, dxLeft, dyTop, dyBottom;
159 s32 edgeX, edgeY;
160 s32 vtxIdx;
163 s32 i, j;
164
169
170
171 for (i = 0; i < 40; i++) {
172 gDPLoadTextureTile(
174 G_IM_FMT_RGBA, G_IM_SIZ_16b,
177 G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
178 G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
179 gSPTextureRectangle(
181 0 * 4, (i * 6) * 4,
183 G_TX_RENDERTILE, 0, 0, 0x1000, 0x0400);
185 }
186
192 gDPSetRenderMode(
gMainGfxPos++, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1));
195
196 guFrustumF(mtx, -80.0f, 80.0f, 60.0f, -60.0f, 160.0f, 640.0f, 1.0f);
199 gSPClearGeometryMode(
gMainGfxPos++, G_CULL_BOTH | G_LIGHTING);
200 gSPSetGeometryMode(
gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
202
203 for (j = 0; j < 12; j++) {
204 y = j * 16 + 24;
205 edgeY = FALSE;
206
207 if (j == 0) {
208 dyTop = -4;
209 edgeY = TRUE;
210 } else {
211 dyTop = 0;
212 }
213
214 if (j == 11) {
215 dyBottom = 4;
216 edgeY = TRUE;
217 } else {
218 dyBottom = 0;
219 }
220
221 for (i = 0; i < 18; i++) {
222 x = i * 16 + 16;
223 edgeX = FALSE;
224
225 if (i == 0) {
226 dxLeft = -4;
227 edgeX = TRUE;
228 } else {
229 dxLeft = 0;
230 }
231
232 if (i == 17) {
233 dxRight = 4;
234 edgeX = TRUE;
235 } else {
236 dxRight = 0;
237 }
238
239 gDPSetTile(
241 (((((x + dxRight + 16) - (x + dxLeft)) + 1) * 2) + 7) >> 3, 0x0000,
242 G_TX_LOADTILE, 0,
243 G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD,
244 G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD);
247 (x + dxLeft) * 4,
248 (y + dyTop) * 4,
249 (x + dxRight + 16) * 4,
250 (y + dyBottom + 16) * 4);
252 gDPSetTile(
254 (((((x + dxRight + 16) - (x + dxLeft)) + 1) * 2) + 7) >> 3, 0x0000,
255 G_TX_RENDERTILE, 0,
256 G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD,
257 G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD);
259 0, 0, (x + dxRight + 31) * 4, (y + dyBottom + 31) * 4);
260
261 if (edgeX && edgeY) {
262 vtxIdx = 12;
263 } else {
264 vtxIdx = 4;
265 if (!edgeX) {
266 if (!edgeY) {
267 vtxIdx = 0;
268 } else {
269 vtxIdx = 8;
270 }
271 }
272 }
273
274 gSPModifyVertex(
gMainGfxPos++, vtxIdx , G_MWO_POINT_XYSCREEN, ((x + dxLeft ) << 0x12) | ((y + dyTop ) * 4 + data->
unk_23[i ][j ]));
275 gSPModifyVertex(
gMainGfxPos++, vtxIdx + 1, G_MWO_POINT_XYSCREEN, ((x + dxRight + 0x10) << 0x12) | ((y + dyTop ) * 4 + data->
unk_23[i + 1][j ]));
276 gSPModifyVertex(
gMainGfxPos++, vtxIdx + 2, G_MWO_POINT_XYSCREEN, ((x + dxLeft ) << 0x12) | ((y + dyBottom + 0x10) * 4 + data->
unk_23[i ][j + 1]));
277 gSPModifyVertex(
gMainGfxPos++, vtxIdx + 3, G_MWO_POINT_XYSCREEN, ((x + dxRight + 0x10) << 0x12) | ((y + dyBottom + 0x10) * 4 + data->
unk_23[i + 1][j + 1]));
278 gSP2Triangles(
gMainGfxPos++, vtxIdx, vtxIdx + 3, vtxIdx + 1, 0, vtxIdx, vtxIdx + 2, vtxIdx + 3, 0);
280 }
281 }
282
289}
#define VIRTUAL_TO_PHYSICAL(addr)
DisplayContext * gDisplayContext