Misc matches and fixes (#2703)

* Match mDoExt_morf_c::getPlayMode

* Misc cleanup

* Fix actor cull spheres

* Match daPy_py_c::getLastSceneSwordAtUpTime, JUTGamePad::testTrigger

* Fix improper demangling of dBgS_SphChk::SetCallback

* Fix d_camera rangef weak func order

* Match more alink_wolf funcs
This commit is contained in:
LagoLunatic
2025-09-26 21:50:46 -04:00
committed by GitHub
parent 30fafe135d
commit 6242aa6e84
36 changed files with 176 additions and 130 deletions
@@ -11,6 +11,7 @@ inline f32 J3DCalcZValue(register MtxP m, register Vec v) {
register f32 temp_f2;
register f32 temp_f1 = 1.0f;
#ifdef __MWERKS__
// clang-format off
asm {
psq_l temp_f0, 0(v), 0, 0 /* qr0 */
@@ -23,6 +24,7 @@ inline f32 J3DCalcZValue(register MtxP m, register Vec v) {
ps_sum0 out, out, out, out
}
// clang-format on
#endif
return out;
}
+2 -2
View File
@@ -241,8 +241,8 @@ struct TLinkList_factory : public TLinkList<T, I> {
}
}
TLinkList<T, I>::iterator Erase_destroy(T* param_0) {
TLinkList<T, I>::iterator spC(Erase(param_0));
typename TLinkList<T, I>::iterator Erase_destroy(T* param_0) {
typename TLinkList<T, I>::iterator spC(Erase(param_0));
Do_destroy(param_0);
return spC;
}
+1 -1
View File
@@ -38,7 +38,7 @@ struct JPABaseShapeData {
/* 0x2E */ u8 mAnmRndm;
/* 0x2F */ u8 mClrAnmRndmMask;
/* 0x30 */ u8 mTexAnmRndmMask;
};
}; // Size: 0x34
/**
* @ingroup jsystem-jparticle
+1 -1
View File
@@ -34,7 +34,7 @@ struct JPAChildShapeData {
/* 0x44 */ u8 mStep;
/* 0x45 */ u8 mTexIdx;
/* 0x46 */ s16 mRotSpeed;
};
}; // Size: 0x48
/**
* @ingroup jsystem-jparticle
+1 -2
View File
@@ -41,8 +41,7 @@ struct JPADynamicsBlockData {
/* 0x74 */ u16 mVolumeSize;
/* 0x76 */ u16 mDivNumber;
/* 0x78 */ u8 mRateStep;
/* 0x7C */ u32 field_0x7c;
};
}; // Size: 0x7C
typedef void (*JPADynamicsCalcVolumeFunc)(JPAEmitterWorkData*);
+1 -1
View File
@@ -19,7 +19,7 @@ struct JPAExTexShapeData {
/* 0x24 */ s8 mExpScale;
/* 0x25 */ s8 mIndTexIdx;
/* 0x26 */ s8 mSecTexIdx;
};
}; // Size: 0x28
/**
* @ingroup jsystem-jparticle
+1 -1
View File
@@ -38,7 +38,7 @@ struct JPAExtraShapeData {
/* 0x54 */ f32 mRotateSpeed;
/* 0x58 */ f32 mRotateSpeedRandom;
/* 0x5C */ f32 mRotateDirection;
};
}; // Size: 0x60
/**
* @ingroup jsystem-jparticle
+1 -1
View File
@@ -100,7 +100,7 @@ public:
JUTGamePadRecordBase* getPadReplay() const { return mPadReplay; }
JUTGamePadRecordBase* getPadRecord() const { return mPadRecord; }
u32 testTrigger(u32 button) const { return mButton.mTrigger & button; }
bool testTrigger(u32 button) const { return mButton.mTrigger & button; }
bool isPushing3ButtonReset() const {
return mPortNum != EPortInvalid && mButtonReset.mReset != false;
+1 -1
View File
@@ -1131,7 +1131,7 @@ public:
static bool checkWolfCargoCarrySceneChange() { return getLastSceneMode() == 10; }
static int getLastSceneDamage() { return (dComIfGs_getLastSceneMode() >> 4) & 0x7F; }
static u8 getLastSceneSwordAtUpTime() { return (dComIfGs_getLastSceneMode() >> 11) & 0xFF; }
static u32 getLastSceneSwordAtUpTime() { return (dComIfGs_getLastSceneMode() >> 11) & 0xFF; }
static BOOL checkNormalSwordEquip() { return dComIfGs_getSelectEquipSword() == fpcNm_ITEM_SWORD; }
+1 -1
View File
@@ -8,7 +8,7 @@
struct cBgD_Vtx_t;
class dBgS_SphChk;
typedef void* (*SphChk_Callback)(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*);
typedef void (*SphChk_Callback)(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*);
class dBgS_SphChk : public cM3dGSph, public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk {
public:
+1
View File
@@ -3,6 +3,7 @@
#include <dolphin/gx/GXEnum.h>
#include <dolphin/gx/GXStruct.h>
#include "global.h"
#ifdef __cplusplus
extern "C" {
+1 -7
View File
@@ -76,14 +76,8 @@ enum fopAc_Cull_e {
fopAc_CULLSPHERE_5_e,
fopAc_CULLSPHERE_6_e,
fopAc_CULLSPHERE_7_e,
fopAc_CULLSPHERE_8_e,
fopAc_CULLSPHERE_9_e,
fopAc_CULLSPHERE_10_e,
fopAc_CULLSPHERE_11_e,
fopAc_CULLSPHERE_12_e,
fopAc_CULLSPHERE_13_e,
#ifdef DEBUG
fopAc_CULLSPHERE_14_e,
fopAc_CULLSPHERE_8_e,
#endif
fopAc_CULLSPHERE_CUSTOM_e,
};
+8
View File
@@ -402,6 +402,14 @@ inline int fopAcM_GetCullSize(const fopAc_ac_c* i_actor) {
return i_actor->cullType;
}
inline int fopAcM_CULLSIZE_IDX(int i_culltype) {
return i_culltype - fopAc_CULLBOX_0_e;
}
inline int fopAcM_CULLSIZE_Q_IDX(int i_culltype) {
return i_culltype - fopAc_CULLSPHERE_0_e;
}
inline BOOL fopAcM_CULLSIZE_IS_BOX(int i_culltype) {
return (i_culltype >= 0 && i_culltype < fopAc_CULLBOX_CUSTOM_e) ||
i_culltype == fopAc_CULLBOX_CUSTOM_e;
+5 -4
View File
@@ -58,11 +58,12 @@
#define STATIC_ASSERT(...)
#endif
// hack to make functions that return comparisons as int match
// Intrinsics
extern int __cntlzw(unsigned int);
inline BOOL checkEqual(s32 a, s32 b) {
return (u32)__cntlzw(a - b) >> 5;
}
extern int __rlwimi(int, int, int, int, int);
extern void __dcbz(void*, int);
extern void __sync();
extern int __abs(int);
#ifndef __MWERKS__
void* __memcpy(void*, const void*, int);
+1 -1
View File
@@ -290,7 +290,7 @@ public:
J3DAnmTransform* getAnm() { return mpAnm; }
void changeAnm(J3DAnmTransform* anm) { mpAnm = anm; }
u8 getPlayMode() { return mFrameCtrl.getAttribute(); }
int getPlayMode() { return mFrameCtrl.getAttribute(); }
void setPlayMode(int mode) { mFrameCtrl.setAttribute(mode); }
BOOL isStop() { return mFrameCtrl.checkState(1) || mFrameCtrl.getRate() == 0.0f; }
bool isLoop() { return mFrameCtrl.checkState(2); }
+1 -1
View File
@@ -1355,7 +1355,7 @@ GXBlendMode JPABaseShape::st_bm[3] = {
/* 803C436C-803C4394 02148C 0028+00 0/1 0/0 0/0 .data st_bf__12JPABaseShape */
GXBlendFactor JPABaseShape::st_bf[10] = {
GX_BL_ZERO, GX_BL_ONE, GX_BL_SRCCLR, GX_BL_INVSRCCLR,
GX_BL_SRCCLR, GX_BL_INVSRCCLR, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA,
GX_BL_DSTCLR, GX_BL_INVDSTCLR, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA,
GX_BL_DSTALPHA, GX_BL_INVDSTALPHA,
};
@@ -1,5 +1,6 @@
#include "alloc.h"
#include "critical_regions.h"
#include <string.h>
typedef struct Block {
struct Block* prev;
@@ -331,4 +332,4 @@ void free(void* ptr) {
__begin_critical_region(malloc_pool_access);
__pool_free(get_malloc_pool(), ptr);
__end_critical_region(malloc_pool_access);
}
}
@@ -2,6 +2,7 @@
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/nubevent.h"
#include "TRK_MINNOW_DOLPHIN/utils/common/MWTrace.h"
#include "trk.h"
#include <string.h>
/* 8044F288-8044F290 07BFA8 0004+04 4/4 0/0 0/0 .bss IsTRKConnected */
static BOOL IsTRKConnected;
@@ -530,4 +531,4 @@ DSError TRKDoSetOption(TRKBuffer* message) {
TRKStandardACK(message, DSMSG_ReplyACK, DS_NoError);
return 0;
}
}
@@ -1,6 +1,7 @@
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/support.h"
#include "TRK_MINNOW_DOLPHIN/utils/common/MWTrace.h"
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h"
#include <string.h>
/* 8036F278-8036F498 369BB8 0220+00 0/0 1/1 0/0 .text TRKSuppAccessFile */
DSError TRKSuppAccessFile(u32 file_handle, u8* data, size_t* count, DSIOResult* io_result,
@@ -286,4 +287,4 @@ DSError HandlePositionFileSupportRequest(DSReplyError replyErr, u32* param_2, u8
TRKReleaseBuffer(bufferId1);
return error;
}
}
@@ -1,6 +1,7 @@
#include "TRK_MINNOW_DOLPHIN/ppc/Generic/targimpl.h"
#include "TRK_MINNOW_DOLPHIN/utils/common/MWTrace.h"
#include <stdint.h>
#include <string.h>
typedef struct memRange {
u8* start;
-5
View File
@@ -22,14 +22,9 @@
#include "d/actor/d_a_mirror.h"
#include "d/actor/d_a_spinner.h"
#include "d/actor/d_a_tbox.h"
#include "d/actor/d_a_e_wb.h"
#include "d/actor/d_a_obj_carry.h"
#include "d/actor/d_a_obj_movebox.h"
#include "d/actor/d_a_obj_sekizoa.h"
#include "d/actor/d_a_tag_Lv6Gate.h"
#include "d/actor/d_a_tag_kmsg.h"
#include "d/actor/d_a_tag_magne.h"
#include "d/actor/d_a_tag_mist.h"
#include "d/actor/d_a_tag_wljump.h"
#include "d/actor/d_a_npc_tk.h"
#include "d/actor/d_a_cow.h"
+109 -69
View File
@@ -26,11 +26,48 @@
#include "d/actor/d_a_obj_digplace.h"
#include "d/actor/d_a_obj_digsnow.h"
#include "d/actor/d_a_obj_digholl.h"
#include "d/actor/d_a_obj_sekizoa.h"
#include "d/actor/d_a_midna.h"
#include "d/d_com_inf_game.h"
#include "d/d_msg_object.h"
#include "f_op/f_op_kankyo_mng.h"
#include "m_Do/m_Do_controller_pad.h"
// Forward declarations (for clangd)
int daAlink_kandelaarModelCallBack(J3DJoint* param_0, int param_1);
extern const char l_wArcName[];
extern const char l_bArcName[];
extern const char l_kArcName[];
extern const char l_zArcName[];
extern const char l_mArcName[];
extern const char l_hyShdArcName[];
extern const char l_cWShdArcName[];
extern const char l_sWShdArcName[];
extern const char l_arcName[];
extern dJntColData_c l_jntColData[];
extern dJntColData_c l_wolfJntColData[];
extern f32 l_autoUpHeight;
extern f32 l_autoDownHeight;
extern f32 const l_crawlStartFrontOffset[];
extern Vec const l_crawlFrontOffset;
extern Vec const l_crawlBackOffset;
extern Vec const l_crawlTopOffset;
extern Vec const l_crawlFrontUpOffset;
extern Vec const l_wolfLieFrontUpOffset;
extern Vec const l_crawlBackUpOffset;
extern Vec const l_wolfLieBackUpOffset;
extern Vec const l_crawlStandUpOffset;
extern Vec const l_wolfLieStandUpOffset;
extern Vec const l_crawlTopUpOffset;
extern Vec const l_wolfLieTopUpOffset;
extern Vec const l_crawlSideOffset;
extern Vec const l_wolfLieSideOffset;
extern Vec const l_crawlMinSideOffset;
extern f32 const l_wolfFootOnFrame[][4];
extern cXyz l_wolfBaseAnime;
extern cXyz l_wolfRopeBaseAnime;
/* 80126740-80126928 121080 01E8+00 2/2 0/0 0/0 .text changeCommon__9daAlink_cFv */
void daAlink_c::changeCommon() {
fopAcM_SetMtx(this, mpLinkModel->getBaseTRMtx());
@@ -108,41 +145,40 @@ void daAlink_c::changeCommon() {
}
/* 80126928-80126F3C 121268 0614+00 2/2 0/0 0/0 .text changeWolf__9daAlink_cFv */
// NONMATCHING - small regalloc, equivalent?
void daAlink_c::changeWolf() {
JKRHeap* current_heap = mAnmHeap3.setAnimeHeap();
mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 14), 0x20200);
mpLinkModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 14)), 0x20200);
J3DModelData* chainModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 15);
J3DModelData* chainModelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 15));
for (u16 i = 0; i < 4; i++) {
mpWlChainModels[i] = initModel(chainModelData, 0);
}
mpWlMidnaModel = initModelEnv((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 10), 0x1020200);
mpWlMidnaModel = initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 10)), 0x1020200);
mpWlMidnaMaskModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 7), 0x1000000);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 7)), 0x1000000);
mpWlMidnaHandModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 6), 0x1000000);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 6)), 0x1000000);
mpWlMidnaHairModel =
initModelEnv((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 11), 0x1000000);
initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 11)), 0x1000000);
mpDMidnaBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 18);
mpDMidnaBrk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes(l_wArcName, 18));
mpDMidnaBrk->searchUpdateMaterialID(mpWlMidnaModel->getModelData());
mpWlMidnaModel->getModelData()->entryTevRegAnimator(mpDMidnaBrk);
mpDMidnaBrk->setFrame(1.0f);
mpDMidnaMaskBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 21);
mpDMidnaMaskBrk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes(l_wArcName, 21));
mpDMidnaMaskBrk->searchUpdateMaterialID(mpWlMidnaMaskModel->getModelData());
mpWlMidnaMaskModel->getModelData()->entryTevRegAnimator(mpDMidnaMaskBrk);
mpDMidnaMaskBrk->setFrame(1.0f);
mpDMidnaHandBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 20);
mpDMidnaHandBrk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes(l_wArcName, 20));
mpDMidnaHandBrk->searchUpdateMaterialID(mpWlMidnaHandModel->getModelData());
mpWlMidnaHandModel->getModelData()->entryTevRegAnimator(mpDMidnaHandBrk);
mpDMidnaHandBrk->setFrame(1.0f);
mpDMidnaHairHandBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 19);
mpDMidnaHairHandBrk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes(l_wArcName, 19));
mpDMidnaHairHandBrk->searchUpdateMaterialID(mpWlMidnaHairModel->getModelData());
mpWlMidnaHairModel->getModelData()->entryTevRegAnimator(mpDMidnaHairHandBrk);
mpDMidnaHairHandBrk->setFrame(1.0f);
@@ -241,7 +277,6 @@ void daAlink_c::changeWolf() {
}
/* 80126F3C-80127C54 12187C 0D18+00 2/2 0/0 0/0 .text changeLink__9daAlink_cFi */
// NONMATCHING - almost, small regalloc
void daAlink_c::changeLink(int param_0) {
JKRHeap* current_heap = mAnmHeap3.setAnimeHeap();
offNoResetFlg2(daPy_FLG2(FLG2_UNK_100000 | FLG2_UNK_80000));
@@ -254,32 +289,32 @@ void daAlink_c::changeLink(int param_0) {
offNoResetFlg2(FLG2_UNK_200000);
onNoResetFlg2(FLG2_UNK_80000);
tempModelData_r28 = (J3DModelData*)dComIfG_getObjectRes("alSumou", 0x31);
tempModelData_r28 = static_cast<J3DModelData*>(dComIfG_getObjectRes("alSumou", 0x31));
mpLinkModel = mDoExt_J3DModel__create(tempModelData_r28,
0x80000, 0x11000084);
mpLinkHatModel = initModel((J3DModelData*)dComIfG_getObjectRes("alSumou", 0x33), 0);
mpLinkHandModel = initModel((J3DModelData*)dComIfG_getObjectRes("alSumou", 0x32), 0);
mpLinkHatModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes("alSumou", 0x33)), 0);
mpLinkHandModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes("alSumou", 0x32)), 0);
} else if (checkCasualWearFlg()) {
onNoResetFlg2(FLG2_UNK_100000);
mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl.bmd"), 0);
mpLinkModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_bArcName, "bl.bmd")), 0);
mpLinkHatModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_head.bmd"), 0);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_bArcName, "bl_head.bmd")), 0);
mpLinkHandModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_hands.bmd"), 0);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_bArcName, "bl_hands.bmd")), 0);
} else if (checkZoraWearFlg()) {
mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl.bmd"), 0);
mpLinkModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_zArcName, "zl.bmd")), 0);
mpLinkHatModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl_head.bmd"), 0);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_zArcName, "zl_head.bmd")), 0);
mpLinkHandModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_zArcName, "al_hands.bmd"), 0);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_zArcName, "al_hands.bmd")), 0);
} else if (checkMagicArmorWearFlg()) {
mpLinkModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml.bmd"), 0x1000000);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_mArcName, "ml.bmd")), 0x1000000);
mpLinkHatModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml_head.bmd"), 0x1000000);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_mArcName, "ml_head.bmd")), 0x1000000);
mpLinkHandModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_mArcName, "al_hands.bmd"), 0);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_mArcName, "al_hands.bmd")), 0);
if (dComIfGs_getRupee() != 0) {
setMagicArmorBrk(1);
@@ -290,39 +325,39 @@ void daAlink_c::changeLink(int param_0) {
mMagicArmorBodyBrk->setFrame(mMagicArmorBodyBrk->getFrameMax());
mMagicArmorHeadBrk->setFrame(mMagicArmorHeadBrk->getFrameMax());
} else {
mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al.bmd"), 0);
mpLinkModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_kArcName, "al.bmd")), 0);
mpLinkHatModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_head.bmd"), 0);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_kArcName, "al_head.bmd")), 0);
mpLinkHandModel =
initModel((J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_hands.bmd"), 0);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_kArcName, "al_hands.bmd")), 0);
}
if (checkNoResetFlg2(FLG2_UNK_200000) || !checkZoraWearFlg()) {
mpLinkFaceModel =
initModel((J3DModelData*)dComIfG_getObjectRes(mArcName, "al_face.bmd"), 0x20200);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_face.bmd")), 0x20200);
} else {
mpLinkFaceModel =
initModel((J3DModelData*)dComIfG_getObjectRes(mArcName, "zl_face.bmd"), 0x20200);
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "zl_face.bmd")), 0x20200);
}
tempModelData_r28 = (J3DModelData*)dComIfG_getObjectRes(mArcName, "al_bootsH.bmd");
tempModelData_r28 = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_bootsH.bmd"));
u16 i;
for (i = 0; i < 2; i++) {
mpLinkBootModels[i] = initModel(tempModelData_r28, 0);
}
mpKanteraModel = initModelEnv((J3DModelData*)dComIfG_getObjectRes(mArcName, "al_kantera.bmd"), 0);
mpKanteraModel = initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_kantera.bmd")), 0);
tempModelData_r28 =
(J3DModelData*)dComIfG_getObjectRes(mArcName, "ef_ktGlow.bmd");
static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.bmd"));
mpKanteraGlowModel = initModel(tempModelData_r28, 0x200);
mpKanteraGlowBtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(mArcName, "ef_ktGlow.btk");
mpKanteraGlowBtk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.btk"));
mpKanteraGlowBtk->setFrame(0.0f);
mpKanteraGlowBtk->searchUpdateMaterialID(tempModelData_r28);
tempModelData_r28->entryTexMtxAnimator(mpKanteraGlowBtk);
mWoodSwordModel = initModel((J3DModelData*)dComIfG_getObjectRes(mArcName, "al_SWB.bmd"), 0);
mWoodSwordModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_SWB.bmd")), 0);
mDoExt_setCurrentHeap(current_heap);
@@ -1922,6 +1957,8 @@ void daAlink_c::setWolfFootMatrix() {
/* 8012B724-8012BFA8 126064 0884+00 1/1 0/0 0/0 .text wolfFootBgCheck__9daAlink_cFv */
void daAlink_c::wolfFootBgCheck() {
int i;
int j;
if (field_0x2060->getOldFrameFlg()) {
cXyz spBC;
cXyz spB0;
@@ -1957,8 +1994,13 @@ void daAlink_c::wolfFootBgCheck() {
f32* sp20 = &spA0[0][0];
cXyz* var_r26 = &spC8[0];
f32 temp_f29 = 50.0f * fabsf(cM_ssin(field_0x2ff0));
f32 temp_f27 = 30.0f + temp_f29;
f32 temp_f31;
f32 temp_f30;
f32 temp_f29;
f32 var_f28;
f32 temp_f27;
temp_f29 = 50.0f * fabsf(cM_ssin(field_0x2ff0));
temp_f27 = 30.0f + temp_f29;
f32 sp1C = -temp_f27;
mDoMtx_stack_c::XrotS(-shape_angle.x);
mDoMtx_stack_c::YrotM(-shape_angle.y);
@@ -1991,15 +2033,15 @@ void daAlink_c::wolfFootBgCheck() {
spBC.set(var_r26->x, temp_f29 + (50.0f + (current.pos.y + l_autoUpHeight)), var_r26->z);
mLinkGndChk.SetPos(&spBC);
f32 temp_f1 = dComIfG_Bgsp().GroundCross(&mLinkGndChk);
f32 temp_f30 = var_r26->y - temp_f1;
temp_f31 = dComIfG_Bgsp().GroundCross(&mLinkGndChk);
temp_f30 = var_r26->y - temp_f31;
if (-1000000000.0f != temp_f1 && temp_f30 < temp_f27 && temp_f30 > sp1C) {
*sp20 = temp_f1;
if (-1000000000.0f != temp_f31 && temp_f30 < temp_f27 && temp_f30 > sp1C) {
*sp20 = temp_f31;
var_r28->field_0x0 = 1;
sp48[i][j] = getGroundAngle(&mLinkGndChk, shape_angle.y);
spBC.set(var_r26->x - current.pos.x, temp_f1 - current.pos.y, var_r26->z - current.pos.z);
spBC.set(var_r26->x - current.pos.x, temp_f31 - current.pos.y, var_r26->z - current.pos.z);
mDoMtx_stack_c::multVec(&spBC, &spB0);
*sp20 = spB0.y + current.pos.y;
} else {
@@ -2009,22 +2051,21 @@ void daAlink_c::wolfFootBgCheck() {
}
}
f32 var_f28;
if (!sp24) {
for (i = 0; i < 2; i++) {
/* if (spA0[i][1] > spA0[i][0]) {
if (spA0[i][1] > spA0[i][0]) {
sp38[i] = spA0[i][0];
sp40[i] = 0;
} else {
sp38[i] = spA0[i][1];
sp40[i] = 1;
}
}
if (sp38[0] > sp38[1]) {
var_f28 = sp38[0];
} else {
var_f28 = sp38[1];
} */
if (sp38[0] > sp38[1]) {
var_f28 = sp38[1];
} else {
var_f28 = sp38[0];
}
}
@@ -2046,13 +2087,13 @@ void daAlink_c::wolfFootBgCheck() {
sp58[i][j] = 0;
sp50[i][j] = 0;
} else {
f32 var_f30 = spA0[i][j] - sp2C[1][3];
if (var_f30 >= 35.0f) {
var_f30 = 35.0f;
temp_f30 = spA0[i][j] - sp2C[1][3];
if (temp_f30 >= 35.0f) {
temp_f30 = 35.0f;
}
if (var_f30 > 0.0f || sp30) {
if (!setLegAngle(var_f30, var_r28, &sp58[i][j], &sp50[i][j], 1)) {
if (temp_f30 > 0.0f || sp30) {
if (!setLegAngle(temp_f30, var_r28, &sp58[i][j], &sp50[i][j], 1)) {
sp58[i][j] = 0;
sp50[i][j] = 0;
}
@@ -2095,36 +2136,36 @@ void daAlink_c::wolfFootBgCheck() {
sp84.y += 165.0f;
mLinkGndChk.SetPos(&sp90);
f32 temp_f1_2 = dComIfG_Bgsp().GroundCross(&mLinkGndChk);
if (fabsf(temp_f1_2 - current.pos.y) < 55.0f + temp_f29) {
sp90.y = temp_f1_2;
temp_f31 = dComIfG_Bgsp().GroundCross(&mLinkGndChk);
if (fabsf(temp_f31 - current.pos.y) < 55.0f + temp_f29) {
sp90.y = temp_f31;
} else {
sp90.y = current.pos.y;
}
int sp18;
if (-1000000000.0f != temp_f1_2) {
if (-1000000000.0f != temp_f31) {
sp18 = dComIfG_Bgsp().GetPolyAtt0(mLinkGndChk);
}
if (-1000000000.0f == temp_f1_2 || sp18 == 3 || sp18 == 0xD) {
if (-1000000000.0f == temp_f31 || sp18 == 3 || sp18 == 0xD) {
sp90.y += mSinkShapeOffset;
}
mLinkGndChk.SetPos(&sp84);
f32 temp_f1_3 = dComIfG_Bgsp().GroundCross(&mLinkGndChk);
if (fabsf(temp_f1_3 - current.pos.y) < 55.0f + temp_f29) {
sp84.y = temp_f1_3;
temp_f31 = dComIfG_Bgsp().GroundCross(&mLinkGndChk);
if (fabsf(temp_f31 - current.pos.y) < 55.0f + temp_f29) {
sp84.y = temp_f31;
} else {
sp84.y = current.pos.y;
}
if (-1000000000.0f != temp_f1_3) {
if (-1000000000.0f != temp_f31) {
sp18 = dComIfG_Bgsp().GetPolyAtt0(mLinkGndChk);
}
if (-1000000000.0f == temp_f1_3 || sp18 == 3 || sp18 == 0xD) {
if (-1000000000.0f == temp_f31 || sp18 == 3 || sp18 == 0xD) {
sp84.y += mSinkShapeOffset;
}
@@ -4897,7 +4938,6 @@ int daAlink_c::procWolfRopeStaggerInit(int param_0) {
/* 80133164-8013384C 12DAA4 06E8+00 1/0 0/0 0/0 .text procWolfRopeStagger__9daAlink_cFv
*/
// NONMATCHING - regalloc
int daAlink_c::procWolfRopeStagger() {
daPy_frameCtrl_c* temp_r29 = &mUnderFrameCtrl[0];
daObjCrope_c* temp_r3 = (daObjCrope_c*)field_0x280c.getActor();
@@ -5009,14 +5049,13 @@ int daAlink_c::procWolfRopeSubjectivityInit() {
}
/* 80133930-80133D6C 12E270 043C+00 1/0 0/0 0/0 .text procWolfRopeSubjectivity__9daAlink_cFv */
// NONMATCHING - float regalloc
int daAlink_c::procWolfRopeSubjectivity() {
daPy_frameCtrl_c* temp_r28 = &mUnderFrameCtrl[0];
daObjCrope_c* temp_r3 = (daObjCrope_c*)field_0x280c.getActor();
cXyz* temp_r26 = temp_r3->getRopeStartPos();
cXyz* temp_r25 = temp_r3->getRopeEndPos();
temp_r3->getRopeVec();
cXyz* r23 = temp_r3->getRopeVec();
f32 temp_f31 = temp_r3->getStartRate(&current.pos);
f32 temp_f30 = temp_r26->absXZ(current.pos);
@@ -5050,7 +5089,8 @@ int daAlink_c::procWolfRopeSubjectivity() {
shape_angle.y += mBodyAngle.y;
setBodyAngleToCamera();
mBodyAngle.y = cLib_minMaxLimit<s16>((s16)(shape_angle.y - current.angle.y), -0x5000, 0x5000);
s16 r24 = cLib_minMaxLimit<s16>((s16)(shape_angle.y - current.angle.y), -0x5000, 0x5000);
mBodyAngle.y = r24;
shape_angle.y = current.angle.y;
return 1;
}
@@ -6983,8 +7023,8 @@ void daAlink_c::setWolfLockDomeModel() {
void daAlink_c::setWolfBallModel() {
JKRHeap* prev_heap = setItemHeap();
mHeldItemModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_arcName, 0x25), 0x200);
field_0x0718 = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x49);
mHeldItemModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_arcName, 0x25)), 0x200);
field_0x0718 = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(l_arcName, 0x49));
field_0x0718->searchUpdateMaterialID(mHeldItemModel->getModelData());
mpHookSound = new Z2SoundObjSimple();
+1 -1
View File
@@ -834,7 +834,7 @@ void daE_DK_c::action() {
collCenter.y += 150.0f + nREG_F(18);
mSphereChk.SetC(collCenter);
mSphereChk.SetR(150.0f + nREG_F(19));
mSphereChk.SetCallback((SphChk_Callback)SphBgcCallBack);
mSphereChk.SetCallback(SphBgcCallBack);
dComIfG_Bgsp().SphChk(&mSphereChk, this);
}
+6 -6
View File
@@ -1490,14 +1490,14 @@ J3DAnmTexPattern* daMyna_c::getTexPtrnAnm(char* i_resName) {
/* 80949998-80949A70 003E18 00D8+00 1/1 0/0 0/0 .text checkEndAnm__8daMyna_cFf */
int daMyna_c::checkEndAnm(f32 param_0) {
bool retVal;
switch (mpMorf->getPlayMode()) {
case 2:
switch ((u8)mpMorf->getPlayMode()) {
case J3DFrameCtrl::EMode_LOOP:
return mpMorf->isLoop();
case 0:
case 1:
case J3DFrameCtrl::EMode_NONE:
case J3DFrameCtrl::EMode_RESET:
return mpMorf->isStop() && mpMorf->getPlaySpeed() != param_0;
case 3:
case 4:
case J3DFrameCtrl::EMode_REVERSE:
case J3DFrameCtrl::EMode_LOOP_REVERSE:
return mpMorf->isStop() && mpMorf->getPlaySpeed() != param_0;
default:
return false;
+1 -1
View File
@@ -1438,7 +1438,7 @@ void daNpcT_c::setRoomNo() {
/* 80148D10-80148DD0 143650 00C0+00 1/1 0/0 0/0 .text checkEndAnm__8daNpcT_cFf */
int daNpcT_c::checkEndAnm(f32 i_speed) {
switch (mpMorf[0]->getPlayMode()) {
switch ((u8)mpMorf[0]->getPlayMode()) {
case J3DFrameCtrl::EMode_LOOP:
return mpMorf[0]->isLoop();
case J3DFrameCtrl::EMode_NONE:
+1 -1
View File
@@ -551,7 +551,7 @@ BOOL daBaseNpc_c::btkCtrl() {
/* 8014F148-8014F1C8 149A88 0080+00 1/1 0/0 0/0 .text checkEndAnm__11daBaseNpc_cFf */
int daBaseNpc_c::checkEndAnm(f32 param_0) {
switch (mpModelMorf->getPlayMode()) {
switch ((u8)mpModelMorf->getPlayMode()) {
case J3DFrameCtrl::EMode_LOOP:
return mpModelMorf->isLoop();
case J3DFrameCtrl::EMode_NONE:
+1 -1
View File
@@ -936,7 +936,7 @@ void daNpcF_c::setRoomNo() {
/* 80152E24-80152EC4 14D764 00A0+00 1/1 0/0 0/0 .text chkEndAnm__8daNpcF_cFf */
BOOL daNpcF_c::chkEndAnm(f32 param_0) {
switch (mpMorf->getPlayMode()) {
switch ((u8)mpMorf->getPlayMode()) {
case J3DFrameCtrl::EMode_LOOP:
return mpMorf->isLoop();
case J3DFrameCtrl::EMode_NONE:
+1 -1
View File
@@ -278,7 +278,7 @@ void daNpc_Kn_c::setRoomNo() {
/* 80A3904C-80A390F8 00E72C 00AC+00 1/1 0/0 0/0 .text checkEndAnm__10daNpc_Kn_cFf */
BOOL daNpc_Kn_c::checkEndAnm(f32 i_speed) {
switch (mpModelMorf[0]->getPlayMode()) {
switch ((u8)mpModelMorf[0]->getPlayMode()) {
case J3DFrameCtrl::EMode_LOOP:
return mpModelMorf[0]->isLoop();
case J3DFrameCtrl::EMode_RESET:
+1 -1
View File
@@ -1080,7 +1080,7 @@ int daObjCarry_c::Create() {
}
}
fopAcM_SetCullSize(this, fopAc_CULLSPHERE_8_e);
fopAcM_SetCullSize(this, fopAc_CULLSPHERE_CUSTOM_e);
fopAcM_setCullSizeSphere(this, data().m_cullsph_min_x, data().m_cullsph_min_y, data().m_cullsph_min_z, mpModel->getModelData()->getJointNodePointer(0)->getRadius() * data().scale);
cLib_onBit<u32>(attention_info.flags, fopAc_AttnFlag_CARRY_e);
+1 -1
View File
@@ -1106,7 +1106,7 @@ extern actor_process_profile_definition g_profile_Obj_Stone = {
&l_daObjStone_Method, // sub_method
0x40100, // mStatus
fopAc_ACTOR_e, // mActorType
fopAc_CULLSPHERE_8_e, // cullType
fopAc_CULLSPHERE_CUSTOM_e, // cullType
};
/* 80CECC3C-80CECC3C 000188 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
+1 -1
View File
@@ -115,5 +115,5 @@ extern actor_process_profile_definition g_profile_Obj_StoneMark = {
&l_daObjSMark_Method, // sub_method
0x40100, // mStatus
fopAc_ACTOR_e, // mActorType
fopAc_CULLSPHERE_8_e, // cullType
fopAc_CULLSPHERE_CUSTOM_e, // cullType
};
+7 -4
View File
@@ -65,9 +65,11 @@ int daTagLv6Gate_c::createHeap() {
return 0;
}
return checkEqual(
mBgW[1].Set((cBgD_t*)dComIfG_getObjectRes(l_arcName, 28), cBgW::MOVE_BG_e, &field_0x6f8[1]),
0);
if (mBgW[1].Set((cBgD_t*)dComIfG_getObjectRes(l_arcName, 28), cBgW::MOVE_BG_e, &field_0x6f8[1])) {
return 0;
}
return 1;
}
/* 80D4FBB8-80D4FBD8 000398 0020+00 1/0 0/0 0/0 .text daTagLv6Gate_Create__FP10fopAc_ac_c
@@ -151,12 +153,13 @@ inline int daTagLv6Gate_c::execute() {
dComIfGp_particle_set(0x8B89, &pos, &angle, NULL);
break;
}
case '0003':
case '0003': {
fopAcM_onSwitch(this, getSwitchNo2());
Vec se_pos = {0.0f, 1800.0f, -6800.0f};
Z2GetAudioMgr()->seStart(Z2SE_OBJ_LV6_GATE_STAIR, &se_pos, 0, 0, 1.0f, 1.0f,
-1.0f, -1.0f, 0);
break;
}
case '0004': {
cXyz pos(117.8473f, 1677.0f, -5110.8394f);
+2 -3
View File
@@ -40,7 +40,7 @@ static f32 limitf(f32 value, f32 min, f32 max) {
return value;
}
static f32 rangef(f32 value1, f32 value2, f32 ratio) {
static inline f32 rangef(f32 value1, f32 value2, f32 ratio) {
return value1 + (value2 - value1) * ratio;
}
@@ -2336,7 +2336,7 @@ u32 dCamera_c::lineCollisionCheckBush(cXyz* i_start, cXyz* i_end) {
/* 80165C08-80165CE0 160548 00D8+00 1/1 0/0 0/0 .text
* sph_chk_callback__FP11dBgS_SphChkP10cBgD_Vtx_tiiiP8cM3dGPlaPv */
static void* sph_chk_callback(dBgS_SphChk* i_sphChk, cBgD_Vtx_t* i_vtxTbl, int i_vtxIdx0,
static void sph_chk_callback(dBgS_SphChk* i_sphChk, cBgD_Vtx_t* i_vtxTbl, int i_vtxIdx0,
int i_vtxIdx1, int i_vtxIdx2, cM3dGPla* i_plane, void* i_data) {
camSphChkdata* sph_chk_data = (camSphChkdata*)i_data;
if (!sph_chk_data->field_0x1c) {
@@ -2348,7 +2348,6 @@ static void* sph_chk_callback(dBgS_SphChk* i_sphChk, cBgD_Vtx_t* i_vtxTbl, int i
sph_chk_data->field_0x1c = true;
}
}
//! @bug Function does not return a value
}
/* 80165CE0-80165E74 160620 0194+00 1/1 0/0 0/0 .text compWallMargin__9dCamera_cFP4cXyzP4cXyzf */
+1
View File
@@ -1,5 +1,6 @@
#include <dolphin/gx.h>
#include <dolphin/os.h>
#include <string.h>
#include "__gx.h"
+1
View File
@@ -2,6 +2,7 @@
#define _DOLPHIN_GX_INTERNAL_H_
#include <dolphin/gx.h>
#include "global.h" // IWYU pragma: export
#ifdef __cplusplus
extern "C" {
+6 -8
View File
@@ -757,7 +757,7 @@ s32 fopAcM_cullingCheck(fopAc_ac_c const* i_actor) {
mtx_p = j3dSys.getViewMtx();
} else {
Mtx concat_mtx;
MTXConcat(j3dSys.getViewMtx(), fopAcM_GetMtx(i_actor), concat_mtx);
cMtx_concat(j3dSys.getViewMtx(), fopAcM_GetMtx(i_actor), concat_mtx);
mtx_p = concat_mtx;
}
@@ -766,10 +766,8 @@ s32 fopAcM_cullingCheck(fopAc_ac_c const* i_actor) {
cullsize_far *= dComIfGp_event_getCullRate();
}
int cullsize = fopAcM_GetCullSize(i_actor);
if (fopAcM_CULLSIZE_IS_BOX(cullsize)) {
if (fopAcM_GetCullSize(i_actor) == 14) {
if (fopAcM_CULLSIZE_IS_BOX(fopAcM_GetCullSize(i_actor))) {
if (fopAcM_GetCullSize(i_actor) == fopAc_CULLBOX_CUSTOM_e) {
if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
u32 ret =
@@ -780,7 +778,7 @@ s32 fopAcM_cullingCheck(fopAc_ac_c const* i_actor) {
return mDoLib_clipper::clip(mtx_p, &i_actor->cull.box.max, &i_actor->cull.box.min);
}
} else {
cull_box* box = &l_cullSizeBox[cullsize];
cull_box* box = &l_cullSizeBox[fopAcM_CULLSIZE_IDX(fopAcM_GetCullSize(i_actor))];
if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
@@ -792,7 +790,7 @@ s32 fopAcM_cullingCheck(fopAc_ac_c const* i_actor) {
}
}
} else {
if (fopAcM_GetCullSize(i_actor) == 23) {
if (fopAcM_GetCullSize(i_actor) == fopAc_CULLSPHERE_CUSTOM_e) {
if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());
u32 ret = mDoLib_clipper::clip(mtx_p, fopAcM_getCullSizeSphereCenter(i_actor),
@@ -804,7 +802,7 @@ s32 fopAcM_cullingCheck(fopAc_ac_c const* i_actor) {
fopAcM_getCullSizeSphereR(i_actor));
}
} else {
cull_sphere* sphere = &l_cullSizeSphere[cullsize - 15];
cull_sphere* sphere = &l_cullSizeSphere[fopAcM_CULLSIZE_Q_IDX(fopAcM_GetCullSize(i_actor))];
if (fopAcM_getCullSizeFar(i_actor) > 0.0f) {
mDoLib_clipper::changeFar(cullsize_far * mDoLib_clipper::getFar());