mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-11 03:23:46 +00:00
Doc misc 1 (#1160)
* Misc documentation 1 * Add parentheses Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * Move the parentheses to the right place * `curByte`(2) -> `curChar`(2) Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * Revert `isMaterialSet` boolean usage * Fix misplaced line (how did that happen) * Fixup Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
parent
dfbc356cdf
commit
ed6ec5bceb
11 changed files with 265 additions and 262 deletions
|
@ -65,8 +65,8 @@
|
||||||
<!-- Other DisplayLists -->
|
<!-- Other DisplayLists -->
|
||||||
<DList Name="gGreatFairyBetaDL" Offset="0xD1B0"/>
|
<DList Name="gGreatFairyBetaDL" Offset="0xD1B0"/>
|
||||||
<DList Name="gGreatFairyFlowerDL" Offset="0xDC68"/>
|
<DList Name="gGreatFairyFlowerDL" Offset="0xDC68"/>
|
||||||
<DList Name="gGreatFairyParticleAppearDL" Offset="0x5860"/>
|
<DList Name="gGreatFairyParticleMaterialDL" Offset="0x5860"/>
|
||||||
<DList Name="gGreatFairyParticleAliveDL" Offset="0x58D8"/>
|
<DList Name="gGreatFairyParticleModelDL" Offset="0x58D8"/>
|
||||||
<DList Name="gGreatFairySpiralBeamDL" Offset="0x1C160"/>
|
<DList Name="gGreatFairySpiralBeamDL" Offset="0x1C160"/>
|
||||||
|
|
||||||
<!-- Great Fairy Palettes -->
|
<!-- Great Fairy Palettes -->
|
||||||
|
|
|
@ -472,11 +472,11 @@ void func_800C2500(PreRender* this, s32 x, s32 y) {
|
||||||
void func_800C2FE4(PreRender* this) {
|
void func_800C2FE4(PreRender* this) {
|
||||||
s32 x;
|
s32 x;
|
||||||
s32 y;
|
s32 y;
|
||||||
s32 phi_v0;
|
s32 pad1;
|
||||||
u8* buffR = alloca(this->width);
|
u8* buffR = alloca(this->width);
|
||||||
u8* buffG = alloca(this->width);
|
u8* buffG = alloca(this->width);
|
||||||
u8* buffB = alloca(this->width);
|
u8* buffB = alloca(this->width);
|
||||||
s32 pad[3];
|
s32 pad2[3];
|
||||||
s32 pxR;
|
s32 pxR;
|
||||||
s32 pxG;
|
s32 pxG;
|
||||||
s32 pxB;
|
s32 pxB;
|
||||||
|
|
|
@ -196,42 +196,42 @@ void func_80038A28(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest) {
|
||||||
f32 ny;
|
f32 ny;
|
||||||
f32 nz;
|
f32 nz;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
f32 phi_f2;
|
f32 xx;
|
||||||
f32 phi_f14;
|
f32 zz;
|
||||||
f32 phi_f12;
|
f32 yz;
|
||||||
f32 inv_phi_f2;
|
f32 xxInv;
|
||||||
f32 inv_phi_f14;
|
f32 zzInv;
|
||||||
|
|
||||||
if (poly == NULL) {
|
if (poly == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
|
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
|
||||||
|
|
||||||
phi_f2 = sqrtf(1.0f - SQ(nx));
|
xx = sqrtf(1.0f - SQ(nx));
|
||||||
if (!IS_ZERO(phi_f2)) {
|
if (!IS_ZERO(xx)) {
|
||||||
inv_phi_f2 = 1.0f / phi_f2;
|
xxInv = 1.0f / xx;
|
||||||
phi_f14 = ny * inv_phi_f2;
|
zz = ny * xxInv;
|
||||||
phi_f12 = -(nz * inv_phi_f2);
|
yz = -(nz * xxInv);
|
||||||
} else {
|
} else {
|
||||||
phi_f14 = sqrtf(1.0f - SQ(ny));
|
zz = sqrtf(1.0f - SQ(ny));
|
||||||
if (1) {}
|
if (1) {}
|
||||||
if (!IS_ZERO(phi_f14)) {
|
if (!IS_ZERO(zz)) {
|
||||||
inv_phi_f14 = (1.0f / phi_f14);
|
zzInv = 1.0f / zz;
|
||||||
phi_f12 = nx * inv_phi_f14;
|
yz = nx * zzInv;
|
||||||
phi_f2 = -(nz * inv_phi_f14);
|
xx = -(nz * zzInv);
|
||||||
} else {
|
} else {
|
||||||
phi_f12 = 0.0f;
|
yz = 0.0f;
|
||||||
phi_f2 = 0.0f;
|
xx = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dest->xx = phi_f2;
|
dest->xx = xx;
|
||||||
dest->yx = (-nx) * phi_f14;
|
dest->yx = -nx * zz;
|
||||||
dest->zx = nx * phi_f12;
|
dest->zx = nx * yz;
|
||||||
dest->xy = nx;
|
dest->xy = nx;
|
||||||
dest->yy = ny;
|
dest->yy = ny;
|
||||||
dest->zy = nz;
|
dest->zy = nz;
|
||||||
dest->yz = phi_f12;
|
dest->yz = yz;
|
||||||
dest->zz = phi_f14;
|
dest->zz = zz;
|
||||||
dest->wx = 0.0f;
|
dest->wx = 0.0f;
|
||||||
dest->wy = 0.0f;
|
dest->wy = 0.0f;
|
||||||
dest->xz = 0.0f;
|
dest->xz = 0.0f;
|
||||||
|
@ -1364,25 +1364,26 @@ u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, GlobalContext* glob
|
||||||
Vec3f curSubdivMin;
|
Vec3f curSubdivMin;
|
||||||
Vec3f curSubdivMax;
|
Vec3f curSubdivMax;
|
||||||
CollisionHeader* colHeader = colCtx->colHeader;
|
CollisionHeader* colHeader = colCtx->colHeader;
|
||||||
StaticLookup* spA4;
|
StaticLookup* lookupTblXY;
|
||||||
StaticLookup* phi_fp;
|
StaticLookup* lookupTblX;
|
||||||
StaticLookup* phi_s0;
|
StaticLookup* lookup;
|
||||||
s32 sp98;
|
s32 subdivAmountXY;
|
||||||
f32 subdivLengthX;
|
f32 subdivLengthX;
|
||||||
f32 subdivLengthY;
|
f32 subdivLengthY;
|
||||||
f32 subdivLengthZ;
|
f32 subdivLengthZ;
|
||||||
|
|
||||||
for (spA4 = lookupTbl;
|
for (lookupTblXY = lookupTbl;
|
||||||
spA4 < (colCtx->subdivAmount.x * colCtx->subdivAmount.y * colCtx->subdivAmount.z + lookupTbl); spA4++) {
|
lookupTblXY < (colCtx->subdivAmount.x * colCtx->subdivAmount.y * colCtx->subdivAmount.z + lookupTbl);
|
||||||
spA4->floor.head = SS_NULL;
|
lookupTblXY++) {
|
||||||
spA4->wall.head = SS_NULL;
|
lookupTblXY->floor.head = SS_NULL;
|
||||||
spA4->ceiling.head = SS_NULL;
|
lookupTblXY->wall.head = SS_NULL;
|
||||||
|
lookupTblXY->ceiling.head = SS_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
polyMax = colHeader->numPolygons;
|
polyMax = colHeader->numPolygons;
|
||||||
vtxList = colHeader->vtxList;
|
vtxList = colHeader->vtxList;
|
||||||
polyList = colHeader->polyList;
|
polyList = colHeader->polyList;
|
||||||
sp98 = colCtx->subdivAmount.x * colCtx->subdivAmount.y;
|
subdivAmountXY = colCtx->subdivAmount.x * colCtx->subdivAmount.y;
|
||||||
subdivLengthX = colCtx->subdivLength.x + (2 * BGCHECK_SUBDIV_OVERLAP);
|
subdivLengthX = colCtx->subdivLength.x + (2 * BGCHECK_SUBDIV_OVERLAP);
|
||||||
subdivLengthY = colCtx->subdivLength.y + (2 * BGCHECK_SUBDIV_OVERLAP);
|
subdivLengthY = colCtx->subdivLength.y + (2 * BGCHECK_SUBDIV_OVERLAP);
|
||||||
subdivLengthZ = colCtx->subdivLength.z + (2 * BGCHECK_SUBDIV_OVERLAP);
|
subdivLengthZ = colCtx->subdivLength.z + (2 * BGCHECK_SUBDIV_OVERLAP);
|
||||||
|
@ -1390,35 +1391,35 @@ u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, GlobalContext* glob
|
||||||
for (polyIdx = 0; polyIdx < polyMax; polyIdx++) {
|
for (polyIdx = 0; polyIdx < polyMax; polyIdx++) {
|
||||||
BgCheck_GetPolySubdivisionBounds(colCtx, vtxList, polyList, &sxMin, &syMin, &szMin, &sxMax, &syMax, &szMax,
|
BgCheck_GetPolySubdivisionBounds(colCtx, vtxList, polyList, &sxMin, &syMin, &szMin, &sxMax, &syMax, &szMax,
|
||||||
polyIdx);
|
polyIdx);
|
||||||
spA4 = szMin * sp98 + lookupTbl;
|
lookupTblXY = szMin * subdivAmountXY + lookupTbl;
|
||||||
curSubdivMin.z = (colCtx->subdivLength.z * szMin + colCtx->minBounds.z) - BGCHECK_SUBDIV_OVERLAP;
|
curSubdivMin.z = (colCtx->subdivLength.z * szMin + colCtx->minBounds.z) - BGCHECK_SUBDIV_OVERLAP;
|
||||||
curSubdivMax.z = curSubdivMin.z + subdivLengthZ;
|
curSubdivMax.z = curSubdivMin.z + subdivLengthZ;
|
||||||
|
|
||||||
for (sz = szMin; sz < szMax + 1; sz++) {
|
for (sz = szMin; sz < szMax + 1; sz++) {
|
||||||
phi_fp = (colCtx->subdivAmount.x * syMin) + spA4;
|
lookupTblX = (colCtx->subdivAmount.x * syMin) + lookupTblXY;
|
||||||
curSubdivMin.y = (colCtx->subdivLength.y * syMin + colCtx->minBounds.y) - BGCHECK_SUBDIV_OVERLAP;
|
curSubdivMin.y = (colCtx->subdivLength.y * syMin + colCtx->minBounds.y) - BGCHECK_SUBDIV_OVERLAP;
|
||||||
curSubdivMax.y = curSubdivMin.y + subdivLengthY;
|
curSubdivMax.y = curSubdivMin.y + subdivLengthY;
|
||||||
|
|
||||||
for (sy = syMin; sy < syMax + 1; sy++) {
|
for (sy = syMin; sy < syMax + 1; sy++) {
|
||||||
phi_s0 = sxMin + phi_fp;
|
lookup = sxMin + lookupTblX;
|
||||||
curSubdivMin.x = (colCtx->subdivLength.x * sxMin + colCtx->minBounds.x) - BGCHECK_SUBDIV_OVERLAP;
|
curSubdivMin.x = (colCtx->subdivLength.x * sxMin + colCtx->minBounds.x) - BGCHECK_SUBDIV_OVERLAP;
|
||||||
curSubdivMax.x = curSubdivMin.x + subdivLengthX;
|
curSubdivMax.x = curSubdivMin.x + subdivLengthX;
|
||||||
|
|
||||||
for (sx = sxMin; sx < sxMax + 1; sx++) {
|
for (sx = sxMin; sx < sxMax + 1; sx++) {
|
||||||
if (BgCheck_PolyIntersectsSubdivision(&curSubdivMin, &curSubdivMax, polyList, vtxList, polyIdx)) {
|
if (BgCheck_PolyIntersectsSubdivision(&curSubdivMin, &curSubdivMax, polyList, vtxList, polyIdx)) {
|
||||||
StaticLookup_AddPoly(phi_s0, colCtx, polyList, vtxList, polyIdx);
|
StaticLookup_AddPoly(lookup, colCtx, polyList, vtxList, polyIdx);
|
||||||
}
|
}
|
||||||
curSubdivMin.x += colCtx->subdivLength.x;
|
curSubdivMin.x += colCtx->subdivLength.x;
|
||||||
curSubdivMax.x += colCtx->subdivLength.x;
|
curSubdivMax.x += colCtx->subdivLength.x;
|
||||||
phi_s0++;
|
lookup++;
|
||||||
}
|
}
|
||||||
curSubdivMin.y += colCtx->subdivLength.y;
|
curSubdivMin.y += colCtx->subdivLength.y;
|
||||||
curSubdivMax.y += colCtx->subdivLength.y;
|
curSubdivMax.y += colCtx->subdivLength.y;
|
||||||
phi_fp += colCtx->subdivAmount.x;
|
lookupTblX += colCtx->subdivAmount.x;
|
||||||
}
|
}
|
||||||
curSubdivMin.z += colCtx->subdivLength.z;
|
curSubdivMin.z += colCtx->subdivLength.z;
|
||||||
curSubdivMax.z += colCtx->subdivLength.z;
|
curSubdivMax.z += colCtx->subdivLength.z;
|
||||||
spA4 += sp98;
|
lookupTblXY += subdivAmountXY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return colCtx->polyNodes.count * sizeof(SSNode);
|
return colCtx->polyNodes.count * sizeof(SSNode);
|
||||||
|
|
|
@ -1013,7 +1013,7 @@ s32 Camera_CalcAtForParallel(Camera* camera, VecSph* arg1, f32 yOffset, f32* arg
|
||||||
PosRot* playerPosRot = &camera->playerPosRot;
|
PosRot* playerPosRot = &camera->playerPosRot;
|
||||||
f32 temp_f2;
|
f32 temp_f2;
|
||||||
f32 phi_f16;
|
f32 phi_f16;
|
||||||
f32 sp54;
|
f32 eyeAtDistXZ;
|
||||||
f32 phi_f20;
|
f32 phi_f20;
|
||||||
f32 temp_f0_4;
|
f32 temp_f0_4;
|
||||||
|
|
||||||
|
@ -1036,9 +1036,9 @@ s32 Camera_CalcAtForParallel(Camera* camera, VecSph* arg1, f32 yOffset, f32* arg
|
||||||
} else {
|
} else {
|
||||||
if (!PREG(75)) {
|
if (!PREG(75)) {
|
||||||
phi_f20 = playerPosRot->pos.y - *arg3;
|
phi_f20 = playerPosRot->pos.y - *arg3;
|
||||||
sp54 = OLib_Vec3fDistXZ(at, &camera->eye);
|
eyeAtDistXZ = OLib_Vec3fDistXZ(at, &camera->eye);
|
||||||
phi_f16 = sp54;
|
phi_f16 = eyeAtDistXZ;
|
||||||
Math_FAtan2F(phi_f20, sp54);
|
Math_FAtan2F(phi_f20, eyeAtDistXZ);
|
||||||
temp_f2 = Math_FTanF(DEG_TO_RAD(camera->fov * 0.4f)) * phi_f16;
|
temp_f2 = Math_FTanF(DEG_TO_RAD(camera->fov * 0.4f)) * phi_f16;
|
||||||
if (temp_f2 < phi_f20) {
|
if (temp_f2 < phi_f20) {
|
||||||
*arg3 += phi_f20 - temp_f2;
|
*arg3 += phi_f20 - temp_f2;
|
||||||
|
@ -1085,7 +1085,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecSph* eyeAtDir, Vec3f* targetPos, f
|
||||||
PosRot* playerPosRot = &camera->playerPosRot;
|
PosRot* playerPosRot = &camera->playerPosRot;
|
||||||
f32 yPosDelta;
|
f32 yPosDelta;
|
||||||
f32 phi_f16;
|
f32 phi_f16;
|
||||||
f32 eyeAtDist;
|
f32 eyeAtDistXZ;
|
||||||
f32 temp_f0_2;
|
f32 temp_f0_2;
|
||||||
f32 playerHeight;
|
f32 playerHeight;
|
||||||
|
|
||||||
|
@ -1138,9 +1138,9 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecSph* eyeAtDir, Vec3f* targetPos, f
|
||||||
} else {
|
} else {
|
||||||
if (!(flags & FLG_OFFGROUND)) {
|
if (!(flags & FLG_OFFGROUND)) {
|
||||||
yPosDelta = playerPosRot->pos.y - *yPosOffset;
|
yPosDelta = playerPosRot->pos.y - *yPosOffset;
|
||||||
eyeAtDist = OLib_Vec3fDistXZ(at, &camera->eye);
|
eyeAtDistXZ = OLib_Vec3fDistXZ(at, &camera->eye);
|
||||||
phi_f16 = eyeAtDist;
|
phi_f16 = eyeAtDistXZ;
|
||||||
Math_FAtan2F(yPosDelta, eyeAtDist);
|
Math_FAtan2F(yPosDelta, eyeAtDistXZ);
|
||||||
temp_f0_2 = Math_FTanF(DEG_TO_RAD(camera->fov * 0.4f)) * phi_f16;
|
temp_f0_2 = Math_FTanF(DEG_TO_RAD(camera->fov * 0.4f)) * phi_f16;
|
||||||
if (temp_f0_2 < yPosDelta) {
|
if (temp_f0_2 < yPosDelta) {
|
||||||
*yPosOffset = *yPosOffset + (yPosDelta - temp_f0_2);
|
*yPosOffset = *yPosOffset + (yPosDelta - temp_f0_2);
|
||||||
|
@ -1261,24 +1261,24 @@ f32 Camera_ClampDist(Camera* camera, f32 dist, f32 minDist, f32 maxDist, s16 tim
|
||||||
|
|
||||||
s16 Camera_CalcDefaultPitch(Camera* camera, s16 arg1, s16 arg2, s16 arg3) {
|
s16 Camera_CalcDefaultPitch(Camera* camera, s16 arg1, s16 arg2, s16 arg3) {
|
||||||
f32 pad;
|
f32 pad;
|
||||||
f32 phi_a2;
|
f32 stepScale;
|
||||||
f32 t;
|
f32 t;
|
||||||
s16 phi_v0;
|
s16 phi_v0;
|
||||||
s16 phi_v1;
|
s16 absCur;
|
||||||
s16 sp1C;
|
s16 target;
|
||||||
|
|
||||||
phi_v1 = ABS(arg1);
|
absCur = ABS(arg1);
|
||||||
phi_v0 = arg3 > 0 ? (s16)(Math_CosS(arg3) * arg3) : arg3;
|
phi_v0 = arg3 > 0 ? (s16)(Math_CosS(arg3) * arg3) : arg3;
|
||||||
sp1C = arg2 - phi_v0;
|
target = arg2 - phi_v0;
|
||||||
|
|
||||||
if (ABS(sp1C) < phi_v1) {
|
if (ABS(target) < absCur) {
|
||||||
phi_a2 = (1.0f / camera->pitchUpdateRateInv) * 3.0f;
|
stepScale = (1.0f / camera->pitchUpdateRateInv) * 3.0f;
|
||||||
} else {
|
} else {
|
||||||
t = phi_v1 * (1.0f / R_CAM_MAX_PHI);
|
t = absCur * (1.0f / R_CAM_MAX_PHI);
|
||||||
pad = Camera_InterpolateCurve(0.8f, 1.0f - t);
|
pad = Camera_InterpolateCurve(0.8f, 1.0f - t);
|
||||||
phi_a2 = (1.0f / camera->pitchUpdateRateInv) * pad;
|
stepScale = (1.0f / camera->pitchUpdateRateInv) * pad;
|
||||||
}
|
}
|
||||||
return Camera_LERPCeilS(sp1C, arg1, phi_a2, 0xA);
|
return Camera_LERPCeilS(target, arg1, stepScale, 0xA);
|
||||||
}
|
}
|
||||||
|
|
||||||
s16 Camera_CalcDefaultYaw(Camera* camera, s16 cur, s16 target, f32 arg3, f32 accel) {
|
s16 Camera_CalcDefaultYaw(Camera* camera, s16 cur, s16 target, f32 arg3, f32 accel) {
|
||||||
|
@ -7296,8 +7296,8 @@ void Camera_UpdateDistortion(Camera* camera) {
|
||||||
depthPhase += DEGF_TO_BINANG(depthPhaseStep);
|
depthPhase += DEGF_TO_BINANG(depthPhaseStep);
|
||||||
screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep);
|
screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep);
|
||||||
|
|
||||||
View_SetDistortionOrientation(&camera->globalCtx->view, Math_CosS(depthPhase) * 0.0f, Math_SinS(depthPhase) * 0.0f,
|
View_SetDistortionOrientation(&camera->globalCtx->view, Math_CosS(depthPhase) * 0.0f,
|
||||||
Math_SinS(screenPlanePhase) * 0.0f);
|
Math_SinS(depthPhase) * 0.0f, Math_SinS(screenPlanePhase) * 0.0f);
|
||||||
View_SetDistortionScale(&camera->globalCtx->view, Math_SinS(screenPlanePhase) * (xScale * scaleFactor) + 1.0f,
|
View_SetDistortionScale(&camera->globalCtx->view, Math_SinS(screenPlanePhase) * (xScale * scaleFactor) + 1.0f,
|
||||||
Math_CosS(screenPlanePhase) * (yScale * scaleFactor) + 1.0f,
|
Math_CosS(screenPlanePhase) * (yScale * scaleFactor) + 1.0f,
|
||||||
Math_CosS(depthPhase) * (zScale * scaleFactor) + 1.0f);
|
Math_CosS(depthPhase) * (zScale * scaleFactor) + 1.0f);
|
||||||
|
|
|
@ -944,7 +944,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
||||||
EffectBlureElement* elem;
|
EffectBlureElement* elem;
|
||||||
s32 i;
|
s32 i;
|
||||||
s32 j;
|
s32 j;
|
||||||
s32 phi_t2;
|
s32 flag;
|
||||||
|
|
||||||
OPEN_DISPS(gfxCtx, "../z_eff_blure.c", 1596);
|
OPEN_DISPS(gfxCtx, "../z_eff_blure.c", 1596);
|
||||||
|
|
||||||
|
@ -1029,22 +1029,22 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
||||||
|
|
||||||
gSPVertex(POLY_XLU_DISP++, vtx, 32, 0);
|
gSPVertex(POLY_XLU_DISP++, vtx, 32, 0);
|
||||||
|
|
||||||
phi_t2 = 0;
|
flag = 0;
|
||||||
for (i = 0; i < this->numElements; i++) {
|
for (i = 0; i < this->numElements; i++) {
|
||||||
elem = &this->elements[i];
|
elem = &this->elements[i];
|
||||||
|
|
||||||
if (elem->state == 0) {
|
if (elem->state == 0) {
|
||||||
phi_t2 = 0;
|
flag = 0;
|
||||||
} else {
|
} else {
|
||||||
if (phi_t2 == 0) {
|
if (flag == 0) {
|
||||||
phi_t2 = 1;
|
flag = 1;
|
||||||
} else {
|
} else {
|
||||||
gSP1Quadrangle(POLY_XLU_DISP++, j - 2, j - 1, j + 1, j, 0);
|
gSP1Quadrangle(POLY_XLU_DISP++, j - 2, j - 1, j + 1, j, 0);
|
||||||
|
|
||||||
if (1) {} // Necessary to match
|
if (1) {} // Necessary to match
|
||||||
|
|
||||||
if (this->unkFlag == 1) {
|
if (this->unkFlag == 1) {
|
||||||
phi_t2 = 0;
|
flag = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
j += 2;
|
j += 2;
|
||||||
|
|
|
@ -1169,9 +1169,9 @@ void Message_LoadItemIcon(GlobalContext* globalCtx, u16 itemId, s16 y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Message_Decode(GlobalContext* globalCtx) {
|
void Message_Decode(GlobalContext* globalCtx) {
|
||||||
u8 temp_s2;
|
u8 curChar;
|
||||||
u8 phi_s1;
|
u8 curChar2;
|
||||||
u16 phi_s0_3;
|
u16 value;
|
||||||
s32 loadChar;
|
s32 loadChar;
|
||||||
s32 charTexIdx = 0;
|
s32 charTexIdx = 0;
|
||||||
s16 playerNameLen;
|
s16 playerNameLen;
|
||||||
|
@ -1188,10 +1188,10 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
sTextFade = false;
|
sTextFade = false;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
phi_s1 = temp_s2 = msgCtx->msgBufDecoded[decodedBufPos] = font->msgBuf[msgCtx->msgBufPos];
|
curChar2 = curChar = msgCtx->msgBufDecoded[decodedBufPos] = font->msgBuf[msgCtx->msgBufPos];
|
||||||
|
|
||||||
if (temp_s2 == MESSAGE_BOX_BREAK || temp_s2 == MESSAGE_TEXTID || temp_s2 == MESSAGE_BOX_BREAK_DELAYED ||
|
if (curChar == MESSAGE_BOX_BREAK || curChar == MESSAGE_TEXTID || curChar == MESSAGE_BOX_BREAK_DELAYED ||
|
||||||
temp_s2 == MESSAGE_EVENT || temp_s2 == MESSAGE_END) {
|
curChar == MESSAGE_EVENT || curChar == MESSAGE_END) {
|
||||||
// Textbox decoding ends with any of the above text control characters
|
// Textbox decoding ends with any of the above text control characters
|
||||||
msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING;
|
msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING;
|
||||||
msgCtx->textDrawPos = 1;
|
msgCtx->textDrawPos = 1;
|
||||||
|
@ -1206,15 +1206,15 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 16);
|
R_TEXT_INIT_YPOS = (u16)(R_TEXTBOX_Y + 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (phi_s1 == MESSAGE_TEXTID) {
|
if (curChar2 == MESSAGE_TEXTID) {
|
||||||
osSyncPrintf("NZ_NEXTMSG=%x, %x, %x\n", font->msgBuf[msgCtx->msgBufPos],
|
osSyncPrintf("NZ_NEXTMSG=%x, %x, %x\n", font->msgBuf[msgCtx->msgBufPos],
|
||||||
font->msgBuf[msgCtx->msgBufPos + 1], font->msgBuf[msgCtx->msgBufPos + 2]);
|
font->msgBuf[msgCtx->msgBufPos + 1], font->msgBuf[msgCtx->msgBufPos + 2]);
|
||||||
temp_s2 = msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1];
|
curChar = msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1];
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 2];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 2];
|
||||||
phi_s0_3 = temp_s2 << 8;
|
value = curChar << 8;
|
||||||
sNextTextId = msgCtx->msgBufDecoded[decodedBufPos] | phi_s0_3;
|
sNextTextId = msgCtx->msgBufDecoded[decodedBufPos] | value;
|
||||||
}
|
}
|
||||||
if (phi_s1 == MESSAGE_BOX_BREAK_DELAYED) {
|
if (curChar2 == MESSAGE_BOX_BREAK_DELAYED) {
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1];
|
||||||
msgCtx->msgBufPos += 2;
|
msgCtx->msgBufPos += 2;
|
||||||
}
|
}
|
||||||
|
@ -1223,7 +1223,7 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
msgCtx->textDrawPos = msgCtx->decodedTextLen;
|
msgCtx->textDrawPos = msgCtx->decodedTextLen;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else if (temp_s2 == MESSAGE_NAME) {
|
} else if (curChar == MESSAGE_NAME) {
|
||||||
// Substitute the player name control character for the file's player name.
|
// Substitute the player name control character for the file's player name.
|
||||||
for (playerNameLen = ARRAY_COUNT(gSaveContext.playerName); playerNameLen > 0; playerNameLen--) {
|
for (playerNameLen = ARRAY_COUNT(gSaveContext.playerName); playerNameLen > 0; playerNameLen--) {
|
||||||
if (gSaveContext.playerName[playerNameLen - 1] != 0x3E) {
|
if (gSaveContext.playerName[playerNameLen - 1] != 0x3E) {
|
||||||
|
@ -1233,39 +1233,39 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
// "Name"
|
// "Name"
|
||||||
osSyncPrintf("\n名前 = ");
|
osSyncPrintf("\n名前 = ");
|
||||||
for (i = 0; i < playerNameLen; i++) {
|
for (i = 0; i < playerNameLen; i++) {
|
||||||
phi_s1 = gSaveContext.playerName[i];
|
curChar2 = gSaveContext.playerName[i];
|
||||||
if (phi_s1 == 0x3E) {
|
if (curChar2 == 0x3E) {
|
||||||
phi_s1 = ' ';
|
curChar2 = ' ';
|
||||||
} else if (phi_s1 == 0x40) {
|
} else if (curChar2 == 0x40) {
|
||||||
phi_s1 = '.';
|
curChar2 = '.';
|
||||||
} else if (phi_s1 == 0x3F) {
|
} else if (curChar2 == 0x3F) {
|
||||||
phi_s1 = '-';
|
curChar2 = '-';
|
||||||
} else if (phi_s1 < 0xA) {
|
} else if (curChar2 < 0xA) {
|
||||||
phi_s1 += 0;
|
curChar2 += 0;
|
||||||
phi_s1 += '0';
|
curChar2 += '0';
|
||||||
} else if (phi_s1 < 0x24) {
|
} else if (curChar2 < 0x24) {
|
||||||
phi_s1 += 0;
|
curChar2 += 0;
|
||||||
phi_s1 += '7';
|
curChar2 += '7';
|
||||||
} else if (phi_s1 < 0x3E) {
|
} else if (curChar2 < 0x3E) {
|
||||||
phi_s1 += 0;
|
curChar2 += 0;
|
||||||
phi_s1 += '=';
|
curChar2 += '=';
|
||||||
}
|
}
|
||||||
if (phi_s1 != ' ') {
|
if (curChar2 != ' ') {
|
||||||
Font_LoadChar(font, phi_s1 - ' ', charTexIdx);
|
Font_LoadChar(font, curChar2 - ' ', charTexIdx);
|
||||||
charTexIdx += FONT_CHAR_TEX_SIZE;
|
charTexIdx += FONT_CHAR_TEX_SIZE;
|
||||||
}
|
}
|
||||||
osSyncPrintf("%x ", phi_s1);
|
osSyncPrintf("%x ", curChar2);
|
||||||
msgCtx->msgBufDecoded[decodedBufPos] = phi_s1;
|
msgCtx->msgBufDecoded[decodedBufPos] = curChar2;
|
||||||
decodedBufPos++;
|
decodedBufPos++;
|
||||||
}
|
}
|
||||||
decodedBufPos--;
|
decodedBufPos--;
|
||||||
} else if (temp_s2 == MESSAGE_MARATHON_TIME || temp_s2 == MESSAGE_RACE_TIME) {
|
} else if (curChar == MESSAGE_MARATHON_TIME || curChar == MESSAGE_RACE_TIME) {
|
||||||
// Convert the values of the appropriate timer to digits and add the
|
// Convert the values of the appropriate timer to digits and add the
|
||||||
// digits to the decoded buffer in place of the control character.
|
// digits to the decoded buffer in place of the control character.
|
||||||
// "EVENT timer"
|
// "EVENT timer"
|
||||||
osSyncPrintf("\nEVENTタイマー = ");
|
osSyncPrintf("\nEVENTタイマー = ");
|
||||||
digits[0] = digits[1] = digits[2] = 0;
|
digits[0] = digits[1] = digits[2] = 0;
|
||||||
if (temp_s2 == MESSAGE_RACE_TIME) {
|
if (curChar == MESSAGE_RACE_TIME) {
|
||||||
digits[3] = gSaveContext.timer1Value;
|
digits[3] = gSaveContext.timer1Value;
|
||||||
} else {
|
} else {
|
||||||
digits[3] = gSaveContext.timer2Value;
|
digits[3] = gSaveContext.timer2Value;
|
||||||
|
@ -1300,7 +1300,7 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
msgCtx->msgBufDecoded[decodedBufPos] = '"';
|
msgCtx->msgBufDecoded[decodedBufPos] = '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (temp_s2 == MESSAGE_POINTS) {
|
} else if (curChar == MESSAGE_POINTS) {
|
||||||
// Convert the values of the current minigame score to digits and
|
// Convert the values of the current minigame score to digits and
|
||||||
// add the digits to the decoded buffer in place of the control character.
|
// add the digits to the decoded buffer in place of the control character.
|
||||||
// "Yabusame score"
|
// "Yabusame score"
|
||||||
|
@ -1334,7 +1334,7 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decodedBufPos--;
|
decodedBufPos--;
|
||||||
} else if (temp_s2 == MESSAGE_TOKENS) {
|
} else if (curChar == MESSAGE_TOKENS) {
|
||||||
// Convert the current number of collected gold skulltula tokens to digits and
|
// Convert the current number of collected gold skulltula tokens to digits and
|
||||||
// add the digits to the decoded buffer in place of the control character.
|
// add the digits to the decoded buffer in place of the control character.
|
||||||
// "Total number of gold stars"
|
// "Total number of gold stars"
|
||||||
|
@ -1365,7 +1365,7 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decodedBufPos--;
|
decodedBufPos--;
|
||||||
} else if (temp_s2 == MESSAGE_FISH_INFO) {
|
} else if (curChar == MESSAGE_FISH_INFO) {
|
||||||
// "Fishing hole fish size"
|
// "Fishing hole fish size"
|
||||||
osSyncPrintf("\n釣り堀魚サイズ = ");
|
osSyncPrintf("\n釣り堀魚サイズ = ");
|
||||||
digits[0] = 0;
|
digits[0] = 0;
|
||||||
|
@ -1386,27 +1386,27 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decodedBufPos--;
|
decodedBufPos--;
|
||||||
} else if (temp_s2 == MESSAGE_HIGHSCORE) {
|
} else if (curChar == MESSAGE_HIGHSCORE) {
|
||||||
phi_s0_3 = HIGH_SCORE((u8)font->msgBuf[++msgCtx->msgBufPos]);
|
value = HIGH_SCORE((u8)font->msgBuf[++msgCtx->msgBufPos]);
|
||||||
// "Highscore"
|
// "Highscore"
|
||||||
osSyncPrintf("ランキング=%d\n", font->msgBuf[msgCtx->msgBufPos]);
|
osSyncPrintf("ランキング=%d\n", font->msgBuf[msgCtx->msgBufPos]);
|
||||||
if ((font->msgBuf[msgCtx->msgBufPos] & 0xFF) == 2) {
|
if ((font->msgBuf[msgCtx->msgBufPos] & 0xFF) == 2) {
|
||||||
if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
|
if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
|
||||||
phi_s0_3 &= 0x7F;
|
value &= 0x7F;
|
||||||
} else {
|
} else {
|
||||||
osSyncPrintf("HI_SCORE( kanfont->mbuff.nes_mes_buf[message->rdp] & 0xff000000 ) = %x\n",
|
osSyncPrintf("HI_SCORE( kanfont->mbuff.nes_mes_buf[message->rdp] & 0xff000000 ) = %x\n",
|
||||||
HIGH_SCORE(font->msgBufWide[msgCtx->msgBufPos] & 0xFF000000));
|
HIGH_SCORE(font->msgBufWide[msgCtx->msgBufPos] & 0xFF000000));
|
||||||
phi_s0_3 = ((HIGH_SCORE((u8)font->msgBuf[msgCtx->msgBufPos]) & 0xFF000000) >> 0x18) & 0x7F;
|
value = ((HIGH_SCORE((u8)font->msgBuf[msgCtx->msgBufPos]) & 0xFF000000) >> 0x18) & 0x7F;
|
||||||
}
|
}
|
||||||
phi_s0_3 = SQ((f32)phi_s0_3) * 0.0036f + 0.5f;
|
value = SQ((f32)value) * 0.0036f + 0.5f;
|
||||||
osSyncPrintf("score=%d\n", phi_s0_3);
|
osSyncPrintf("score=%d\n", value);
|
||||||
}
|
}
|
||||||
switch (font->msgBuf[msgCtx->msgBufPos] & 0xFF) {
|
switch (font->msgBuf[msgCtx->msgBufPos] & 0xFF) {
|
||||||
case HS_HBA:
|
case HS_HBA:
|
||||||
case HS_POE_POINTS:
|
case HS_POE_POINTS:
|
||||||
case HS_FISHING:
|
case HS_FISHING:
|
||||||
digits[0] = digits[1] = digits[2] = 0;
|
digits[0] = digits[1] = digits[2] = 0;
|
||||||
digits[3] = phi_s0_3;
|
digits[3] = value;
|
||||||
|
|
||||||
while (digits[3] >= 1000) {
|
while (digits[3] >= 1000) {
|
||||||
digits[0]++;
|
digits[0]++;
|
||||||
|
@ -1420,7 +1420,7 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
digits[2]++;
|
digits[2]++;
|
||||||
digits[3] -= 10;
|
digits[3] -= 10;
|
||||||
}
|
}
|
||||||
if (temp_s2) {}
|
if (curChar) {}
|
||||||
|
|
||||||
loadChar = false;
|
loadChar = false;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
@ -1442,7 +1442,7 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
case HS_MARATHON:
|
case HS_MARATHON:
|
||||||
case HS_DAMPE_RACE:
|
case HS_DAMPE_RACE:
|
||||||
digits[0] = digits[1] = digits[2] = 0;
|
digits[0] = digits[1] = digits[2] = 0;
|
||||||
digits[3] = phi_s0_3;
|
digits[3] = value;
|
||||||
|
|
||||||
while (digits[3] >= 60) {
|
while (digits[3] >= 60) {
|
||||||
digits[1]++;
|
digits[1]++;
|
||||||
|
@ -1475,7 +1475,7 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (temp_s2 == MESSAGE_TIME) {
|
} else if (curChar == MESSAGE_TIME) {
|
||||||
// "Zelda time"
|
// "Zelda time"
|
||||||
osSyncPrintf("\nゼルダ時間 = ");
|
osSyncPrintf("\nゼルダ時間 = ");
|
||||||
digits[0] = 0;
|
digits[0] = 0;
|
||||||
|
@ -1506,12 +1506,12 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decodedBufPos--;
|
decodedBufPos--;
|
||||||
} else if (temp_s2 == MESSAGE_ITEM_ICON) {
|
} else if (curChar == MESSAGE_ITEM_ICON) {
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1];
|
||||||
osSyncPrintf("ITEM_NO=(%d) (%d)\n", msgCtx->msgBufDecoded[decodedBufPos],
|
osSyncPrintf("ITEM_NO=(%d) (%d)\n", msgCtx->msgBufDecoded[decodedBufPos],
|
||||||
font->msgBuf[msgCtx->msgBufPos + 1]);
|
font->msgBuf[msgCtx->msgBufPos + 1]);
|
||||||
Message_LoadItemIcon(globalCtx, font->msgBuf[msgCtx->msgBufPos + 1], R_TEXTBOX_Y + 10);
|
Message_LoadItemIcon(globalCtx, font->msgBuf[msgCtx->msgBufPos + 1], R_TEXTBOX_Y + 10);
|
||||||
} else if (temp_s2 == MESSAGE_BACKGROUND) {
|
} else if (curChar == MESSAGE_BACKGROUND) {
|
||||||
msgCtx->textboxBackgroundIdx = font->msgBuf[msgCtx->msgBufPos + 1] * 2;
|
msgCtx->textboxBackgroundIdx = font->msgBuf[msgCtx->msgBufPos + 1] * 2;
|
||||||
msgCtx->textboxBackgroundForeColorIdx = (font->msgBuf[msgCtx->msgBufPos + 2] & 0xF0) >> 4;
|
msgCtx->textboxBackgroundForeColorIdx = (font->msgBuf[msgCtx->msgBufPos + 2] & 0xF0) >> 4;
|
||||||
msgCtx->textboxBackgroundBackColorIdx = font->msgBuf[msgCtx->msgBufPos + 2] & 0xF;
|
msgCtx->textboxBackgroundBackColorIdx = font->msgBuf[msgCtx->msgBufPos + 2] & 0xF;
|
||||||
|
@ -1528,33 +1528,33 @@ void Message_Decode(GlobalContext* globalCtx) {
|
||||||
R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8;
|
R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8;
|
||||||
numLines = 2;
|
numLines = 2;
|
||||||
R_TEXT_INIT_XPOS = 50;
|
R_TEXT_INIT_XPOS = 50;
|
||||||
} else if (temp_s2 == MESSAGE_COLOR) {
|
} else if (curChar == MESSAGE_COLOR) {
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
||||||
} else if (temp_s2 == MESSAGE_NEWLINE) {
|
} else if (curChar == MESSAGE_NEWLINE) {
|
||||||
numLines++;
|
numLines++;
|
||||||
} else if (temp_s2 != MESSAGE_QUICKTEXT_ENABLE && temp_s2 != MESSAGE_QUICKTEXT_DISABLE &&
|
} else if (curChar != MESSAGE_QUICKTEXT_ENABLE && curChar != MESSAGE_QUICKTEXT_DISABLE &&
|
||||||
temp_s2 != MESSAGE_AWAIT_BUTTON_PRESS && temp_s2 != MESSAGE_OCARINA &&
|
curChar != MESSAGE_AWAIT_BUTTON_PRESS && curChar != MESSAGE_OCARINA &&
|
||||||
temp_s2 != MESSAGE_PERSISTENT && temp_s2 != MESSAGE_UNSKIPPABLE) {
|
curChar != MESSAGE_PERSISTENT && curChar != MESSAGE_UNSKIPPABLE) {
|
||||||
if (temp_s2 == MESSAGE_FADE) {
|
if (curChar == MESSAGE_FADE) {
|
||||||
sTextFade = true;
|
sTextFade = true;
|
||||||
osSyncPrintf("NZ_TIMER_END (key_off_flag=%d)\n", sTextFade);
|
osSyncPrintf("NZ_TIMER_END (key_off_flag=%d)\n", sTextFade);
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
||||||
} else if (temp_s2 == MESSAGE_FADE2) {
|
} else if (curChar == MESSAGE_FADE2) {
|
||||||
sTextFade = true;
|
sTextFade = true;
|
||||||
osSyncPrintf("NZ_BGM (key_off_flag=%d)\n", sTextFade);
|
osSyncPrintf("NZ_BGM (key_off_flag=%d)\n", sTextFade);
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
||||||
} else if (temp_s2 == MESSAGE_SHIFT || temp_s2 == MESSAGE_TEXT_SPEED) {
|
} else if (curChar == MESSAGE_SHIFT || curChar == MESSAGE_TEXT_SPEED) {
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos] & 0xFF;
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos] & 0xFF;
|
||||||
} else if (temp_s2 == MESSAGE_SFX) {
|
} else if (curChar == MESSAGE_SFX) {
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
||||||
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
|
||||||
} else if (temp_s2 == MESSAGE_TWO_CHOICE) {
|
} else if (curChar == MESSAGE_TWO_CHOICE) {
|
||||||
msgCtx->choiceNum = 2;
|
msgCtx->choiceNum = 2;
|
||||||
} else if (temp_s2 == MESSAGE_THREE_CHOICE) {
|
} else if (curChar == MESSAGE_THREE_CHOICE) {
|
||||||
msgCtx->choiceNum = 3;
|
msgCtx->choiceNum = 3;
|
||||||
} else if (temp_s2 != ' ') {
|
} else if (curChar != ' ') {
|
||||||
Font_LoadChar(font, temp_s2 - ' ', charTexIdx);
|
Font_LoadChar(font, curChar - ' ', charTexIdx);
|
||||||
charTexIdx += FONT_CHAR_TEX_SIZE;
|
charTexIdx += FONT_CHAR_TEX_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,17 +86,17 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||||
struct_80095D04 spB8[SHAPE_SORT_MAX];
|
struct_80095D04 spB8[SHAPE_SORT_MAX];
|
||||||
struct_80095D04* spB4 = NULL;
|
struct_80095D04* spB4 = NULL;
|
||||||
struct_80095D04* spB0 = NULL;
|
struct_80095D04* spB0 = NULL;
|
||||||
struct_80095D04* phi_v0;
|
struct_80095D04* iter;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
struct_80095D04* spA4;
|
struct_80095D04* spA4;
|
||||||
s32 phi_v1;
|
s32 j;
|
||||||
s32 sp9C;
|
s32 i;
|
||||||
Vec3f sp90;
|
Vec3f pos;
|
||||||
Vec3f sp84;
|
Vec3f projectedPos;
|
||||||
f32 sp80;
|
f32 projectedW;
|
||||||
s32 pad2;
|
s32 pad2;
|
||||||
PolygonDlist2* sp78;
|
PolygonDlist2* polygonDlistFirst;
|
||||||
PolygonDlist2* temp;
|
PolygonDlist2* polygonDlistIter;
|
||||||
f32 temp_f2;
|
f32 temp_f2;
|
||||||
|
|
||||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 287);
|
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 287);
|
||||||
|
@ -119,44 +119,44 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||||
spA4 = spB8;
|
spA4 = spB8;
|
||||||
|
|
||||||
ASSERT(polygon2->num <= SHAPE_SORT_MAX, "polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
|
ASSERT(polygon2->num <= SHAPE_SORT_MAX, "polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
|
||||||
sp78 = polygonDlist;
|
polygonDlistFirst = polygonDlist;
|
||||||
|
|
||||||
for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) {
|
for (i = 0; i < polygon2->num; i++, polygonDlist++) {
|
||||||
sp90.x = polygonDlist->pos.x;
|
pos.x = polygonDlist->pos.x;
|
||||||
sp90.y = polygonDlist->pos.y;
|
pos.y = polygonDlist->pos.y;
|
||||||
sp90.z = polygonDlist->pos.z;
|
pos.z = polygonDlist->pos.z;
|
||||||
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &sp90, &sp84, &sp80);
|
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &pos, &projectedPos, &projectedW);
|
||||||
if (-(f32)polygonDlist->unk_06 < sp84.z) {
|
if (-(f32)polygonDlist->unk_06 < projectedPos.z) {
|
||||||
temp_f2 = sp84.z - polygonDlist->unk_06;
|
temp_f2 = projectedPos.z - polygonDlist->unk_06;
|
||||||
if (temp_f2 < globalCtx->lightCtx.fogFar) {
|
if (temp_f2 < globalCtx->lightCtx.fogFar) {
|
||||||
phi_v0 = spB4;
|
|
||||||
spA4->unk_00 = polygonDlist;
|
spA4->unk_00 = polygonDlist;
|
||||||
spA4->unk_04 = temp_f2;
|
spA4->unk_04 = temp_f2;
|
||||||
if (phi_v0 == NULL) {
|
iter = spB4;
|
||||||
|
if (iter == NULL) {
|
||||||
spB4 = spB0 = spA4;
|
spB4 = spB0 = spA4;
|
||||||
spA4->unk_08 = spA4->unk_0C = NULL;
|
spA4->unk_08 = spA4->unk_0C = NULL;
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
if (spA4->unk_04 < phi_v0->unk_04) {
|
if (spA4->unk_04 < iter->unk_04) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
phi_v0 = phi_v0->unk_0C;
|
iter = iter->unk_0C;
|
||||||
} while (phi_v0 != NULL);
|
} while (iter != NULL);
|
||||||
|
|
||||||
if (phi_v0 == NULL) {
|
if (iter == NULL) {
|
||||||
spA4->unk_08 = spB0;
|
spA4->unk_08 = spB0;
|
||||||
spA4->unk_0C = NULL;
|
spA4->unk_0C = NULL;
|
||||||
spB0->unk_0C = spA4;
|
spB0->unk_0C = spA4;
|
||||||
spB0 = spA4;
|
spB0 = spA4;
|
||||||
} else {
|
} else {
|
||||||
spA4->unk_08 = phi_v0->unk_08;
|
spA4->unk_08 = iter->unk_08;
|
||||||
if (spA4->unk_08 == NULL) {
|
if (spA4->unk_08 == NULL) {
|
||||||
spB4 = spA4;
|
spB4 = spA4;
|
||||||
} else {
|
} else {
|
||||||
spA4->unk_08->unk_0C = spA4;
|
spA4->unk_08->unk_0C = spA4;
|
||||||
}
|
}
|
||||||
phi_v0->unk_08 = spA4;
|
iter->unk_08 = spA4;
|
||||||
spA4->unk_0C = phi_v0;
|
spA4->unk_0C = iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spA4++;
|
spA4++;
|
||||||
|
@ -166,51 +166,51 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||||
|
|
||||||
iREG(87) = polygon2->num & 0xFFFF & 0xFFFF & 0xFFFF; // if this is real then I might not be
|
iREG(87) = polygon2->num & 0xFFFF & 0xFFFF & 0xFFFF; // if this is real then I might not be
|
||||||
|
|
||||||
for (sp9C = 1; spB4 != NULL; spB4 = spB4->unk_0C, sp9C++) {
|
for (i = 1; spB4 != NULL; spB4 = spB4->unk_0C, i++) {
|
||||||
Gfx* temp2;
|
Gfx* displayList;
|
||||||
|
|
||||||
polygonDlist = spB4->unk_00;
|
polygonDlist = spB4->unk_00;
|
||||||
if (iREG(86) != 0) {
|
if (iREG(86) != 0) {
|
||||||
temp = sp78;
|
polygonDlistIter = polygonDlistFirst;
|
||||||
for (phi_v1 = 0; phi_v1 < polygon2->num; phi_v1++, temp++) {
|
for (j = 0; j < polygon2->num; j++, polygonDlistIter++) {
|
||||||
if (polygonDlist == temp) {
|
if (polygonDlist == polygonDlistIter) {
|
||||||
break; // This loop does nothing?
|
break; // This loop does nothing?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((iREG(86) == 1) && (iREG(89) >= sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) {
|
if (((iREG(86) == 1) && (iREG(89) >= i)) || ((iREG(86) == 2) && (iREG(89) == i))) {
|
||||||
if (flags & 1) {
|
if (flags & 1) {
|
||||||
temp2 = polygonDlist->opa;
|
displayList = polygonDlist->opa;
|
||||||
if (temp2 != NULL) {
|
if (displayList != NULL) {
|
||||||
gSPDisplayList(POLY_OPA_DISP++, temp2);
|
gSPDisplayList(POLY_OPA_DISP++, displayList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & 2) {
|
if (flags & 2) {
|
||||||
temp2 = polygonDlist->xlu;
|
displayList = polygonDlist->xlu;
|
||||||
if (temp2 != NULL) {
|
if (displayList != NULL) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, temp2);
|
gSPDisplayList(POLY_XLU_DISP++, displayList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (flags & 1) {
|
if (flags & 1) {
|
||||||
temp2 = polygonDlist->opa;
|
displayList = polygonDlist->opa;
|
||||||
if (temp2 != NULL) {
|
if (displayList != NULL) {
|
||||||
gSPDisplayList(POLY_OPA_DISP++, temp2);
|
gSPDisplayList(POLY_OPA_DISP++, displayList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & 2) {
|
if (flags & 2) {
|
||||||
temp2 = polygonDlist->xlu;
|
displayList = polygonDlist->xlu;
|
||||||
if (temp2 != NULL) {
|
if (displayList != NULL) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, temp2);
|
gSPDisplayList(POLY_XLU_DISP++, displayList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
iREG(88) = sp9C - 1;
|
iREG(88) = i - 1;
|
||||||
|
|
||||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 430);
|
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 430);
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,6 @@ void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 h
|
||||||
u16 tlutCount, f32 frameX, f32 frameY) {
|
u16 tlutCount, f32 frameX, f32 frameY) {
|
||||||
Gfx* displayListHead;
|
Gfx* displayListHead;
|
||||||
uObjBg* bg;
|
uObjBg* bg;
|
||||||
s32 temp;
|
|
||||||
|
|
||||||
displayListHead = *displayList;
|
displayListHead = *displayList;
|
||||||
func_80096238(SEGMENTED_TO_VIRTUAL(source));
|
func_80096238(SEGMENTED_TO_VIRTUAL(source));
|
||||||
|
@ -312,31 +311,31 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||||
Gfx* spA8;
|
Gfx* spA8;
|
||||||
PolygonType1* polygon1;
|
PolygonType1* polygon1;
|
||||||
PolygonDlist* polygonDlist;
|
PolygonDlist* polygonDlist;
|
||||||
u32 sp9C;
|
u32 isFixedCamera;
|
||||||
u32 sp98;
|
u32 drawBg;
|
||||||
u32 sp94;
|
u32 drawOpa;
|
||||||
u32 sp90;
|
u32 drawXlu;
|
||||||
|
|
||||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 628);
|
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 628);
|
||||||
|
|
||||||
camera = GET_ACTIVE_CAM(globalCtx);
|
camera = GET_ACTIVE_CAM(globalCtx);
|
||||||
sp9C = (camera->setting == CAM_SET_PREREND_FIXED);
|
isFixedCamera = camera->setting == CAM_SET_PREREND_FIXED;
|
||||||
polygon1 = &room->mesh->polygon1;
|
polygon1 = &room->mesh->polygon1;
|
||||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||||
sp98 = (flags & 1) && sp9C && polygon1->single.source && !(SREG(25) & 1);
|
drawBg = (flags & 1) && isFixedCamera && polygon1->single.source && !(SREG(25) & 1);
|
||||||
sp94 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
|
drawOpa = (flags & 1) && (polygonDlist->opa != NULL) && !(SREG(25) & 2);
|
||||||
sp90 = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
|
drawXlu = (flags & 2) && (polygonDlist->xlu != NULL) && !(SREG(25) & 4);
|
||||||
|
|
||||||
if (sp94 || sp98) {
|
if (drawOpa || drawBg) {
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
||||||
|
|
||||||
if (sp94) {
|
if (drawOpa) {
|
||||||
func_80093D18(globalCtx->state.gfxCtx);
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
|
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp98) {
|
if (drawBg) {
|
||||||
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)?
|
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)?
|
||||||
gSPLoadUcodeEx(POLY_OPA_DISP++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
|
gSPLoadUcodeEx(POLY_OPA_DISP++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
|
||||||
|
|
||||||
|
@ -356,7 +355,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp90) {
|
if (drawXlu) {
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
||||||
func_80093D84(globalCtx->state.gfxCtx);
|
func_80093D84(globalCtx->state.gfxCtx);
|
||||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
|
@ -403,47 +402,49 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||||
// Room Draw Polygon Type 1 - Multi Format
|
// Room Draw Polygon Type 1 - Multi Format
|
||||||
void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||||
Camera* camera;
|
Camera* camera;
|
||||||
Gfx* spA8;
|
Gfx* gfx;
|
||||||
PolygonType1* polygon1;
|
PolygonType1* polygon1;
|
||||||
BgImage* bgImage;
|
BgImage* bgImage;
|
||||||
PolygonDlist* polygonDlist;
|
PolygonDlist* polygonDlist;
|
||||||
u32 sp98;
|
u32 isFixedCamera;
|
||||||
u32 sp94;
|
u32 drawBg;
|
||||||
u32 sp90;
|
u32 drawOpa;
|
||||||
u32 sp8C;
|
u32 drawXlu;
|
||||||
|
|
||||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 752);
|
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 752);
|
||||||
|
|
||||||
camera = GET_ACTIVE_CAM(globalCtx);
|
camera = GET_ACTIVE_CAM(globalCtx);
|
||||||
sp98 = (camera->setting == CAM_SET_PREREND_FIXED);
|
isFixedCamera = camera->setting == CAM_SET_PREREND_FIXED;
|
||||||
polygon1 = &room->mesh->polygon1;
|
polygon1 = &room->mesh->polygon1;
|
||||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||||
bgImage = func_80096A74(polygon1, globalCtx);
|
bgImage = func_80096A74(polygon1, globalCtx);
|
||||||
sp94 = (flags & 1) && sp98 && bgImage->source && !(SREG(25) & 1);
|
drawBg = (flags & 1) && isFixedCamera && bgImage->source && !(SREG(25) & 1);
|
||||||
sp90 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
|
drawOpa = (flags & 1) && (polygonDlist->opa != NULL) && !(SREG(25) & 2);
|
||||||
sp8C = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
|
drawXlu = (flags & 2) && (polygonDlist->xlu != NULL) && !(SREG(25) & 4);
|
||||||
|
|
||||||
if (sp90 || sp94) {
|
if (drawOpa || drawBg) {
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
||||||
|
|
||||||
if (sp90) {
|
if (drawOpa) {
|
||||||
func_80093D18(globalCtx->state.gfxCtx);
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
|
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp94) {
|
if (drawBg) {
|
||||||
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)?
|
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)?
|
||||||
gSPLoadUcodeEx(POLY_OPA_DISP++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
|
gSPLoadUcodeEx(POLY_OPA_DISP++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
|
||||||
|
|
||||||
{
|
{
|
||||||
Vec3f sp5C;
|
Vec3f skyboxOffset;
|
||||||
spA8 = POLY_OPA_DISP;
|
|
||||||
Camera_GetSkyboxOffset(&sp5C, camera);
|
gfx = POLY_OPA_DISP;
|
||||||
func_8009638C(&spA8, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt,
|
Camera_GetSkyboxOffset(&skyboxOffset, camera);
|
||||||
|
func_8009638C(&gfx, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt,
|
||||||
bgImage->siz, bgImage->mode0, bgImage->tlutCount,
|
bgImage->siz, bgImage->mode0, bgImage->tlutCount,
|
||||||
(sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f, sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f);
|
(skyboxOffset.x + skyboxOffset.z) * 1.2f + skyboxOffset.y * 0.6f,
|
||||||
POLY_OPA_DISP = spA8;
|
skyboxOffset.y * 2.4f + (skyboxOffset.x + skyboxOffset.z) * 0.3f);
|
||||||
|
POLY_OPA_DISP = gfx;
|
||||||
}
|
}
|
||||||
|
|
||||||
// gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData())?
|
// gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData())?
|
||||||
|
@ -451,7 +452,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp8C) {
|
if (drawXlu) {
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
||||||
func_80093D84(globalCtx->state.gfxCtx);
|
func_80093D84(globalCtx->state.gfxCtx);
|
||||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
|
|
|
@ -2313,9 +2313,9 @@ void func_8009FE58(GlobalContext* globalCtx) {
|
||||||
|
|
||||||
temp = 0.020000001f;
|
temp = 0.020000001f;
|
||||||
View_SetDistortionOrientation(&globalCtx->view,
|
View_SetDistortionOrientation(&globalCtx->view,
|
||||||
((360.00018f / 65535.0f) * (M_PI / 180.0f)) * temp * Math_CosS(D_8012A39C),
|
((360.00018f / 65535.0f) * (M_PI / 180.0f)) * temp * Math_CosS(D_8012A39C),
|
||||||
((360.00018f / 65535.0f) * (M_PI / 180.0f)) * temp * Math_SinS(D_8012A39C),
|
((360.00018f / 65535.0f) * (M_PI / 180.0f)) * temp * Math_SinS(D_8012A39C),
|
||||||
((360.00018f / 65535.0f) * (M_PI / 180.0f)) * temp * Math_SinS(D_8012A3A0));
|
((360.00018f / 65535.0f) * (M_PI / 180.0f)) * temp * Math_SinS(D_8012A3A0));
|
||||||
View_SetDistortionScale(&globalCtx->view, 1.f + (0.79999995f * temp * Math_SinS(D_8012A3A0)),
|
View_SetDistortionScale(&globalCtx->view, 1.f + (0.79999995f * temp * Math_SinS(D_8012A3A0)),
|
||||||
1.f + (0.39999998f * temp * Math_CosS(D_8012A3A0)),
|
1.f + (0.39999998f * temp * Math_CosS(D_8012A3A0)),
|
||||||
1.f + (1 * temp * Math_CosS(D_8012A39C)));
|
1.f + (1 * temp * Math_CosS(D_8012A39C)));
|
||||||
|
|
|
@ -373,8 +373,8 @@ void func_800AF178(SkyboxContext* skyboxCtx, s32 arg1) {
|
||||||
void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
||||||
u32 size;
|
u32 size;
|
||||||
s16 i;
|
s16 i;
|
||||||
u8 sp41; // imageIdx
|
u8 skybox1Index;
|
||||||
u8 sp40; // imageIdx2
|
u8 skybox2Index;
|
||||||
u32 start;
|
u32 start;
|
||||||
s32 phi_v1;
|
s32 phi_v1;
|
||||||
|
|
||||||
|
@ -390,8 +390,8 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||||
if (gSaveContext.skyboxTime >= D_8011FC1C[phi_v1][i].startTime &&
|
if (gSaveContext.skyboxTime >= D_8011FC1C[phi_v1][i].startTime &&
|
||||||
(gSaveContext.skyboxTime < D_8011FC1C[phi_v1][i].endTime ||
|
(gSaveContext.skyboxTime < D_8011FC1C[phi_v1][i].endTime ||
|
||||||
D_8011FC1C[phi_v1][i].endTime == 0xFFFF)) {
|
D_8011FC1C[phi_v1][i].endTime == 0xFFFF)) {
|
||||||
globalCtx->envCtx.skybox1Index = sp41 = D_8011FC1C[phi_v1][i].skybox1Index;
|
globalCtx->envCtx.skybox1Index = skybox1Index = D_8011FC1C[phi_v1][i].skybox1Index;
|
||||||
globalCtx->envCtx.skybox2Index = sp40 = D_8011FC1C[phi_v1][i].skybox2Index;
|
globalCtx->envCtx.skybox2Index = skybox2Index = D_8011FC1C[phi_v1][i].skybox2Index;
|
||||||
if (D_8011FC1C[phi_v1][i].blend != 0) {
|
if (D_8011FC1C[phi_v1][i].blend != 0) {
|
||||||
globalCtx->envCtx.skyboxBlend =
|
globalCtx->envCtx.skyboxBlend =
|
||||||
Environment_LerpWeight(D_8011FC1C[phi_v1][i].endTime, D_8011FC1C[phi_v1][i].startTime,
|
Environment_LerpWeight(D_8011FC1C[phi_v1][i].endTime, D_8011FC1C[phi_v1][i].startTime,
|
||||||
|
@ -404,43 +404,43 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size = gSkyboxFiles[sp41].file.vromEnd - gSkyboxFiles[sp41].file.vromStart;
|
size = gSkyboxFiles[skybox1Index].file.vromEnd - gSkyboxFiles[skybox1Index].file.vromStart;
|
||||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1054);
|
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1054);
|
||||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||||
1055);
|
1055);
|
||||||
|
|
||||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], gSkyboxFiles[sp41].file.vromStart, size, "../z_vr_box.c",
|
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], gSkyboxFiles[skybox1Index].file.vromStart, size,
|
||||||
1058);
|
"../z_vr_box.c", 1058);
|
||||||
|
|
||||||
size = gSkyboxFiles[sp40].file.vromEnd - gSkyboxFiles[sp40].file.vromStart;
|
size = gSkyboxFiles[skybox2Index].file.vromEnd - gSkyboxFiles[skybox2Index].file.vromStart;
|
||||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1060);
|
skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1060);
|
||||||
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
||||||
1061);
|
1061);
|
||||||
|
|
||||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], gSkyboxFiles[sp40].file.vromStart, size, "../z_vr_box.c",
|
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], gSkyboxFiles[skybox2Index].file.vromStart, size,
|
||||||
1064);
|
"../z_vr_box.c", 1064);
|
||||||
|
|
||||||
if ((sp41 & 1) ^ ((sp41 & 4) >> 2)) {
|
if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) {
|
||||||
size = gSkyboxFiles[sp41].palette.vromEnd - gSkyboxFiles[sp41].palette.vromStart;
|
size = gSkyboxFiles[skybox1Index].palette.vromEnd - gSkyboxFiles[skybox1Index].palette.vromStart;
|
||||||
|
|
||||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1072);
|
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1072);
|
||||||
|
|
||||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073);
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073);
|
||||||
|
|
||||||
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[sp41].palette.vromStart, size, "../z_vr_box.c",
|
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[skybox1Index].palette.vromStart, size,
|
||||||
1075);
|
"../z_vr_box.c", 1075);
|
||||||
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[sp40].palette.vromStart, size,
|
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[skybox2Index].palette.vromStart, size,
|
||||||
"../z_vr_box.c", 1077);
|
"../z_vr_box.c", 1077);
|
||||||
} else {
|
} else {
|
||||||
size = gSkyboxFiles[sp41].palette.vromEnd - gSkyboxFiles[sp41].palette.vromStart;
|
size = gSkyboxFiles[skybox1Index].palette.vromEnd - gSkyboxFiles[skybox1Index].palette.vromStart;
|
||||||
|
|
||||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1085);
|
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1085);
|
||||||
|
|
||||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086);
|
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086);
|
||||||
|
|
||||||
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[sp40].palette.vromStart, size, "../z_vr_box.c",
|
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[skybox2Index].palette.vromStart, size,
|
||||||
1088);
|
"../z_vr_box.c", 1088);
|
||||||
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[sp41].palette.vromStart, size,
|
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[skybox1Index].palette.vromStart, size,
|
||||||
"../z_vr_box.c", 1090);
|
"../z_vr_box.c", 1090);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -146,16 +146,16 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||||
f32 bodyDistDiff;
|
f32 bodyDistDiff;
|
||||||
f32 phi_f16;
|
f32 phi_f16;
|
||||||
DynaPolyActor* dynaPolyActor;
|
DynaPolyActor* dynaPolyActor;
|
||||||
f32 sp94;
|
f32 curGrabbedDist;
|
||||||
f32 sp90;
|
f32 grabbedDist;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
CollisionPoly* poly;
|
CollisionPoly* poly;
|
||||||
s32 bgId;
|
s32 bgId;
|
||||||
Vec3f sp78;
|
Vec3f intersectPos;
|
||||||
Vec3f prevFrameDiff;
|
Vec3f prevFrameDiff;
|
||||||
Vec3f sp60;
|
Vec3f sp60;
|
||||||
f32 sp5C;
|
f32 polyNormalX;
|
||||||
f32 sp58;
|
f32 polyNormalZ;
|
||||||
f32 velocity;
|
f32 velocity;
|
||||||
s32 pad1;
|
s32 pad1;
|
||||||
|
|
||||||
|
@ -189,10 +189,11 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||||
grabbed = NULL;
|
grabbed = NULL;
|
||||||
this->grabbed = NULL;
|
this->grabbed = NULL;
|
||||||
} else if (this->actor.child != NULL) {
|
} else if (this->actor.child != NULL) {
|
||||||
sp94 = Actor_WorldDistXYZToActor(&this->actor, grabbed);
|
curGrabbedDist = Actor_WorldDistXYZToActor(&this->actor, grabbed);
|
||||||
sp90 = sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
|
grabbedDist =
|
||||||
|
sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
|
||||||
Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos);
|
Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos);
|
||||||
if (50.0f < (sp94 - sp90)) {
|
if ((curGrabbedDist - grabbedDist) > 50.0f) {
|
||||||
ArmsHook_DetachHookFromActor(this);
|
ArmsHook_DetachHookFromActor(this);
|
||||||
grabbed = NULL;
|
grabbed = NULL;
|
||||||
}
|
}
|
||||||
|
@ -256,14 +257,14 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||||
sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x);
|
sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x);
|
||||||
sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y);
|
sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y);
|
||||||
sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z);
|
sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z);
|
||||||
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &this->unk_1E8, &sp78, &poly, true, true, true, true,
|
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &this->unk_1E8, &intersectPos, &poly, true, true, true,
|
||||||
&bgId) &&
|
true, &bgId) &&
|
||||||
!func_8002F9EC(globalCtx, &this->actor, poly, bgId, &sp78)) {
|
!func_8002F9EC(globalCtx, &this->actor, poly, bgId, &intersectPos)) {
|
||||||
sp5C = COLPOLY_GET_NORMAL(poly->normal.x);
|
polyNormalX = COLPOLY_GET_NORMAL(poly->normal.x);
|
||||||
sp58 = COLPOLY_GET_NORMAL(poly->normal.z);
|
polyNormalZ = COLPOLY_GET_NORMAL(poly->normal.z);
|
||||||
Math_Vec3f_Copy(&this->actor.world.pos, &sp78);
|
Math_Vec3f_Copy(&this->actor.world.pos, &intersectPos);
|
||||||
this->actor.world.pos.x += 10.0f * sp5C;
|
this->actor.world.pos.x += 10.0f * polyNormalX;
|
||||||
this->actor.world.pos.z += 10.0f * sp58;
|
this->actor.world.pos.z += 10.0f * polyNormalZ;
|
||||||
this->timer = 0;
|
this->timer = 0;
|
||||||
if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId)) {
|
if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId)) {
|
||||||
if (bgId != BGCHECK_SCENE) {
|
if (bgId != BGCHECK_SCENE) {
|
||||||
|
@ -299,8 +300,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
ArmsHook* this = (ArmsHook*)thisx;
|
ArmsHook* this = (ArmsHook*)thisx;
|
||||||
Player* player = GET_PLAYER(globalCtx);
|
Player* player = GET_PLAYER(globalCtx);
|
||||||
Vec3f sp78;
|
Vec3f sp78;
|
||||||
Vec3f sp6C;
|
Vec3f hookNewTip;
|
||||||
Vec3f sp60;
|
Vec3f hookNewBase;
|
||||||
f32 sp5C;
|
f32 sp5C;
|
||||||
f32 sp58;
|
f32 sp58;
|
||||||
|
|
||||||
|
@ -309,16 +310,16 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
|
|
||||||
if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) {
|
if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) {
|
||||||
Matrix_MultVec3f(&D_80865B70, &this->unk_1E8);
|
Matrix_MultVec3f(&D_80865B70, &this->unk_1E8);
|
||||||
Matrix_MultVec3f(&D_80865B88, &sp6C);
|
Matrix_MultVec3f(&D_80865B88, &hookNewTip);
|
||||||
Matrix_MultVec3f(&D_80865B94, &sp60);
|
Matrix_MultVec3f(&D_80865B94, &hookNewBase);
|
||||||
this->hookInfo.active = 0;
|
this->hookInfo.active = 0;
|
||||||
} else {
|
} else {
|
||||||
Matrix_MultVec3f(&D_80865B7C, &this->unk_1E8);
|
Matrix_MultVec3f(&D_80865B7C, &this->unk_1E8);
|
||||||
Matrix_MultVec3f(&D_80865BA0, &sp6C);
|
Matrix_MultVec3f(&D_80865BA0, &hookNewTip);
|
||||||
Matrix_MultVec3f(&D_80865BAC, &sp60);
|
Matrix_MultVec3f(&D_80865BAC, &hookNewBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
func_80090480(globalCtx, &this->collider, &this->hookInfo, &sp6C, &sp60);
|
func_80090480(globalCtx, &this->collider, &this->hookInfo, &hookNewTip, &hookNewBase);
|
||||||
func_80093D18(globalCtx->state.gfxCtx);
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895),
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
|
|
@ -803,7 +803,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
||||||
void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||||
GlobalContext* globalCtx = globalCtx2;
|
GlobalContext* globalCtx = globalCtx2;
|
||||||
BgDyYoseizo* this = (BgDyYoseizo*)thisx;
|
BgDyYoseizo* this = (BgDyYoseizo*)thisx;
|
||||||
s32 phi_v1;
|
s32 sfx;
|
||||||
|
|
||||||
this->absoluteTimer++;
|
this->absoluteTimer++;
|
||||||
|
|
||||||
|
@ -820,29 +820,29 @@ void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||||
this->actionFunc(this, globalCtx);
|
this->actionFunc(this, globalCtx);
|
||||||
|
|
||||||
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
|
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
|
||||||
phi_v1 = 0;
|
sfx = 0;
|
||||||
if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) {
|
if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) {
|
||||||
if ((globalCtx->csCtx.frames == 32) || (globalCtx->csCtx.frames == 291) ||
|
if ((globalCtx->csCtx.frames == 32) || (globalCtx->csCtx.frames == 291) ||
|
||||||
(globalCtx->csCtx.frames == 426) || (globalCtx->csCtx.frames == 851)) {
|
(globalCtx->csCtx.frames == 426) || (globalCtx->csCtx.frames == 851)) {
|
||||||
phi_v1 = 1;
|
sfx = 1;
|
||||||
}
|
}
|
||||||
if (globalCtx->csCtx.frames == 101) {
|
if (globalCtx->csCtx.frames == 101) {
|
||||||
phi_v1 = 2;
|
sfx = 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((globalCtx->csCtx.frames == 35) || (globalCtx->csCtx.frames == 181) ||
|
if ((globalCtx->csCtx.frames == 35) || (globalCtx->csCtx.frames == 181) ||
|
||||||
(globalCtx->csCtx.frames == 462) || (globalCtx->csCtx.frames == 795)) {
|
(globalCtx->csCtx.frames == 462) || (globalCtx->csCtx.frames == 795)) {
|
||||||
phi_v1 = 1;
|
sfx = 1;
|
||||||
}
|
}
|
||||||
if (globalCtx->csCtx.frames == 90) {
|
if (globalCtx->csCtx.frames == 90) {
|
||||||
phi_v1 = 2;
|
sfx = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phi_v1 == 1) {
|
if (sfx == 1) {
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_SMILE_0);
|
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_SMILE_0);
|
||||||
}
|
}
|
||||||
if (phi_v1 == 2) {
|
if (sfx == 2) {
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_LAUGH_0);
|
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_LAUGH_0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1015,7 +1015,7 @@ void BgDyYoseizo_ParticleDraw(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
||||||
for (i = 0; i < 200; i++, particle++) {
|
for (i = 0; i < 200; i++, particle++) {
|
||||||
if (particle->alive == 1) {
|
if (particle->alive == 1) {
|
||||||
if (phi_s3 == 0) {
|
if (phi_s3 == 0) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleAppearDL));
|
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleMaterialDL));
|
||||||
gDPPipeSync(POLY_XLU_DISP++);
|
gDPPipeSync(POLY_XLU_DISP++);
|
||||||
|
|
||||||
phi_s3++;
|
phi_s3++;
|
||||||
|
@ -1032,7 +1032,7 @@ void BgDyYoseizo_ParticleDraw(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
||||||
|
|
||||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_bg_dy_yoseizo.c", 1810),
|
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_bg_dy_yoseizo.c", 1810),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleAliveDL));
|
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleModelDL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue