From 7eba85c3b42ab1ebb2844f329596c311456c74ac Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Tue, 2 Aug 2022 18:09:53 -0400 Subject: Prevents blocking Song of Time check by shielding. (#1001) --- soh/src/code/z_play.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'soh/src/code') diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index aa91e43a5..a42fb2f78 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -200,7 +200,8 @@ void GivePlayerRandoRewardSongOfTime(GlobalContext* globalCtx, RandomizerCheck c !Flags_GetTreasure(globalCtx, 0x1F) && gSaveContext.nextTransition == 0xFF) { GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_SONG_OF_TIME); GiveItemWithoutActor(globalCtx, getItemId); - Flags_SetTreasure(globalCtx, 0x1F); + player->pendingFlag.flagID = 0x1F; + player->pendingFlag.flagType = FLAG_SCENE_TREASURE; } } -- cgit v1.2.3 From b89cc25df3e26717a76c7a847494e14fb05d9595 Mon Sep 17 00:00:00 2001 From: aMannus Date: Wed, 3 Aug 2022 05:46:39 +0200 Subject: Fixed deku stick on B and horse swordless (#995) --- soh/src/code/z_parameter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'soh/src/code') diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 4c7443f9f..eecf1be8b 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1363,6 +1363,12 @@ void Inventory_SwapAgeEquipment(void) { u16 temp; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { + // When becoming adult, remove swordless flag since we'll get master sword + // Only in rando to keep swordless link bugs in vanilla + if (gSaveContext.n64ddFlag) { + gSaveContext.infTable[29] &= ~1; + } + for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { if (i != 0) { gSaveContext.childEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; @@ -1423,6 +1429,12 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.equips.equipment = gSaveContext.adultEquips.equipment; } } else { + // When becoming child, set swordless flag if player doesn't have kokiri sword + // Only in rando to keep swordless link bugs in vanilla + if (gSaveContext.n64ddFlag && (1 << 0 & gSaveContext.inventory.equipment) == 0) { + gSaveContext.infTable[29] |= 1; + } + for (i = 0; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; -- cgit v1.2.3 From 0f7a88bd5a34e1ff21e6a7a3ef5ac9b81cafb0f8 Mon Sep 17 00:00:00 2001 From: Kenix3 Date: Wed, 3 Aug 2022 22:36:13 -0400 Subject: This should fix (all?) 60fps interpolation issues left. (#938) * This should fix (all?) 60fps interpolation issues left. Resolves #631 #917 * Update z_fishing.c * Re-adds Emil's interpolation in certain places. * move open/close disps out of if statments checking timer based vars, revert fishing to use recordopen/closed child * move disps out of ifs for morpha * use recordopen/recordclose for volv * recordopen/recordclose for ganondorf * switch back to recordopen/recordclose for ganondorf floor * Frame interpolation now uses a 64bit parameter rather than 32. * More 60fps fixes * Fix close child typo * add todo calls to recordopen/recordclose * fix build * revert long long frame interpolation * add some epochs * add more epochs * bongo epochs * the rest of the epochs * fix the typo fix the build * interpolation fixes pr cleanup * init/cleanup bongo epochs * bongo hand trails * Fixes niw feathers * Fixes bongo bongo hands, and replaces epoch * i with epoch + i * don't update epochs Co-authored-by: briaguya --- soh/src/code/speed_meter.c | 4 ++-- soh/src/code/z_actor.c | 4 ++++ soh/src/code/z_eff_shield_particle.c | 7 +++++-- soh/src/code/z_eff_spark.c | 6 ++++++ soh/src/code/z_kankyo.c | 28 ++++++++++++++++++++++++---- soh/src/code/z_lifemeter.c | 7 +++++++ 6 files changed, 48 insertions(+), 8 deletions(-) (limited to 'soh/src/code') diff --git a/soh/src/code/speed_meter.c b/soh/src/code/speed_meter.c index f645c7bb5..800eef0f0 100644 --- a/soh/src/code/speed_meter.c +++ b/soh/src/code/speed_meter.c @@ -55,13 +55,13 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) { uly = this->y; lry = this->y + 2; - OPEN_DISPS(gfxCtx); - /*! @bug if gIrqMgrRetraceTime is 0, CLOSE_DISPS will never be reached */ if (gIrqMgrRetraceTime == 0) { return; } + OPEN_DISPS(gfxCtx); + sSpeedMeterTimeEntryPtr = &sSpeedMeterTimeEntryArray[0]; for (i = 0; i < ARRAY_COUNT(sSpeedMeterTimeEntryArray); i++) { temp = ((f64) * (sSpeedMeterTimeEntryPtr->time) / gIrqMgrRetraceTime) * 64.0; diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 70771880c..fc6e10825 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -3973,6 +3973,8 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { f32 chainsTranslateX; f32 chainsTranslateY; f32 rotZStep; + static s32 epoch = 0; + epoch++; entry = &sDoorLocksInfo[type]; chainRotZ = entry->chainsRotZInit; @@ -3986,6 +3988,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); Matrix_Put(&baseMtxF); Matrix_RotateZ(chainRotZ, MTXMODE_APPLY); Matrix_Translate(chainsTranslateX, chainsTranslateY, 0.0f, MTXMODE_APPLY); @@ -4005,6 +4008,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { } chainRotZ += rotZStep; + FrameInterpolation_RecordCloseChild(); } Matrix_Put(&baseMtxF); diff --git a/soh/src/code/z_eff_shield_particle.c b/soh/src/code/z_eff_shield_particle.c index a5d9ca53f..27032a632 100644 --- a/soh/src/code/z_eff_shield_particle.c +++ b/soh/src/code/z_eff_shield_particle.c @@ -47,6 +47,7 @@ void EffectShieldParticle_Init(void* thisx, void* initParamsx) { elem->endXChange = elem->initialSpeed; elem->yaw = Rand_ZeroOne() * 65534.0f; elem->pitch = Rand_ZeroOne() * 65534.0f; + elem->epoch++; } this->lightDecay = initParams->lightDecay; @@ -156,7 +157,6 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { Color_RGBA8 primColor; Color_RGBA8 envColor; - FrameInterpolation_RecordOpenChild(this, 0); OPEN_DISPS(gfxCtx); if (this != NULL) { @@ -182,6 +182,8 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_XLU_DISP++); for (elem = &this->elements[0]; elem < &this->elements[this->numElements]; elem++) { + FrameInterpolation_RecordOpenChild(elem, elem->epoch); + Mtx* mtx; MtxF sp104; MtxF spC4; @@ -212,9 +214,10 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(POLY_XLU_DISP++, sVertices, 4, 0); gSP2Triangles(POLY_XLU_DISP++, 0, 1, 2, 0, 0, 3, 1, 0); + + FrameInterpolation_RecordCloseChild(); } } CLOSE_DISPS(gfxCtx); - FrameInterpolation_RecordCloseChild(); } diff --git a/soh/src/code/z_eff_spark.c b/soh/src/code/z_eff_spark.c index 445fd7fea..5ce627508 100644 --- a/soh/src/code/z_eff_spark.c +++ b/soh/src/code/z_eff_spark.c @@ -89,6 +89,7 @@ void EffectSpark_Init(void* thisx, void* initParamsx) { elem->unkPosition.x = Rand_ZeroOne() * 65534.0f; elem->unkPosition.y = Rand_ZeroOne() * 65534.0f; elem->unkPosition.z = Rand_ZeroOne() * 65534.0f; + elem->epoch++; } this->timer = 0; @@ -210,6 +211,8 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { Mtx* mtx; f32 temp; + FrameInterpolation_RecordOpenChild(elem, elem->epoch); + SkinMatrix_SetTranslate(&spEC, elem->position.x, elem->position.y, elem->position.z); temp = ((Rand_ZeroOne() * 2.5f) + 1.5f) / 64.0f; SkinMatrix_SetScale(&spAC, temp, temp, 1.0f); @@ -264,6 +267,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp12C); if (mtx == NULL) { + FrameInterpolation_RecordCloseChild(); goto end; } @@ -273,6 +277,8 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { } gDPPipeSync(POLY_XLU_DISP++); + + FrameInterpolation_RecordCloseChild(); } end: diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index de654dfbb..de8634f32 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -3,6 +3,7 @@ #include "vt.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" +#include "soh/frame_interpolation.h" typedef enum { /* 0 */ LENS_FLARE_CIRCLE0, @@ -950,7 +951,6 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li Gfx* prevDisplayList; OPEN_DISPS(globalCtx->state.gfxCtx); - prevDisplayList = POLY_OPA_DISP; displayList = Graph_GfxPlusOne(POLY_OPA_DISP); gSPDisplayList(OVERLAY_DISP++, displayList); @@ -1459,6 +1459,8 @@ 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 s32 epoch = 0; + epoch++; OPEN_DISPS(gfxCtx); @@ -1502,9 +1504,7 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env unk88Target = cosAngle; } - if (cosAngle < 0.0f) { - - } else { + if (!(cosAngle < 0.0f)) { if (arg9) { u32 shrink = ShrinkWindow_GetCurrentVal(); func_800C016C(globalCtx, &pos, &screenPos); @@ -1517,6 +1517,8 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env } for (i = 0; i < ARRAY_COUNT(lensFlareTypes); i++) { + FrameInterpolation_RecordOpenChild("Lens Flare", epoch + i * 25); + Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW); if (arg9) { @@ -1573,6 +1575,8 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env gSPDisplayList(POLY_XLU_DISP++, gLensFlareRingDL); break; } + + FrameInterpolation_RecordCloseChild(); } alphaScale = cosAngle - (1.5f - cosAngle); @@ -1638,6 +1642,8 @@ 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 s32 epoch = 0; + epoch++; if (!(globalCtx->cameraPtrs[0]->unk_14C & 0x100) && (globalCtx->envCtx.unk_EE[2] == 0)) { OPEN_DISPS(gfxCtx); @@ -1667,6 +1673,8 @@ 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); + temp2 = Rand_ZeroOne(); temp1 = Rand_ZeroOne(); temp3 = Rand_ZeroOne(); @@ -1692,6 +1700,8 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gRaindropDL); + + FrameInterpolation_RecordCloseChild(); } // draw droplet rings on the ground @@ -1699,6 +1709,8 @@ 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); + if (!firstDone) { func_80093D84(gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0); @@ -1719,6 +1731,8 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); + + FrameInterpolation_RecordCloseChild(); } } @@ -1911,10 +1925,14 @@ 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 s32 epoch = 0; + epoch++; OPEN_DISPS(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(sLightningBolts); i++) { + FrameInterpolation_RecordOpenChild("Lightning Bolt", epoch + i * 25); + switch (sLightningBolts[i].state) { case LIGHTNING_BOLT_START: dx = globalCtx->view.lookAt.x - globalCtx->view.eye.x; @@ -1969,6 +1987,8 @@ void Environment_DrawLightning(GlobalContext* globalCtx, s32 unused) { gSPMatrix(POLY_XLU_DISP++, SEG_ADDR(1, 0), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffLightningDL); } + + FrameInterpolation_RecordCloseChild(); } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index e1bafb3d2..400f0a275 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -1,5 +1,6 @@ #include "global.h" #include "textures/parameter_static/parameter_static.h" +#include "soh/frame_interpolation.h" s16 Top_LM_Margin = 0; s16 Left_LM_Margin = 0; @@ -412,6 +413,8 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { s32 curCombineModeSet = 0; u8* curBgImgLoaded = NULL; s32 ddHeartCountMinusOne = gSaveContext.inventory.defenseHearts - 1; + static s32 epoch = 0; + epoch++; OPEN_DISPS(gfxCtx); @@ -449,6 +452,8 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { } for (i = 0; i < totalHeartCount; i++) { + FrameInterpolation_RecordOpenChild("HealthMeter Heart", epoch + i * 25); + if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { if (i < fullHeartCount) { if (curColorSet != 0) { @@ -624,6 +629,8 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { offsetX = PosX_original; } } + + FrameInterpolation_RecordCloseChild(); } CLOSE_DISPS(gfxCtx); -- cgit v1.2.3 From 78ad2820562e80f31b90853d8536133d8f2604f8 Mon Sep 17 00:00:00 2001 From: vaguerant Date: Thu, 4 Aug 2022 12:47:54 +1000 Subject: Fix Navi HUD text regression (#1020) * Fix Navi HUD text regression * Fix the fix --- soh/src/code/z_parameter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'soh/src/code') diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index eecf1be8b..617cfa397 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -3343,8 +3343,8 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { const s16 C_Right_BTN_Pos_ori[] = { C_RIGHT_BUTTON_X+X_Margins_CR, C_RIGHT_BUTTON_Y+Y_Margins_CR }; const s16 C_Up_BTN_Pos_ori[] = { C_UP_BUTTON_X+X_Margins_CU, C_UP_BUTTON_Y+Y_Margins_CU }; const s16 C_Down_BTN_Pos_ori[] = { C_DOWN_BUTTON_X+X_Margins_CD, C_DOWN_BUTTON_Y+Y_Margins_CD }; - s16 LabelX_Navi=8; - s16 LabelY_Navi=4 - !!CVar_GetS32("gNaviTextFix", 0); + s16 LabelX_Navi=7 + !!CVar_GetS32("gNaviTextFix", 0); + s16 LabelY_Navi=4; s16 C_Left_BTN_Pos[2]; //(X,Y) s16 C_Right_BTN_Pos[2]; s16 C_Up_BTN_Pos[2]; -- cgit v1.2.3