summaryrefslogtreecommitdiff
path: root/src/d
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-01-15 01:47:29 -0500
committerGitHub <noreply@github.com>2025-01-14 22:47:29 -0800
commit2189777abfd60d8c1b9afbcc63f7c6e007f6e37e (patch)
tree4495321c2fbccbdada04483a9338e13ca18bf374 /src/d
parent36daa2588496eb4d84220274c82ea85b0723619f (diff)
Fix various issues in TUs marked `Equivalent` (#2286)
Diffstat (limited to 'src/d')
-rw-r--r--src/d/actor/d_a_b_yo.cpp2
-rw-r--r--src/d/actor/d_a_do.cpp16
-rw-r--r--src/d/actor/d_a_door_mbossL1.cpp10
-rw-r--r--src/d/actor/d_a_obj_cb.cpp5
-rw-r--r--src/d/actor/d_a_obj_gra_rock.cpp6
-rw-r--r--src/d/actor/d_a_obj_stone.cpp2
-rw-r--r--src/d/d_menu_save.cpp5
-rw-r--r--src/d/d_select_cursor.cpp12
8 files changed, 35 insertions, 23 deletions
diff --git a/src/d/actor/d_a_b_yo.cpp b/src/d/actor/d_a_b_yo.cpp
index f0a93f3919..1b6b5c611c 100644
--- a/src/d/actor/d_a_b_yo.cpp
+++ b/src/d/actor/d_a_b_yo.cpp
@@ -1014,7 +1014,7 @@ void daB_YO_c::executeOpening() {
}
break;
- case 14:
+ case 15:
cam_pos.set(51.0f, 207.0f, -2082.0f);
cLib_chasePos(&mCamCenter, cam_pos, mCamCenterSpeed);
cam_pos.set(51.0f, 207.0f, -1562.0f);
diff --git a/src/d/actor/d_a_do.cpp b/src/d/actor/d_a_do.cpp
index 5343bb0c78..297e218aa1 100644
--- a/src/d/actor/d_a_do.cpp
+++ b/src/d/actor/d_a_do.cpp
@@ -558,7 +558,7 @@ static void do_walk(do_class* i_this) {
i_this->mTailWagTarget = 1000.0f;
switch (i_this->mMode) {
- case 11:
+ case -1:
i_this->mTargetPos = i_this->home.pos;
if (i_this->speedF >= l_HIO.mRunSpeed) {
i_this->mAnmSpeed = 4.0f;
@@ -571,7 +571,7 @@ static void do_walk(do_class* i_this) {
i_this->mMode = 3;
break;
- case -1:
+ case 0:
if (i_this->field_0x5f4 == 8) {
anm_init(i_this, ANM_SIT, 5.0f, 0, 1.0f);
} else {
@@ -581,13 +581,13 @@ static void do_walk(do_class* i_this) {
i_this->mMode++;
break;
- case 0:
+ case 1:
if (i_this->mpMorf->isStop()) {
i_this->mMode++;
}
break;
- case 1:
+ case 2:
local_5c.x = 0.0f;
local_5c.y = 20.0f;
@@ -611,7 +611,7 @@ static void do_walk(do_class* i_this) {
anm_init(i_this, ANM_WALK, 5.0f, 2, i_this->mAnmSpeed);
i_this->mMode++;
- case 2:
+ case 3:
local_5c = i_this->mTargetPos - i_this->current.pos;
cLib_addCalcAngleS2(&i_this->current.angle.y, (s16)cM_atan2s(local_5c.x, local_5c.z), 0x10,
@@ -633,7 +633,7 @@ static void do_walk(do_class* i_this) {
break;
- case 3:
+ case 4:
cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f);
if (i_this->mTimer[0] == 0) {
@@ -642,7 +642,7 @@ static void do_walk(do_class* i_this) {
break;
- case 9:
+ case 10:
cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f);
cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 4, 0x400);
@@ -664,7 +664,7 @@ static void do_walk(do_class* i_this) {
break;
- case 10:
+ case 11:
i_this->field_0x616 = 1;
i_this->mTailWagTarget = 3000.0f;
if (i_this->mTimer[0] == 0) {
diff --git a/src/d/actor/d_a_door_mbossL1.cpp b/src/d/actor/d_a_door_mbossL1.cpp
index ab7cf52675..1344e3b2eb 100644
--- a/src/d/actor/d_a_door_mbossL1.cpp
+++ b/src/d/actor/d_a_door_mbossL1.cpp
@@ -254,10 +254,10 @@ char* daMBdoorL1_c::getArcName() {
case 5:
case 11:
return "L5MBdoor";
+ case 8:
+ return "L8MBdoor";
case 7:
case 10:
- return "L8MBdoor";
- case 8:
return "L7MBdoor";
}
}
@@ -714,7 +714,7 @@ void daMBdoorL1_c::demoProc() {
case 20:
openInitKnob(3);
break;
- case 21:
+ case 22:
if (field_0x5df == 0) {
shape_angle.y += 0x7fff;
}
@@ -736,7 +736,7 @@ void daMBdoorL1_c::demoProc() {
}
}
break;
- case 22:
+ case 21:
if (field_0x5df == 0) {
shape_angle.y += 0x7fff;
}
@@ -960,7 +960,6 @@ void daMBdoorL1_c::demoProc() {
}
/* 80674AF4-80674DA4 002334 02B0+00 1/1 0/0 0/0 .text openInit__12daMBdoorL1_cFv */
-// NONMATCHING regalloc
int daMBdoorL1_c::openInit() {
static u16 const l_eff_id[2] = {0x8295, 0x8296};
static u16 const l_eff_id_lv3[5] = {0x8762, 0x8763, 0x8764, 0x8765, 0x8766};
@@ -1551,7 +1550,6 @@ int daMBdoorL1_c::checkMBossRoom() {
}
/* 806769D0-80676AB4 004210 00E4+00 1/1 0/0 0/0 .text checkStopClose__12daMBdoorL1_cFv */
-// NONMATCHING regalloc
int daMBdoorL1_c::checkStopClose() {
u8 FRoomNo = door_param2_c::getFRoomNo(this);
door_param2_c::getFRoomNo(this);
diff --git a/src/d/actor/d_a_obj_cb.cpp b/src/d/actor/d_a_obj_cb.cpp
index cc0b52656b..5b54888ba0 100644
--- a/src/d/actor/d_a_obj_cb.cpp
+++ b/src/d/actor/d_a_obj_cb.cpp
@@ -29,9 +29,8 @@ static void ride_call_back(dBgW* param_0, fopAc_ac_c* i_this, fopAc_ac_c* param_
}
/* 80BC4BB4-80BC51B8 000174 0604+00 1/1 0/0 0/0 .text action__FP12obj_cb_class */
-// NONMATCHING - i_this regalloc. Assigning i_this to a variable with a conversion
-// fixes the regalloc but the assignment is in wrong place
static void action(obj_cb_class* i_this) {
+ fopAc_ac_c* a_this = i_this;
cXyz local_60;
int local_78 = 0;
switch(i_this->field_0x596) {
@@ -113,7 +112,7 @@ static void action(obj_cb_class* i_this) {
// !@bug field_0x594 is never initialized
i_this->field_0x594++;
if (i_this->field_0x594 > 150) {
- fopAcM_delete(i_this);
+ fopAcM_delete(a_this);
}
}
cLib_addCalc0(&i_this->field_0x5a8, 1.0f, 5.0f);
diff --git a/src/d/actor/d_a_obj_gra_rock.cpp b/src/d/actor/d_a_obj_gra_rock.cpp
index 12d56a97d8..d18bfa3682 100644
--- a/src/d/actor/d_a_obj_gra_rock.cpp
+++ b/src/d/actor/d_a_obj_gra_rock.cpp
@@ -7,6 +7,12 @@
#include "d/actor/d_a_npc.h"
#include "d/d_bg_w.h"
+static void dummy() {
+ // fakematch to fix weak function order
+ cLib_calcTimer<u8>(0);
+ cLib_calcTimer<s16>(0);
+}
+
/* 80C123BC-80C12400 000000 0044+00 3/3 0/0 0/0 .rodata mCcDCyl__14daObjGraRock_c */
dCcD_SrcCyl const daObjGraRock_c::mCcDCyl = {
{
diff --git a/src/d/actor/d_a_obj_stone.cpp b/src/d/actor/d_a_obj_stone.cpp
index 1ee80e8757..8f09ae5c0a 100644
--- a/src/d/actor/d_a_obj_stone.cpp
+++ b/src/d/actor/d_a_obj_stone.cpp
@@ -317,7 +317,7 @@ void daObjStone_c::mode_proc_call() {
&daObjStone_c::modeDrop,
&daObjStone_c::modeCarry,
&daObjStone_c::modePutWait,
- &daObjStone_c::modeWait,
+ &daObjStone_c::modeWalk,
&daObjStone_c::modeBreak,
&daObjStone_c::modeYogan,
};
diff --git a/src/d/d_menu_save.cpp b/src/d/d_menu_save.cpp
index c6965a7248..41ed7db973 100644
--- a/src/d/d_menu_save.cpp
+++ b/src/d/d_menu_save.cpp
@@ -358,8 +358,9 @@ void dMenu_save_c::screenSet() {
mSelIcon = new dSelect_cursor_c(0, 1.0f, NULL);
mSelIcon->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
- Vec* pos = &mpSelData[mSelectedFile]->getGlobalVtxCenter(false, 0);
- mSelIcon->setPos(pos->x, pos->y, mpSelData[mSelectedFile]->getPanePtr(), true);
+ Vec pos;
+ pos = mpSelData[mSelectedFile]->getGlobalVtxCenter(false, 0);
+ mSelIcon->setPos(pos.x, pos.y, mpSelData[mSelectedFile]->getPanePtr(), true);
mSelIcon->setAlphaRate(0.0f);
J2DPane* pane = mSaveSel.Scr->search('Nm_02');
diff --git a/src/d/d_select_cursor.cpp b/src/d/d_select_cursor.cpp
index 30db6c75f8..3bfdb5257f 100644
--- a/src/d/d_select_cursor.cpp
+++ b/src/d/d_select_cursor.cpp
@@ -3,6 +3,8 @@
// Translation Unit: d/d_select_cursor
//
+#define NO_INLINE_DLSTBASE_DRAW
+
#include "d/d_select_cursor.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "d/d_com_inf_game.h"
@@ -57,7 +59,7 @@ dSelect_cursor_c::dSelect_cursor_c(u8 param_0, f32 param_1, JKRArchive* param_2)
"",
};
- static char* btk2_name[4 + 12 /* padding */] = {
+ static char* btk2_name[4] = {
"",
"zelda_store_select_icon_02.btk",
"",
@@ -206,6 +208,13 @@ dSelect_cursor_c::dSelect_cursor_c(u8 param_0, f32 param_1, JKRArchive* param_2)
mPositionX = 0.0f;
}
+static void dummy() {
+ // Need 0x30 bytes of padding with no symbol between btk2_name$3688 and dSelect_cursor_c::__vtable
+ // This is likely caused by the vtables of abstract base classes getting put there and then stripped out.
+ // Not sure which abstract base classes could go there though.
+ static u8 padding_fakematch[0x30] = {};
+}
+
/* 801949EC-80194C30 18F32C 0244+00 1/0 0/0 0/0 .text __dt__16dSelect_cursor_cFv */
dSelect_cursor_c::~dSelect_cursor_c() {
@@ -254,7 +263,6 @@ dSelect_cursor_c::~dSelect_cursor_c() {
}
/* 80194C30-80194CC0 18F570 0090+00 1/0 0/0 0/0 .text draw__16dSelect_cursor_cFv */
-// NONMATCHING
void dSelect_cursor_c::draw() {
mpPaneMgr->getAlphaRate();
update();