2020-10-03 15:22:44 +00:00
|
|
|
|
#include "global.h"
|
2022-11-01 23:17:11 +00:00
|
|
|
|
#include "terminal.h"
|
2021-09-20 16:51:35 +00:00
|
|
|
|
#include "z64environment.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
typedef struct {
|
|
|
|
|
/* 0x000 */ s32 xStart;
|
|
|
|
|
/* 0x004 */ s32 yStart;
|
|
|
|
|
/* 0x008 */ s32 zStart;
|
|
|
|
|
/* 0x00C */ s32 outerIncrVal;
|
|
|
|
|
/* 0x010 */ s32 innerIncrVal;
|
|
|
|
|
} SkyboxFaceParams; // size = 0x14
|
|
|
|
|
|
|
|
|
|
// Converts texture coordinate values to s10.5 fixed point
|
|
|
|
|
#define TC(x) ((s16)((x)*32))
|
|
|
|
|
|
|
|
|
|
// Texture offsets for each face in the static segment buffer
|
|
|
|
|
u32 sSkybox256TexOffsets[4] = {
|
|
|
|
|
256 * 256 * 0,
|
|
|
|
|
256 * 256 * 1,
|
|
|
|
|
256 * 256 * 2,
|
|
|
|
|
256 * 256 * 3,
|
2021-09-21 08:48:43 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// Maps vertex buffer index to coordinate buffer index
|
|
|
|
|
u16 sSkybox256VtxBufIndices[2][32] = {
|
|
|
|
|
{
|
|
|
|
|
0, 2, 10, 12, 2, 4, 12, 14, 10, 12, 20, 22, 12, 14, 22, 24,
|
|
|
|
|
1, 3, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17, 18, 19, 21, 23,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
20, 22, 30, 32, 22, 24, 32, 34, 30, 32, 40, 42, 32, 34, 42, 44,
|
|
|
|
|
21, 23, 25, 26, 27, 28, 29, 31, 33, 35, 36, 37, 38, 39, 41, 43,
|
|
|
|
|
},
|
2021-09-21 08:48:43 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// S coordinates for all faces
|
|
|
|
|
s16 sSkybox256TexSCoords[5] = {
|
|
|
|
|
TC(126 * 0), TC(126 * 1), TC(126 * 2), TC(126 * 3), TC(126 * 4),
|
2021-09-21 08:48:43 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// T coordinates for all faces
|
|
|
|
|
s16 sSkybox256TexTCoords[9] = {
|
|
|
|
|
TC(62 * 0), TC(62 * 1), TC(62 * 2), TC(62 * 3), TC(62 * 4), TC(62 * 5), TC(62 * 6), TC(62 * 7), TC(62 * 8),
|
2021-09-21 08:48:43 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// Maps vertex index to vertex buffer index
|
|
|
|
|
s16 sSkybox256VtxIndices[64] = {
|
|
|
|
|
0, 16, 19, 18, 16, 1, 20, 19, 1, 17, 21, 20, 17, 5, 22, 21, 18, 19, 23, 2, 19, 20,
|
|
|
|
|
3, 23, 20, 21, 24, 3, 21, 22, 7, 24, 2, 23, 26, 25, 23, 3, 27, 26, 3, 24, 28, 27,
|
|
|
|
|
24, 7, 29, 28, 25, 26, 30, 10, 26, 27, 11, 30, 27, 28, 31, 11, 28, 29, 15, 31,
|
2021-09-21 08:48:43 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* Build the vertex and display list data for a skybox with 256x256 face textures.
|
|
|
|
|
*
|
|
|
|
|
* While the textures are nominally 256x256 the 4x8 tiles that cover it are only 63x31, therefore only a
|
|
|
|
|
* 253x249 area is ever sampled (253 = 4 * 63 + 1, the additional +1 accounts for bilinear filtering,
|
|
|
|
|
* similarly 249 = 8 * 31 + 1)
|
|
|
|
|
*
|
|
|
|
|
* Each texture dimension is padded to the next power of 2, resulting in a final size of 256x256.
|
|
|
|
|
*/
|
|
|
|
|
s32 Skybox_CalculateFace256(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 roomVtxStartIndex, s32 xStart, s32 yStart,
|
|
|
|
|
s32 zStart, s32 innerIncrVal, s32 outerIncrVal, s32 faceNum, s32 dlistBufStartIndex) {
|
|
|
|
|
u32 innerIncr;
|
|
|
|
|
s32 outerIncr;
|
|
|
|
|
s32 n;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
s32 i;
|
|
|
|
|
s32 j;
|
2021-10-27 21:12:16 +00:00
|
|
|
|
s32 k;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
u16 index;
|
2023-07-04 02:30:53 +00:00
|
|
|
|
s16 m;
|
|
|
|
|
s16 ult;
|
|
|
|
|
s16 uls;
|
|
|
|
|
s16 vtxIdx;
|
|
|
|
|
s16 l;
|
|
|
|
|
s32 xPoints[9 * 5];
|
|
|
|
|
s32 yPoints[9 * 5];
|
|
|
|
|
s32 zPoints[9 * 5];
|
|
|
|
|
s32 tcS[9 * 5];
|
|
|
|
|
s32 tcT[9 * 5];
|
2021-10-27 21:12:16 +00:00
|
|
|
|
s32 pad;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// Collect all vertex positions for this face
|
|
|
|
|
switch (faceNum) {
|
|
|
|
|
case 0: // xy plane
|
2021-09-21 08:48:43 +00:00
|
|
|
|
case 2:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr = yStart;
|
|
|
|
|
|
|
|
|
|
for (i = 0, k = 0; k < 9 * 5; i++) {
|
|
|
|
|
innerIncr = xStart;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (j = 0; j < 5; j++, k++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
zPoints[k] = zStart;
|
|
|
|
|
xPoints[k] = innerIncr;
|
|
|
|
|
yPoints[k] = outerIncr;
|
|
|
|
|
tcS[k] = sSkybox256TexSCoords[j];
|
|
|
|
|
tcT[k] = sSkybox256TexTCoords[i];
|
|
|
|
|
innerIncr += innerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr += outerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2021-10-27 21:12:16 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
case 1: // yz plane
|
2021-09-21 08:48:43 +00:00
|
|
|
|
case 3:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr = yStart;
|
|
|
|
|
|
|
|
|
|
for (i = 0, k = 0; k < 9 * 5; i++) {
|
|
|
|
|
innerIncr = zStart;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (j = 0; j < 5; j++, k++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
xPoints[k] = xStart;
|
|
|
|
|
yPoints[k] = outerIncr;
|
|
|
|
|
zPoints[k] = innerIncr;
|
|
|
|
|
tcS[k] = sSkybox256TexSCoords[j];
|
|
|
|
|
tcT[k] = sSkybox256TexTCoords[i];
|
|
|
|
|
innerIncr += innerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr += outerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2021-10-27 21:12:16 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
case 4: // xz plane
|
2021-09-21 08:48:43 +00:00
|
|
|
|
case 5:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr = zStart;
|
|
|
|
|
|
|
|
|
|
for (i = 0, k = 0; k < 9 * 5; i++) {
|
|
|
|
|
innerIncr = xStart;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (j = 0; j < 5; j++, k++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
yPoints[k] = yStart;
|
|
|
|
|
xPoints[k] = innerIncr;
|
|
|
|
|
zPoints[k] = outerIncr;
|
|
|
|
|
tcS[k] = sSkybox256TexSCoords[j];
|
|
|
|
|
tcT[k] = sSkybox256TexTCoords[i];
|
|
|
|
|
innerIncr += innerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr += outerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// For a 256x256 texture with 63x31 tiles there are 32 tiles which requires at least 45 vertices,
|
|
|
|
|
// 45 > 32 (the maximum number of vertices that can be loaded at once) so it is split into two passes
|
|
|
|
|
for (ult = 0, n = 0; n < 2; n++) {
|
|
|
|
|
// Each iteration is 16 tiles of the texture, first iteration is the top 16 tiles
|
|
|
|
|
|
|
|
|
|
// Select gfx buffer
|
|
|
|
|
skyboxCtx->gfx = skyboxCtx->dListBuf[dlistBufStartIndex + n];
|
|
|
|
|
|
|
|
|
|
// Generate and load Vertex structures
|
|
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
|
index = sSkybox256VtxBufIndices[n][i];
|
|
|
|
|
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.ob[0] = xPoints[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.ob[1] = yPoints[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.ob[2] = zPoints[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.flag = 0;
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.tc[0] = tcS[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.tc[1] = tcT[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.cn[1] = 0;
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.cn[2] = 0;
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.cn[0] = 255;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
gSPVertex(skyboxCtx->gfx++, &roomVtx[roomVtxStartIndex], 32, 0);
|
|
|
|
|
roomVtxStartIndex += i; // += 32
|
|
|
|
|
|
|
|
|
|
// Cull the face if not within the viewing volume
|
|
|
|
|
gSPCullDisplayList(skyboxCtx->gfx++, 0, 15);
|
|
|
|
|
|
|
|
|
|
// Draw face, load the texture in several tiles to work around TMEM size limitations
|
|
|
|
|
for (vtxIdx = 0, l = 0; l < 4; l++, ult += 31) {
|
|
|
|
|
for (uls = 0, m = 0; m < 4; m++, uls += 63, vtxIdx += 4) {
|
|
|
|
|
gDPLoadTextureTile(skyboxCtx->gfx++, (u32)skyboxCtx->staticSegments[0] + sSkybox256TexOffsets[faceNum],
|
|
|
|
|
G_IM_FMT_CI, G_IM_SIZ_8b, 256, 0, uls, ult, uls + 63, ult + 31, 0,
|
|
|
|
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
|
|
|
|
G_TX_NOMASK, G_TX_NOLOD);
|
|
|
|
|
gSP1Quadrangle(skyboxCtx->gfx++, sSkybox256VtxIndices[vtxIdx + 1], sSkybox256VtxIndices[vtxIdx + 2],
|
|
|
|
|
sSkybox256VtxIndices[vtxIdx + 3], sSkybox256VtxIndices[vtxIdx + 0], 3);
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
gSPEndDisplayList(skyboxCtx->gfx++);
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
return roomVtxStartIndex;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2021-10-27 21:12:16 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// Texture offsets for each face in the static segment buffer
|
|
|
|
|
u32 sSkybox128TexOffsets[6] = {
|
|
|
|
|
128 * 64 * 0, 128 * 64 * 1, 128 * 64 * 2, 128 * 64 * 3, 128 * 64 * 4, 128 * 64 * 4 + 128 * 128,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Maps vertex buffer index to coordinate buffer index
|
|
|
|
|
u16 sSkybox128VtxBufIndices[32] = {
|
|
|
|
|
0, 2, 10, 12, 2, 4, 12, 14, 10, 12, 20, 22, 12, 14, 22, 24, 1, 3, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17, 18, 19, 21, 23,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// S coordinates for all faces
|
|
|
|
|
s16 sSkybox128TexSCoords[5] = {
|
|
|
|
|
TC(62 * 0), TC(62 * 1), TC(62 * 2), TC(62 * 3), TC(62 * 4),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// T coordinates for top and bottom faces
|
|
|
|
|
s16 sSkybox128TexTCoordsXZ[5] = {
|
|
|
|
|
TC(62 * 0), TC(62 * 1), TC(62 * 2), TC(62 * 3), TC(62 * 4),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// T coordinates for side faces
|
|
|
|
|
s16 sSkybox128TexTCoords[5] = {
|
|
|
|
|
TC(62 * 0), TC(62 * 1), TC(62 * 2), TC(62 * 1), TC(62 * 0),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Maps vertex index to vertex buffer index
|
|
|
|
|
s16 sSkybox128VtxIndices[64] = {
|
|
|
|
|
0, 16, 19, 18, 16, 1, 20, 19, 1, 17, 21, 20, 17, 5, 22, 21, 18, 19, 23, 2, 19, 20,
|
|
|
|
|
3, 23, 20, 21, 24, 3, 21, 22, 7, 24, 2, 23, 26, 25, 23, 3, 27, 26, 3, 24, 28, 27,
|
|
|
|
|
24, 7, 29, 28, 25, 26, 30, 10, 26, 27, 11, 30, 27, 28, 31, 11, 28, 29, 15, 31,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Build the vertex and display list data for a skybox with 128x128 and 128x64 face textures.
|
|
|
|
|
*
|
|
|
|
|
* While the textures are nominally 128x128 (128x64) the 4x4 (4x2) tiles that cover it are only 31x31,
|
|
|
|
|
* therefore only a 125x125 (125x63) area is ever sampled (see `Skybox_CalculateFace256` for more details)
|
|
|
|
|
*
|
|
|
|
|
* Each texture dimension is padded to the next power of 2, resulting in a final size of 128x128 (128x64)
|
|
|
|
|
*/
|
|
|
|
|
s32 Skybox_CalculateFace128(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 roomVtxStartIndex, s32 xStart, s32 yStart,
|
|
|
|
|
s32 zStart, s32 innerIncrVal, s32 outerIncrVal, s32 faceNum) {
|
2021-09-21 08:48:43 +00:00
|
|
|
|
s32 i;
|
|
|
|
|
s32 j;
|
2021-10-27 21:12:16 +00:00
|
|
|
|
s32 k;
|
2023-07-04 02:30:53 +00:00
|
|
|
|
s16 uls;
|
|
|
|
|
s16 m;
|
|
|
|
|
s32 outerIncr;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
u16 index;
|
2023-07-04 02:30:53 +00:00
|
|
|
|
s16 ult;
|
|
|
|
|
s16 l;
|
|
|
|
|
s16 vtxIdx;
|
|
|
|
|
s32 innerIncr;
|
|
|
|
|
s32 xPoints[5 * 5];
|
|
|
|
|
s32 yPoints[5 * 5];
|
|
|
|
|
s32 zPoints[5 * 5];
|
|
|
|
|
s32 tcS[5 * 5];
|
|
|
|
|
s32 tcT[5 * 5];
|
2021-10-27 21:12:16 +00:00
|
|
|
|
s32 pad;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// Collect all vertex positions for this face
|
|
|
|
|
switch (faceNum) {
|
|
|
|
|
case 0: // xy plane
|
2021-09-21 08:48:43 +00:00
|
|
|
|
case 1:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr = yStart;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (i = 0, k = 0; k < 25; i++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
innerIncr = xStart;
|
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (j = 0; j < 5; j++, k++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
zPoints[k] = zStart;
|
|
|
|
|
xPoints[k] = innerIncr;
|
|
|
|
|
yPoints[k] = outerIncr;
|
|
|
|
|
tcS[k] = sSkybox128TexSCoords[j];
|
|
|
|
|
tcT[k] = sSkybox128TexTCoords[i];
|
|
|
|
|
innerIncr += innerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr += outerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2021-10-27 21:12:16 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
case 2: // yz plane
|
2021-09-21 08:48:43 +00:00
|
|
|
|
case 3:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr = yStart;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (i = 0, k = 0; k < 25; i++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
innerIncr = zStart;
|
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (j = 0; j < 5; j++, k++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
xPoints[k] = xStart;
|
|
|
|
|
yPoints[k] = outerIncr;
|
|
|
|
|
zPoints[k] = innerIncr;
|
|
|
|
|
tcS[k] = sSkybox128TexSCoords[j];
|
|
|
|
|
tcT[k] = sSkybox128TexTCoords[i];
|
|
|
|
|
innerIncr += innerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr += outerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2021-10-27 21:12:16 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
case 4: // xz plane
|
2021-09-21 08:48:43 +00:00
|
|
|
|
case 5:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr = zStart;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (i = 0, k = 0; k < 25; i++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
innerIncr = xStart;
|
|
|
|
|
|
2021-10-27 21:12:16 +00:00
|
|
|
|
for (j = 0; j < 5; j++, k++) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
yPoints[k] = yStart;
|
|
|
|
|
xPoints[k] = innerIncr;
|
|
|
|
|
zPoints[k] = outerIncr;
|
|
|
|
|
tcS[k] = sSkybox128TexSCoords[j];
|
|
|
|
|
tcT[k] = sSkybox128TexTCoordsXZ[i];
|
|
|
|
|
innerIncr += innerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
outerIncr += outerIncrVal;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
|
|
|
|
|
// Select gfx buffer
|
|
|
|
|
skyboxCtx->gfx = &skyboxCtx->dListBuf[2 * faceNum][0];
|
|
|
|
|
|
|
|
|
|
// Generate and load Vertex structures
|
|
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
|
index = sSkybox128VtxBufIndices[i];
|
|
|
|
|
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.ob[0] = xPoints[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.ob[1] = yPoints[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.ob[2] = zPoints[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.flag = 0;
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.tc[0] = tcS[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.tc[1] = tcT[index];
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.cn[1] = 0;
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.cn[2] = 0;
|
|
|
|
|
roomVtx[roomVtxStartIndex + i].v.cn[0] = 255;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
gSPVertex(skyboxCtx->gfx++, &roomVtx[roomVtxStartIndex], 32, 0);
|
|
|
|
|
roomVtxStartIndex += i;
|
|
|
|
|
|
|
|
|
|
// Cull the face if not within the viewing volume
|
|
|
|
|
gSPCullDisplayList(skyboxCtx->gfx++, 0, 15);
|
|
|
|
|
|
|
|
|
|
// Draw face, load the texture in several tiles to work around TMEM size limitations
|
|
|
|
|
if (faceNum == 4 || faceNum == 5) {
|
|
|
|
|
// top/bottom faces, 128x128 texture
|
|
|
|
|
|
|
|
|
|
ult = 0;
|
|
|
|
|
for (vtxIdx = 0, l = 0; l < 4; l++, ult += 31) {
|
|
|
|
|
for (uls = 0, m = 0; m < 4; m++, uls += 31, vtxIdx += 4) {
|
|
|
|
|
gDPLoadMultiTile(skyboxCtx->gfx++, (u32)skyboxCtx->staticSegments[0] + sSkybox128TexOffsets[faceNum], 0,
|
|
|
|
|
G_TX_RENDERTILE, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, uls, ult, uls + 31, ult + 31, 0,
|
|
|
|
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
2021-09-21 08:48:43 +00:00
|
|
|
|
G_TX_NOMASK, G_TX_NOLOD);
|
2023-07-04 02:30:53 +00:00
|
|
|
|
gDPLoadMultiTile(skyboxCtx->gfx++, (u32)skyboxCtx->staticSegments[1] + sSkybox128TexOffsets[faceNum],
|
|
|
|
|
0x80, 1, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, uls, ult, uls + 31, ult + 31, 0,
|
|
|
|
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
|
|
|
|
G_TX_NOMASK, G_TX_NOLOD);
|
|
|
|
|
gSP1Quadrangle(skyboxCtx->gfx++, sSkybox128VtxIndices[vtxIdx + 1], sSkybox128VtxIndices[vtxIdx + 2],
|
|
|
|
|
sSkybox128VtxIndices[vtxIdx + 3], sSkybox128VtxIndices[vtxIdx + 0], 3);
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// other faces, 128x64 texture
|
|
|
|
|
|
|
|
|
|
ult = 0;
|
|
|
|
|
for (vtxIdx = 0, l = 0; l < 2; l++, ult += 31) {
|
|
|
|
|
for (uls = 0, m = 0; m < 4; m++, uls += 31, vtxIdx += 4) {
|
|
|
|
|
gDPLoadMultiTile(skyboxCtx->gfx++, (u32)skyboxCtx->staticSegments[0] + sSkybox128TexOffsets[faceNum], 0,
|
|
|
|
|
G_TX_RENDERTILE, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, uls, ult, uls + 31, ult + 31, 0,
|
|
|
|
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
|
|
|
|
G_TX_NOMASK, G_TX_NOLOD);
|
|
|
|
|
gDPLoadMultiTile(skyboxCtx->gfx++, (u32)skyboxCtx->staticSegments[1] + sSkybox128TexOffsets[faceNum],
|
|
|
|
|
0x80, 1, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, uls, ult, uls + 31, ult + 31, 0,
|
|
|
|
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
2021-09-21 08:48:43 +00:00
|
|
|
|
G_TX_NOMASK, G_TX_NOLOD);
|
2023-07-04 02:30:53 +00:00
|
|
|
|
gSP1Quadrangle(skyboxCtx->gfx++, sSkybox128VtxIndices[vtxIdx + 1], sSkybox128VtxIndices[vtxIdx + 2],
|
|
|
|
|
sSkybox128VtxIndices[vtxIdx + 3], sSkybox128VtxIndices[vtxIdx + 0], 3);
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
ult -= 31;
|
|
|
|
|
for (l = 0; l < 2; l++, ult -= 31) {
|
|
|
|
|
for (uls = 0, m = 0; m < 4; m++, uls += 31, vtxIdx += 4) {
|
|
|
|
|
gDPLoadMultiTile(skyboxCtx->gfx++, (u32)skyboxCtx->staticSegments[0] + sSkybox128TexOffsets[faceNum], 0,
|
|
|
|
|
G_TX_RENDERTILE, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, uls, ult, uls + 31, ult + 31, 0,
|
|
|
|
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
|
|
|
|
G_TX_NOMASK, G_TX_NOLOD);
|
|
|
|
|
gDPLoadMultiTile(skyboxCtx->gfx++, (u32)skyboxCtx->staticSegments[1] + sSkybox128TexOffsets[faceNum],
|
|
|
|
|
0x80, 1, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, uls, ult, uls + 31, ult + 31, 0,
|
|
|
|
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
2021-09-21 08:48:43 +00:00
|
|
|
|
G_TX_NOMASK, G_TX_NOLOD);
|
2023-07-04 02:30:53 +00:00
|
|
|
|
gSP1Quadrangle(skyboxCtx->gfx++, sSkybox128VtxIndices[vtxIdx + 1], sSkybox128VtxIndices[vtxIdx + 2],
|
|
|
|
|
sSkybox128VtxIndices[vtxIdx + 3], sSkybox128VtxIndices[vtxIdx + 0], 3);
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
gSPEndDisplayList(skyboxCtx->gfx++);
|
|
|
|
|
return roomVtxStartIndex;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
SkyboxFaceParams sSkybox256FaceParams[4] = {
|
|
|
|
|
{ -126, 124, -126, 63, -31 },
|
|
|
|
|
{ 126, 124, -126, 63, -31 },
|
|
|
|
|
{ 126, 124, 126, -63, -31 },
|
|
|
|
|
{ -126, 124, 126, -63, -31 },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Computes the display list for a skybox where each face is a 256x256 CI8 texture.
|
|
|
|
|
* The number of faces is determined by the skybox id or from the drawType field in SkyboxContext.
|
|
|
|
|
*/
|
|
|
|
|
void Skybox_Calculate256(SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|
|
|
|
s32 faceNum;
|
|
|
|
|
s32 dlistBufStartIndex;
|
|
|
|
|
s32 roomVtxStartIndex = 0;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
|
|
|
|
if (skyboxId == SKYBOX_BAZAAR || (skyboxId > SKYBOX_HOUSE_KAKARIKO && skyboxId <= SKYBOX_BOMBCHU_SHOP)) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// 2 faces, one in xy plane and one in yz plane
|
|
|
|
|
for (dlistBufStartIndex = 0, faceNum = 0; faceNum < 2; faceNum++, dlistBufStartIndex += 2) {
|
|
|
|
|
roomVtxStartIndex = Skybox_CalculateFace256(
|
|
|
|
|
skyboxCtx, skyboxCtx->roomVtx, roomVtxStartIndex, sSkybox256FaceParams[faceNum].xStart,
|
|
|
|
|
sSkybox256FaceParams[faceNum].yStart, sSkybox256FaceParams[faceNum].zStart,
|
|
|
|
|
sSkybox256FaceParams[faceNum].outerIncrVal, sSkybox256FaceParams[faceNum].innerIncrVal, faceNum,
|
|
|
|
|
dlistBufStartIndex);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
2023-07-04 02:30:53 +00:00
|
|
|
|
} else if (skyboxCtx->drawType == SKYBOX_DRAW_256_3FACE) {
|
|
|
|
|
// 3 faces, 2 in xy plane and 1 in yz plane
|
|
|
|
|
for (dlistBufStartIndex = 0, faceNum = 0; faceNum < 3; faceNum++, dlistBufStartIndex += 2) {
|
|
|
|
|
roomVtxStartIndex = Skybox_CalculateFace256(
|
|
|
|
|
skyboxCtx, skyboxCtx->roomVtx, roomVtxStartIndex, sSkybox256FaceParams[faceNum].xStart,
|
|
|
|
|
sSkybox256FaceParams[faceNum].yStart, sSkybox256FaceParams[faceNum].zStart,
|
|
|
|
|
sSkybox256FaceParams[faceNum].outerIncrVal, sSkybox256FaceParams[faceNum].innerIncrVal, faceNum,
|
|
|
|
|
dlistBufStartIndex);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// 4 faces, 2 in xy plane and 2 in yz plane
|
|
|
|
|
for (dlistBufStartIndex = 0, faceNum = 0; faceNum < 4; faceNum++, dlistBufStartIndex += 2) {
|
|
|
|
|
roomVtxStartIndex = Skybox_CalculateFace256(
|
|
|
|
|
skyboxCtx, skyboxCtx->roomVtx, roomVtxStartIndex, sSkybox256FaceParams[faceNum].xStart,
|
|
|
|
|
sSkybox256FaceParams[faceNum].yStart, sSkybox256FaceParams[faceNum].zStart,
|
|
|
|
|
sSkybox256FaceParams[faceNum].outerIncrVal, sSkybox256FaceParams[faceNum].innerIncrVal, faceNum,
|
|
|
|
|
dlistBufStartIndex);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
SkyboxFaceParams sSkybox128FaceParams[6] = {
|
|
|
|
|
{ -64, 64, -64, 32, -32 }, { 64, 64, 64, -32, -32 }, { -64, 64, 64, -32, -32 },
|
|
|
|
|
{ 64, 64, -64, 32, -32 }, { -64, 64, 64, 32, -32 }, { -64, -64, -64, 32, 32 },
|
|
|
|
|
};
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* Computes the display list for a skybox with up to 6 faces, where the sides are 128x64 CI8 textures and the
|
|
|
|
|
* top/bottom faces are 128x128 CI8 textures.
|
|
|
|
|
*/
|
|
|
|
|
void Skybox_Calculate128(SkyboxContext* skyboxCtx, s32 nFaces) {
|
|
|
|
|
s32 roomVtxStartIndex = 0;
|
|
|
|
|
s32 faceNum;
|
|
|
|
|
|
|
|
|
|
for (faceNum = 0; faceNum < nFaces; faceNum++) {
|
|
|
|
|
roomVtxStartIndex = Skybox_CalculateFace128(
|
|
|
|
|
skyboxCtx, skyboxCtx->roomVtx, roomVtxStartIndex, sSkybox128FaceParams[faceNum].xStart,
|
|
|
|
|
sSkybox128FaceParams[faceNum].yStart, sSkybox128FaceParams[faceNum].zStart,
|
|
|
|
|
sSkybox128FaceParams[faceNum].outerIncrVal, sSkybox128FaceParams[faceNum].innerIncrVal, faceNum);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
|
void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
2021-08-04 17:37:26 +00:00
|
|
|
|
u32 size;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
s16 i;
|
2022-02-27 21:32:05 +00:00
|
|
|
|
u8 skybox1Index;
|
|
|
|
|
u8 skybox2Index;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
u32 start;
|
2022-05-20 18:40:13 +00:00
|
|
|
|
s32 skyboxConfig;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
|
|
|
|
switch (skyboxId) {
|
|
|
|
|
case SKYBOX_NORMAL_SKY:
|
2022-05-20 18:40:13 +00:00
|
|
|
|
skyboxConfig = 0;
|
2022-07-30 21:28:50 +00:00
|
|
|
|
if (gSaveContext.retainWeatherMode && !IS_CUTSCENE_LAYER && gWeatherMode > WEATHER_MODE_CLEAR &&
|
|
|
|
|
gWeatherMode <= WEATHER_MODE_HEAVY_RAIN) {
|
2022-05-20 18:40:13 +00:00
|
|
|
|
skyboxConfig = 1;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-05-20 18:40:13 +00:00
|
|
|
|
for (i = 0; i < ARRAY_COUNT(gTimeBasedSkyboxConfigs[skyboxConfig]); i++) {
|
|
|
|
|
if (gSaveContext.skyboxTime >= gTimeBasedSkyboxConfigs[skyboxConfig][i].startTime &&
|
|
|
|
|
(gSaveContext.skyboxTime < gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime ||
|
|
|
|
|
gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime == 0xFFFF)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
|
play->envCtx.skybox1Index = skybox1Index = gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox1Index;
|
|
|
|
|
play->envCtx.skybox2Index = skybox2Index = gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox2Index;
|
2022-05-20 18:40:13 +00:00
|
|
|
|
if (gTimeBasedSkyboxConfigs[skyboxConfig][i].changeSkybox) {
|
2022-05-21 18:23:43 +00:00
|
|
|
|
play->envCtx.skyboxBlend =
|
2022-05-20 18:40:13 +00:00
|
|
|
|
Environment_LerpWeight(gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime,
|
|
|
|
|
gTimeBasedSkyboxConfigs[skyboxConfig][i].startTime,
|
2021-09-20 16:51:35 +00:00
|
|
|
|
((void)0, gSaveContext.skyboxTime)) *
|
2021-07-04 15:43:04 +00:00
|
|
|
|
255.0f;
|
|
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
|
play->envCtx.skyboxBlend = 0;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-20 18:40:13 +00:00
|
|
|
|
size = gNormalSkyFiles[skybox1Index].file.vromEnd - gNormalSkyFiles[skybox1Index].file.vromStart;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1054);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1055);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], gNormalSkyFiles[skybox1Index].file.vromStart, size,
|
|
|
|
|
"../z_vr_box.c", 1058);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-05-20 18:40:13 +00:00
|
|
|
|
size = gNormalSkyFiles[skybox2Index].file.vromEnd - gNormalSkyFiles[skybox2Index].file.vromStart;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1060);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
|
|
|
|
1061);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], gNormalSkyFiles[skybox2Index].file.vromStart, size,
|
|
|
|
|
"../z_vr_box.c", 1064);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-02-27 21:32:05 +00:00
|
|
|
|
if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) {
|
2022-05-20 18:40:13 +00:00
|
|
|
|
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1072);
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, gNormalSkyFiles[skybox1Index].palette.vromStart, size,
|
|
|
|
|
"../z_vr_box.c", 1075);
|
|
|
|
|
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size,
|
|
|
|
|
gNormalSkyFiles[skybox2Index].palette.vromStart, size, "../z_vr_box.c", 1077);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
} else {
|
2022-05-20 18:40:13 +00:00
|
|
|
|
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1085);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, gNormalSkyFiles[skybox2Index].palette.vromStart, size,
|
|
|
|
|
"../z_vr_box.c", 1088);
|
|
|
|
|
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size,
|
|
|
|
|
gNormalSkyFiles[skybox1Index].palette.vromStart, size, "../z_vr_box.c", 1090);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2021-08-04 17:37:26 +00:00
|
|
|
|
|
2021-07-04 15:43:04 +00:00
|
|
|
|
case SKYBOX_BAZAAR:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_SP1a_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_SP1a_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1127);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1128);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1129);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_SP1a_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_SP1a_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1132);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1133);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1134);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_OVERCAST_SUNSET:
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_cloud2_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_cloud2_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1155);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1156);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1159);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1162);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
|
|
|
|
1163);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1166);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_cloud2_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_cloud2_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1170);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1171);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1173);
|
|
|
|
|
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, start, size, "../z_vr_box.c", 1175);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_MARKET_ADULT:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_RUVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_RUVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1182);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1183);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1184);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_RUVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_RUVR_pal_staticSegmentRomEnd - start;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
osSyncPrintf("SIZE = %d\n", size);
|
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1188);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1189);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1190);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_CUTSCENE_MAP:
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_holy0_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_holy0_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1196);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1197);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1200);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_holy1_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_holy1_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1203);
|
2021-08-04 17:37:26 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
|
|
|
|
1204);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1207);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_holy0_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_holy0_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1211);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1212);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1214);
|
|
|
|
|
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, (uintptr_t)_vr_holy1_pal_staticSegmentRomStart,
|
|
|
|
|
size, "../z_vr_box.c", 1216);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_LINK:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_LHVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_LHVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1226);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1227);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1228);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_LHVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_LHVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1231);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1232);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1233);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_MARKET_CHILD_DAY:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_MDVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_MDVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1257);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1258);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1259);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_MDVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_MDVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1262);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1263);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1264);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_MARKET_CHILD_NIGHT:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_MNVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_MNVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1271);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1272);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1273);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_MNVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_MNVR_pal_staticSegmentRomEnd - start;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
osSyncPrintf("SIZE = %d\n", size);
|
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1277);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1278);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1279);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HAPPY_MASK_SHOP:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_FCVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_FCVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1286);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1287);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1288);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_FCVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_FCVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1291);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1292);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1293);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_KNOW_IT_ALL_BROTHERS:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KHVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KHVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1301);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1302);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1303);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KHVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KHVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1306);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1307);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1308);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_OF_TWINS:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_K3VR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_K3VR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1331);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1332);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1333);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_K3VR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_K3VR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1336);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1337);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1338);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_STABLES:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_MLVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_MLVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1345);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
2021-08-04 17:37:26 +00:00
|
|
|
|
1346);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1347);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_MLVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_MLVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1350);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1351);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1352);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_KAKARIKO:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KKRVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KKRVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1359);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1360);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1361);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1364);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1365);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1366);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_KOKIRI_SHOP:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KSVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KSVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1373);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1374);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1375);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KSVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KSVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1378);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1379);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1380);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_GORON_SHOP:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_GLVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_GLVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1405);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1406);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1407);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_GLVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_GLVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1410);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1411);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1412);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_ZORA_SHOP:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_ZRVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_ZRVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1420);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1421);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1422);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1425);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1426);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1427);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_POTION_SHOP_KAKARIKO:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_DGVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_DGVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1451);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1452);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1453);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_DGVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_DGVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1456);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1457);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1458);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_POTION_SHOP_MARKET:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_ALVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_ALVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1466);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1467);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1468);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_ALVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_ALVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1471);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1472);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1473);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_BOMBCHU_SHOP:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_NSVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_NSVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1481);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1482);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1483);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_NSVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_NSVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1486);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1487);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1488);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
skyboxCtx->rot.y = 0.8f;
|
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_RICHARD:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_IPVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_IPVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1512);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1513);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1514);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_IPVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_IPVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1517);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1518);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1519);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_IMPA:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_LBVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_LBVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1526);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1527);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1528);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_LBVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_LBVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1531);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1532);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1533);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_TENT:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_TTVR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_TTVR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1540);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1541);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1542);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_TTVR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_TTVR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1545);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1546);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1547);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_MIDO:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_K4VR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_K4VR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1560);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1561);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1562);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_K4VR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_K4VR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1565);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1566);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1567);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_SARIA:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_K5VR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_K5VR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1574);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1575);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1576);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_K5VR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_K5VR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1579);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1580);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1581);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_HOUSE_ALLEY:
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KR3VR_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KR3VR_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1588);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
|
|
|
|
1589);
|
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1590);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-10-02 15:38:09 +00:00
|
|
|
|
start = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomStart;
|
|
|
|
|
size = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomEnd - start;
|
2022-05-21 18:23:43 +00:00
|
|
|
|
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1593);
|
EnWf OK and documented (#967)
* a ton of progress, 14 functions remain
* cleanup
* a few more functions done, 11 remain
* finally all updated
* another function matched
* another action finished
* damage table
* death action done
* started very large action func
* more progress on long action funcs
* large action func matched
* 5 functions remain
* another large action finished
* start another action, doesn't match yet
* a few new functions, neither match
* done working on this for now
* Correct one nonmatching, fix compiler warnings
* Two functions left
* one left
* remove remaining gotos
* OK
* Delete outdated comment
* namefixer
* Flag macros
* audio, dmgeff, some colour
* Import symbols from object, reloc, name a few things
* Rest of object done
* Named a few more things, add action enum
* Name body parts and another couple of actions
* Last few names
* Delete asm
* Format
* undefined_syms, mods where possible
* Correct parent to EnEncount1
* Review
* Last newline
* louis and Dragorn's reviews
* Format
* More review
* Put back to isInvisible and or, as in EnGeldB
* Remove if (0)s in func_8009728C and change pointer arithmetic cast
* More review
* Unname headRot, make "fallthrough" case clearer, other review
* Format
* Even more review
* Rephrase
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
2021-09-24 22:35:42 +00:00
|
|
|
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1594);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
|
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1595);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
break;
|
|
|
|
|
case SKYBOX_UNSET_27:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-15 21:33:44 +00:00
|
|
|
|
void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
2022-05-21 18:23:43 +00:00
|
|
|
|
PlayState* play = (PlayState*)state;
|
2021-11-15 21:33:44 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->drawType = SKYBOX_DRAW_128;
|
2021-09-21 08:48:43 +00:00
|
|
|
|
skyboxCtx->rot.x = skyboxCtx->rot.y = skyboxCtx->rot.z = 0.0f;
|
2021-07-04 15:43:04 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// DMA required assets based on skybox id
|
2022-05-21 18:23:43 +00:00
|
|
|
|
Skybox_Setup(play, skyboxCtx, skyboxId);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
osSyncPrintf("\n\n\n********************\n\n\n"
|
|
|
|
|
"TYPE=%d"
|
|
|
|
|
"\n\n\n********************\n\n\n",
|
|
|
|
|
skyboxId);
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
// Precompute vertices and display lists for drawing the skybox
|
2021-07-04 15:43:04 +00:00
|
|
|
|
if (skyboxId != SKYBOX_NONE) {
|
|
|
|
|
osSyncPrintf(VT_FGCOL(GREEN));
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
if (skyboxCtx->drawType != SKYBOX_DRAW_128) {
|
2021-11-15 21:33:44 +00:00
|
|
|
|
skyboxCtx->dListBuf = GameState_Alloc(state, 8 * 150 * sizeof(Gfx), "../z_vr_box.c", 1636);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1637);
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->roomVtx = GameState_Alloc(state, 8 * 32 * sizeof(Vtx), "../z_vr_box.c", 1639);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1640);
|
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
Skybox_Calculate256(skyboxCtx, skyboxId);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
} else {
|
2021-11-15 21:33:44 +00:00
|
|
|
|
skyboxCtx->dListBuf = GameState_Alloc(state, 12 * 150 * sizeof(Gfx), "../z_vr_box.c", 1643);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1644);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
2021-07-04 15:43:04 +00:00
|
|
|
|
if (skyboxId == SKYBOX_CUTSCENE_MAP) {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->roomVtx = GameState_Alloc(state, 6 * 32 * sizeof(Vtx), "../z_vr_box.c", 1648);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1649);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
Skybox_Calculate128(skyboxCtx, 6); // compute all 6 faces
|
2021-07-04 15:43:04 +00:00
|
|
|
|
} else {
|
2023-07-04 02:30:53 +00:00
|
|
|
|
skyboxCtx->roomVtx = GameState_Alloc(state, 5 * 32 * sizeof(Vtx), "../z_vr_box.c", 1653);
|
2021-07-04 15:43:04 +00:00
|
|
|
|
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1654);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
2023-07-04 02:30:53 +00:00
|
|
|
|
Skybox_Calculate128(skyboxCtx, 5); // compute 5 faces, excludes the bottom face
|
2021-07-04 15:43:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
osSyncPrintf(VT_RST);
|
|
|
|
|
}
|
|
|
|
|
}
|