1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-11 11:33:48 +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:
Dragorn421 2022-02-27 22:32:05 +01:00 committed by GitHub
parent dfbc356cdf
commit ed6ec5bceb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 265 additions and 262 deletions

View file

@ -65,8 +65,8 @@
<!-- Other DisplayLists -->
<DList Name="gGreatFairyBetaDL" Offset="0xD1B0"/>
<DList Name="gGreatFairyFlowerDL" Offset="0xDC68"/>
<DList Name="gGreatFairyParticleAppearDL" Offset="0x5860"/>
<DList Name="gGreatFairyParticleAliveDL" Offset="0x58D8"/>
<DList Name="gGreatFairyParticleMaterialDL" Offset="0x5860"/>
<DList Name="gGreatFairyParticleModelDL" Offset="0x58D8"/>
<DList Name="gGreatFairySpiralBeamDL" Offset="0x1C160"/>
<!-- Great Fairy Palettes -->

View file

@ -472,11 +472,11 @@ void func_800C2500(PreRender* this, s32 x, s32 y) {
void func_800C2FE4(PreRender* this) {
s32 x;
s32 y;
s32 phi_v0;
s32 pad1;
u8* buffR = alloca(this->width);
u8* buffG = alloca(this->width);
u8* buffB = alloca(this->width);
s32 pad[3];
s32 pad2[3];
s32 pxR;
s32 pxG;
s32 pxB;

View file

@ -196,42 +196,42 @@ void func_80038A28(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest) {
f32 ny;
f32 nz;
s32 pad;
f32 phi_f2;
f32 phi_f14;
f32 phi_f12;
f32 inv_phi_f2;
f32 inv_phi_f14;
f32 xx;
f32 zz;
f32 yz;
f32 xxInv;
f32 zzInv;
if (poly == NULL) {
return;
}
CollisionPoly_GetNormalF(poly, &nx, &ny, &nz);
phi_f2 = sqrtf(1.0f - SQ(nx));
if (!IS_ZERO(phi_f2)) {
inv_phi_f2 = 1.0f / phi_f2;
phi_f14 = ny * inv_phi_f2;
phi_f12 = -(nz * inv_phi_f2);
xx = sqrtf(1.0f - SQ(nx));
if (!IS_ZERO(xx)) {
xxInv = 1.0f / xx;
zz = ny * xxInv;
yz = -(nz * xxInv);
} else {
phi_f14 = sqrtf(1.0f - SQ(ny));
zz = sqrtf(1.0f - SQ(ny));
if (1) {}
if (!IS_ZERO(phi_f14)) {
inv_phi_f14 = (1.0f / phi_f14);
phi_f12 = nx * inv_phi_f14;
phi_f2 = -(nz * inv_phi_f14);
if (!IS_ZERO(zz)) {
zzInv = 1.0f / zz;
yz = nx * zzInv;
xx = -(nz * zzInv);
} else {
phi_f12 = 0.0f;
phi_f2 = 0.0f;
yz = 0.0f;
xx = 0.0f;
}
}
dest->xx = phi_f2;
dest->yx = (-nx) * phi_f14;
dest->zx = nx * phi_f12;
dest->xx = xx;
dest->yx = -nx * zz;
dest->zx = nx * yz;
dest->xy = nx;
dest->yy = ny;
dest->zy = nz;
dest->yz = phi_f12;
dest->zz = phi_f14;
dest->yz = yz;
dest->zz = zz;
dest->wx = 0.0f;
dest->wy = 0.0f;
dest->xz = 0.0f;
@ -1364,25 +1364,26 @@ u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, GlobalContext* glob
Vec3f curSubdivMin;
Vec3f curSubdivMax;
CollisionHeader* colHeader = colCtx->colHeader;
StaticLookup* spA4;
StaticLookup* phi_fp;
StaticLookup* phi_s0;
s32 sp98;
StaticLookup* lookupTblXY;
StaticLookup* lookupTblX;
StaticLookup* lookup;
s32 subdivAmountXY;
f32 subdivLengthX;
f32 subdivLengthY;
f32 subdivLengthZ;
for (spA4 = lookupTbl;
spA4 < (colCtx->subdivAmount.x * colCtx->subdivAmount.y * colCtx->subdivAmount.z + lookupTbl); spA4++) {
spA4->floor.head = SS_NULL;
spA4->wall.head = SS_NULL;
spA4->ceiling.head = SS_NULL;
for (lookupTblXY = lookupTbl;
lookupTblXY < (colCtx->subdivAmount.x * colCtx->subdivAmount.y * colCtx->subdivAmount.z + lookupTbl);
lookupTblXY++) {
lookupTblXY->floor.head = SS_NULL;
lookupTblXY->wall.head = SS_NULL;
lookupTblXY->ceiling.head = SS_NULL;
}
polyMax = colHeader->numPolygons;
vtxList = colHeader->vtxList;
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);
subdivLengthY = colCtx->subdivLength.y + (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++) {
BgCheck_GetPolySubdivisionBounds(colCtx, vtxList, polyList, &sxMin, &syMin, &szMin, &sxMax, &syMax, &szMax,
polyIdx);
spA4 = szMin * sp98 + lookupTbl;
lookupTblXY = szMin * subdivAmountXY + lookupTbl;
curSubdivMin.z = (colCtx->subdivLength.z * szMin + colCtx->minBounds.z) - BGCHECK_SUBDIV_OVERLAP;
curSubdivMax.z = curSubdivMin.z + subdivLengthZ;
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;
curSubdivMax.y = curSubdivMin.y + subdivLengthY;
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;
curSubdivMax.x = curSubdivMin.x + subdivLengthX;
for (sx = sxMin; sx < sxMax + 1; sx++) {
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;
curSubdivMax.x += colCtx->subdivLength.x;
phi_s0++;
lookup++;
}
curSubdivMin.y += colCtx->subdivLength.y;
curSubdivMax.y += colCtx->subdivLength.y;
phi_fp += colCtx->subdivAmount.x;
lookupTblX += colCtx->subdivAmount.x;
}
curSubdivMin.z += colCtx->subdivLength.z;
curSubdivMax.z += colCtx->subdivLength.z;
spA4 += sp98;
lookupTblXY += subdivAmountXY;
}
}
return colCtx->polyNodes.count * sizeof(SSNode);

View file

@ -1013,7 +1013,7 @@ s32 Camera_CalcAtForParallel(Camera* camera, VecSph* arg1, f32 yOffset, f32* arg
PosRot* playerPosRot = &camera->playerPosRot;
f32 temp_f2;
f32 phi_f16;
f32 sp54;
f32 eyeAtDistXZ;
f32 phi_f20;
f32 temp_f0_4;
@ -1036,9 +1036,9 @@ s32 Camera_CalcAtForParallel(Camera* camera, VecSph* arg1, f32 yOffset, f32* arg
} else {
if (!PREG(75)) {
phi_f20 = playerPosRot->pos.y - *arg3;
sp54 = OLib_Vec3fDistXZ(at, &camera->eye);
phi_f16 = sp54;
Math_FAtan2F(phi_f20, sp54);
eyeAtDistXZ = OLib_Vec3fDistXZ(at, &camera->eye);
phi_f16 = eyeAtDistXZ;
Math_FAtan2F(phi_f20, eyeAtDistXZ);
temp_f2 = Math_FTanF(DEG_TO_RAD(camera->fov * 0.4f)) * phi_f16;
if (temp_f2 < phi_f20) {
*arg3 += phi_f20 - temp_f2;
@ -1085,7 +1085,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecSph* eyeAtDir, Vec3f* targetPos, f
PosRot* playerPosRot = &camera->playerPosRot;
f32 yPosDelta;
f32 phi_f16;
f32 eyeAtDist;
f32 eyeAtDistXZ;
f32 temp_f0_2;
f32 playerHeight;
@ -1138,9 +1138,9 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecSph* eyeAtDir, Vec3f* targetPos, f
} else {
if (!(flags & FLG_OFFGROUND)) {
yPosDelta = playerPosRot->pos.y - *yPosOffset;
eyeAtDist = OLib_Vec3fDistXZ(at, &camera->eye);
phi_f16 = eyeAtDist;
Math_FAtan2F(yPosDelta, eyeAtDist);
eyeAtDistXZ = OLib_Vec3fDistXZ(at, &camera->eye);
phi_f16 = eyeAtDistXZ;
Math_FAtan2F(yPosDelta, eyeAtDistXZ);
temp_f0_2 = Math_FTanF(DEG_TO_RAD(camera->fov * 0.4f)) * phi_f16;
if (temp_f0_2 < yPosDelta) {
*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) {
f32 pad;
f32 phi_a2;
f32 stepScale;
f32 t;
s16 phi_v0;
s16 phi_v1;
s16 sp1C;
s16 absCur;
s16 target;
phi_v1 = ABS(arg1);
absCur = ABS(arg1);
phi_v0 = arg3 > 0 ? (s16)(Math_CosS(arg3) * arg3) : arg3;
sp1C = arg2 - phi_v0;
target = arg2 - phi_v0;
if (ABS(sp1C) < phi_v1) {
phi_a2 = (1.0f / camera->pitchUpdateRateInv) * 3.0f;
if (ABS(target) < absCur) {
stepScale = (1.0f / camera->pitchUpdateRateInv) * 3.0f;
} 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);
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) {
@ -7296,8 +7296,8 @@ void Camera_UpdateDistortion(Camera* camera) {
depthPhase += DEGF_TO_BINANG(depthPhaseStep);
screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep);
View_SetDistortionOrientation(&camera->globalCtx->view, Math_CosS(depthPhase) * 0.0f, Math_SinS(depthPhase) * 0.0f,
Math_SinS(screenPlanePhase) * 0.0f);
View_SetDistortionOrientation(&camera->globalCtx->view, Math_CosS(depthPhase) * 0.0f,
Math_SinS(depthPhase) * 0.0f, Math_SinS(screenPlanePhase) * 0.0f);
View_SetDistortionScale(&camera->globalCtx->view, Math_SinS(screenPlanePhase) * (xScale * scaleFactor) + 1.0f,
Math_CosS(screenPlanePhase) * (yScale * scaleFactor) + 1.0f,
Math_CosS(depthPhase) * (zScale * scaleFactor) + 1.0f);

View file

@ -944,7 +944,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
EffectBlureElement* elem;
s32 i;
s32 j;
s32 phi_t2;
s32 flag;
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);
phi_t2 = 0;
flag = 0;
for (i = 0; i < this->numElements; i++) {
elem = &this->elements[i];
if (elem->state == 0) {
phi_t2 = 0;
flag = 0;
} else {
if (phi_t2 == 0) {
phi_t2 = 1;
if (flag == 0) {
flag = 1;
} else {
gSP1Quadrangle(POLY_XLU_DISP++, j - 2, j - 1, j + 1, j, 0);
if (1) {} // Necessary to match
if (this->unkFlag == 1) {
phi_t2 = 0;
flag = 0;
}
}
j += 2;

View file

@ -1169,9 +1169,9 @@ void Message_LoadItemIcon(GlobalContext* globalCtx, u16 itemId, s16 y) {
}
void Message_Decode(GlobalContext* globalCtx) {
u8 temp_s2;
u8 phi_s1;
u16 phi_s0_3;
u8 curChar;
u8 curChar2;
u16 value;
s32 loadChar;
s32 charTexIdx = 0;
s16 playerNameLen;
@ -1188,10 +1188,10 @@ void Message_Decode(GlobalContext* globalCtx) {
sTextFade = false;
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 ||
temp_s2 == MESSAGE_EVENT || temp_s2 == MESSAGE_END) {
if (curChar == MESSAGE_BOX_BREAK || curChar == MESSAGE_TEXTID || curChar == MESSAGE_BOX_BREAK_DELAYED ||
curChar == MESSAGE_EVENT || curChar == MESSAGE_END) {
// Textbox decoding ends with any of the above text control characters
msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING;
msgCtx->textDrawPos = 1;
@ -1206,15 +1206,15 @@ void Message_Decode(GlobalContext* globalCtx) {
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],
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];
phi_s0_3 = temp_s2 << 8;
sNextTextId = msgCtx->msgBufDecoded[decodedBufPos] | phi_s0_3;
value = curChar << 8;
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->msgBufPos += 2;
}
@ -1223,7 +1223,7 @@ void Message_Decode(GlobalContext* globalCtx) {
msgCtx->textDrawPos = msgCtx->decodedTextLen;
}
break;
} else if (temp_s2 == MESSAGE_NAME) {
} else if (curChar == MESSAGE_NAME) {
// Substitute the player name control character for the file's player name.
for (playerNameLen = ARRAY_COUNT(gSaveContext.playerName); playerNameLen > 0; playerNameLen--) {
if (gSaveContext.playerName[playerNameLen - 1] != 0x3E) {
@ -1233,39 +1233,39 @@ void Message_Decode(GlobalContext* globalCtx) {
// "Name"
osSyncPrintf("\n名前 ");
for (i = 0; i < playerNameLen; i++) {
phi_s1 = gSaveContext.playerName[i];
if (phi_s1 == 0x3E) {
phi_s1 = ' ';
} else if (phi_s1 == 0x40) {
phi_s1 = '.';
} else if (phi_s1 == 0x3F) {
phi_s1 = '-';
} else if (phi_s1 < 0xA) {
phi_s1 += 0;
phi_s1 += '0';
} else if (phi_s1 < 0x24) {
phi_s1 += 0;
phi_s1 += '7';
} else if (phi_s1 < 0x3E) {
phi_s1 += 0;
phi_s1 += '=';
curChar2 = gSaveContext.playerName[i];
if (curChar2 == 0x3E) {
curChar2 = ' ';
} else if (curChar2 == 0x40) {
curChar2 = '.';
} else if (curChar2 == 0x3F) {
curChar2 = '-';
} else if (curChar2 < 0xA) {
curChar2 += 0;
curChar2 += '0';
} else if (curChar2 < 0x24) {
curChar2 += 0;
curChar2 += '7';
} else if (curChar2 < 0x3E) {
curChar2 += 0;
curChar2 += '=';
}
if (phi_s1 != ' ') {
Font_LoadChar(font, phi_s1 - ' ', charTexIdx);
if (curChar2 != ' ') {
Font_LoadChar(font, curChar2 - ' ', charTexIdx);
charTexIdx += FONT_CHAR_TEX_SIZE;
}
osSyncPrintf("%x ", phi_s1);
msgCtx->msgBufDecoded[decodedBufPos] = phi_s1;
osSyncPrintf("%x ", curChar2);
msgCtx->msgBufDecoded[decodedBufPos] = curChar2;
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
// digits to the decoded buffer in place of the control character.
// "EVENT timer"
osSyncPrintf("\nEVENTタイマー ");
digits[0] = digits[1] = digits[2] = 0;
if (temp_s2 == MESSAGE_RACE_TIME) {
if (curChar == MESSAGE_RACE_TIME) {
digits[3] = gSaveContext.timer1Value;
} else {
digits[3] = gSaveContext.timer2Value;
@ -1300,7 +1300,7 @@ void Message_Decode(GlobalContext* globalCtx) {
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
// add the digits to the decoded buffer in place of the control character.
// "Yabusame score"
@ -1334,7 +1334,7 @@ void Message_Decode(GlobalContext* globalCtx) {
}
}
decodedBufPos--;
} else if (temp_s2 == MESSAGE_TOKENS) {
} else if (curChar == MESSAGE_TOKENS) {
// 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.
// "Total number of gold stars"
@ -1365,7 +1365,7 @@ void Message_Decode(GlobalContext* globalCtx) {
}
}
decodedBufPos--;
} else if (temp_s2 == MESSAGE_FISH_INFO) {
} else if (curChar == MESSAGE_FISH_INFO) {
// "Fishing hole fish size"
osSyncPrintf("\n釣り堀魚サイズ ");
digits[0] = 0;
@ -1386,27 +1386,27 @@ void Message_Decode(GlobalContext* globalCtx) {
}
}
decodedBufPos--;
} else if (temp_s2 == MESSAGE_HIGHSCORE) {
phi_s0_3 = HIGH_SCORE((u8)font->msgBuf[++msgCtx->msgBufPos]);
} else if (curChar == MESSAGE_HIGHSCORE) {
value = HIGH_SCORE((u8)font->msgBuf[++msgCtx->msgBufPos]);
// "Highscore"
osSyncPrintf("ランキング=%d\n", font->msgBuf[msgCtx->msgBufPos]);
if ((font->msgBuf[msgCtx->msgBufPos] & 0xFF) == 2) {
if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
phi_s0_3 &= 0x7F;
value &= 0x7F;
} else {
osSyncPrintf("HI_SCORE( kanfont->mbuff.nes_mes_buf[message->rdp] & 0xff000000 ) = %x\n",
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;
osSyncPrintf("score=%d\n", phi_s0_3);
value = SQ((f32)value) * 0.0036f + 0.5f;
osSyncPrintf("score=%d\n", value);
}
switch (font->msgBuf[msgCtx->msgBufPos] & 0xFF) {
case HS_HBA:
case HS_POE_POINTS:
case HS_FISHING:
digits[0] = digits[1] = digits[2] = 0;
digits[3] = phi_s0_3;
digits[3] = value;
while (digits[3] >= 1000) {
digits[0]++;
@ -1420,7 +1420,7 @@ void Message_Decode(GlobalContext* globalCtx) {
digits[2]++;
digits[3] -= 10;
}
if (temp_s2) {}
if (curChar) {}
loadChar = false;
for (i = 0; i < 4; i++) {
@ -1442,7 +1442,7 @@ void Message_Decode(GlobalContext* globalCtx) {
case HS_MARATHON:
case HS_DAMPE_RACE:
digits[0] = digits[1] = digits[2] = 0;
digits[3] = phi_s0_3;
digits[3] = value;
while (digits[3] >= 60) {
digits[1]++;
@ -1475,7 +1475,7 @@ void Message_Decode(GlobalContext* globalCtx) {
}
break;
}
} else if (temp_s2 == MESSAGE_TIME) {
} else if (curChar == MESSAGE_TIME) {
// "Zelda time"
osSyncPrintf("\nゼルダ時間 ");
digits[0] = 0;
@ -1506,12 +1506,12 @@ void Message_Decode(GlobalContext* globalCtx) {
}
}
decodedBufPos--;
} else if (temp_s2 == MESSAGE_ITEM_ICON) {
} else if (curChar == MESSAGE_ITEM_ICON) {
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[msgCtx->msgBufPos + 1];
osSyncPrintf("ITEM_NO=(%d) (%d)\n", msgCtx->msgBufDecoded[decodedBufPos],
font->msgBuf[msgCtx->msgBufPos + 1]);
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->textboxBackgroundForeColorIdx = (font->msgBuf[msgCtx->msgBufPos + 2] & 0xF0) >> 4;
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;
numLines = 2;
R_TEXT_INIT_XPOS = 50;
} else if (temp_s2 == MESSAGE_COLOR) {
} else if (curChar == MESSAGE_COLOR) {
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
} else if (temp_s2 == MESSAGE_NEWLINE) {
} else if (curChar == MESSAGE_NEWLINE) {
numLines++;
} else if (temp_s2 != MESSAGE_QUICKTEXT_ENABLE && temp_s2 != MESSAGE_QUICKTEXT_DISABLE &&
temp_s2 != MESSAGE_AWAIT_BUTTON_PRESS && temp_s2 != MESSAGE_OCARINA &&
temp_s2 != MESSAGE_PERSISTENT && temp_s2 != MESSAGE_UNSKIPPABLE) {
if (temp_s2 == MESSAGE_FADE) {
} else if (curChar != MESSAGE_QUICKTEXT_ENABLE && curChar != MESSAGE_QUICKTEXT_DISABLE &&
curChar != MESSAGE_AWAIT_BUTTON_PRESS && curChar != MESSAGE_OCARINA &&
curChar != MESSAGE_PERSISTENT && curChar != MESSAGE_UNSKIPPABLE) {
if (curChar == MESSAGE_FADE) {
sTextFade = true;
osSyncPrintf("NZ_TIMER_END (key_off_flag=%d)\n", sTextFade);
msgCtx->msgBufDecoded[++decodedBufPos] = font->msgBuf[++msgCtx->msgBufPos];
} else if (temp_s2 == MESSAGE_FADE2) {
} else if (curChar == MESSAGE_FADE2) {
sTextFade = true;
osSyncPrintf("NZ_BGM (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_SHIFT || temp_s2 == MESSAGE_TEXT_SPEED) {
} else if (curChar == MESSAGE_SHIFT || curChar == MESSAGE_TEXT_SPEED) {
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];
} else if (temp_s2 == MESSAGE_TWO_CHOICE) {
} else if (curChar == MESSAGE_TWO_CHOICE) {
msgCtx->choiceNum = 2;
} else if (temp_s2 == MESSAGE_THREE_CHOICE) {
} else if (curChar == MESSAGE_THREE_CHOICE) {
msgCtx->choiceNum = 3;
} else if (temp_s2 != ' ') {
Font_LoadChar(font, temp_s2 - ' ', charTexIdx);
} else if (curChar != ' ') {
Font_LoadChar(font, curChar - ' ', charTexIdx);
charTexIdx += FONT_CHAR_TEX_SIZE;
}
}

View file

@ -86,17 +86,17 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
struct_80095D04 spB8[SHAPE_SORT_MAX];
struct_80095D04* spB4 = NULL;
struct_80095D04* spB0 = NULL;
struct_80095D04* phi_v0;
struct_80095D04* iter;
s32 pad;
struct_80095D04* spA4;
s32 phi_v1;
s32 sp9C;
Vec3f sp90;
Vec3f sp84;
f32 sp80;
s32 j;
s32 i;
Vec3f pos;
Vec3f projectedPos;
f32 projectedW;
s32 pad2;
PolygonDlist2* sp78;
PolygonDlist2* temp;
PolygonDlist2* polygonDlistFirst;
PolygonDlist2* polygonDlistIter;
f32 temp_f2;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 287);
@ -119,44 +119,44 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
spA4 = spB8;
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++) {
sp90.x = polygonDlist->pos.x;
sp90.y = polygonDlist->pos.y;
sp90.z = polygonDlist->pos.z;
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &sp90, &sp84, &sp80);
if (-(f32)polygonDlist->unk_06 < sp84.z) {
temp_f2 = sp84.z - polygonDlist->unk_06;
for (i = 0; i < polygon2->num; i++, polygonDlist++) {
pos.x = polygonDlist->pos.x;
pos.y = polygonDlist->pos.y;
pos.z = polygonDlist->pos.z;
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &pos, &projectedPos, &projectedW);
if (-(f32)polygonDlist->unk_06 < projectedPos.z) {
temp_f2 = projectedPos.z - polygonDlist->unk_06;
if (temp_f2 < globalCtx->lightCtx.fogFar) {
phi_v0 = spB4;
spA4->unk_00 = polygonDlist;
spA4->unk_04 = temp_f2;
if (phi_v0 == NULL) {
iter = spB4;
if (iter == NULL) {
spB4 = spB0 = spA4;
spA4->unk_08 = spA4->unk_0C = NULL;
} else {
do {
if (spA4->unk_04 < phi_v0->unk_04) {
if (spA4->unk_04 < iter->unk_04) {
break;
}
phi_v0 = phi_v0->unk_0C;
} while (phi_v0 != NULL);
iter = iter->unk_0C;
} while (iter != NULL);
if (phi_v0 == NULL) {
if (iter == NULL) {
spA4->unk_08 = spB0;
spA4->unk_0C = NULL;
spB0->unk_0C = spA4;
spB0 = spA4;
} else {
spA4->unk_08 = phi_v0->unk_08;
spA4->unk_08 = iter->unk_08;
if (spA4->unk_08 == NULL) {
spB4 = spA4;
} else {
spA4->unk_08->unk_0C = spA4;
}
phi_v0->unk_08 = spA4;
spA4->unk_0C = phi_v0;
iter->unk_08 = spA4;
spA4->unk_0C = iter;
}
}
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
for (sp9C = 1; spB4 != NULL; spB4 = spB4->unk_0C, sp9C++) {
Gfx* temp2;
for (i = 1; spB4 != NULL; spB4 = spB4->unk_0C, i++) {
Gfx* displayList;
polygonDlist = spB4->unk_00;
if (iREG(86) != 0) {
temp = sp78;
for (phi_v1 = 0; phi_v1 < polygon2->num; phi_v1++, temp++) {
if (polygonDlist == temp) {
polygonDlistIter = polygonDlistFirst;
for (j = 0; j < polygon2->num; j++, polygonDlistIter++) {
if (polygonDlist == polygonDlistIter) {
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) {
temp2 = polygonDlist->opa;
if (temp2 != NULL) {
gSPDisplayList(POLY_OPA_DISP++, temp2);
displayList = polygonDlist->opa;
if (displayList != NULL) {
gSPDisplayList(POLY_OPA_DISP++, displayList);
}
}
if (flags & 2) {
temp2 = polygonDlist->xlu;
if (temp2 != NULL) {
gSPDisplayList(POLY_XLU_DISP++, temp2);
displayList = polygonDlist->xlu;
if (displayList != NULL) {
gSPDisplayList(POLY_XLU_DISP++, displayList);
}
}
}
} else {
if (flags & 1) {
temp2 = polygonDlist->opa;
if (temp2 != NULL) {
gSPDisplayList(POLY_OPA_DISP++, temp2);
displayList = polygonDlist->opa;
if (displayList != NULL) {
gSPDisplayList(POLY_OPA_DISP++, displayList);
}
}
if (flags & 2) {
temp2 = polygonDlist->xlu;
if (temp2 != NULL) {
gSPDisplayList(POLY_XLU_DISP++, temp2);
displayList = polygonDlist->xlu;
if (displayList != NULL) {
gSPDisplayList(POLY_XLU_DISP++, displayList);
}
}
}
}
iREG(88) = sp9C - 1;
iREG(88) = i - 1;
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) {
Gfx* displayListHead;
uObjBg* bg;
s32 temp;
displayListHead = *displayList;
func_80096238(SEGMENTED_TO_VIRTUAL(source));
@ -312,31 +311,31 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
Gfx* spA8;
PolygonType1* polygon1;
PolygonDlist* polygonDlist;
u32 sp9C;
u32 sp98;
u32 sp94;
u32 sp90;
u32 isFixedCamera;
u32 drawBg;
u32 drawOpa;
u32 drawXlu;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 628);
camera = GET_ACTIVE_CAM(globalCtx);
sp9C = (camera->setting == CAM_SET_PREREND_FIXED);
isFixedCamera = camera->setting == CAM_SET_PREREND_FIXED;
polygon1 = &room->mesh->polygon1;
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
sp98 = (flags & 1) && sp9C && polygon1->single.source && !(SREG(25) & 1);
sp94 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
sp90 = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
drawBg = (flags & 1) && isFixedCamera && polygon1->single.source && !(SREG(25) & 1);
drawOpa = (flags & 1) && (polygonDlist->opa != NULL) && !(SREG(25) & 2);
drawXlu = (flags & 2) && (polygonDlist->xlu != NULL) && !(SREG(25) & 4);
if (sp94 || sp98) {
if (drawOpa || drawBg) {
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
if (sp94) {
if (drawOpa) {
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
}
if (sp98) {
if (drawBg) {
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)?
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);
func_80093D84(globalCtx->state.gfxCtx);
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
void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
Camera* camera;
Gfx* spA8;
Gfx* gfx;
PolygonType1* polygon1;
BgImage* bgImage;
PolygonDlist* polygonDlist;
u32 sp98;
u32 sp94;
u32 sp90;
u32 sp8C;
u32 isFixedCamera;
u32 drawBg;
u32 drawOpa;
u32 drawXlu;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 752);
camera = GET_ACTIVE_CAM(globalCtx);
sp98 = (camera->setting == CAM_SET_PREREND_FIXED);
isFixedCamera = camera->setting == CAM_SET_PREREND_FIXED;
polygon1 = &room->mesh->polygon1;
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
bgImage = func_80096A74(polygon1, globalCtx);
sp94 = (flags & 1) && sp98 && bgImage->source && !(SREG(25) & 1);
sp90 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
sp8C = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
drawBg = (flags & 1) && isFixedCamera && bgImage->source && !(SREG(25) & 1);
drawOpa = (flags & 1) && (polygonDlist->opa != NULL) && !(SREG(25) & 2);
drawXlu = (flags & 2) && (polygonDlist->xlu != NULL) && !(SREG(25) & 4);
if (sp90 || sp94) {
if (drawOpa || drawBg) {
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
if (sp90) {
if (drawOpa) {
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
}
if (sp94) {
if (drawBg) {
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)?
gSPLoadUcodeEx(POLY_OPA_DISP++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
{
Vec3f sp5C;
spA8 = POLY_OPA_DISP;
Camera_GetSkyboxOffset(&sp5C, camera);
func_8009638C(&spA8, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt,
Vec3f skyboxOffset;
gfx = POLY_OPA_DISP;
Camera_GetSkyboxOffset(&skyboxOffset, camera);
func_8009638C(&gfx, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt,
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);
POLY_OPA_DISP = spA8;
(skyboxOffset.x + skyboxOffset.z) * 1.2f + skyboxOffset.y * 0.6f,
skyboxOffset.y * 2.4f + (skyboxOffset.x + skyboxOffset.z) * 0.3f);
POLY_OPA_DISP = gfx;
}
// 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);
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);

View file

@ -2313,9 +2313,9 @@ void func_8009FE58(GlobalContext* globalCtx) {
temp = 0.020000001f;
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_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_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_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 + (1 * temp * Math_CosS(D_8012A39C)));

View file

@ -373,8 +373,8 @@ void func_800AF178(SkyboxContext* skyboxCtx, s32 arg1) {
void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyboxId) {
u32 size;
s16 i;
u8 sp41; // imageIdx
u8 sp40; // imageIdx2
u8 skybox1Index;
u8 skybox2Index;
u32 start;
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 &&
(gSaveContext.skyboxTime < D_8011FC1C[phi_v1][i].endTime ||
D_8011FC1C[phi_v1][i].endTime == 0xFFFF)) {
globalCtx->envCtx.skybox1Index = sp41 = D_8011FC1C[phi_v1][i].skybox1Index;
globalCtx->envCtx.skybox2Index = sp40 = D_8011FC1C[phi_v1][i].skybox2Index;
globalCtx->envCtx.skybox1Index = skybox1Index = D_8011FC1C[phi_v1][i].skybox1Index;
globalCtx->envCtx.skybox2Index = skybox2Index = D_8011FC1C[phi_v1][i].skybox2Index;
if (D_8011FC1C[phi_v1][i].blend != 0) {
globalCtx->envCtx.skyboxBlend =
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);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1055);
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], gSkyboxFiles[sp41].file.vromStart, size, "../z_vr_box.c",
1058);
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], gSkyboxFiles[skybox1Index].file.vromStart, size,
"../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);
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
1061);
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], gSkyboxFiles[sp40].file.vromStart, size, "../z_vr_box.c",
1064);
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], gSkyboxFiles[skybox2Index].file.vromStart, size,
"../z_vr_box.c", 1064);
if ((sp41 & 1) ^ ((sp41 & 4) >> 2)) {
size = gSkyboxFiles[sp41].palette.vromEnd - gSkyboxFiles[sp41].palette.vromStart;
if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) {
size = gSkyboxFiles[skybox1Index].palette.vromEnd - gSkyboxFiles[skybox1Index].palette.vromStart;
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);
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[sp41].palette.vromStart, size, "../z_vr_box.c",
1075);
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[sp40].palette.vromStart, size,
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[skybox1Index].palette.vromStart, size,
"../z_vr_box.c", 1075);
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[skybox2Index].palette.vromStart, size,
"../z_vr_box.c", 1077);
} 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);
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",
1088);
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[sp41].palette.vromStart, size,
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[skybox2Index].palette.vromStart, size,
"../z_vr_box.c", 1088);
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[skybox1Index].palette.vromStart, size,
"../z_vr_box.c", 1090);
}
break;

View file

@ -146,16 +146,16 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
f32 bodyDistDiff;
f32 phi_f16;
DynaPolyActor* dynaPolyActor;
f32 sp94;
f32 sp90;
f32 curGrabbedDist;
f32 grabbedDist;
s32 pad;
CollisionPoly* poly;
s32 bgId;
Vec3f sp78;
Vec3f intersectPos;
Vec3f prevFrameDiff;
Vec3f sp60;
f32 sp5C;
f32 sp58;
f32 polyNormalX;
f32 polyNormalZ;
f32 velocity;
s32 pad1;
@ -189,10 +189,11 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
grabbed = NULL;
this->grabbed = NULL;
} else if (this->actor.child != NULL) {
sp94 = Actor_WorldDistXYZToActor(&this->actor, grabbed);
sp90 = sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
curGrabbedDist = Actor_WorldDistXYZToActor(&this->actor, grabbed);
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);
if (50.0f < (sp94 - sp90)) {
if ((curGrabbedDist - grabbedDist) > 50.0f) {
ArmsHook_DetachHookFromActor(this);
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.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);
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &this->unk_1E8, &sp78, &poly, true, true, true, true,
&bgId) &&
!func_8002F9EC(globalCtx, &this->actor, poly, bgId, &sp78)) {
sp5C = COLPOLY_GET_NORMAL(poly->normal.x);
sp58 = COLPOLY_GET_NORMAL(poly->normal.z);
Math_Vec3f_Copy(&this->actor.world.pos, &sp78);
this->actor.world.pos.x += 10.0f * sp5C;
this->actor.world.pos.z += 10.0f * sp58;
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &this->unk_1E8, &intersectPos, &poly, true, true, true,
true, &bgId) &&
!func_8002F9EC(globalCtx, &this->actor, poly, bgId, &intersectPos)) {
polyNormalX = COLPOLY_GET_NORMAL(poly->normal.x);
polyNormalZ = COLPOLY_GET_NORMAL(poly->normal.z);
Math_Vec3f_Copy(&this->actor.world.pos, &intersectPos);
this->actor.world.pos.x += 10.0f * polyNormalX;
this->actor.world.pos.z += 10.0f * polyNormalZ;
this->timer = 0;
if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId)) {
if (bgId != BGCHECK_SCENE) {
@ -299,8 +300,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
ArmsHook* this = (ArmsHook*)thisx;
Player* player = GET_PLAYER(globalCtx);
Vec3f sp78;
Vec3f sp6C;
Vec3f sp60;
Vec3f hookNewTip;
Vec3f hookNewBase;
f32 sp5C;
f32 sp58;
@ -309,16 +310,16 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) {
Matrix_MultVec3f(&D_80865B70, &this->unk_1E8);
Matrix_MultVec3f(&D_80865B88, &sp6C);
Matrix_MultVec3f(&D_80865B94, &sp60);
Matrix_MultVec3f(&D_80865B88, &hookNewTip);
Matrix_MultVec3f(&D_80865B94, &hookNewBase);
this->hookInfo.active = 0;
} else {
Matrix_MultVec3f(&D_80865B7C, &this->unk_1E8);
Matrix_MultVec3f(&D_80865BA0, &sp6C);
Matrix_MultVec3f(&D_80865BAC, &sp60);
Matrix_MultVec3f(&D_80865BA0, &hookNewTip);
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);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View file

@ -803,7 +803,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, GlobalContext* globalCtx) {
void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
BgDyYoseizo* this = (BgDyYoseizo*)thisx;
s32 phi_v1;
s32 sfx;
this->absoluteTimer++;
@ -820,29 +820,29 @@ void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->actionFunc(this, globalCtx);
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
phi_v1 = 0;
sfx = 0;
if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) {
if ((globalCtx->csCtx.frames == 32) || (globalCtx->csCtx.frames == 291) ||
(globalCtx->csCtx.frames == 426) || (globalCtx->csCtx.frames == 851)) {
phi_v1 = 1;
sfx = 1;
}
if (globalCtx->csCtx.frames == 101) {
phi_v1 = 2;
sfx = 2;
}
} else {
if ((globalCtx->csCtx.frames == 35) || (globalCtx->csCtx.frames == 181) ||
(globalCtx->csCtx.frames == 462) || (globalCtx->csCtx.frames == 795)) {
phi_v1 = 1;
sfx = 1;
}
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);
}
if (phi_v1 == 2) {
if (sfx == 2) {
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++) {
if (particle->alive == 1) {
if (phi_s3 == 0) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleAppearDL));
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleMaterialDL));
gDPPipeSync(POLY_XLU_DISP++);
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),
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));
}
}