summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYunataSavior <58997725+YunataSavior@users.noreply.github.com>2025-11-09 01:20:24 -0800
committerGitHub <noreply@github.com>2025-11-09 11:20:24 +0200
commite49519229cd6b3974739f6e789f3bccb7ef302a3 (patch)
treed2b017a78ae25987c100d7459b68afd911ec4e22 /src
parent72cb2950a0d8218eb791e3c5eeeaf2acd28e66e6 (diff)
Link obj_web0, obj_picture, npc_zrz (#2784)
* Link obj_web0 * Link npc_zrz * Link obj_picture
Diffstat (limited to 'src')
-rw-r--r--src/d/actor/d_a_npc_zrz.cpp18
-rw-r--r--src/d/actor/d_a_obj_picture.cpp65
-rw-r--r--src/d/actor/d_a_obj_web0.cpp41
3 files changed, 67 insertions, 57 deletions
diff --git a/src/d/actor/d_a_npc_zrz.cpp b/src/d/actor/d_a_npc_zrz.cpp
index dd581958b1..55c3408ee9 100644
--- a/src/d/actor/d_a_npc_zrz.cpp
+++ b/src/d/actor/d_a_npc_zrz.cpp
@@ -1328,6 +1328,8 @@ void daNpc_zrZ_c::lightColorProc() {
int prev_key_frame, next_key_frame, next, i;
for (i = 0; i < 4; i++) {
if (key_frame[i] <= mLightEffectFrame && key_frame[i + 1] > mLightEffectFrame) {
+ // The following is present to cause dbg asm to use r31 for stack reg:
+ int nested_var;
prev_key_frame = key_frame[i];
next_key_frame = key_frame[i + 1];
next = i + 1;
@@ -1336,12 +1338,16 @@ void daNpc_zrZ_c::lightColorProc() {
}
int frames = next_key_frame - prev_key_frame;
- s16 step_r = std::fabs(key_color[i + 1].r - key_color[i].r) / frames;
- s16 step_g = std::fabs(key_color[i + 1].g - key_color[i].g) / frames;
- s16 step_b = std::fabs(key_color[i + 1].b - key_color[i].b) / frames;
- cLib_chaseS(&mLight.mColor.r, key_color[next].r, ++step_r);
- cLib_chaseS(&mLight.mColor.g, key_color[next].g, ++step_g);
- cLib_chaseS(&mLight.mColor.b, key_color[next].b, ++step_b);
+ GXColorS10 color;
+ color.r = std::fabs(key_color[i + 1].r - key_color[i].r) / frames;
+ color.g = std::fabs(key_color[i + 1].g - key_color[i].g) / frames;
+ color.b = std::fabs(key_color[i + 1].b - key_color[i].b) / frames;
+ ++color.r;
+ ++color.g;
+ ++color.b;
+ cLib_chaseS(&mLight.mColor.r, key_color[next].r, color.r);
+ cLib_chaseS(&mLight.mColor.g, key_color[next].g, color.g);
+ cLib_chaseS(&mLight.mColor.b, key_color[next].b, color.b);
}
/* 80B9B1B8-80B9B1C0 0001CC 0008+00 0/0 0/0 0/0 .rodata @5782 */
diff --git a/src/d/actor/d_a_obj_picture.cpp b/src/d/actor/d_a_obj_picture.cpp
index 97e8c2575d..0a68e6f752 100644
--- a/src/d/actor/d_a_obj_picture.cpp
+++ b/src/d/actor/d_a_obj_picture.cpp
@@ -26,35 +26,6 @@ static Vec l_PIC_AT_OFFSET_POS = {
0.0f, 100.0f, 0.0f
};
-/* 80CAF110-80CAF15C 000028 004C+00 1/1 0/0 0/0 .data s_CcDCps__14daObjPicture_c */
-dCcD_SrcCps daObjPicture_c::s_CcDCps = {
- {
- {0x0, {{0x0, 0x0, 0x0}, {0x20A0, 0x11}, 0x0}}, // mObj
- {dCcD_SE_SWORD, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
- {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x4}, // mGObjTg
- {0x0}, // mGObjCo
- }, // mObjInf
- {
- {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 14.0f}, // mCps
- } // mCpsAttr
-};
-
-/* 80CAF15C-80CAF1A0 000074 0044+00 1/1 0/0 0/0 .data s_CcDCyl_pic_at__14daObjPicture_c
- */
-dCcD_SrcCyl daObjPicture_c::s_CcDCyl_pic_at = {
- {
- {0x0, {{0x400, 0x1, 0x11}, {0x0, 0x11}, 0x79}}, // mObj
- {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
- {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg
- {0x0}, // mGObjCo
- }, // mObjInf
- {
- {0.0f, 0.0f, 0.0f}, // mCenter
- 0.0f, // mRadius
- 0.0f // mHeight
- } // mCyl
-};
-
/* 80CAD318-80CAD498 000098 0180+00 2/2 0/0 0/0 .text __ct__14daObjPicture_cFv */
daObjPicture_c::daObjPicture_c() {
memset(mpBgw, 0, 8);
@@ -151,7 +122,6 @@ int daObjPicture_c::createHeap() {
}
/* 80CADC18-80CADFB0 000998 0398+00 1/1 0/0 0/0 .text create__14daObjPicture_cFv */
-// NONMATCHING
int daObjPicture_c::create() {
fopAcM_ct(this, daObjPicture_c);
@@ -577,6 +547,41 @@ static int daObjPicture_draw(daObjPicture_c* i_this) {
return i_this->draw();
}
+/* 80CAF110-80CAF15C 000028 004C+00 1/1 0/0 0/0 .data s_CcDCps__14daObjPicture_c */
+#if DEBUG
+const
+#endif
+dCcD_SrcCps daObjPicture_c::s_CcDCps = {
+ {
+ {0x0, {{0x0, 0x0, 0x0}, {0x20A0, 0x11}, 0x0}}, // mObj
+ {dCcD_SE_SWORD, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
+ {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x4}, // mGObjTg
+ {0x0}, // mGObjCo
+ }, // mObjInf
+ {
+ {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 14.0f}, // mCps
+ } // mCpsAttr
+};
+
+/* 80CAF15C-80CAF1A0 000074 0044+00 1/1 0/0 0/0 .data s_CcDCyl_pic_at__14daObjPicture_c
+ */
+#if DEBUG
+const
+#endif
+dCcD_SrcCyl daObjPicture_c::s_CcDCyl_pic_at = {
+ {
+ {0x0, {{0x400, 0x1, 0x11}, {0x0, 0x11}, 0x79}}, // mObj
+ {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
+ {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg
+ {0x0}, // mGObjCo
+ }, // mObjInf
+ {
+ {0.0f, 0.0f, 0.0f}, // mCenter
+ 0.0f, // mRadius
+ 0.0f // mHeight
+ } // mCyl
+};
+
/* 80CAF1A0-80CAF1C0 -00001 0020+00 1/0 0/0 0/0 .data daObjPicture_METHODS */
static actor_method_class daObjPicture_METHODS = {
(process_method_func)daObjPicture_create,
diff --git a/src/d/actor/d_a_obj_web0.cpp b/src/d/actor/d_a_obj_web0.cpp
index 8a553ad4c9..a3dfc53ca1 100644
--- a/src/d/actor/d_a_obj_web0.cpp
+++ b/src/d/actor/d_a_obj_web0.cpp
@@ -74,9 +74,8 @@ static void damage_check(obj_web0_class* i_this) {
/* 80D34794-80D34B24 000354 0390+00 2/1 0/0 0/0 .text daObj_Web0_Execute__FP14obj_web0_class */
// NONMATCHING - reg alloc
static int daObj_Web0_Execute(obj_web0_class* i_this) {
- u32 sp0C;
- s16 sp08;
- fopAc_ac_c* player = dComIfGp_getPlayer(0);
+ fopAc_ac_c* base_p = i_this;
+ fopAc_ac_c* player = (fopAc_ac_c*) dComIfGp_getPlayer(0);
i_this->field_0x57c++;
@@ -92,21 +91,21 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) {
if (i_this->mDeleteTimer != 0) {
if (i_this->mDeleteTimer == 1) {
- cXyz sp20(i_this->scale);
+ cXyz sp20(base_p->scale);
sp20.z = 1.0f;
- dComIfGp_particle_set(0x840C, &i_this->current.pos, &i_this->shape_angle, &sp20);
+ dComIfGp_particle_set(0x840C, &base_p->current.pos, &base_p->shape_angle, &sp20);
i_this->mpBrk->setPlaySpeed(1.0f);
} else if (i_this->mDeleteTimer == 41) {
i_this->mpBrk->setPlaySpeed(1.0f);
}
- fopAcM_seStartLevel(i_this, Z2SE_OBJ_WEB_BURN, 0);
+ fopAcM_seStartLevel(base_p, Z2SE_OBJ_WEB_BURN, 0);
if (i_this->mDeleteTimer == 40 || i_this->mDeleteTimer == 80) {
- sp0C = (fopAcM_GetParam(i_this) & 0xff000000) >> 24;
- dComIfGs_onSwitch(sp0C, fopAcM_GetRoomNo(i_this));
- fopAcM_delete(i_this);
+ u32 sp0C = (fopAcM_GetParam(base_p) & 0xff000000) >> 24;
+ dComIfGs_onSwitch(sp0C, fopAcM_GetRoomNo(base_p));
+ fopAcM_delete(base_p);
}
i_this->mDeleteTimer++;
@@ -114,10 +113,10 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) {
damage_check(i_this);
}
- mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z);
- mDoMtx_stack_c::YrotM((s16)i_this->shape_angle.y);
- mDoMtx_stack_c::ZrotM((s16)i_this->shape_angle.z);
- mDoMtx_stack_c::scaleM(i_this->scale.x, i_this->scale.y, i_this->scale.z);
+ mDoMtx_stack_c::transS(base_p->current.pos.x, base_p->current.pos.y, base_p->current.pos.z);
+ mDoMtx_stack_c::YrotM((s16)base_p->shape_angle.y);
+ mDoMtx_stack_c::ZrotM((s16)base_p->shape_angle.z);
+ mDoMtx_stack_c::scaleM(base_p->scale.x, base_p->scale.y, base_p->scale.z);
i_this->mpBrk->play();
i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
@@ -126,11 +125,11 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) {
i_this->mReboundTimer--;
}
- i_this->scale.z =
+ base_p->scale.z =
i_this->mReboundTimer * cM_ssin(i_this->mReboundTimer * 0x1900) * (0.075f + TREG_F(0));
- s16 playerAngle = fopAcM_searchPlayerAngleY(i_this);
- sp08 = (playerAngle + 0x4000) - i_this->shape_angle.y;
+ s16 var_r28 = fopAcM_searchPlayerAngleY(base_p);
+ s16 sp08 = (var_r28 + 0x4000) - base_p->shape_angle.y;
if (sp08 < 0) {
mDoMtx_stack_c::YrotM(-0x8000);
}
@@ -138,14 +137,14 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) {
i_this->mpBgW->Move();
- cXyz sp14(i_this->current.pos);
+ cXyz sp14(base_p->current.pos);
if (i_this->field_0x57c & 1) {
- sp14.y -= i_this->scale.x * 70.0f;
+ sp14.y -= base_p->scale.x * 70.0f;
}
- s16 var_r28 = i_this->shape_angle.y;
+ var_r28 = base_p->shape_angle.y;
if (sp08 < 0) {
- var_r28 += -0x8000;
+ var_r28 += (s16) -0x8000;
}
var_r28 -= player->shape_angle.y;
@@ -154,7 +153,7 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) {
}
i_this->mSphCc.SetC(sp14);
- i_this->mSphCc.SetR((150.0f + TREG_F(2)) * i_this->scale.x);
+ i_this->mSphCc.SetR((150.0f + TREG_F(2)) * base_p->scale.x);
dComIfG_Ccsp()->Set(&i_this->mSphCc);
return 1;