From 37dd045bd27e203801bfccca3052349d7507aa84 Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 15 Aug 2022 05:01:00 +0200 Subject: [PATCH 01/11] Rando: Fix bomb/bombchu shops (#1134) * Fix bomb shops in rando * Addressed review comments --- soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 3 ++- soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index fa367b709..5a1a36be7 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -633,7 +633,8 @@ s32 EnGirlA_CanBuy_Unk20(GlobalContext* globalCtx, EnGirlA* this) { } s32 EnGirlA_CanBuy_Bombchus(GlobalContext* globalCtx, EnGirlA* this) { - if (AMMO(ITEM_BOMBCHU) >= 50) { + // When in rando, don't allow buying bombchus when the player doesn't have a bomb bag + if (AMMO(ITEM_BOMBCHU) >= 50 || (gSaveContext.n64ddFlag && CUR_CAPACITY(UPG_BOMB_BAG) == 0)) { return CANBUY_RESULT_CANT_GET_NOW; } if (gSaveContext.rupees < this->basePrice) { diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index e195d34e2..79a2d7010 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -601,8 +601,9 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - // Completed Dodongo's Cavern - if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !(gSaveContext.eventChkInf[2] & 0x20)) { + // Don't kill bombchu shop actor in rando, making it so the shop is immediately open + // gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern + if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !(gSaveContext.eventChkInf[2] & 0x20) && !gSaveContext.n64ddFlag) { Actor_Kill(&this->actor); return; } @@ -1469,7 +1470,10 @@ void EnOssan_HandleCanBuyBombs(GlobalContext* globalCtx, EnOssan* this) { void EnOssan_BuyGoronCityBombs(GlobalContext* globalCtx, EnOssan* this) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - if (!(gSaveContext.eventChkInf[2] & 0x20)) { + // Let players buy the right side of the goron shop in rando regardless of DC completion + // Players will still need a bomb bag to buy bombs (handled by vanilla behaviour) + // gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern + if (!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[2] & 0x20)) { if (gSaveContext.infTable[15] & 0x1000) { EnOssan_SetStateCantGetItem(globalCtx, this, 0x302E); } else { From d575a3dda6b28dece53018ae27accd3cfc591173 Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 15 Aug 2022 05:01:30 +0200 Subject: [PATCH 02/11] Fixed rotation of freestanding key checks in rando (#1135) --- soh/src/code/z_en_item00.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index a2447ac4c..1b19474d8 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -557,6 +557,7 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag && this->actor.params == ITEM00_SMALL_KEY) { this->actor.shape.yOffset = 600.0f; + this->actor.shape.rot.y += 960; } Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); @@ -709,15 +710,17 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (CVar_GetS32("gNewDrops", 0)) { //set the rotation system on selected model only :) - if ((this->actor.params == ITEM00_RUPEE_GREEN) || (this->actor.params == ITEM00_RUPEE_BLUE) || (this->actor.params == ITEM00_RUPEE_RED) || (this->actor.params == ITEM00_ARROWS_SINGLE) || (this->actor.params == ITEM00_ARROWS_SMALL) || (this->actor.params == ITEM00_ARROWS_MEDIUM) || (this->actor.params == ITEM00_ARROWS_LARGE) || (this->actor.params == ITEM00_BOMBS_A) || (this->actor.params == ITEM00_BOMBS_B) || (this->actor.params == ITEM00_NUTS) || - (this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) || - (this->actor.params == ITEM00_SMALL_KEY) || (this->actor.params == ITEM00_MAGIC_LARGE) || - (this->actor.params == ITEM00_HEART) || (this->actor.params == ITEM00_BOMBS_SPECIAL) || this->actor.params == ITEM00_HEART_PIECE) { + (this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) || + (this->actor.params == ITEM00_MAGIC_LARGE) || (this->actor.params == ITEM00_HEART) || + (this->actor.params == ITEM00_BOMBS_SPECIAL) || this->actor.params == ITEM00_HEART_PIECE) { + this->actor.shape.rot.y += 960; + } + if (this->actor.params == ITEM00_SMALL_KEY && !gSaveContext.n64ddFlag) { this->actor.shape.rot.y += 960; } } @@ -1177,16 +1180,19 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { this->actor.world.rot.x = 0x4000; this->actor.shape.shadowScale = 0.5f; GetItem_Draw(globalCtx, GID_KEY_SMALL); + break; } else { Actor_SetScale(&this->actor, 0.03f); this->scale = 0.03f; this->actor.shape.yOffset = 320.0f; this->actor.shape.shadowScale = 6.0f; - this->actor.world.rot.x = 0; - this->actor.shape.rot.y = 0; + if (!gSaveContext.n64ddFlag) { + this->actor.world.rot.x = 0; + this->actor.shape.rot.y = 0; + } EnItem00_DrawCollectible(this, globalCtx); + break; } - break; case ITEM00_SHIELD_DEKU: GetItem_Draw(globalCtx, GID_SHIELD_DEKU); break; From 8945b2ed487199c08b80110c2adacfe6839584db Mon Sep 17 00:00:00 2001 From: Julien Lemay Date: Sun, 14 Aug 2022 23:02:14 -0400 Subject: [PATCH 03/11] Fix Save Editor Event Check Inf "A" Row flags (#1138) Fix Save Editor Event Check Inf Flags "A" Row flags not working. It was set to "eci1" instead of "eci10". --- soh/soh/Enhancements/debugger/debugSaveEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index f31a5e42a..7946b2362 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -944,7 +944,7 @@ void DrawFlagsTab() { DrawGroupWithBorder([&]() { ImGui::Text("A"); InsertHelpHoverText("First-time overworld entrance cs related"); - DrawFlagArray16("eci1", gSaveContext.eventChkInf[10]); + DrawFlagArray16("eci10", gSaveContext.eventChkInf[10]); }); DrawGroupWithBorder([&]() { From fabe051d3d2ff7f65429e160bd502086c0ce76d3 Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 15 Aug 2022 05:04:40 +0200 Subject: [PATCH 04/11] Fix lost woods leading music in rando (#1155) --- .../overlays/actors/ovl_En_River_Sound/z_en_river_sound.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index ed60d6b7f..5f0997a1e 100644 --- a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -40,9 +40,8 @@ void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) { Audio_PlayNatureAmbienceSequence(NATURE_ID_KOKIRI_REGION); Actor_Kill(&this->actor); } else if (this->actor.params == RS_SARIAS_SONG) { - if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || - CHECK_QUEST_ITEM(QUEST_SONG_SARIA) || - gSaveContext.n64ddFlag) { + // Always have leading music in rando + if ((!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) && !gSaveContext.n64ddFlag) { Actor_Kill(&this->actor); } } From 42bce9d33ec38176de454584cb66dfea94755439 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sun, 14 Aug 2022 23:18:12 -0400 Subject: [PATCH 05/11] don't abuse epochs (#1179) * don't abuse epochs * update bongo hand trails Co-authored-by: briaguya --- soh/src/code/z_actor.c | 4 +--- soh/src/code/z_kankyo.c | 14 ++++---------- soh/src/code/z_lifemeter.c | 4 +--- .../z_bg_spot00_hanebasi.c | 4 +--- .../overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 4 +--- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 14 ++++---------- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 18 +++++------------- .../overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 4 +--- .../overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 4 +--- .../overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 10 +++------- .../overlays/actors/ovl_Boss_Va/z_boss_va.c | 4 +--- .../overlays/actors/ovl_Demo_6K/z_demo_6k.c | 4 +--- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 16 ++++------------ .../overlays/actors/ovl_Eff_Dust/z_eff_dust.c | 8 ++------ .../overlays/actors/ovl_Fishing/z_fishing.c | 6 ++---- 15 files changed, 32 insertions(+), 86 deletions(-) diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 8f132b2c0..c760dda7c 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -3973,8 +3973,6 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { f32 chainsTranslateX; f32 chainsTranslateY; f32 rotZStep; - static u32 epoch = 0; - epoch++; entry = &sDoorLocksInfo[type]; chainRotZ = entry->chainsRotZInit; @@ -3988,7 +3986,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { chainsTranslateY = cosf(entry->chainAngle - chainRotZ) * (10 - frame) * 0.1f * entry->chainLength; for (i = 0; i < 4; i++) { - FrameInterpolation_RecordOpenChild(entry, epoch + i * 25); + FrameInterpolation_RecordOpenChild(entry, i); Matrix_Put(&baseMtxF); Matrix_RotateZ(chainRotZ, MTXMODE_APPLY); Matrix_Translate(chainsTranslateX, chainsTranslateY, 0.0f, MTXMODE_APPLY); diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 7fd9a7480..3d2a6d588 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -1459,8 +1459,6 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env LENS_FLARE_RING, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, }; - static u32 epoch = 0; - epoch++; OPEN_DISPS(gfxCtx); @@ -1517,7 +1515,7 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env } for (i = 0; i < ARRAY_COUNT(lensFlareTypes); i++) { - FrameInterpolation_RecordOpenChild("Lens Flare", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Lens Flare", i); Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW); @@ -1642,8 +1640,6 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* Vec3f unused = { 0.0f, 0.0f, 0.0f }; Vec3f windDirection = { 0.0f, 0.0f, 0.0f }; Player* player = GET_PLAYER(globalCtx); - static u32 epoch = 0; - epoch++; if (!(globalCtx->cameraPtrs[0]->unk_14C & 0x100) && (globalCtx->envCtx.unk_EE[2] == 0)) { OPEN_DISPS(gfxCtx); @@ -1673,7 +1669,7 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* // draw rain drops for (i = 0; i < globalCtx->envCtx.unk_EE[1]; i++) { - FrameInterpolation_RecordOpenChild("Rain Drop", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Rain Drop", i); temp2 = Rand_ZeroOne(); temp1 = Rand_ZeroOne(); @@ -1709,7 +1705,7 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* u8 firstDone = false; for (i = 0; i < globalCtx->envCtx.unk_EE[1]; i++) { - FrameInterpolation_RecordOpenChild("Droplet Ring", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Droplet Ring", i); if (!firstDone) { func_80093D84(gfxCtx); @@ -1925,13 +1921,11 @@ void Environment_DrawLightning(GlobalContext* globalCtx, s32 unused) { s32 pad[2]; Vec3f unused1 = { 0.0f, 0.0f, 0.0f }; Vec3f unused2 = { 0.0f, 0.0f, 0.0f }; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(sLightningBolts); i++) { - FrameInterpolation_RecordOpenChild("Lightning Bolt", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Lightning Bolt", i); switch (sLightningBolts[i].state) { case LIGHTNING_BOLT_START: diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index 071cc18a7..3c402a58b 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -413,8 +413,6 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { s32 curCombineModeSet = 0; u8* curBgImgLoaded = NULL; s32 ddHeartCountMinusOne = gSaveContext.inventory.defenseHearts - 1; - static u32 epoch = 0; - epoch++; OPEN_DISPS(gfxCtx); @@ -452,7 +450,7 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { } for (i = 0; i < totalHeartCount; i++) { - FrameInterpolation_RecordOpenChild("HealthMeter Heart", epoch + i * 25); + FrameInterpolation_RecordOpenChild("HealthMeter Heart", i); if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { if (i < fullHeartCount) { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 50b3e1fc4..4479ede06 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -261,8 +261,6 @@ void BgSpot00Hanebasi_DrawTorches(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; f32 angle; s32 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -279,7 +277,7 @@ void BgSpot00Hanebasi_DrawTorches(Actor* thisx, GlobalContext* globalCtx2) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); for (i = 0; i < 2; i++) { - FrameInterpolation_RecordOpenChild("Hanebasi Torch", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Hanebasi Torch", i); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index b1bfeb5de..0c8455701 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -1835,8 +1835,6 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) { s16 i; f32 temp_float; Mtx* tempMat = Graph_Alloc(globalCtx->state.gfxCtx, 18 * sizeof(Mtx)); - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); if (this->skinSegments != 0) { @@ -1878,7 +1876,7 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) { Matrix_Push(); for (i = 0; i < 18; i++, tempMat++) { - FrameInterpolation_RecordOpenChild(tempMat, epoch + i * 25); + FrameInterpolation_RecordOpenChild(tempMat, i); segIndex = (this->work[BFD_LEAD_BODY_SEG] + sBodyIndex[i + 1]) % 100; Matrix_Translate(this->bodySegsPos[segIndex].x, this->bodySegsPos[segIndex].y, this->bodySegsPos[segIndex].z, diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index da84d0f5e..81a5b9132 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -3356,8 +3356,6 @@ void BossGanon_DrawShock(BossGanon* this, GlobalContext* globalCtx) { s32 pad; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; s16 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(gfxCtx); @@ -3371,7 +3369,7 @@ void BossGanon_DrawShock(BossGanon* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); for (i = 0; i < ARRAY_COUNT(player->bodyPartsPos); i++) { - FrameInterpolation_RecordOpenChild("Ganondorf Shock 0", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganondorf Shock 0", i); Matrix_Translate(player->bodyPartsPos[i].x, player->bodyPartsPos[i].y, player->bodyPartsPos[i].z, MTXMODE_NEW); @@ -3386,7 +3384,7 @@ void BossGanon_DrawShock(BossGanon* this, GlobalContext* globalCtx) { } } else { for (i = 1; i < 15; i++) { - FrameInterpolation_RecordOpenChild("Ganondorf Shock 1", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganondorf Shock 1", i); Matrix_Translate(this->unk_2EC[i].x, this->unk_2EC[i].y, this->unk_2EC[i].z, MTXMODE_NEW); Matrix_ReplaceRotation(&globalCtx->billboardMtxF); @@ -3463,8 +3461,6 @@ void BossGanon_DrawBigMagicCharge(BossGanon* this, GlobalContext* globalCtx) { f32 yRot; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; s16 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(gfxCtx); @@ -3525,7 +3521,7 @@ void BossGanon_DrawBigMagicCharge(BossGanon* this, GlobalContext* globalCtx) { yRot = BINANG_TO_RAD(this->actor.yawTowardsPlayer); for (i = 0; i < this->unk_1AC; i++) { - FrameInterpolation_RecordOpenChild("Ganondorf Big Magic", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganondorf Big Magic", i); f32 xzRot = (BossGanon_RandZeroOne() - 0.5f) * M_PI * 1.5f; @@ -4158,8 +4154,6 @@ void BossGanon_LightBall_Draw(Actor* thisx, GlobalContext* globalCtx) { s16 i; f32 alpha; s32 pad; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -4184,7 +4178,7 @@ void BossGanon_LightBall_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_1A8 == 1) { for (i = 0; i < 8; i++) { - FrameInterpolation_RecordOpenChild("Ganondorf Light Ball 0", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganondorf Light Ball 0", i); Matrix_Push(); Matrix_RotateY(i * (M_PI / 8), MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 1f5455e24..98410204e 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -2464,8 +2464,6 @@ void func_80904340(BossGanon2* this, GlobalContext* globalCtx) { f32 angle; f32 sin; f32 cos; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); Matrix_Push(); @@ -2488,7 +2486,7 @@ void func_80904340(BossGanon2* this, GlobalContext* globalCtx) { rand = BossGanon2_RandZeroOne(); for (i = 0; i < 5; i++) { - FrameInterpolation_RecordOpenChild("Ganon 80904340", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganon 80904340", i); angle = (i * (2 * M_PI / 5)) + (rand * M_PI); sin = 5000.0f * sinf(angle); cos = 5000.0f * cosf(angle); @@ -2637,8 +2635,6 @@ void BossGanon2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis void func_80904D88(BossGanon2* this, GlobalContext* globalCtx) { s32 pad; s16 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -2654,7 +2650,7 @@ void func_80904D88(BossGanon2* this, GlobalContext* globalCtx) { gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308); for (i = 0; i < 15; i++) { - FrameInterpolation_RecordOpenChild("Ganon 80904D88", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganon 80904D88", i); Matrix_Translate(this->unk_234[i].x, this->unk_234[i].y, this->unk_234[i].z, MTXMODE_NEW); Matrix_ReplaceRotation(&globalCtx->billboardMtxF); @@ -2701,8 +2697,6 @@ void func_80904FC8(BossGanon2* this, GlobalContext* globalCtx) { void func_8090523C(BossGanon2* this, GlobalContext* globalCtx) { Player* player; f32 phi_f20; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -2716,7 +2710,7 @@ void func_8090523C(BossGanon2* this, GlobalContext* globalCtx) { gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308); for (i = 0; i < 11; i++) { - FrameInterpolation_RecordOpenChild("Ganon 8090523C", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganon 8090523C", i); Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); Matrix_Translate((i * 250.0f) + 900.0f, 350.0f, 0.0f, MTXMODE_APPLY); @@ -2933,8 +2927,6 @@ void func_809060E8(GlobalContext* globalCtx) { BossGanon2Effect* effect; s16 i; BossGanon2Effect* effects; - static u32 epoch = 0; - epoch++; effects = effect = globalCtx->specialEffects; @@ -2944,7 +2936,7 @@ void func_809060E8(GlobalContext* globalCtx) { for (i = 0; i < 1; i++) { if (effect->type == 1) { - FrameInterpolation_RecordOpenChild("Ganon 809060E8 0", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganon 809060E8 0", i); Vec3f spA0; f32 temp_f0; @@ -2988,7 +2980,7 @@ void func_809060E8(GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sBossGanon2Particles); i++, effect++) { if (effect->type == 2) { - FrameInterpolation_RecordOpenChild("Ganon 809060E8 1", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Ganon 809060E8 1", i); if (!usingObjectGEff) { BossGanon2_SetObjectSegment(NULL, globalCtx, OBJECT_GEFF, true); diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index ae326d696..a182d7efa 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -2443,8 +2443,6 @@ void BossMo_DrawTentacle(BossMo* this, GlobalContext* globalCtx) { f32 phi_f20; f32 phi_f22; Vec3f sp110; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -2465,7 +2463,7 @@ void BossMo_DrawTentacle(BossMo* this, GlobalContext* globalCtx) { BossMo_InitRand(1, 29100, 9786); for (i = 0; i < 41; i++, matrix++) { - FrameInterpolation_RecordOpenChild("Morpha Tentacle", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Morpha Tentacle", i); s32 pad; s32 pad2; diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 31d1488a7..f827eb538 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -2706,8 +2706,6 @@ s32 BossSst_OverrideHandTrailDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** void BossSst_DrawHand(Actor* thisx, GlobalContext* globalCtx) { BossSst* this = (BossSst*)thisx; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -2741,7 +2739,7 @@ void BossSst_DrawHand(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < end; i++) { if (Math3D_Vec3fDistSq(&trail2->world.pos, &trail->world.pos) > 900.0f) { - FrameInterpolation_RecordOpenChild(trail, 0); + FrameInterpolation_RecordOpenChild(trail, i); Matrix_SetTranslateRotateYXZ(trail->world.pos.x, trail->world.pos.y, trail->world.pos.z, &trail->world.rot); diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 533420b06..e4dad4833 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -3329,8 +3329,6 @@ void func_80942180(BossTw* this, GlobalContext* globalCtx) { void func_809426F0(BossTw* this, GlobalContext* globalCtx) { s32 pad; s16 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -3364,7 +3362,7 @@ void func_809426F0(BossTw* this, GlobalContext* globalCtx) { } for (i = 0; i < 8; i++) { - FrameInterpolation_RecordOpenChild("Twinrova 809426F0", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Twinrova 809426F0", i); Matrix_Push(); Matrix_Translate(0.0f, 0.0f, 5000.0f, MTXMODE_APPLY); @@ -4492,8 +4490,6 @@ void BossTw_DrawDeathBall(Actor* thisx, GlobalContext* globalCtx2) { f32 scaleFactor; s16 tailIdx; s16 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -4504,7 +4500,7 @@ void BossTw_DrawDeathBall(Actor* thisx, GlobalContext* globalCtx2) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); for (i = 9; i >= 0; i--) { - FrameInterpolation_RecordOpenChild("Twinrova Death Ball 0", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Twinrova Death Ball 0", i); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (((this->work[CS_TIMER_1] * 3) + (i * 0xA))) & 0x7F, @@ -4528,7 +4524,7 @@ void BossTw_DrawDeathBall(Actor* thisx, GlobalContext* globalCtx2) { gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998)); for (i = 9; i >= 0; i--) { - FrameInterpolation_RecordOpenChild("Twinrova Death Ball 1", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Twinrova Death Ball 1", i); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (((this->work[CS_TIMER_1] * 3) + (i * 0xA))) & 0x7F, diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index c8134866a..c30ec81e1 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -4006,8 +4006,6 @@ void BossVa_DrawDoor(GlobalContext* globalCtx, s16 scale) { f32 yScale; f32 segAngle = 0.0f; s32 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -4025,7 +4023,7 @@ void BossVa_DrawDoor(GlobalContext* globalCtx, s16 scale) { Matrix_Get(&doorMtx); for (i = 0; i < 8; i++, segAngle -= M_PI / 4) { - FrameInterpolation_RecordOpenChild("Barinade Door", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Barinade Door", i); Matrix_Put(&doorMtx); Matrix_RotateZ(segAngle, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index bd1bafc0a..1132e5661 100644 --- a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -564,8 +564,6 @@ void func_80967FFC(Actor* thisx, GlobalContext* globalCtx) { Demo6K* this = (Demo6K*)thisx; s32 pad; u16 timer1 = this->timer1; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); func_80093D84(globalCtx->state.gfxCtx); @@ -586,7 +584,7 @@ void func_80967FFC(Actor* thisx, GlobalContext* globalCtx) { Matrix_RotateZ(-M_PI / 2, MTXMODE_APPLY); for (i = 0; i < 6; i++) { - FrameInterpolation_RecordOpenChild("Demo6K 80967FFC", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Demo6K 80967FFC", i); Matrix_RotateZ(M_PI / 3, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index ca162f584..637a4d0f1 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -522,8 +522,6 @@ void DemoKankyo_DrawRain(Actor* thisx, GlobalContext* globalCtx) { f32 translateY; f32 translateZ; s16 j; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -597,7 +595,7 @@ void DemoKankyo_DrawRain(Actor* thisx, GlobalContext* globalCtx) { Matrix_Scale(sRainScale * 0.001f, sRainScale * 0.001f, sRainScale * 0.001f, MTXMODE_APPLY); for (j = 0; j < 5; j++) { - FrameInterpolation_RecordOpenChild("Kankyo Rain", epoch + i * j * 25); + FrameInterpolation_RecordOpenChild("Kankyo Rain", i * j); s32 pad1; @@ -663,13 +661,11 @@ void DemoKankyo_DrawClouds(Actor* thisx, GlobalContext* globalCtx) { f32 dx; f32 dy; f32 dz; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); for (i = 0; i < 30; i++) { - FrameInterpolation_RecordOpenChild("Kankyo Clouds", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Kankyo Clouds", i); dx = -(Math_SinS(this->unk_150[i].unk_20 - 0x8000) * 120.0f) * (30.0f + (i / 30.0f) * 10.0f); dy = Math_CosS(this->unk_150[i].unk_20 - 0x8000) * 5.0f + 1200.0f; @@ -784,8 +780,6 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) { f32 translateZ; PosRot posRot; u8 linkAge = gSaveContext.linkAge; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -793,7 +787,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) { this->sparkleCounter += 2; } for (i = this->sparkleCounter - 1; i >= 0; i--) { - FrameInterpolation_RecordOpenChild("Kankyo Warp Sparkles", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Kankyo Warp Sparkles", i); temp_f22 = 1.0f - (i / (f32)this->sparkleCounter); @@ -933,8 +927,6 @@ void DemoKankyo_DrawSparkles(Actor* thisx, GlobalContext* globalCtx) { f32 scale; s16 i; PosRot posRot; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -943,7 +935,7 @@ void DemoKankyo_DrawSparkles(Actor* thisx, GlobalContext* globalCtx) { } for (i = this->sparkleCounter - 1; i >= 0; i--) { - FrameInterpolation_RecordOpenChild("Kankyo Sparkles", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Kankyo Sparkles", i); temp_f20 = 1.0f - (i / (f32)this->sparkleCounter); diff --git a/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index b9bd8e311..9fbe721b6 100644 --- a/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -269,8 +269,6 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, GlobalContext* globalCtx2) { f32* distanceTraveled; s32 i; f32 aux; - static u32 epoch = 0; - epoch++; OPEN_DISPS(gfxCtx); @@ -286,7 +284,7 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, GlobalContext* globalCtx2) { gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL); for (i = 0; i < 64; i++) { - FrameInterpolation_RecordOpenChild("Dust 8099E4F4", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Dust 8099E4F4", i); if (*distanceTraveled < 1.0f) { aux = 1.0f - (*distanceTraveled * *distanceTraveled); @@ -321,8 +319,6 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx2) { s32 i; f32 aux; Player* player = GET_PLAYER(globalCtx); - static u32 epoch = 0; - epoch++; OPEN_DISPS(gfxCtx); @@ -342,7 +338,7 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx2) { gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL); for (i = 0; i < 64; i++) { - FrameInterpolation_RecordOpenChild("Dust 8099E784", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Dust 8099E784", i); if (*distanceTraveled < 1.0f) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255); diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 1cb3b53e9..b562dad30 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -1766,8 +1766,6 @@ static f32 sSinkingLureSizes[] = { void Fishing_DrawSinkingLure(GlobalContext* globalCtx) { s16 i; f32 scale; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -1780,7 +1778,7 @@ void Fishing_DrawSinkingLure(GlobalContext* globalCtx) { for (i = SINKING_LURE_SEG_COUNT - 1; i >= 0; i--) { if ((i + D_80B7FEA0) < SINKING_LURE_SEG_COUNT) { - FrameInterpolation_RecordOpenChild("Fishing Lures 1", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Fishing Lures 1", i); Matrix_Translate(sSinkingLurePos[i].x, sSinkingLurePos[i].y, sSinkingLurePos[i].z, MTXMODE_NEW); scale = sSinkingLureSizes[i + D_80B7FEA0] * 0.04f; Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); @@ -1799,7 +1797,7 @@ void Fishing_DrawSinkingLure(GlobalContext* globalCtx) { for (i = SINKING_LURE_SEG_COUNT - 1; i >= 0; i--) { if ((i + D_80B7FEA0) < SINKING_LURE_SEG_COUNT) { - FrameInterpolation_RecordOpenChild("Fishing Lures 2", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Fishing Lures 2", i); Matrix_Translate(sSinkingLurePos[i].x, sSinkingLurePos[i].y, sSinkingLurePos[i].z, MTXMODE_NEW); scale = sSinkingLureSizes[i + D_80B7FEA0] * 0.04f; Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); From ee9ea3f2bdd5faede3b15303adf09f323a624c29 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Mon, 15 Aug 2022 21:17:58 -0400 Subject: [PATCH 06/11] add 3drando license (#1206) Co-authored-by: briaguya --- .../randomizer/3drando/LICENSE.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 soh/soh/Enhancements/randomizer/3drando/LICENSE.md diff --git a/soh/soh/Enhancements/randomizer/3drando/LICENSE.md b/soh/soh/Enhancements/randomizer/3drando/LICENSE.md new file mode 100644 index 000000000..a94ec836f --- /dev/null +++ b/soh/soh/Enhancements/randomizer/3drando/LICENSE.md @@ -0,0 +1,27 @@ +This software contains derivative code from [OoT-Randomizer](https://github.com/TestRunnerSRL/OoT-Randomizer), which is licensed under the MIT license with the following language. + +MIT License + +Copyright (c) 2017 Amazing Ampharos + +Credit for contributions to Junglechief87 on this and to LLCoolDave and +KevinCathcart for their work on the Zelda Lttp Entrance Randomizer which +was the code base for this project. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file From 0f2e7db8e092a4b104685dc538c6b265903f8c47 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Tue, 16 Aug 2022 15:49:52 -0400 Subject: [PATCH 07/11] Fix Ice Traps on Windows and Mac (#1216) --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 2c3b3d61b..80d9b1e41 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6280,7 +6280,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { this->actor.colChkInfo.damage = 0; func_80837C0C(globalCtx, this, 3, 0.0f, 0.0f, 0, 20); Player_SetPendingFlag(this, globalCtx); - return; + return 1; } s32 drop = giEntry->objectId; From cd37a561611755c10503338f24479b7273c30182 Mon Sep 17 00:00:00 2001 From: aMannus Date: Tue, 16 Aug 2022 22:16:44 +0200 Subject: [PATCH 08/11] Rando: Fix being able to get Sun's Song check multiple times (#1185) --- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index cc7360c0a..56bd79e7b 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -323,13 +323,9 @@ void func_80ABF708(EnOkarinaTag* this, GlobalContext* globalCtx) { } void GivePlayerRandoRewardSunSong(EnOkarinaTag* song, GlobalContext* globalCtx, RandomizerCheck check) { - if (song->actor.parent != NULL && song->actor.parent->id == GET_PLAYER(globalCtx)->actor.id && - !Flags_GetTreasure(globalCtx, 0x1F)) { - Flags_SetTreasure(globalCtx, 0x1F); - } else if (!Flags_GetTreasure(globalCtx, 0x1F)) { - GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA); - func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f); - } + Flags_SetTreasure(globalCtx, 0x1F); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA); + func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f); } void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) { @@ -338,15 +334,11 @@ void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) { if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) { Message_CloseTextbox(globalCtx); - if (!gSaveContext.n64ddFlag) { - if (!CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { - globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs); - gSaveContext.cutsceneTrigger = 1; - } - } else { - if (!Flags_GetTreasure(globalCtx, 0x1F)) { - GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB); - } + if (!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { + globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs); + gSaveContext.cutsceneTrigger = 1; + } else if (!Flags_GetTreasure(globalCtx, 0x1F)) { + GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB); } this->actionFunc = func_80ABF708; } From 71b1db1fb6de95edc7573c965a90308ce7b2a2de Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 16 Aug 2022 21:50:12 -0400 Subject: [PATCH 09/11] volvagia interpolation fix (#1203) Co-authored-by: briaguya --- soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 0c8455701..4a13a7e89 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -1876,8 +1876,6 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) { Matrix_Push(); for (i = 0; i < 18; i++, tempMat++) { - FrameInterpolation_RecordOpenChild(tempMat, i); - segIndex = (this->work[BFD_LEAD_BODY_SEG] + sBodyIndex[i + 1]) % 100; Matrix_Translate(this->bodySegsPos[segIndex].x, this->bodySegsPos[segIndex].y, this->bodySegsPos[segIndex].z, MTXMODE_NEW); @@ -1903,6 +1901,8 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) { f32 padD8; if (this->bodyFallApart[i] < 2) { + FrameInterpolation_RecordOpenChild(tempMat, i); + f32 spD4 = 0.1f; temp_float = 0.1f; @@ -1935,13 +1935,13 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) { bones->actor.scale.y = this->actor.scale.y * spD4; bones->actor.scale.z = this->actor.scale.z * 0.1f; } + + FrameInterpolation_RecordCloseChild(); } } if (i > 0) { Collider_UpdateSpheres(i + 1, &this->collider); } - - FrameInterpolation_RecordCloseChild(); } Matrix_Pop(); osSyncPrintf("BH\n"); From 01b7fedc355073a010c9ab1e42fc007bb0550ee2 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 16 Aug 2022 21:50:37 -0400 Subject: [PATCH 10/11] clean up a few epochs that were missed (#1204) Co-authored-by: briaguya --- soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 6 ++---- soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c | 4 +--- soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index e4dad4833..e36ad0c9a 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -4416,8 +4416,6 @@ void BossTw_BlastDraw(Actor* thisx, GlobalContext* globalCtx2) { f32 scaleFactor; s16 tailIdx; s16 i; - static u32 epoch = 0; - epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -4428,7 +4426,7 @@ void BossTw_BlastDraw(Actor* thisx, GlobalContext* globalCtx2) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, (s8)this->workf[TAIL_ALPHA]); gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); for (i = 9; i >= 0; i--) { - FrameInterpolation_RecordOpenChild("Twinrova Fire Blast", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Twinrova Fire Blast", i); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll( @@ -4456,7 +4454,7 @@ void BossTw_BlastDraw(Actor* thisx, GlobalContext* globalCtx2) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s8)this->workf[TAIL_ALPHA]); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998)); for (i = 9; i >= 0; i--) { - FrameInterpolation_RecordOpenChild("Twinrova Ice Blast", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Twinrova Ice Blast", i); gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll( diff --git a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 1132e5661..dfd767b9f 100644 --- a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -693,8 +693,6 @@ void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; u32 frames = globalCtx->state.frames; s32 i; - static u32 epoch = 0; - epoch++; if ((i = (globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[1] != NULL)) && (globalCtx->csCtx.npcActions[1]->action != 1)) { @@ -705,7 +703,7 @@ void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) { Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000) * (M_PI / 0x8000), MTXMODE_APPLY); for (i = 0; i < 16; i++) { - FrameInterpolation_RecordOpenChild("Demo6K 809688C4", epoch + i * 25); + FrameInterpolation_RecordOpenChild("Demo6K 809688C4", i); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, sEnvColors[this->unk_274[i]].r, sEnvColors[this->unk_274[i]].g, diff --git a/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 9ea675b55..bcee72971 100644 --- a/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -482,8 +482,6 @@ void MirRay_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 i; MirRayShieldReflection reflection[6]; s32 temp; - static u32 epoch = 0; - epoch++; this->reflectIntensity = 0.0f; if ((D_80B8E670 == 0) && !this->unLit && Player_HasMirrorShieldSetToDraw(globalCtx)) { @@ -514,7 +512,7 @@ void MirRay_Draw(Actor* thisx, GlobalContext* globalCtx) { } for (i = 0; i < 6; i++) { if (reflection[i].reflectionPoly != NULL) { - FrameInterpolation_RecordOpenChild(&reflection[i], epoch + i * 25); + FrameInterpolation_RecordOpenChild(&reflection[i], i); Matrix_Translate(reflection[i].pos.x, reflection[i].pos.y, reflection[i].pos.z, MTXMODE_NEW); Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); Matrix_Mult(&reflection[i].mtx, MTXMODE_APPLY); From 6206cd7db004ca8e6a9afa1150e539ad28ea0f89 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 16 Aug 2022 21:50:52 -0400 Subject: [PATCH 11/11] add ActorResetFunc for courtyard guards (#1213) Co-authored-by: briaguya --- soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 5a313a07f..adafa3674 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -14,6 +14,7 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx); void EnHeishi1_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx); void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi1_Reset(void); void EnHeishi1_SetupWait(EnHeishi1* this, GlobalContext* globalCtx); void EnHeishi1_SetupWalk(EnHeishi1* this, GlobalContext* globalCtx); @@ -41,7 +42,7 @@ const ActorInit En_Heishi1_InitVars = { (ActorFunc)EnHeishi1_Destroy, (ActorFunc)EnHeishi1_Update, (ActorFunc)EnHeishi1_Draw, - NULL, + (ActorResetFunc)EnHeishi1_Reset, }; static f32 sAnimParamsInit[][8] = { @@ -64,6 +65,10 @@ static s32 sCamDataIdxs[] = { static s16 sWaypoints[] = { 0, 4, 1, 5, 2, 6, 3, 7 }; +void EnHeishi1_Reset(void) { + sHeishi1PlayerIsCaught = false; +} + void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnHeishi1* this = (EnHeishi1*)thisx;