1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 05:19:36 +00:00

Misc Cleanup (#1585)

* misc cleanup

* more fake matches

* revert for sym
This commit is contained in:
engineer124 2023-11-22 20:19:31 +11:00 committed by GitHub
parent 2aaa286cf8
commit f2c06ce441
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 134 additions and 161 deletions

View file

@ -269,7 +269,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) {
adsr->delay = 1;
}
adsr->target = adsr->envelope[adsr->envIndex].arg / 32767.0f;
adsr->target = adsr->target * adsr->target;
adsr->target = SQ(adsr->target);
adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
adsr->action.s.state = ADSR_STATE_FADE;
adsr->envIndex++;

View file

@ -1356,8 +1356,8 @@ void AudioHeap_ChangeStorage(StorageChange* change, Sample* sample) {
u32 startAddr = change->oldAddr;
u32 endAddr = change->oldAddr + change->size;
if (startAddr <= (u32)sample->sampleAddr && (u32)sample->sampleAddr < endAddr) {
sample->sampleAddr = sample->sampleAddr - startAddr + change->newAddr;
if (((u32)sample->sampleAddr >= startAddr) && ((u32)sample->sampleAddr < endAddr)) {
sample->sampleAddr += -startAddr + change->newAddr;
sample->medium = change->newMedium;
}
}

View file

@ -789,7 +789,7 @@ AudioTable* AudioLoad_GetLoadTable(s32 tableType) {
* Also relocate offsets into pointers within this loaded soundFont
*
* @param fontId index of font being processed
* @param fontData ram address of raw soundfont binary loaded into cache
* @param fontDataStartAddr ram address of raw soundfont binary loaded into cache
* @param sampleBankReloc information on the sampleBank containing raw audio samples
*/
void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, SampleBankRelocInfo* sampleBankReloc) {
@ -811,7 +811,6 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
// The first u32 in fontData is an offset to a list of offsets to the drums
soundListOffset = fontData[0];
if (1) {}
// If the soundFont has drums
if ((soundListOffset != 0) && (numDrums != 0)) {
@ -824,20 +823,24 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
soundOffset = (u32)((Drum**)fontData[0])[i];
// Some drum data entries are empty, represented by an offset of 0 in the list of drum offsets
if (soundOffset != 0) {
soundOffset = RELOC_TO_RAM(soundOffset);
((Drum**)fontData[0])[i] = drum = (Drum*)soundOffset;
// The drum may be in the list multiple times and already relocated
if (!drum->isRelocated) {
AudioLoad_RelocateSample(&drum->tunedSample, fontDataStartAddr, sampleBankReloc);
soundOffset = (u32)drum->envelope;
drum->envelope = (EnvelopePoint*)RELOC_TO_RAM(soundOffset);
drum->isRelocated = true;
}
if (soundOffset == 0) {
continue;
}
soundOffset = RELOC_TO_RAM(soundOffset);
((Drum**)fontData[0])[i] = drum = (Drum*)soundOffset;
// The drum may be in the list multiple times and already relocated
if (drum->isRelocated) {
continue;
}
AudioLoad_RelocateSample(&drum->tunedSample, fontDataStartAddr, sampleBankReloc);
soundOffset = (u32)drum->envelope;
drum->envelope = (EnvelopePoint*)RELOC_TO_RAM(soundOffset);
drum->isRelocated = true;
}
}
@ -845,7 +848,6 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
// The second u32 in fontData is an offset to the first sound effect entry
soundListOffset = fontData[1];
if (1) {}
// If the soundFont has sound effects
if ((soundListOffset != 0) && (numSfx != 0)) {
@ -859,9 +861,11 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
soundEffect = (SoundEffect*)soundOffset;
// Check for NULL (note: the pointer is guaranteed to be in fontData and can never be NULL)
if ((soundEffect != NULL) && ((u32)soundEffect->tunedSample.sample != 0)) {
AudioLoad_RelocateSample(&soundEffect->tunedSample, fontDataStartAddr, sampleBankReloc);
if ((soundEffect == NULL) || ((u32)soundEffect->tunedSample.sample == 0)) {
continue;
}
AudioLoad_RelocateSample(&soundEffect->tunedSample, fontDataStartAddr, sampleBankReloc);
}
}

View file

@ -50,8 +50,8 @@ f32 Math_FAtanTaylorQF(f32 x) {
if (poly + term == poly) {
break;
}
poly = poly + term;
exp = exp * sq;
poly += term;
exp *= sq;
}
return poly;

View file

@ -181,7 +181,6 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
R_HREG_MODE = HREG_MODE_UCODE_DISAS;
R_UCODE_DISAS_TOGGLE = 1;
R_UCODE_DISAS_LOG_LEVEL = 2;
sPrevTaskWorkBuffer = sPrevTaskWorkBuffer;
Graph_DisassembleUCode(sPrevTaskWorkBuffer);
}

View file

@ -1120,7 +1120,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecGeo* eyeAtDir, Vec3f* targetPos, f
playerToTargetDir.r = (playerToTargetDir.r * CAM_DATA_SCALED(OREG(39))) -
(((CAM_DATA_SCALED(OREG(39)) - CAM_DATA_SCALED(OREG(38))) * playerToTargetDir.r) *
(playerToTargetDir.r / distance));
playerToTargetDir.r = playerToTargetDir.r - (playerToTargetDir.r * temp_f0_2) * temp_f0_2;
playerToTargetDir.r -= (playerToTargetDir.r * temp_f0_2) * temp_f0_2;
}
if (flags & CAM_LOCKON_AT_FLAG_OFF_GROUND) {
@ -1160,7 +1160,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecGeo* eyeAtDir, Vec3f* targetPos, f
*yPosOffset = *yPosOffset + (yPosDelta + temp_f0_2);
yPosDelta = -temp_f0_2;
}
playerToAtOffsetTarget.y = playerToAtOffsetTarget.y - yPosDelta;
playerToAtOffsetTarget.y -= yPosDelta;
} else {
yPosDelta = playerPosRot->pos.y - *yPosOffset;
temp_f0_2 = Math_FAtan2F(yPosDelta, OLib_Vec3fDistXZ(at, &camera->eye));
@ -4318,10 +4318,9 @@ s32 Camera_Subj3(Camera* camera) {
tGeo.pitch = rwData->pitch;
if (rwData->animTimer != 0) {
temp_f0_3 = (1.0f / rwData->animTimer);
pad2 = at;
at->x = at->x + (sp98.x - pad2->x) * temp_f0_3;
at->y = at->y + (sp98.y - pad2->y) * temp_f0_3;
at->z = at->z + (sp98.z - pad2->z) * temp_f0_3;
at->x = F32_LERPIMP(at->x, sp98.x, temp_f0_3);
at->y = F32_LERPIMP(at->y, sp98.y, temp_f0_3);
at->z = F32_LERPIMP(at->z, sp98.z, temp_f0_3);
temp_f0_3 = (1.0f / R_CAM_DEFAULT_ANIM_TIME);
sp58 = (tGeo.r - sp84.r) * temp_f0_3;
@ -6964,7 +6963,7 @@ s32 Camera_Special9(Camera* camera) {
doorParams->timer2--;
if (doorParams->timer2 <= 0) {
camera->animState++;
rwData->targetYaw = rwData->targetYaw - 0x7FFF;
rwData->targetYaw -= 0x7FFF;
} else {
break;
}

View file

@ -973,14 +973,14 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio);
break;
case 3:
ratio = ratio * 0.5f;
ratio *= 0.5f;
vtx[j].v.ob[0] = EffectSs_LerpS16(elem->p1.x, elem->p2.x, ratio);
vtx[j].v.ob[1] = EffectSs_LerpS16(elem->p1.y, elem->p2.y, ratio);
vtx[j].v.ob[2] = EffectSs_LerpS16(elem->p1.z, elem->p2.z, ratio);
vtx[j + 1].v.ob[0] = EffectSs_LerpS16(elem->p2.x, elem->p1.x, ratio);
vtx[j + 1].v.ob[1] = EffectSs_LerpS16(elem->p2.y, elem->p1.y, ratio);
vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio);
ratio = ratio + ratio;
ratio *= 2.0f;
break;
case 0:
default:

View file

@ -160,24 +160,24 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
s32 i;
for (i = 0; i < SPARK_COUNT; i++) {
if (sEffectContext.sparks[i].status.active) {
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
if (!sEffectContext.sparks[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
}
for (i = 0; i < BLURE_COUNT; i++) {
if (sEffectContext.blures[i].status.active) {
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
if (!sEffectContext.blures[i].status.active) {
continue;
}
if (1) {} // Necessary to match
if (1) {}
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
}
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (sEffectContext.shieldParticles[i].status.active) {
if (gfxCtx) {} // Necessary to match
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
if (!sEffectContext.shieldParticles[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
}
}

View file

@ -2419,17 +2419,17 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) {
if (ABS(primA - primA1) < 9) {
primA = primA1;
} else if (primA1 < primA) {
primA = primA - 9;
primA -= 9;
} else {
primA = primA + 9;
primA += 9;
}
if (ABS(envA - envA1) < 9) {
envA = envA1;
} else if (envA1 < envA) {
envA = envA - 9;
envA -= 9;
} else {
envA = envA + 9;
envA += 9;
}
play->envCtx.sandstormPrimA = primA;

View file

@ -108,7 +108,7 @@ void Lights_BindPoint(Lights* lights, LightParams* params, Vec3f* vec) {
if (light != NULL) {
posDiff = sqrtf(posDiff);
if (1) {}
scale = posDiff / scale;
scale = 1 - SQ(scale);

View file

@ -848,7 +848,7 @@ void Message_HandleOcarina(PlayState* play) {
*/
void Message_DrawText(PlayState* play, Gfx** gfxP) {
MessageContext* msgCtx = &play->msgCtx;
u16 lookAheadCharacter;
s16 pad;
u8 character;
u16 j;
u16 i;
@ -928,15 +928,13 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) {
j = i;
while (true) {
lookAheadCharacter = msgCtx->msgBufDecoded[j];
if (lookAheadCharacter == MESSAGE_SHIFT) {
character = msgCtx->msgBufDecoded[j];
if (character == MESSAGE_SHIFT) {
j += 2;
} else if ((lookAheadCharacter != MESSAGE_QUICKTEXT_DISABLE) &&
(lookAheadCharacter != MESSAGE_PERSISTENT) &&
(lookAheadCharacter != MESSAGE_EVENT) &&
(lookAheadCharacter != MESSAGE_BOX_BREAK_DELAYED) &&
(lookAheadCharacter != MESSAGE_AWAIT_BUTTON_PRESS) &&
(lookAheadCharacter != MESSAGE_BOX_BREAK) && (lookAheadCharacter != MESSAGE_END)) {
} else if ((character != MESSAGE_QUICKTEXT_DISABLE) && (character != MESSAGE_PERSISTENT) &&
(character != MESSAGE_EVENT) && (character != MESSAGE_BOX_BREAK_DELAYED) &&
(character != MESSAGE_AWAIT_BUTTON_PRESS) && (character != MESSAGE_BOX_BREAK) &&
(character != MESSAGE_END)) {
j++;
} else {
break;
@ -944,8 +942,6 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
}
i = j - 1;
msgCtx->textDrawPos = i + 1;
if (character) {}
}
FALLTHROUGH;
case MESSAGE_QUICKTEXT_DISABLE:
@ -1435,7 +1431,6 @@ void Message_Decode(PlayState* play) {
digits[2]++;
digits[3] -= 10;
}
if (curChar) {}
loadChar = false;
for (i = 0; i < 4; i++) {

View file

@ -1025,7 +1025,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p
sp50 = Math_FAtan2F(sp58, sp60);
temp1 = RAD_TO_BINANG(M_PI - (Math_FAtan2F(sp5C, sp58) + ((M_PI / 2) - sp50)));
temp1 = temp1 - skelAnime->jointTable[shinLimbIndex].z;
temp1 -= skelAnime->jointTable[shinLimbIndex].z;
if ((s16)(ABS(skelAnime->jointTable[shinLimbIndex].x) + ABS(skelAnime->jointTable[shinLimbIndex].y)) < 0) {
temp1 += 0x8000;

View file

@ -14,7 +14,7 @@ void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) {
guNormalize(&x, &y, &z);
a = a * D_80134D10;
a *= D_80134D10;
sine = sinf(a);
cosine = cosf(a);

View file

@ -139,12 +139,7 @@ void func_8087E040(BgHakaMeganeBG* this, PlayState* play) {
void func_8087E10C(BgHakaMeganeBG* this, PlayState* play) {
this->dyna.actor.velocity.y += 1.0f;
if (this->dyna.actor.velocity.y > 20.0f) {
this->dyna.actor.velocity.y = 20.0f;
} else {
this->dyna.actor.velocity.y = this->dyna.actor.velocity.y;
}
this->dyna.actor.velocity.y = CLAMP_MAX(this->dyna.actor.velocity.y, 20.0f);
if (this->unk_16A != 0) {
this->unk_16A--;

View file

@ -354,7 +354,7 @@ void BgSpot06Objects_LockSwimToSurface(BgSpot06Objects* this, PlayState* play) {
cos = Math_CosS(this->dyna.actor.shape.rot.x) * 4.3f;
this->dyna.actor.world.pos.x += (cos * Math_SinS(this->dyna.actor.shape.rot.y));
this->dyna.actor.world.pos.z += (cos * Math_CosS(this->dyna.actor.shape.rot.y));
this->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y - 1.3f;
this->dyna.actor.world.pos.y -= 1.3f;
BgSpot06Objects_LockSpawnWaterRipples(this, play, 0);
if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, 0, 0x260) != 0) {

View file

@ -373,7 +373,7 @@ void BgSpot08Iceblock_FloatRotating(BgSpot08Iceblock* this, PlayState* play) {
BgSpot08Iceblock_Bobbing(this);
BgSpot08Iceblock_SinkUnderPlayer(this);
BgSpot08Iceblock_SetWaterline(this);
this->dyna.actor.world.rot.y = this->dyna.actor.world.rot.y + 0x190;
this->dyna.actor.world.rot.y += 0x190;
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y;
BgSpot08Iceblock_Roll(this, play);
}

View file

@ -145,7 +145,7 @@ static s16 D_808B6088[] = { 0, 1, 2, 3, 4 };
void func_808B4C30(BgSpot16Bombstone* this) {
this->switchFlag = (this->actor.params >> 8) & 0x3F;
this->actor.params = this->actor.params & 0xFF;
this->actor.params &= 0xFF;
}
void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) {

View file

@ -249,7 +249,7 @@ void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
Math_StepToS(&this->unk_210, 0xBB8, 0x64);
}
this->dyna.actor.shape.rot.y = this->dyna.actor.shape.rot.y + this->unk_210;
this->dyna.actor.shape.rot.y += this->unk_210;
if (this->unk_216 < 70) {
Math_StepToF(&this->unk_208, 100.0f, 2.0f);

View file

@ -45,7 +45,7 @@ void BgYdanHasi_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(thisx, sInitChain);
this->type = ((thisx->params >> 8) & 0x3F);
thisx->params = thisx->params & 0xFF;
thisx->params &= 0xFF;
waterBox = &play->colCtx.colHeader->waterBoxes[1];
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
if (thisx->params == HASI_WATER) {

View file

@ -168,7 +168,6 @@ void BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) {
void BgYdanSp_BurnWeb(BgYdanSp* this, PlayState* play) {
this->timer = 30;
this = this;
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
Flags_SetSwitch(play, this->isDestroyedSwitchFlag);
if (this->dyna.actor.params == WEB_FLOOR) {
@ -312,11 +311,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) {
if (this->unk_16C < 0.1f) {
this->timer = 14;
}
if (this->unk_16C < 2.0f) {
this->unk_16C = 2.0f;
} else {
this->unk_16C = this->unk_16C;
}
this->unk_16C = CLAMP_MIN(this->unk_16C, 2.0f);
}
}
if (this->timer != 0) {

View file

@ -107,9 +107,9 @@ void BgZg_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&gTowerCollapseBarsCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if ((func_808C0CC8(this) == 8) || (func_808C0CC8(this) == 9)) {
this->dyna.actor.scale.x = this->dyna.actor.scale.x * 1.3f;
this->dyna.actor.scale.z = this->dyna.actor.scale.z * 1.3f;
this->dyna.actor.scale.y = this->dyna.actor.scale.y * 1.2f;
this->dyna.actor.scale.x *= 1.3f;
this->dyna.actor.scale.z *= 1.3f;
this->dyna.actor.scale.y *= 1.2f;
}
this->action = 0;

View file

@ -1410,7 +1410,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) {
this->actor.velocity.y = 15.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_K_COLI2);
if (this->unk_1A2 == 0) {
this->unk_1A0 = this->unk_1A0 + 1;
this->unk_1A0++;
if (this->unk_1A0 >= 4) {
this->unk_1A0 = 0;
}

View file

@ -1851,10 +1851,8 @@ void BossGanon_PoundFloor(BossGanon* this, PlayState* play) {
switch (this->unk_1C2) {
case 0:
targetPosX = Math_SinS(this->unk_1A2 * 1280);
targetPosX = targetPosX * this->fwork[GDF_CENTER_POS];
targetPosZ = Math_CosS(this->unk_1A2 * 1792);
targetPosZ = targetPosZ * this->fwork[GDF_CENTER_POS];
targetPosX = Math_SinS(this->unk_1A2 * 1280) * this->fwork[GDF_CENTER_POS];
targetPosZ = Math_CosS(this->unk_1A2 * 1792) * this->fwork[GDF_CENTER_POS];
Math_ApproachF(&this->actor.world.pos.x, targetPosX, 0.05f, this->fwork[GDF_FWORK_0]);
Math_ApproachF(&this->actor.world.pos.z, targetPosZ, 0.05f, this->fwork[GDF_FWORK_0]);
@ -1987,11 +1985,8 @@ void BossGanon_ChargeBigMagic(BossGanon* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
targetPosX = Math_SinS(this->unk_1A2 * 1280);
targetPosX = targetPosX * this->fwork[GDF_CENTER_POS];
targetPosZ = Math_CosS(this->unk_1A2 * 1792);
targetPosZ = targetPosZ * this->fwork[GDF_CENTER_POS];
targetPosX = Math_SinS(this->unk_1A2 * 1280) * this->fwork[GDF_CENTER_POS];
targetPosZ = Math_CosS(this->unk_1A2 * 1792) * this->fwork[GDF_CENTER_POS];
Math_ApproachF(&this->actor.world.pos.x, targetPosX, 0.05f, this->fwork[GDF_FWORK_0]);
Math_ApproachF(&this->actor.world.pos.z, targetPosZ, 0.05, this->fwork[GDF_FWORK_0]);
@ -2556,7 +2551,7 @@ void BossGanon_Vulnerable(BossGanon* this, PlayState* play) {
case 2:
sCape->minDist = 0.0f;
this->actor.velocity.y = this->actor.velocity.y - 0.5f;
this->actor.velocity.y -= 0.5f;
if (this->actor.world.pos.y < 40.0f) {
this->actor.world.pos.y = 40.0f;
@ -3721,8 +3716,8 @@ void BossGanon_GenShadowTexture(u8* tex, BossGanon* this, PlayState* play) {
Matrix_MultVec3f(&sp7C, &sp70);
sp70.x = sp70.x * 0.28f;
sp70.y = sp70.y * 0.28f;
sp70.x *= 0.28f;
sp70.y *= 0.28f;
baseX = (s32)(sp70.x + 32.0f);
baseY = (s16)sp70.y * 0x40;
@ -4436,9 +4431,9 @@ void func_808E2544(Actor* thisx, PlayState* play) {
this->unk_1F0.y = Rand_CenteredFloat(200.0f) + dorf->unk_1FC.y;
this->unk_1F0.z = Rand_CenteredFloat(700.0f) + dorf->unk_1FC.z;
this->unk_1F0.x = this->unk_1F0.x + ((this->unk_1F0.x - this->actor.world.pos.x) * 100.0f);
this->unk_1F0.y = this->unk_1F0.y + ((this->unk_1F0.y - this->actor.world.pos.y) * 100.0f);
this->unk_1F0.z = this->unk_1F0.z + ((this->unk_1F0.z - this->actor.world.pos.z) * 100.0f);
this->unk_1F0.x += (this->unk_1F0.x - this->actor.world.pos.x) * 100.0f;
this->unk_1F0.y += (this->unk_1F0.y - this->actor.world.pos.y) * 100.0f;
this->unk_1F0.z += (this->unk_1F0.z - this->actor.world.pos.z) * 100.0f;
numEffects = 10;
break;

View file

@ -445,7 +445,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
this->unk_39C = 14;
this->unk_398 = 0;
this->actor.world.pos.x = -200.0f;
this->actor.world.pos.y = this->actor.world.pos.y - 30.0f;
this->actor.world.pos.y -= 30.0f;
this->actor.world.pos.z = -200.0f;
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_OPENING_GANON);
} else {

View file

@ -2022,14 +2022,14 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
Actor_SetScale(&sKotakePtr->actor, 0.014999999f);
}
} else {
sKoumePtr->actor.shape.rot.y = sKoumePtr->actor.shape.rot.y + (s16)this->subCamYawStep;
sKoumePtr->actor.shape.rot.y += (s16)this->subCamYawStep;
}
} else {
if ((this->work[CS_TIMER_1] % 8) == 0) {
Actor_PlaySfx(&sKoumePtr->actor, NA_SE_EN_TWINROBA_ROLL);
}
sKoumePtr->actor.shape.rot.y = sKoumePtr->actor.shape.rot.y + (s16)this->subCamYawStep;
sKoumePtr->actor.shape.rot.y += (s16)this->subCamYawStep;
Math_ApproachF(&this->subCamYawStep, 12288.0f, 1.0f, 384.0f);
if (Animation_OnFrame(&sKoumePtr->skelAnime, this->workf[ANIM_SW_TGT])) {
@ -2182,14 +2182,14 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
this->spawnPortalAlpha = 0.0f;
}
} else {
sKotakePtr->actor.shape.rot.y = sKotakePtr->actor.shape.rot.y + (s16)this->subCamYawStep;
sKotakePtr->actor.shape.rot.y += (s16)this->subCamYawStep;
}
} else {
if ((this->work[CS_TIMER_1] % 8) == 0) {
Actor_PlaySfx(&sKotakePtr->actor, NA_SE_EN_TWINROBA_ROLL);
}
sKotakePtr->actor.shape.rot.y = sKotakePtr->actor.shape.rot.y + (s16)this->subCamYawStep;
sKotakePtr->actor.shape.rot.y += (s16)this->subCamYawStep;
Math_ApproachF(&this->subCamYawStep, 12288.0f, 1.0f, 384.0f);
if (Animation_OnFrame(&sKotakePtr->skelAnime, this->workf[ANIM_SW_TGT])) {
@ -3951,7 +3951,7 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) {
this->actor.world.pos.y = -2000.0f;
Matrix_MtxFToYXZRotS(&player2->shieldMf, &blastDir, 0);
blastDir.x = -blastDir.x;
blastDir.y = blastDir.y + 0x8000;
blastDir.y += 0x8000;
Math_ApproachS(&this->magicDir.x, blastDir.x, 0xA, 0x800);
Math_ApproachS(&this->magicDir.y, blastDir.y, 0xA, 0x800);

View file

@ -922,7 +922,7 @@ void BossVa_BodyIntro(BossVa* this, PlayState* play) {
sSubCamEyeMaxVelFrac.z = sSubCamEyeMaxVelFrac.x;
sSubCamAtMaxVelFrac = sSubCamEyeMaxVelFrac;
sSubCamAtMaxVelFrac.z = sSubCamAtMaxVelFrac.z * 1.75f;
sSubCamAtMaxVelFrac.z *= 1.75f;
this->timer--;
if (this->timer == 0) {

View file

@ -1572,7 +1572,7 @@ void DemoGt_Draw7(DemoGt* this, PlayState* play) {
sp64 = kREG(75);
sp62 = kREG(74) + 0x7FEC;
sp60 = kREG(74) + 0x7FEC;
sp60 = sp60 + 0x4000;
sp60 += 0x4000;
sp5C = Graph_Alloc(gfxCtx, sizeof(Mtx));
sp40 = 1.0f - Math_CosS(sp6E);

View file

@ -137,16 +137,10 @@ void func_809B05F0(EnAni* this, PlayState* play) {
}
void func_809B064C(EnAni* this, PlayState* play) {
u16 textId;
u16 textId = Text_GetFaceReaction(play, 0xA);
s16 yawDiff;
u16 textId2;
textId2 = Text_GetFaceReaction(play, 0xA);
textId = textId2 & 0xFFFF;
if (!textId) {}
if (textId2 == 0) {
if (textId == 0) {
textId = !IS_DAY ? 0x5051 : 0x5050;
}

View file

@ -242,7 +242,7 @@ void EnBoom_Update(Actor* thisx, PlayState* play) {
if (!(player->stateFlags1 & PLAYER_STATE1_29)) {
this->actionFunc(this, play);
Actor_SetFocus(&this->actor, 0.0f);
this->activeTimer = this->activeTimer + 1;
this->activeTimer++;
}
}

View file

@ -80,7 +80,8 @@ void EnBx_Init(Actor* thisx, PlayState* play) {
thisx->scale.x = thisx->scale.z = 0.01f;
thisx->scale.y = 0.03f;
thisx->world.pos.y = thisx->world.pos.y - 100.0f;
thisx->world.pos.y -= 100.0f;
for (i = 0; i < 4; i++) {
this->unk_184[i] = sp48;
if (i == 0) {

View file

@ -696,7 +696,7 @@ void func_80A03610(EnElf* this, PlayState* play) {
Math_SmoothStepToF(&this->unk_2B8, 30.0f, 0.1f, 4.0f, 1.0f);
this->unk_28C.x = Math_CosS(this->unk_2AC) * this->unk_2B8;
this->unk_28C.y = this->unk_28C.y + this->unk_2B4;
this->unk_28C.y += this->unk_2B4;
switch (this->unk_2AA) {
case 0:

View file

@ -426,7 +426,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) {
this->actor.colorFilterTimer = 40;
} else {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x6800, 0x200);
this->actor.shape.rot.y = this->actor.shape.rot.y - 0x300;
this->actor.shape.rot.y -= 0x300;
if (this->timer != 0) {
this->timer--;
}

View file

@ -242,7 +242,7 @@ void EnFloormas_SetupTurn(EnFloormas* this) {
if (this->actor.scale.x > 0.004f) {
this->actionTarget = (rotDelta * (2.0f / 30.0f));
} else {
this->skelAnime.playSpeed = this->skelAnime.playSpeed + this->skelAnime.playSpeed;
this->skelAnime.playSpeed *= 2.0f;
this->actionTarget = rotDelta * (2.0f / 15.0f);
}
this->actionFunc = EnFloormas_Turn;

View file

@ -710,8 +710,8 @@ void EnGoma_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
Actor_MoveXZGravity(&this->actor);
this->actor.world.pos.x = this->actor.world.pos.x + this->shieldKnockbackVel.x;
this->actor.world.pos.z = this->actor.world.pos.z + this->shieldKnockbackVel.z;
this->actor.world.pos.x += this->shieldKnockbackVel.x;
this->actor.world.pos.z += this->shieldKnockbackVel.z;
Math_ApproachZeroF(&this->shieldKnockbackVel.x, 1.0f, 3.0f);
Math_ApproachZeroF(&this->shieldKnockbackVel.z, 1.0f, 3.0f);

View file

@ -806,11 +806,11 @@ s32 EnHeishi2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
break;
default:
if (limbIndex == 9) {
rot->x = rot->x + this->unk_26C.y;
rot->x += this->unk_26C.y;
}
if (limbIndex == 16) {
rot->x = rot->x + this->unk_260.y;
rot->z = rot->z + this->unk_260.z;
rot->x += this->unk_260.y;
rot->z += this->unk_260.z;
}
}

View file

@ -562,15 +562,15 @@ void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceIn
playerDist = this->actor.xzDistToPlayer;
if (playerDist < 130.0f || this->jntSph.elements[0].info.ocElemFlags & OCELEM_HIT) {
if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) {
this->actor.world.rot.y = this->actor.world.rot.y - 280;
this->actor.world.rot.y -= 280;
} else {
this->actor.world.rot.y = this->actor.world.rot.y + 280;
this->actor.world.rot.y += 280;
}
} else if (playerDist < 300.0f) {
if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) {
this->actor.world.rot.y = this->actor.world.rot.y + 280;
this->actor.world.rot.y += 280;
} else {
this->actor.world.rot.y = this->actor.world.rot.y - 280;
this->actor.world.rot.y -= 280;
}
}
this->actor.shape.rot.y = this->actor.world.rot.y;
@ -750,7 +750,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
this->riderPos = this->actor.world.pos;
this->noInputTimer = 0;
this->noInputTimerMax = 0;
this->riderPos.y = this->riderPos.y + 70.0f;
this->riderPos.y += 70.0f;
if (DREG(4) == 0) {
DREG(4) = 70;
@ -1172,7 +1172,7 @@ void EnHorse_MountedTurn(EnHorse* this, PlayState* play) {
EnHorse_StartReversingInterruptable(this);
} else if (Math_CosS(stickAngle) <= 0.7071) { // cos(45 degrees)
clampedYaw = CLAMP(stickAngle, -800.0f, 800.0f);
this->actor.world.rot.y = this->actor.world.rot.y + clampedYaw;
this->actor.world.rot.y += clampedYaw;
this->actor.shape.rot.y = this->actor.world.rot.y;
} else {
EnHorse_StartWalkingInterruptable(this);
@ -1931,7 +1931,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) {
this->stateFlags &= ~ENHORSE_LAND2_SOUND;
this->unk_21C = this->unk_228;
} else if (this->stateFlags & ENHORSE_TURNING_TO_PLAYER) {
this->actor.world.rot.y = this->actor.world.rot.y + this->followPlayerTurnSpeed;
this->actor.world.rot.y += this->followPlayerTurnSpeed;
this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->curFrame > 25.0f) {
if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) {
@ -2755,7 +2755,7 @@ void EnHorse_BridgeJumpInit(EnHorse* this, PlayState* play) {
this->stateFlags |= ENHORSE_JUMPING;
this->animationIdx = ENHORSE_ANIM_HIGH_JUMP;
y = this->skin.skelAnime.jointTable->y;
y = y * 0.01f;
y *= 0.01f;
this->bridgeJumpStart = this->actor.world.pos;
this->bridgeJumpStart.y += y;
this->bridgeJumpYVel =
@ -3106,7 +3106,7 @@ void EnHorse_BgCheckSlowMoving(EnHorse* this, PlayState* play) {
yOffset = 40.0f;
}
Math_Vec3f_Copy(&start, &this->actor.world.pos);
start.y = start.y + yOffset;
start.y += yOffset;
Math_Vec3f_Copy(&end, &start);
end.x += 30.0f * Math_SinS(this->actor.world.rot.y);
@ -3370,7 +3370,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) {
this->boostTimer++;
if (this->boostRegenTime <= 0) {
this->numBoosts = this->numBoosts + 1;
this->numBoosts++;
if (!EN_HORSE_CHECK_4(this)) {
Audio_PlaySfxGeneral(NA_SE_SY_CARROT_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
@ -3697,9 +3697,9 @@ void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
if (!(this->stateFlags & ENHORSE_CALC_RIDER_POS)) {
Skin_GetLimbPos(skin, 30, &riderOffset, &this->riderPos);
this->riderPos.x = this->riderPos.x - this->actor.world.pos.x;
this->riderPos.y = this->riderPos.y - this->actor.world.pos.y;
this->riderPos.z = this->riderPos.z - this->actor.world.pos.z;
this->riderPos.x -= this->actor.world.pos.x;
this->riderPos.y -= this->actor.world.pos.y;
this->riderPos.z -= this->actor.world.pos.z;
} else {
this->stateFlags &= ~ENHORSE_CALC_RIDER_POS;
}
@ -3712,7 +3712,7 @@ void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
if (Rand_ZeroOne() < 0.6f) {
this->dustFlags |= 1;
Skin_GetLimbPos(skin, 28, &hoofOffset, &this->frontRightHoof);
this->frontRightHoof.y = this->frontRightHoof.y - 5.0f;
this->frontRightHoof.y -= 5.0f;
}
} else {
if (this->action == ENHORSE_ACT_STOPPING) {

View file

@ -556,7 +556,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_SM_FLY - SFX_FLAG);
if (this->colQuad.base.atFlags & AT_BOUNCED) {
this->actor.colChkInfo.health = 0;
this->colQuad.base.acFlags = this->colQuad.base.acFlags & ~AC_BOUNCED;
this->colQuad.base.acFlags &= ~AC_BOUNCED;
EnPeehat_SetStateAttackRecoil(this);
} else if ((this->colQuad.base.atFlags & AT_HIT) || (this->colCylinder.base.acFlags & AC_HIT) ||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {

View file

@ -30,7 +30,7 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) {
this->playSfx = false;
this->pathIndex = (this->actor.params >> 8) & 0xFF;
this->actor.params = this->actor.params & 0xFF;
this->actor.params &= 0xFF;
if (this->actor.params >= RS_GANON_TOWER_0) {
// Incrementally increase volume of NA_BGM_GANON_TOWER for each new room during the climb of Ganon's Tower

View file

@ -629,7 +629,6 @@ s32 func_80AFEDF8(EnSkj* this, PlayState* play) {
s16 yawDiff;
if (this->actor.xzDistToPlayer < this->unk_2EC) {
this = this;
if (func_8002DDE4(play) != 0) {
return 1;
}

View file

@ -90,9 +90,9 @@ s32 func_80B0BE20(EnSw* this, CollisionPoly* poly) {
if (temp_f0 < 0.001f) {
return 0;
}
this->unk_37C.x = this->unk_37C.x * (1.0f / temp_f0);
this->unk_37C.y = this->unk_37C.y * (1.0f / temp_f0);
this->unk_37C.z = this->unk_37C.z * (1.0f / temp_f0);
this->unk_37C.x *= 1.0f / temp_f0;
this->unk_37C.y *= 1.0f / temp_f0;
this->unk_37C.z *= 1.0f / temp_f0;
this->unk_364 = polyNormal;
this->unk_3D8.xx = this->unk_370.x;
this->unk_3D8.yx = this->unk_370.y;

View file

@ -125,7 +125,7 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit);
CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit);
this->switchFlag = (u8)(thisx->params >> 0x8);
thisx->params = thisx->params & 0xFF;
thisx->params &= 0xFF;
if (thisx->params == WMT_FLAG) {
if (Flags_GetSwitch(play, this->switchFlag) != 0) {
@ -365,7 +365,7 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->skelAnime.curFrame > 20.0f) {
this->timer += 9;
this->actor.world.pos.y = this->actor.world.pos.y + 30.0f;
this->actor.world.pos.y += 30.0f;
}
if (Animation_OnFrame(&this->skelAnime, 20.0f) != 0) {
@ -437,9 +437,9 @@ void EnWallmas_TakePlayer(EnWallmas* this, PlayState* play) {
player->actor.world.pos.z = this->actor.world.pos.z;
if (this->timer < 0) {
this->actor.world.pos.y = this->actor.world.pos.y + 2.0f;
this->actor.world.pos.y += 2.0f;
} else {
this->actor.world.pos.y = this->actor.world.pos.y + 10.0f;
this->actor.world.pos.y += 10.0f;
}
if (!LINK_IS_ADULT) {
@ -461,7 +461,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_UP);
}
this->timer = this->timer + 2;
this->timer += 2;
} else {
Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y + (!LINK_IS_ADULT ? 30.0f : 50.0f), 5.0f);
}

View file

@ -677,7 +677,6 @@ void ObjSwitch_CrystalOn(ObjSwitch* this, PlayState* play) {
if ((this->jntSph.col.base.acFlags & AC_HIT) && !(this->prevColFlags & AC_HIT) &&
this->disableAcTimer <= 0) {
this->disableAcTimer = 10;
play = play;
ObjSwitch_CrystalTurnOffInit(this);
ObjSwitch_SetOff(this, play);
}

View file

@ -2659,7 +2659,7 @@ s32 func_8083499C(Player* this, PlayState* play) {
/**
* The actual sword weapon is not handled here. See `Player_ActionChange_7` for melee weapon usage.
* This upper body action allows for shielding or changing held items while a sword is in hand.
*/
*/
s32 Player_UpperAction_Sword(Player* this, PlayState* play) {
if (func_80834758(play, this) || func_8083499C(this, play)) {
return 1;
@ -11274,7 +11274,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
this->cylinder.dim.yShift = phi_f12 - this->actor.world.pos.y;
if (this->stateFlags1 & PLAYER_STATE1_22) {
this->cylinder.dim.height = this->cylinder.dim.height * 0.8f;
this->cylinder.dim.height *= 0.8f;
}
Collider_UpdateCylinder(&this->actor, &this->cylinder);
@ -11440,9 +11440,9 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList,
}
D_8085486C = (-sp5C * 4) + 36;
D_8085486C = D_8085486C * D_8085486C;
D_8085486C = SQ(D_8085486C);
D_8085486C = (s32)((Math_CosS(D_8085486C) * 100.0f) + 100.0f) + 55.0f;
D_8085486C = D_8085486C * (sp5C * (1.0f / 9.0f));
D_8085486C *= sp5C * (1.0f / 9.0f);
}
Matrix_SetTranslateRotateYXZ(this->actor.world.pos.x, this->actor.world.pos.y + 2.0f,

View file

@ -59,10 +59,10 @@ u32 EffectSsGRipple_Init(PlayState* play, u32 index, EffectSs* this, void* initP
return 1;
}
void EffectSsGRipple_DrawRipple(PlayState* play, EffectSs* this, void* segment) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
void EffectSsGRipple_DrawRipple(PlayState* play2, EffectSs* this, void* segment) {
PlayState* play = play2;
f32 radius;
s32 pad;
GraphicsContext* gfxCtx = play->state.gfxCtx;
MtxF mfTrans;
MtxF mfScale;
MtxF mfResult;
@ -71,8 +71,6 @@ void EffectSsGRipple_DrawRipple(PlayState* play, EffectSs* this, void* segment)
OPEN_DISPS(gfxCtx, "../z_eff_ss_g_ripple.c", 199);
if (play) {}
radius = this->rRadius * 0.0025f;
if ((this->rWaterBoxNum != -1) && (this->rWaterBoxNum < play->colCtx.colHeader->numWaterBoxes)) {

View file

@ -80,7 +80,7 @@ void EffectSsIcePiece_Draw(PlayState* play, u32 index, EffectSs* this) {
void EffectSsIcePiece_Update(PlayState* play, u32 index, EffectSs* this) {
this->rPitch += this->rRotSpeed;
this->velocity.x = this->velocity.x * 0.85f;
this->velocity.y = this->velocity.y * 0.85f;
this->velocity.z = this->velocity.z * 0.85f;
this->velocity.x *= 0.85f;
this->velocity.y *= 0.85f;
this->velocity.z *= 0.85f;
}