summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorDemur Rumed <159546+serprex@users.noreply.github.com>2026-06-09 21:59:41 +0000
committerDemur Rumed <159546+serprex@users.noreply.github.com>2026-06-09 22:57:16 +0000
commit17f598377195f5d95833fa6f9ea60bd3019a7146 (patch)
tree7589eab84100d9805352fe0c4c3a219ee7d7d78f /soh/src/code
parente93ea5b9192b0f3b55e5a7b333018e4976676a5c (diff)
parentd901223adeba13f3ae149014f9c82dae60707b74 (diff)
Merge remote-tracking branch 'origin/develop' into develop-ackbar
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/game.c4
-rw-r--r--soh/src/code/z_actor.c2
-rw-r--r--soh/src/code/z_camera.c10
-rw-r--r--soh/src/code/z_en_item00.c6
-rw-r--r--soh/src/code/z_horse.c28
-rw-r--r--soh/src/code/z_map_exp.c5
-rw-r--r--soh/src/code/z_parameter.c6
-rw-r--r--soh/src/code/z_player_lib.c37
-rw-r--r--soh/src/code/z_skelanime.c4
9 files changed, 59 insertions, 43 deletions
diff --git a/soh/src/code/game.c b/soh/src/code/game.c
index a31cf6474..dbbe5e75c 100644
--- a/soh/src/code/game.c
+++ b/soh/src/code/game.c
@@ -26,7 +26,7 @@ GameState* gGameState;
// Forward declared, because this in a C++ header.
int gfx_create_framebuffer(uint32_t width, uint32_t height, uint32_t native_width, uint32_t native_height,
- uint8_t resize);
+ uint8_t resize, bool forceFixedAspect);
void gfx_texture_cache_clear();
void GameState_FaultPrint(void) {
@@ -260,7 +260,7 @@ void GameState_Update(GameState* gameState) {
if (gPauseLinkFrameBuffer == -1) {
gPauseLinkFrameBuffer = gfx_create_framebuffer(PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT,
- PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT, true);
+ PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT, true, true);
}
GameState_SetFrameBuffer(gfxCtx);
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c
index f69a7ea8c..7369727e0 100644
--- a/soh/src/code/z_actor.c
+++ b/soh/src/code/z_actor.c
@@ -1472,7 +1472,7 @@ s32 func_8002DEEC(Player* player) {
}
void func_8002DF18(PlayState* play, Player* player) {
- func_8006DC68(play, player);
+ Horse_InitPlayerHorse(play, player);
}
s32 func_8002DF38(PlayState* play, Actor* actor, u8 csAction) {
diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c
index 0d30dcb2e..f6f0a607e 100644
--- a/soh/src/code/z_camera.c
+++ b/soh/src/code/z_camera.c
@@ -8,6 +8,7 @@
#include "soh/frame_interpolation.h"
#include "soh/Enhancements/controls/Mouse.h"
+#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags);
s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags);
@@ -4542,9 +4543,9 @@ s32 Camera_Subj4(Camera* camera) {
}
anim->unk_28 = temp_f16;
- // camera->player->actor.world.pos = *eyeNext;
- // camera->player->actor.world.pos.y = camera->playerGroundY;
- // camera->player->actor.shape.rot.y = sp64.yaw;
+ camera->player->actor.world.pos = *eyeNext;
+ camera->player->actor.world.pos.y = camera->playerGroundY;
+ camera->player->actor.shape.rot.y = sp64.yaw;
temp_f16 = ((240.0f * temp_f16) * (anim->unk_24 * 0.416667f));
temp_a0 = temp_f16 + anim->unk_30;
at->x = eye->x + (Math_SinS(temp_a0) * 10.0f);
@@ -7363,7 +7364,8 @@ s32 Camera_UpdateWater(Camera* camera) {
s32 Camera_UpdateHotRoom(Camera* camera) {
camera->distortionFlags &= ~DISTORTION_HOT_ROOM;
- if (camera->play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) {
+ if (GameInteractor_Should(VB_HOT_ROOM_DISTORTION,
+ camera->play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3)) {
camera->distortionFlags |= DISTORTION_HOT_ROOM;
}
diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c
index e8e29a19d..b2da1c40d 100644
--- a/soh/src/code/z_en_item00.c
+++ b/soh/src/code/z_en_item00.c
@@ -3,7 +3,6 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
#include "textures/icon_item_static/icon_item_static.h"
-#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/OTRGlobals.h"
@@ -781,11 +780,8 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
}
}
- if (this->unk_15A > 0) {
+ if (GameInteractor_Should(VB_ITEM00_TIMER_TICK, this->unk_15A > 0, this)) {
this->unk_15A--;
- if (CVarGetInteger(CVAR_CHEAT("DropsDontDie"), 0) && (this->unk_154 <= 0)) {
- this->unk_15A++;
- }
}
if ((this->unk_15A > 0) && (this->unk_15A < 41) && (this->unk_154 <= 0)) {
diff --git a/soh/src/code/z_horse.c b/soh/src/code/z_horse.c
index 68f9ba9d2..2accaa9ac 100644
--- a/soh/src/code/z_horse.c
+++ b/soh/src/code/z_horse.c
@@ -4,7 +4,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
-s32 func_8006CFC0(s32 scene) {
+s32 Horse_CanSpawn(s32 scene) {
s32 validScenes[] = { SCENE_HYRULE_FIELD, SCENE_LAKE_HYLIA, SCENE_GERUDO_VALLEY, SCENE_GERUDOS_FORTRESS,
SCENE_LON_LON_RANCH };
s32 i;
@@ -18,7 +18,7 @@ s32 func_8006CFC0(s32 scene) {
return 0;
}
-void func_8006D074(PlayState* play) {
+void Horse_ResetHorseData(PlayState* play) {
gSaveContext.horseData.scene = SCENE_HYRULE_FIELD;
gSaveContext.horseData.pos.x = -1840;
gSaveContext.horseData.pos.y = 72;
@@ -26,7 +26,7 @@ void func_8006D074(PlayState* play) {
gSaveContext.horseData.angle = -27353;
}
-void func_8006D0AC(PlayState* play) {
+void Horse_FixLakeHyliaPosition(PlayState* play) {
if (gSaveContext.horseData.scene == SCENE_LAKE_HYLIA) {
gSaveContext.horseData.scene = SCENE_LAKE_HYLIA;
gSaveContext.horseData.pos.x = -2065;
@@ -43,7 +43,7 @@ typedef struct {
/* 0x0A */ s16 type;
} HorseSpawn;
-void func_8006D0EC(PlayState* play, Player* player) {
+void Horse_SetupInGameplay(PlayState* play, Player* player) {
s32 i;
HorseSpawn horseSpawns[] = {
{ SCENE_HYRULE_FIELD, -460, 100, 6640, 0, 2 }, { SCENE_LAKE_HYLIA, -1929, -1025, 768, 0, 2 },
@@ -87,7 +87,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene,
Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), DREG(1));
- if (func_8006CFC0(gSaveContext.horseData.scene)) {
+ if (Horse_CanSpawn(gSaveContext.horseData.scene)) {
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x,
gSaveContext.horseData.pos.y, gSaveContext.horseData.pos.z, 0,
gSaveContext.horseData.angle, 0, 1);
@@ -100,7 +100,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
// "Horse_SetNormal():%d set spot is no good."
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
osSyncPrintf(VT_RST);
- func_8006D074(play);
+ Horse_ResetHorseData(play);
}
} else if ((play->sceneNum == SCENE_LON_LON_RANCH) && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) &&
(DREG(1) == 0)) {
@@ -136,7 +136,7 @@ typedef struct {
/* 0x10 */ s16 type;
} struct_8011F9B8;
-void func_8006D684(PlayState* play, Player* player) {
+void Horse_SetupInCutscene(PlayState* play, Player* player) {
s32 pad;
s32 i;
Vec3s spawnPos;
@@ -247,17 +247,17 @@ void func_8006D684(PlayState* play, Player* player) {
}
}
-void func_8006DC68(PlayState* play, Player* player) {
+void Horse_InitPlayerHorse(PlayState* play, Player* player) {
if (LINK_IS_ADULT) {
- if (!func_8006CFC0(gSaveContext.horseData.scene)) {
+ if (!Horse_CanSpawn(gSaveContext.horseData.scene)) {
osSyncPrintf(VT_COL(RED, WHITE));
// "Horse_Set_Check():%d set spot is no good."
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
osSyncPrintf(VT_RST);
- func_8006D074(play);
+ Horse_ResetHorseData(play);
}
- if (func_8006CFC0(play->sceneNum)) {
+ if (Horse_CanSpawn(play->sceneNum)) {
if ((gSaveContext.sceneSetupIndex > 3) ||
((gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_11 ||
gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_12 ||
@@ -266,15 +266,15 @@ void func_8006DC68(PlayState* play, Player* player) {
(gSaveContext.respawnFlag == 0)) ||
((play->sceneNum == SCENE_LON_LON_RANCH) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0))) {
- func_8006D684(play, player);
+ Horse_SetupInCutscene(play, player);
} else {
- func_8006D0EC(play, player);
+ Horse_SetupInGameplay(play, player);
}
}
}
}
-void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
+void Horse_RotateToPoint(Actor* actor, Vec3f* arg1, s16 arg2) {
s16 x = Math_Vec3f_Yaw(&actor->world.pos, arg1) - actor->world.rot.y;
if (x > arg2) {
diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c
index 44b5b43b5..6d8222e5a 100644
--- a/soh/src/code/z_map_exp.c
+++ b/soh/src/code/z_map_exp.c
@@ -7,6 +7,7 @@
#include <assert.h>
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
+#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
MapData* gMapData;
@@ -761,6 +762,10 @@ void Minimap_DrawCompassIcons(PlayState* play) {
}
CLOSE_DISPS(play->state.gfxCtx);
+
+ if (play->interfaceCtx.minimapAlpha >= 0xAA) {
+ GameInteractor_ExecuteOnMinimapDrawCompassIcons();
+ }
}
void Minimap_Draw(PlayState* play) {
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 4b782d954..2064527e6 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -1711,7 +1711,9 @@ void Interface_InitHorsebackArchery(PlayState* play) {
gSaveContext.minigameState = 1;
interfaceCtx->unk_23C = interfaceCtx->unk_240 = interfaceCtx->unk_242 = 0;
gSaveContext.minigameScore = sHBAScoreTier = 0;
- interfaceCtx->hbaAmmo = 20;
+ if (GameInteractor_Should(VB_SET_HORSEBACK_ARCHERY_AMMO, true, interfaceCtx)) {
+ interfaceCtx->hbaAmmo = 20;
+ }
}
void func_800849EC(PlayState* play) {
@@ -1910,7 +1912,7 @@ u8 Item_Give(PlayState* play, u8 item) {
osSyncPrintf(VT_RST);
if (item == ITEM_MEDALLION_WATER) {
- func_8006D0AC(play);
+ Horse_FixLakeHyliaPosition(play);
}
return Return_Item(item, MOD_NONE, ITEM_NONE);
diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c
index 89faa95ad..f2e2b7321 100644
--- a/soh/src/code/z_player_lib.c
+++ b/soh/src/code/z_player_lib.c
@@ -1598,21 +1598,28 @@ void Player_DrawGetItemIceTrap(PlayState* play, Player* this, Vec3f* refPos, s32
} else if (iceTrapScale < 0.8f) {
iceTrapScale += 0.2f;
}
- gSPSegment(POLY_XLU_DISP++, 0x08,
- Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, (0 - play->gameplayFrames) % 128, 32, 32, 1, 0,
- (play->gameplayFrames * -2) % 128, 32, 32, 0, -1, 0, -2));
-
- Matrix_Translate(0.0f, -40.0f, 0.0f, MTXMODE_APPLY);
- Matrix_Scale(iceTrapScale, iceTrapScale, iceTrapScale, MTXMODE_APPLY);
- gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, 255);
- gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment3DL);
-
- // Reset matrix for the fake item model because we're animating the size of the ice block around it before this.
- Matrix_Translate(refPos->x + (3.3f * Math_SinS(this->actor.shape.rot.y)), refPos->y + height,
- refPos->z + ((3.3f + (IREG(90) / 10.0f)) * Math_CosS(this->actor.shape.rot.y)), MTXMODE_NEW);
- Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
- Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
+
+ // Draw the ice only after a bit so it doesn't spoil the fact that it's a trap
+ if (iceTrapScale >= 0.01) {
+ gSPSegment(POLY_XLU_DISP++, 0x08,
+ Gfx_TwoTexScrollEx(play->state.gfxCtx, 0, 0, (0 - play->gameplayFrames) % 128, 32, 32, 1, 0,
+ (play->gameplayFrames * -2) % 128, 32, 32, 0, -1, 0, -2));
+
+ Matrix_Translate(0.0f, -40.0f, 0.0f, MTXMODE_APPLY);
+ Matrix_Scale(iceTrapScale, iceTrapScale, iceTrapScale, MTXMODE_APPLY);
+ gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, 255);
+ gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment3DL);
+
+ // Reset matrix for the fake item model because we're animating the size of the ice block around it before
+ // this.
+ Matrix_Translate(refPos->x + (3.3f * Math_SinS(this->actor.shape.rot.y)), refPos->y + height,
+ refPos->z + ((3.3f + (IREG(90) / 10.0f)) * Math_CosS(this->actor.shape.rot.y)),
+ MTXMODE_NEW);
+ Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
+ }
+
// Draw fake item model.
if (this->getItemEntry.drawFunc != NULL) {
this->getItemEntry.drawFunc(play, &this->getItemEntry);
diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c
index 4335df0c8..3449c2ed9 100644
--- a/soh/src/code/z_skelanime.c
+++ b/soh/src/code/z_skelanime.c
@@ -902,6 +902,10 @@ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animati
if (frame < 0) {
frame = 0;
}
+ // SOH [Alt Assets] Check if animData is null (can happen if animation data segment failed to load)
+ if (animData == NULL) {
+ return;
+ }
memcpy(ram, (uintptr_t)animData + (((sizeof(Vec3s) * limbCount + 2) * frame)), sizeof(Vec3s) * limbCount + 2);
}
}