Fix relocation and data value mismatches

This commit is contained in:
LagoLunatic
2025-04-24 14:53:58 -04:00
parent ce8d17ec08
commit fa7d4d2896
11 changed files with 27 additions and 25 deletions
+3 -1
View File
@@ -573,7 +573,9 @@ public:
void setModel(J3DModel*) {}
void update() {}
void draw();
void draw() {
/* Nonmatching */
}
void setMaterial();
};
+1 -1
View File
@@ -1074,7 +1074,7 @@ void JAIZelBasic::changeSeaBgm() {
switch (r3) {
case 4:
field_0x0094 = 0.0f;
field_0x0094 = 1.0f;
bgmStart(checkSeaBgmID(), 0x5A, 1);
break;
case 1:
+4 -4
View File
@@ -83,7 +83,7 @@ void JPADrawExecGenPrjTexMtx::exec(const JPADrawContext* pDC) {
f32 transY = tick * pDC->pbsp->getTexScrollTransY() + pDC->pbsp->getTexStaticTransY();
f32 scaleX = tick * pDC->pbsp->getTexScrollScaleX() + pDC->pbsp->getTexStaticScaleX();
f32 scaleY = tick * pDC->pbsp->getTexScrollScaleY() + pDC->pbsp->getTexStaticScaleY();
s32 angle = DEG_TO_RAD(tick * pDC->pbsp->getTexScrollRotate());
s32 angle = 0x8000 * (tick * pDC->pbsp->getTexScrollRotate());
f32 sin = JMASSin(angle);
f32 cos = JMASCos(angle);
@@ -131,7 +131,7 @@ void JPADrawExecSetTexMtx::exec(const JPADrawContext* pDC) {
f32 transY = tick * pDC->pbsp->getTexScrollTransY() + pDC->pbsp->getTexStaticTransY();
f32 scaleX = tick * pDC->pbsp->getTexScrollScaleX() + pDC->pbsp->getTexStaticScaleX();
f32 scaleY = tick * pDC->pbsp->getTexScrollScaleY() + pDC->pbsp->getTexStaticScaleY();
s32 angle = DEG_TO_RAD(tick * pDC->pbsp->getTexScrollRotate());
s32 angle = 0x8000 * (tick * pDC->pbsp->getTexScrollRotate());
f32 sin = JMASSin(angle);
f32 cos = JMASCos(angle);
@@ -248,7 +248,7 @@ void JPADrawExecSetTexMtx::exec(const JPADrawContext* pDC, JPABaseParticle* ptcl
f32 transY = tick * pDC->pbsp->getTexScrollTransY() + pDC->pbsp->getTexStaticTransY();
f32 scaleX = tick * pDC->pbsp->getTexScrollScaleX() + pDC->pbsp->getTexStaticScaleX();
f32 scaleY = tick * pDC->pbsp->getTexScrollScaleY() + pDC->pbsp->getTexStaticScaleY();
s32 angle = DEG_TO_RAD(tick * pDC->pbsp->getTexScrollRotate());
s32 angle = 0x8000 * (tick * pDC->pbsp->getTexScrollRotate());
f32 sin = JMASSin(angle);
f32 cos = JMASCos(angle);
@@ -441,7 +441,7 @@ void rotTypeZ(f32 sin, f32 cos, Mtx& out) {
/* 80261568-802615C4 .text rotTypeXYZ__FffRA3_A4_f */
void rotTypeXYZ(f32 sin, f32 cos, Mtx& out) {
f32 a, b, c;
a = (1.0f - cos) * (1.0f / 3.0f);
a = (1.0f - cos) * 0.333333f;
c = a + (0.57735f * sin);
b = a - (0.57735f * sin);
a = a + cos;
+2 -2
View File
@@ -69,8 +69,8 @@ void daDemo00_c::setBaseMtx() {
void daDemo00_c::setShadowSize() {
J3DModelData* modelData = model.model->getModelData();
cXyz min(1000000000.0f, 1000000000.0f, 1000000000.0f);
cXyz max(-1000000000.0f, -1000000000.0f, -1000000000.0f);
cXyz min(100000000.0f, 100000000.0f, 100000000.0f);
cXyz max(-100000000.0f, -100000000.0f, -100000000.0f);
for (u16 i = 0; i < modelData->getJointNum(); i++) {
J3DJoint* joint = modelData->getJointNodePointer(i);
+2 -2
View File
@@ -35,7 +35,7 @@ BOOL daPy_lk_c::fanJointCB(int param_0) {
}
mDoMtx_stack_c::revConcat(mpEquipItemModel->getAnmMtx(param_0));
mpEquipItemModel->setAnmMtx(1 * param_0, mDoMtx_stack_c::get());
mDoMtx_stack_c::copy(j3dSys.mCurrentMtx);
mDoMtx_copy(mDoMtx_stack_c::get(), j3dSys.mCurrentMtx);
return true;
}
@@ -62,7 +62,7 @@ BOOL daPy_lk_c::parachuteJointCB(int param_0) {
}
mDoMtx_stack_c::revConcat(mpEquipItemModel->getAnmMtx(param_0));
mpEquipItemModel->setAnmMtx(1 * param_0, mDoMtx_stack_c::get());
mDoMtx_stack_c::copy(j3dSys.mCurrentMtx);
mDoMtx_copy(mDoMtx_stack_c::get(), j3dSys.mCurrentMtx);
return true;
}
+3 -3
View File
@@ -55,11 +55,11 @@ static BOOL daPW_Draw(pw_class*) {
void anm_init(pw_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f32 speed, int soundFileIdx) {
i_this->mBckIdx = bckFileIdx;
if (soundFileIdx >= 0) {
void* soundAnm = dComIfG_getObjectRes("AM", soundFileIdx);
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("AM", bckFileIdx);
void* soundAnm = dComIfG_getObjectRes("PW", soundFileIdx);
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("PW", bckFileIdx);
i_this->mpMorf->setAnm(bckAnm, loopMode, morf, speed, 0.0f, -1.0f, soundAnm);
} else {
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("AM", bckFileIdx);
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("PW", bckFileIdx);
i_this->mpMorf->setAnm(bckAnm, loopMode, morf, speed, 0.0f, -1.0f, NULL);
}
}
+2 -3
View File
@@ -15,8 +15,7 @@ f32 dCamMath::rationalBezierRatio(f32 x, f32 y) {
/* 800AF4F4-800AF544 .text customRBRatio__8dCamMathFff */
f32 dCamMath::customRBRatio(f32 x, f32 y) {
/* Nonmatching */
if (x > 0.7071068f) {
if (x > 0.70710677f) {
if (x < 0.0f) {
return -1.0f;
} else {
@@ -24,7 +23,7 @@ f32 dCamMath::customRBRatio(f32 x, f32 y) {
}
}
return rationalBezierRatio(x * 1.414214f, y);
return rationalBezierRatio(x * 1.4142135f, y);
}
/* 800AF544-800AF5A0 .text zoomFovy__8dCamMathFff */
+4 -4
View File
@@ -559,7 +559,7 @@ void dKyr_sun_move() {
pSunPkt->field_0x3c--;
pSunPkt->field_0x3d = false;
if (dKy_getEnvlight().mCurTime > 95.7f && dKy_getEnvlight().mCurTime < 292.5f) {
if (dKy_getEnvlight().mCurTime > 97.5f && dKy_getEnvlight().mCurTime < 292.5f) {
f32 borderY = 0.0f;
s32 numPointsCulled = 0;
@@ -658,9 +658,9 @@ void dKyr_sun_move() {
cLib_addCalc(&pSunPkt->mVisibility, 1.0f, 0.5f, 0.2f, 0.01f);
} else {
if (numPointsVisible < 3)
cLib_addCalc(&pSunPkt->mVisibility, 0.0f, 0.5f, 0.2f, 0.01f);
cLib_addCalc(&pSunPkt->mVisibility, 0.0f, 0.5f, 0.2f, 0.001f);
else
cLib_addCalc(&pSunPkt->mVisibility, 1.0f, 0.1f, 0.1f, 0.01f);
cLib_addCalc(&pSunPkt->mVisibility, 1.0f, 0.1f, 0.1f, 0.001f);
}
if (numPointsVisible >= 2) {
@@ -2361,7 +2361,7 @@ void drawCloudShadow(Mtx drawMtx, u8** pImg) {
for (s32 i = 0; i < pPkt->mCount; i++) {
f32 size = pPkt->mEff[i].mSize;
if (pPkt->mEff[i].mAlpha <= 0.0f)
if (pPkt->mEff[i].mAlpha <= 0.000001f)
continue;
GXLoadTexObj(&texObj, GX_TEXMAP0);
+3 -3
View File
@@ -261,7 +261,7 @@ void dScnOpen_proc_c::proc_execute() {
mAlpha = 0.0f;
mState = 23;
case 23:
mPosX -= 0.4748201f;
mPosX -= 0.47482014f;
mAlpha += 0.067f;
if (mAlpha >= 1.0f) {
mAlpha = 1.0f;
@@ -277,7 +277,7 @@ void dScnOpen_proc_c::proc_execute() {
fopMsgM_setNowAlpha(&pane[4], 1.0f);
mState = 25;
case 25:
mPosX -= 0.4748201f;
mPosX -= 0.47482014f;
if (m_message->field_0x22e8 != 0)
mState = 26;
fopMsgM_paneTrans(&pane[3], mPosX, 0.0f);
@@ -289,7 +289,7 @@ void dScnOpen_proc_c::proc_execute() {
mAlpha = 0.0f;
mState = 27;
case 27:
mPosX -= 0.4748201f;
mPosX -= 0.47482014f;
mAlpha += 0.0223f;
if (mAlpha >= 1.0f) {
mAlpha = 1.0f;
+1
View File
@@ -4,6 +4,7 @@
#include "dolphin/os/__start.h"
void DBInit();
static void __init_registers(void);
SECTION_INIT void __check_pad3(void) {
if ((*(u16*)0x800030E4 & 0xEEF) == 0xEEF) {
+2 -2
View File
@@ -1667,8 +1667,8 @@ void fopMsgM_arrowAnime(J2DPicture* param_1, s16* param_2) {
black.a = 0x0;
u8 alpha = 0;
static GXColor color1 = {0xFF, 0x50, 0x50, 0x00};
static GXColor color2 = {0xFF, 0x96, 0x96, 0x00};
static const GXColor color1 = {0xFF, 0x50, 0x50, 0x00};
static const GXColor color2 = {0xFF, 0x96, 0x96, 0x00};
if(*param_2 < 0x16) {
float temp = fopMsgM_valueIncrease(0x16, *param_2, 2);