Fix various issues in TUs marked Equivalent (#2286)

This commit is contained in:
LagoLunatic
2025-01-15 01:47:29 -05:00
committed by GitHub
parent 36daa25884
commit 2189777abf
20 changed files with 88 additions and 71 deletions
+1 -2
View File
@@ -55,7 +55,6 @@ void JUTXfb::common_init(int bufNum) {
/* 802E5260-802E5308 2DFBA0 00A8+00 1/1 0/0 0/0 .text
* __ct__6JUTXfbFPC16_GXRenderModeObjP7JKRHeapQ26JUTXfb10EXfbNumber */
// NONMATCHING - regswap, equivalent
JUTXfb::JUTXfb(GXRenderModeObj const* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber xfbNum) {
common_init(xfbNum);
@@ -63,7 +62,7 @@ JUTXfb::JUTXfb(GXRenderModeObj const* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber x
initiate(pObj->fb_width, pObj->xfb_height, pHeap, xfbNum);
} else {
u16 fb_width = JUTVideo::getManager()->getRenderMode()->fb_width;
u16 efb_height = JUTVideo::getManager()->getRenderMode()->efb_height;
u16 efb_height = (u32)JUTVideo::getManager()->getRenderMode()->efb_height;
u16 xfb_height = JUTVideo::getManager()->getRenderMode()->xfb_height;
f32 scale_factor = GXGetYScaleFactor(efb_height, xfb_height);
u16 xfb_lines = GXGetNumXfbLines(efb_height, scale_factor);
+5 -3
View File
@@ -10,11 +10,13 @@
/* ############################################################################################## */
/* 80450C98-80450C9C -00001 0004+00 0/0 0/0 50/50 .sbss None */
extern u8 struct_80450C98[4];
u8 struct_80450C98[4];
u8 cDmr_SkipInfo;
u8 data_80450C99;
u8 data_80450C9A;
u8 data_80450C9B;
/* 80450C9C-80450CA0 -00001 0004+00 0/0 0/0 6/6 .sbss None */
u8 cDmr_SkipInfo;
u8 data_80450C9C;
u8 data_80450C9D;
u8 data_80450C9E;
u8 data_80450C9F;
+1 -1
View File
@@ -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);
+8 -8
View File
@@ -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) {
+4 -6
View File
@@ -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);
+2 -3
View File
@@ -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);
+6
View File
@@ -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 = {
{
+1 -1
View File
@@ -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,
};
+3 -2
View File
@@ -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');
+10 -2
View File
@@ -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();
+2 -2
View File
@@ -353,7 +353,7 @@ static u32 __GXGetNumXfbLines(u32 height, u32 scale) {
}
/* 8035CCDC-8035CD6C 35761C 0090+00 0/0 2/2 0/0 .text GXGetNumXfbLines */
u16 GXGetNumXfbLines(const u16 efbHeight, f32 yScale) {
u16 GXGetNumXfbLines(u16 efbHeight, f32 yScale) {
u32 scale = (u32)(256.0f / yScale) & 0x1FF;
return __GXGetNumXfbLines(efbHeight, scale);
@@ -650,4 +650,4 @@ void GXClearBoundingBox(void) {
GXWGFifo.u8 = GX_LOAD_BP_REG;
GXWGFifo.u32 = 0x560003FF;
set_x2(GX_FALSE);
}
}