Several demo matches (#1165)

This commit is contained in:
LagoLunatic
2026-08-13 16:19:28 -04:00
committed by GitHub
parent e1e081f37b
commit 37f7baaaf0
22 changed files with 272 additions and 144 deletions
+3 -3
View File
@@ -409,7 +409,7 @@ config.libs = [
Object(NonMatching, "m_Do/m_Do_graphic.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_machine.cpp"),
Object(Matching, "m_Do/m_Do_mtx.cpp"),
Object(NonMatching, "m_Do/m_Do_ext.cpp"),
Object(MatchingFor("D44J01"), "m_Do/m_Do_ext.cpp"),
Object(Matching, "m_Do/m_Do_lib.cpp"),
Object(Matching, "m_Do/m_Do_hostIO.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_Reset.cpp"),
@@ -565,7 +565,7 @@ config.libs = [
Object(Matching, "d/d_bg_w_deform.cpp"),
Object(Matching, "d/d_bg_w_hf.cpp"),
Object(Matching, "d/d_bg_w_sv.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_cc_d.cpp"),
Object(Matching, "d/d_cc_d.cpp"),
Object(Matching, "d/d_cc_mass_s.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_cc_s.cpp"),
Object(Matching, "d/d_cc_uty.cpp"),
@@ -593,7 +593,7 @@ config.libs = [
Object(Matching, "d/actor/d_a_bomb.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_bomb2.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_boomerang.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_dai_item.cpp"),
Object(Matching, "d/actor/d_a_dai_item.cpp"),
Object(Matching, "d/actor/d_a_demo00.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_disappear.cpp"),
Object(Matching, "d/actor/d_a_esa.cpp"),
@@ -430,7 +430,7 @@ public:
}
u16 getUpdateMaterialNum() const { return mTrackNum / 3; }
JUTNameTab * getUpdateMaterialName() { return &mUpdateMaterialName; }
u16 getUpdateTexMtxID(u16 idx) const {
int getUpdateTexMtxID(u16 idx) const {
J3D_ASSERT(1017, idx < (mTrackNum / 3), "Error : range over.");
return mUpdateTexMtxID[idx];
}
@@ -119,7 +119,6 @@ class J3DMtxCalcMayaAnm : public J3DMtxCalcMaya, public J3DMtxCalcAnm {
public:
J3DMtxCalcMayaAnm(J3DAnmTransform* pAnmTransform)
: J3DMtxCalcMaya(), J3DMtxCalcAnm(pAnmTransform) {}
virtual ~J3DMtxCalcMayaAnm() {}
virtual void calc(u16 jnt_no) { J3DMtxCalcAnm::calc(jnt_no); }
};
+24 -4
View File
@@ -9,8 +9,18 @@
struct J3DGXColorS10 {
J3DGXColorS10() {}
J3DGXColorS10(GXColorS10& other) { mColor = other; }
J3DGXColorS10(J3DGXColorS10& other) { mColor = other.mColor; }
J3DGXColorS10(GXColorS10& other) {
mColor.r = other.r;
mColor.g = other.g;
mColor.b = other.b;
mColor.a = other.a;
}
J3DGXColorS10(J3DGXColorS10& other) {
mColor.r = other.mColor.r;
mColor.g = other.mColor.g;
mColor.b = other.mColor.b;
mColor.a = other.mColor.a;
}
J3DGXColorS10& operator=(const J3DGXColorS10& other) {
mColor = other.mColor;
return *this;
@@ -25,8 +35,18 @@ struct J3DGXColorS10 {
struct J3DGXColor {
J3DGXColor() {}
J3DGXColor(GXColor& other) { mColor = other; }
J3DGXColor(J3DGXColor& other) { mColor = other.mColor; }
J3DGXColor(GXColor& other) {
mColor.r = other.r;
mColor.g = other.g;
mColor.b = other.b;
mColor.a = other.a;
}
J3DGXColor(J3DGXColor& other) {
mColor.r = other.mColor.r;
mColor.g = other.mColor.g;
mColor.b = other.mColor.b;
mColor.a = other.mColor.a;
}
J3DGXColor& operator=(const J3DGXColor& other) {
mColor = other.mColor;
return *this;
+4 -3
View File
@@ -12,9 +12,10 @@ enum J3DError {
J3DErrType_OutOfMemory = 4,
};
enum J3DSysDrawBuffer {
/* 0x0 */ OPA_BUFFER,
/* 0x1 */ XLU_BUFFER
enum J3DSysDrawBuf {
/* 0x0 */ J3DSysDrawBuf_Opa,
/* 0x1 */ J3DSysDrawBuf_Xlu,
/* 0x2 */ J3DSysDrawBuf_MAX,
};
class J3DMtxCalc;
+3 -3
View File
@@ -380,9 +380,9 @@ public:
cCcD_ObjCommonBase() { ct(); }
virtual ~cCcD_ObjCommonBase() {}
void ct() {
SetSPrm(0);
SetRPrm(0);
ClrObj();
mSPrm = 0;
mRPrm = 0;
mHitObj = NULL;
}
void SetSPrm(u32 sprm) { mSPrm = sprm; }
void SetRPrm(u32 rprm) { mRPrm = rprm; }
+12
View File
@@ -35,14 +35,26 @@ public:
void SetR(f32 r);
#endif
void Set(const cM3dGCylS & src) {
#if VERSION == VERSION_DEMO
mCenter = src.mCenter;
mRadius = src.mRadius;
mHeight = src.mHeight;
#else
SetC(src.mCenter);
SetR(src.mRadius);
SetH(src.mHeight);
#endif
}
void Set(const cXyz& center, f32 radius, f32 height) {
#if VERSION == VERSION_DEMO
mCenter = center;
mRadius = radius;
mHeight = height;
#else
SetC(center);
SetR(radius);
SetH(height);
#endif
}
bool cross(const cM3dGSph*, cXyz*) const;
bool cross(const cM3dGCyl*, cXyz*) const;
+10
View File
@@ -29,12 +29,22 @@ public:
#endif
void SetC(f32 x, f32 y, f32 z) { mCenter.x = x; mCenter.y = y; mCenter.z = z; }
void Set(const cM3dGSphS & src) {
#if VERSION == VERSION_DEMO
mCenter = src.mCenter;
mRadius = src.mRadius;
#else
SetC(src.mCenter);
SetR(src.mRadius);
#endif
}
void Set(const cXyz& srcCenter, f32 srcRadius) {
#if VERSION == VERSION_DEMO
mCenter = srcCenter;
mRadius = srcRadius;
#else
SetC(srcCenter);
SetR(srcRadius);
#endif
}
bool Cross(const cM3dGCps* cps, cXyz* dst) const {
return cM3d_Cross_CpsSph(*cps, *this, dst);
+1 -1
View File
@@ -23,7 +23,7 @@ public:
void check_col();
void lift_smooth_move();
void lift_normal_move();
BOOL check_path_point(cXyz, cXyz, cXyz, s8);
BOOL check_path_point(cXyz, cXyz, s8);
void set_next_pnt();
BOOL setNextPath();
bool chkSwitchPathType();
+2 -2
View File
@@ -535,8 +535,8 @@ public:
J3DDrawBuffer* getXluList() { return mpXluList; }
J3DDrawBuffer* getXluListP1() { return mpXluListP1; }
void setXluDrawList(J3DDrawBuffer* buffer) { j3dSys.setDrawBuffer(buffer, XLU_BUFFER); }
void setOpaDrawList(J3DDrawBuffer* buffer) { j3dSys.setDrawBuffer(buffer, OPA_BUFFER); }
void setXluDrawList(J3DDrawBuffer* buffer) { j3dSys.setDrawBuffer(buffer, J3DSysDrawBuf_Xlu); }
void setOpaDrawList(J3DDrawBuffer* buffer) { j3dSys.setDrawBuffer(buffer, J3DSysDrawBuf_Opa); }
void setOpaList() { setOpaDrawList(mpOpaList); }
void setXluList() { setXluDrawList(mpXluList); }
void setOpaListInvisible() { setOpaDrawList(mpOpaListInvisible); }
+12 -12
View File
@@ -17,7 +17,7 @@ public:
public:
/* 0x04 */ s8 mNo;
/* 0x05 */ u8 field_0x05;
/* 0x05 */ u8 mUsingHostIO;
/* 0x06 */ u8 mDisplayMeter;
/* 0x07 */ u8 mDisplayFlag;
/* 0x08 */ u8 field_0x08;
@@ -41,7 +41,7 @@ public:
/* 0x1D */ u8 field_0x1d;
/* 0x1E */ u8 field_0x1e;
/* 0x1F */ u8 field_0x1f;
/* 0x20 */ JUtility::TColor field_0x20;
/* 0x20 */ JUtility::TColor mColor;
/* 0x24 */ f32 mTriggerThreshLo;
/* 0x28 */ f32 mTriggerThreshHi;
/* 0x2C */ s16 mFbWidth;
@@ -58,16 +58,16 @@ public:
/* 0x39 */ u8 field_0x39;
/* 0x3A */ u8 field_0x3a;
/* 0x3B */ u8 field_0x3b;
/* 0x3C */ JUtility::TColor field_0x3c;
/* 0x40 */ JUtility::TColor field_0x40;
/* 0x44 */ JUtility::TColor field_0x44;
/* 0x48 */ JUtility::TColor field_0x48;
/* 0x4C */ u16 field_0x4c;
/* 0x4E */ u16 field_0x4e;
/* 0x50 */ u16 field_0x50;
/* 0x52 */ u16 field_0x52;
/* 0x54 */ u16 field_0x54;
/* 0x56 */ u8 field_0x56;
/* 0x3C */ JUtility::TColor mLetterTopColor;
/* 0x40 */ JUtility::TColor mLetterBottomColor;
/* 0x44 */ JUtility::TColor mLetterTopShadowColor;
/* 0x48 */ JUtility::TColor mLetterBottomShadowColor;
/* 0x4C */ u16 mLetterPositionX;
/* 0x4E */ u16 mLetterPositionY;
/* 0x50 */ u16 mLineSpacing;
/* 0x52 */ u16 mLetterSpacing;
/* 0x54 */ u16 mLetterFontSize;
/* 0x56 */ u8 mBackgroundAlpha;
}; // Size: 0x58
extern fapGm_HIO_c g_HIO;
+16 -16
View File
@@ -127,22 +127,6 @@ inline MtxP fopAcM_GetMtx(fopAc_ac_c* pActor) {
return pActor->cullMtx;
}
inline u32 fopAcM_CheckStatus(fopAc_ac_c* pActor, u32 status) {
return pActor->actor_status & status;
}
inline u32 fopAcM_checkCarryNow(fopAc_ac_c* pActor) {
return pActor->actor_status & fopAcStts_CARRY_e;
}
inline void fopAcM_ClearStatusMap(fopAc_ac_c* pActor) {
pActor->actor_status &= ~0x3F;
}
inline bool fopAcM_checkHookCarryNow(fopAc_ac_c* pActor) {
return fopAcM_CheckStatus(pActor, fopAcStts_HOOK_CARRY_e);
}
inline u32 fopAcM_GetParam(void* pActor) {
return fpcM_GetParam(pActor);
}
@@ -179,6 +163,10 @@ inline void fopAcM_SetGroup(fopAc_ac_c* pActor, u8 group) {
pActor->group = group;
}
inline u32 fopAcM_CheckStatus(fopAc_ac_c* pActor, u32 status) {
return pActor->actor_status & status;
}
inline void fopAcM_OnStatus(fopAc_ac_c* pActor, u32 flag) {
pActor->actor_status |= flag;
}
@@ -187,6 +175,14 @@ inline void fopAcM_OffStatus(fopAc_ac_c* pActor, u32 flag) {
pActor->actor_status &= ~flag;
}
inline u32 fopAcM_checkCarryNow(fopAc_ac_c* pActor) {
return pActor->actor_status & fopAcStts_CARRY_e;
}
inline bool fopAcM_checkHookCarryNow(fopAc_ac_c* pActor) {
return fopAcM_CheckStatus(pActor, fopAcStts_HOOK_CARRY_e);
}
inline BOOL fopAcM_CheckStatusMap(fopAc_ac_c* pActor, u32) {
// TODO: This implementation probably isn't right, the u32 argument is likely used for something
return (pActor->actor_status & fopAcStts_SHOWMAP_e) && (pActor->actor_status & 0x1F) == 0;
@@ -196,6 +192,10 @@ inline void fopAcM_SetStatusMap(fopAc_ac_c* pActor, u32 flag) {
pActor->actor_status = (pActor->actor_status & ~0x3F) | fopAcStts_SHOWMAP_e | flag;
}
inline void fopAcM_ClearStatusMap(fopAc_ac_c* pActor) {
pActor->actor_status &= ~0x3F;
}
inline fopAc_ac_c* fopAcM_Search(fopAcIt_JudgeFunc func, void* param) {
return (fopAc_ac_c*)fopAcIt_Judge(func, param);
}
+4
View File
@@ -95,6 +95,10 @@ inline void cMtx_copy(CMtxP src, MtxP dst) {
mDoMtx_copy(src, dst);
}
inline void cMtx_trans(Mtx dst, f32 x, f32 y, f32 z) {
mDoMtx_trans(dst, x, y, z);
}
inline void cMtx_multVecArray(Mtx mtx, const Vec* src, Vec* dst, u32 count) {
mDoMtx_multVecArray(mtx, src, dst, count);
}
-1
View File
@@ -133,7 +133,6 @@ cPhs_State daDai_c::_create() {
if (PVar3 != cPhs_COMPLEATE_e) {
return PVar3;
}
#else
if (PVar2 != cPhs_COMPLEATE_e) {
return PVar2;
+81 -15
View File
@@ -202,8 +202,8 @@ bool daStandItem_c::_delete() {
m698 = NULL;
}
dComIfG_resDelete(&mPhsDai, m_arcname);
dComIfG_resDelete(&mPhsCloth, "Cloth");
dComIfG_resDeleteDemo(&mPhsDai, m_arcname);
dComIfG_resDeleteDemo(&mPhsCloth, "Cloth");
return true;
}
@@ -215,7 +215,7 @@ static BOOL CheckCreateHeap(fopAc_ac_c* i_ac) {
/* 800E37B8-800E3AF8 .text CreateHeap__13daStandItem_cFv */
BOOL daStandItem_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(m_arcname, m_bmdidx[mItemType]);
JUT_ASSERT(0x239, modelData != NULL);
JUT_ASSERT(DEMO_SELECT(566, 569), modelData != NULL);
if (mItemNo == dItemNo_SHOP_GURU_STATUE_e) {
mpModel = mDoExt_J3DModel__create(modelData, 0x0, 0x11020203);
@@ -228,7 +228,7 @@ BOOL daStandItem_c::CreateHeap() {
if (m_bckidx[mItemType] != -1) {
J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes(m_arcname, m_bckidx[mItemType]);
JUT_ASSERT(0x250, pbck != NULL);
JUT_ASSERT(DEMO_SELECT(589, 592), pbck != NULL);
mpBckAnm = new mDoExt_bckAnm();
static const u32 playmode[] = {
@@ -297,6 +297,37 @@ BOOL daStandItem_c::CreateHeap() {
return TRUE;
}
#if VERSION == VERSION_DEMO
// Note: Retail moved this into d_com_static.cpp as daStandItem_c::daiItemNodeCallBack
static BOOL nodeCallBack(J3DNode* node, int calcTiming) {
if (calcTiming == J3DNodeCBCalcTiming_In) {
J3DJoint* joint = (J3DJoint*)node;
s32 jntNo = joint->getJntNo();
J3DModel* model = j3dSys.getModel();
void* userArea = (void*)model->getUserArea();
if (userArea && fopAcM_IsActor(userArea) && fopAcM_GetName(userArea) == fpcNm_STANDITEM_e) {
daStandItem_c* i_this = (daStandItem_c*)userArea;
mDoMtx_stack_c::copy(model->getAnmMtx(jntNo));
switch (i_this->getItemNo()) {
case dItemNo_PINWHEEL_e:
mDoMtx_stack_c::XrotM(i_this->m6B4);
break;
case dItemNo_FOUNTAIN_IDOL_e:
if (jntNo == FOBJ09_JNT_TUBOKO_BASE_e) {
mDoMtx_copy(mDoMtx_stack_c::get(), i_this->m630);
} else if (jntNo == FOBJ09_JNT_TUBOKO_HEAD_e) {
mDoMtx_copy(mDoMtx_stack_c::get(), i_this->m660);
}
break;
}
model->setAnmMtx(jntNo, mDoMtx_stack_c::get());
cMtx_copy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
}
}
return TRUE;
}
#endif
/* 800E3AF8-800E3E94 .text CreateInit__13daStandItem_cFv */
void daStandItem_c::CreateInit() {
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
@@ -312,7 +343,9 @@ void daStandItem_c::CreateInit() {
m6A4 = *dKyw_get_wind_vec();
m6A2 = cM_atan2s(m6A4.x, m6A4.z);
set_mtx();
#if VERSION > VERSION_DEMO
mpModel->setUserArea(NULL);
#endif
JUTNameTab* jointNameTab = mpModel->getModelData()->getJointName();
const char* jointName;
@@ -323,7 +356,7 @@ void daStandItem_c::CreateInit() {
for (i = 0; i < mpModel->getModelData()->getJointNum(); i++) {
jointName = jointNameTab->getName(i);
if (strcmp("top", jointName) == 0) {
mpModel->getModelData()->getJointNodePointer(i)->setCallBack(daiItemNodeCallBack);
mpModel->getModelData()->getJointNodePointer(i)->setCallBack(DEMO_SELECT(nodeCallBack, daiItemNodeCallBack));
break;
}
}
@@ -336,7 +369,7 @@ void daStandItem_c::CreateInit() {
for (i = 0; i < mpModel->getModelData()->getJointNum(); i++) {
jointName = jointNameTab->getName(i);
if (strcmp("tuboko_head", jointName) == 0 || strcmp("tuboko_base", jointName) == 0)
mpModel->getModelData()->getJointNodePointer(i)->setCallBack(daiItemNodeCallBack);
mpModel->getModelData()->getJointNodePointer(i)->setCallBack(DEMO_SELECT(nodeCallBack, daiItemNodeCallBack));
}
mpModel->setUserArea((u32)this);
mpModel->calc();
@@ -352,18 +385,20 @@ void daStandItem_c::CreateInit() {
s16 stopMaxTime = m_stop_max_time[mItemType];
s16 r29 = (animMinTime + animMaxTime) / 2;
s16 r28 = (animMaxTime - animMinTime) / 2;
s16 temp3 = (stopMinTime + stopMaxTime) / 2;
s16 temp = (stopMaxTime - stopMinTime) / 2;
mBckPlayTimer = 0;
f32 temp2 = cM_rndFX(temp);
s16 temp3 = (stopMinTime + stopMaxTime) / 2;
mBckStopTimer = temp3 + temp2;
if (stopMaxTime == 0) {
mBckPlayTimer = r29 + cM_rndFX(r28);
}
#if VERSION > VERSION_DEMO
m690 = NULL;
m694 = NULL;
m698 = NULL;
#endif
#if VERSION > VERSION_JPN
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
#endif
@@ -376,6 +411,23 @@ cPhs_State daStandItem_c::_create() {
mItemNo = fopAcM_GetParam(this);
mItemType = convItemNo(mItemNo);
#if VERSION == VERSION_DEMO
cPhs_State rt;
cPhs_State cloth_rt;
rt = dComIfG_resLoad(&mPhsDai, m_arcname);
cloth_rt = dComIfG_resLoad(&mPhsCloth, "Cloth");
if (rt == cPhs_ERROR_e || cloth_rt == cPhs_ERROR_e) {
return cPhs_ERROR_e;
}
if (rt != cPhs_COMPLEATE_e) {
return rt;
}
// !@bug They meant to check cloth_rt here, instead they check rt a second time.
if (rt != cPhs_COMPLEATE_e) {
return cloth_rt;
}
#else
cPhs_State rt = dComIfG_resLoad(&mPhsDai, m_arcname);
if (rt != cPhs_COMPLEATE_e)
return rt;
@@ -383,6 +435,7 @@ cPhs_State daStandItem_c::_create() {
cPhs_State cloth_rt = dComIfG_resLoad(&mPhsCloth, "Cloth");
if (cloth_rt != cPhs_COMPLEATE_e)
return cloth_rt;
#endif
if (rt == cPhs_COMPLEATE_e && cloth_rt == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, m_heapsize[mItemType]))
@@ -509,7 +562,8 @@ bool daStandItem_c::actionFobj06() {
m6C4 = 4.0f;
}
m6B2 = m6C4 * 0x600;
int r0 = 0x600;
m6B2 = (f32)r0 * m6C4;
cLib_addCalc(&m6C4, 0.0f, 0.08f, dKyw_get_wind_pow() + 0.3f, dKyw_get_wind_pow() + 0.1f);
m6B4 += m6B2;
return true;
@@ -572,7 +626,10 @@ bool daStandItem_c::actionFobj09() {
if (m694 == NULL) {
m694 = dComIfGp_particle_set(dPa_name::ID_AK_SN_FOUNTAINFIGURE01, &current.pos, &current.angle, NULL, 0xFF, NULL, fopAcM_GetRoomNo(this), &tevStr.mColorK0);
}
if (m698 == NULL) {
#if VERSION > VERSION_DEMO
if (m698 == NULL)
#endif
{
m698 = dComIfGp_particle_set(dPa_name::ID_AK_SN_FOUNTAINFIGURE02, &current.pos, &current.angle);
}
if (m698) {
@@ -627,8 +684,8 @@ void daStandItem_c::animTest() {
}
if (mBckSpeed == 0.0f || mBckPlayTimer == 0) {
mpBckAnm->setPlaySpeed(0.0f);
s16 temp = (stopMaxTime - stopMinTime) / 2;
s16 temp2 = (stopMinTime + stopMaxTime) / 2;
s16 temp = (stopMaxTime - stopMinTime) / 2;
mBckStopTimer = temp2 + cM_rndFX(temp);
}
} else if (mBckStopTimer > 0) {
@@ -637,8 +694,8 @@ void daStandItem_c::animTest() {
mBckStopTimer = 1;
}
if (mBckStopTimer == 0) {
s16 temp = (animMaxTime - animMinTime) / 2;
s16 temp2 = (animMinTime + animMaxTime) / 2;
s16 temp = (animMaxTime - animMinTime) / 2;
mBckPlayTimer = temp2 + cM_rndFX(temp);
mBckSpeed = 1.0f;
if (mpBckAnm) {
@@ -662,8 +719,8 @@ void daStandItem_c::animTestForOneTime() {
if (mBckStopTimer == 0) {
mpBckAnm->setPlaySpeed(1.0f);
mpBckAnm->setFrame(0.0f);
s16 temp = (animMaxTime - animMinTime) / 2;
s16 temp2 = (animMinTime + animMaxTime) / 2;
s16 temp = (animMaxTime - animMinTime) / 2;
mBckPlayTimer = temp2 + cM_rndFX(temp);
}
} else if (mBckPlayTimer > 0) {
@@ -672,8 +729,8 @@ void daStandItem_c::animTestForOneTime() {
mpBckAnm->setPlaySpeed(1.0f);
mpBckAnm->setFrame(0.0f);
} else if (mBckPlayTimer == 0 && isStop) {
s16 temp = (stopMaxTime - stopMinTime) / 2;
s16 temp2 = (stopMinTime + stopMaxTime) / 2;
s16 temp = (stopMaxTime - stopMinTime) / 2;
mBckStopTimer = temp2 + cM_rndFX(temp);
} else if (mBckPlayTimer == 0) {
mBckPlayTimer = 1;
@@ -754,13 +811,22 @@ void daStandItem_c::mode_drop() {
bool daStandItem_c::_draw() {
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
g_env_light.setLightTevColorType(mpModel, &tevStr);
#if VERSION == VERSION_DEMO
if (mpBckAnm != NULL)
mpBckAnm->entry(mpModel->getModelData());
if (mItemNo == dItemNo_PINWHEEL_e)
mDoExt_bckAnmRemove(mpModel->getModelData());
#else
if (mItemNo == dItemNo_PINWHEEL_e)
mDoExt_bckAnmRemove(mpModel->getModelData());
else if (mpBckAnm != NULL)
mpBckAnm->entry(mpModel->getModelData());
#endif
if (mItemNo == dItemNo_SHOP_GURU_STATUE_e)
dDlst_texSpecmapST(&eyePos, &tevStr, mpModel->getModelData(), 1.0f);
if (mItemNo == dItemNo_SHOP_GURU_STATUE_e) {
f32 scale = 1.0f;
dDlst_texSpecmapST(&eyePos, &tevStr, mpModel->getModelData(), scale);
}
mDoExt_modelUpdateDL(mpModel);
if (mpCloth != NULL)
+3 -1
View File
@@ -416,7 +416,9 @@ void daHmlif_c::lift_normal_move() {
cLib_addCalcPos2(&current.pos, m450, 1.0f, fopAcM_GetSpeedF(this));
}
BOOL daHmlif_c::check_path_point(cXyz, cXyz, cXyz, s8) {
BOOL daHmlif_c::check_path_point(cXyz, cXyz, s8) {
// Unused stripped function
return FALSE;
}
/* 00001270-00001410 .text set_next_pnt__9daHmlif_cFv */
+3 -2
View File
@@ -52,8 +52,9 @@ public:
class daNpc_Bm1_HIO_c : public mDoHIO_entry_c {
public:
daNpc_Bm1_HIO_c();
virtual ~daNpc_Bm1_HIO_c() {};
void genMessage(JORMContext* ctx);
virtual ~daNpc_Bm1_HIO_c() {}
void genMessage(JORMContext* ctx) {}
public:
/* 0x04 */ s8 m4;
+1 -1
View File
@@ -185,7 +185,7 @@ BOOL daObjMkie::Act_c::Create() {
#if VERSION > VERSION_DEMO
if (daObj::PrmAbstract<Prm_e>(this, PRM_FLAG_W, PRM_FLAG_S) != 0) {
actor_status &= ~0x3F;
fopAcM_ClearStatusMap(this);
gbaName = 0;
}
#endif
+1 -1
View File
@@ -357,7 +357,7 @@ void dCloth_packet_c::setMtx(Mtx mtx) {
/* 800642FC-80064330 .text cloth_draw__15dCloth_packet_cFv */
void dCloth_packet_c::cloth_draw() {
j3dSys.getDrawBuffer(OPA_BUFFER)->entryImm(this, 0);
j3dSys.getDrawBuffer(J3DSysDrawBuf_Opa)->entryImm(this, 0);
}
/* 80064330-8006441C .text TexObjInit__15dCloth_packet_cFP7ResTIMG */
+2
View File
@@ -457,6 +457,7 @@ void daTitle_proc_c::daTitle_Kirakira_Sound_flag_on() {
}
#endif
#if VERSION > VERSION_DEMO
/* 80056CCC-80056DE0 .text daiItemNodeCallBack__13daStandItem_cFP7J3DNodei */
BOOL daStandItem_c::daiItemNodeCallBack(J3DNode* node, int calcTiming) {
if (calcTiming == J3DNodeCBCalcTiming_In) {
@@ -485,6 +486,7 @@ BOOL daStandItem_c::daiItemNodeCallBack(J3DNode* node, int calcTiming) {
}
return TRUE;
}
#endif
u8 daNpc_Ji1_c::game_life_point;
+18 -17
View File
@@ -16,7 +16,7 @@ fapGm_HIO_c g_HIO;
/* 8002306C-800231BC .text __ct__11fapGm_HIO_cFv */
fapGm_HIO_c::fapGm_HIO_c() {
field_0x05 = 1;
mUsingHostIO = true;
#if VERSION > VERSION_DEMO
if (mDoMain::developmentMode) {
@@ -45,25 +45,26 @@ fapGm_HIO_c::fapGm_HIO_c() {
field_0x1a = 0;
field_0x1b = 1;
field_0x1c = 0;
mFbWidth = 0x280;
mEfbHeight = 0x1e0;
mFbWidth = 640;
mEfbHeight = 480;
field_0x30 = 0;
field_0x20.r = 0xff;
field_0x20.g = 0xff;
field_0x20.b = 0xff;
field_0x20.a = 0xff;
mColor = JUtility::TColor(0xff, 0xff, 0xff, 0xff);
mTriggerThreshLo = 0.9f;
mTriggerThreshHi = 0.6f;
field_0x3c = JUtility::TColor(0xff, 0x96, 0x00, 0xff);
field_0x40 = JUtility::TColor(0xff, 0x78, 0x00, 0xff);
field_0x44 = JUtility::TColor(0x00, 0x00, 0x00, 0xff);
field_0x48 = JUtility::TColor(0x00, 0x00, 0x00, 0xff);
field_0x4c = 0;
field_0x4e = 10;
field_0x54 = 0x1b;
field_0x50 = 0;
field_0x52 = 0;
field_0x56 = 0x82;
mLetterTopColor = JUtility::TColor(0xff, 0x96, 0x00, 0xff);
mLetterBottomColor = JUtility::TColor(0xff, 0x78, 0x00, 0xff);
mLetterTopShadowColor = JUtility::TColor(0x00, 0x00, 0x00, 0xff);
mLetterBottomShadowColor = JUtility::TColor(0x00, 0x00, 0x00, 0xff);
mLetterPositionX = 0;
mLetterPositionY = 10;
mLetterFontSize = 27;
mLineSpacing = 0;
mLetterSpacing = 0;
mBackgroundAlpha = 130;
}
/* 800231BC-800231E4 .text fapGm_After__Fv */
+71 -60
View File
@@ -159,15 +159,15 @@ int mDoExt_bpkAnm::init(J3DMaterialTable* i_matTable, J3DAnmColor* i_bpk, BOOL i
if (i_anmPlay) {
int attribute;
#if VERSION == VERSION_JPN
#if VERSION == VERSION_JPN
if (i_attribute < 0) {
attribute = mpAnm->getAttribute();
} else {
attribute = i_attribute;
}
#else
#else
attribute = i_attribute;
#endif
#endif
if (initPlay(mpAnm->getFrameMax(), attribute, i_rate, i_startF, i_endF, i_modify) == 0) {
return 0;
}
@@ -260,7 +260,7 @@ int mDoExt_btkAnm::init(J3DMaterialTable* i_matTable, J3DAnmTextureSRTKey* i_btk
J3DMaterial* material = i_matTable->getMaterialNodePointer(materialId);
u8 texMtxId = mpAnm->getUpdateTexMtxID(i);
if (texMtxId != 0xFF) {
J3DTexMtx* texMtx = material->getTexGenBlock()->getTexMtx(texMtxId);
J3DTexMtx* texMtx = material->getTexMtx(texMtxId);
if (!texMtx) {
texMtx = new J3DTexMtx();
}
@@ -286,15 +286,15 @@ int mDoExt_btkAnm::init(J3DMaterialTable* i_matTable, J3DAnmTextureSRTKey* i_btk
if (i_anmPlay) {
int attribute;
#if VERSION == VERSION_JPN
#if VERSION == VERSION_JPN
if (i_attribute < 0) {
attribute = mpAnm->getAttribute();
} else {
attribute = i_attribute;
}
#else
#else
attribute = i_attribute;
#endif
#endif
if (initPlay(mpAnm->getFrameMax(), attribute, i_rate, i_startF, i_endF, i_modify) == 0) {
return 0;
}
@@ -365,15 +365,15 @@ int mDoExt_brkAnm::init(J3DMaterialTable* i_matTable, J3DAnmTevRegKey* i_brk, BO
if (i_anmPlay) {
int attribute;
#if VERSION == VERSION_JPN
#if VERSION == VERSION_JPN
if (i_attribute < 0) {
attribute = mpAnm->getAttribute();
} else {
attribute = i_attribute;
}
#else
#else
attribute = i_attribute;
#endif
#endif
if (initPlay(mpAnm->getFrameMax(), attribute, i_rate, i_startF, i_endF, i_modify) == 0) {
return 0;
}
@@ -405,15 +405,15 @@ int mDoExt_bvaAnm::init(J3DModel* i_model, J3DAnmVisibilityFull* i_bva, BOOL i_a
}
if (i_anmPlay) {
int attribute;
#if VERSION == VERSION_JPN
#if VERSION == VERSION_JPN
if (i_attribute < 0) {
attribute = mpAnm->getAttribute();
} else {
attribute = i_attribute;
}
#else
#else
attribute = i_attribute;
#endif
#endif
if (initPlay(mpAnm->getFrameMax(), attribute, i_rate, i_startF, i_endF, i_modify) == 0) {
return 0;
}
@@ -442,15 +442,15 @@ int mDoExt_bckAnm::init(J3DModelData* i_modelData, J3DAnmTransform* i_bck, BOOL
}
if (i_anmPlay) {
int attribute;
#if VERSION == VERSION_JPN
#if VERSION == VERSION_JPN
if (i_attribute < 0) {
attribute = mpAnm->getAttribute();
} else {
attribute = i_attribute;
}
#else
#else
attribute = i_attribute;
#endif
#endif
if (initPlay(mpAnm->getFrameMax(), attribute, i_rate, i_startF, i_endF, i_modify) == 0) {
return 0;
}
@@ -850,9 +850,9 @@ JKRExpHeap* gameHeap;
JKRExpHeap* mDoExt_createGameHeap(u32 heapSize, JKRHeap* i_heap) {
JUT_ASSERT(VERSION_SELECT(2036, 2035, 2050, 2050), gameHeap == NULL || heapSize == 0);
gameHeap = JKRCreateExpHeap(heapSize, i_heap, true);
#if VERSION > VERSION_DEMO
#if VERSION > VERSION_DEMO
gameHeap->setAllocationMode(JKRExpHeap::ALLOC_MODE_1);
#endif
#endif
return gameHeap;
}
@@ -935,9 +935,9 @@ JKRExpHeap* archiveHeap;
JKRExpHeap* mDoExt_createArchiveHeap(u32 heapSize, JKRHeap* i_heap) {
JUT_ASSERT(VERSION_SELECT(2173, 2222, 2237, 2237), archiveHeap == NULL || heapSize == 0);
archiveHeap = JKRCreateExpHeap(heapSize, i_heap, true);
#if VERSION > VERSION_DEMO
#if VERSION > VERSION_DEMO
archiveHeap->setAllocationMode(JKRExpHeap::ALLOC_MODE_1);
#endif
#endif
return archiveHeap;
}
@@ -955,25 +955,28 @@ s32 mDoExt_getSafeArchiveHeapSize() {
}
#endif
#if VERSION == VERSION_DEMO
static u8 archiveHeapGroupID;
#endif
JKRHeap* mDoExt_SaveCurrentHeap;
#if VERSION == VERSION_DEMO
static u8 archiveHeapGroupID;
static u8 SolidHeapGroupID;
#endif
/* 80011AB4-80011ABC .text mDoExt_getArchiveHeap__Fv */
JKRExpHeap* mDoExt_getArchiveHeap() {
#if VERSION == VERSION_DEMO
#if VERSION == VERSION_DEMO
JKRExpHeap* heap = archiveHeap;
heap->changeGroupID(archiveHeapGroupID++);
if (archiveHeapGroupID >= 200) {
archiveHeapGroupID = 0;
}
return heap;
#else
#else
return archiveHeap;
#endif
#endif
}
static void dummy() {
@@ -993,9 +996,9 @@ JKRSolidHeap* mDoExt_createSolidHeap(u32 i_size, JKRHeap* i_heap, u32 i_alignmen
u32 size;
JKRSolidHeap* createdHeap;
#if VERSION == VERSION_DEMO
#if VERSION == VERSION_DEMO
u8 groupID = i_heap->changeGroupID(SolidHeapGroupID);
#endif
#endif
if (i_size == 0 || i_size == -1) {
createdHeap = JKRSolidHeap::create(-1, i_heap, false);
@@ -1010,15 +1013,15 @@ JKRSolidHeap* mDoExt_createSolidHeap(u32 i_size, JKRHeap* i_heap, u32 i_alignmen
createdHeap = JKRSolidHeap::create(size, i_heap, false);
}
#if VERSION == VERSION_DEMO
#if VERSION == VERSION_DEMO
i_heap->changeGroupID(groupID);
#endif
#endif
if (createdHeap != NULL) {
createdHeap->setErrorFlag(true);
}
#if VERSION == VERSION_DEMO
#if VERSION == VERSION_DEMO
if (createdHeap == NULL) {
// "mDoExt_createMaxSolidHeap: Failed to allocate a %fK solid heap. Contiguous free space=%fK Remaining free space=%f\n"
OSReport_Warning(
@@ -1034,7 +1037,7 @@ JKRSolidHeap* mDoExt_createSolidHeap(u32 i_size, JKRHeap* i_heap, u32 i_alignmen
} else {
SolidHeapGroupID = SolidHeapGroupID < 199 ? (u8)(SolidHeapGroupID + 1) : 0;
}
#endif
#endif
return createdHeap;
}
@@ -1055,9 +1058,9 @@ JKRSolidHeap* mDoExt_createSolidHeapToCurrent(u32 i_size, JKRHeap* i_parent, u32
if (!resultHeap) {
return NULL;
}
#if VERSION > VERSION_DEMO
#if VERSION > VERSION_DEMO
JUT_ASSERT(VERSION_SELECT(0, 2530, 2545, 2545), OSGetCurrentThread() == &mainThread);
#endif
#endif
JUT_ASSERT(VERSION_SELECT(2441, 2531, 2546, 2546), mDoExt_SaveCurrentHeap == NULL);
mDoExt_SaveCurrentHeap = JKRGetCurrentHeap();
mDoExt_setCurrentHeap(resultHeap);
@@ -1102,9 +1105,9 @@ JKRHeap* mDoExt_getCurrentHeap() {
/* 80011DDC-80011E98 .text mDoExt_restoreCurrentHeap__Fv */
void mDoExt_restoreCurrentHeap() {
#if VERSION > VERSION_DEMO
#if VERSION > VERSION_DEMO
JUT_ASSERT(VERSION_SELECT(0, 2739, 2754, 2754), OSGetCurrentThread() == &mainThread);
#endif
#endif
JUT_ASSERT(VERSION_SELECT(2647, 2740, 2755, 2755), mDoExt_SaveCurrentHeap != NULL);
mDoExt_SaveCurrentHeap->becomeCurrentHeap();
mDoExt_SaveCurrentHeap = NULL;
@@ -1136,6 +1139,7 @@ void mDoExt_MtxCalcAnmBlendTbl::calc(u16 jnt_no) {
Quaternion quat3;
mAnmRatio->getAnmTransform()->getTransform(jnt_no, &info2);
JMAEulerToQuat(info2.mRotation.x, info2.mRotation.y, info2.mRotation.z, &quat1);
f32 f30 = mAnmRatio[0].getRatio();
quat3 = quat1;
for (int i = 1; i < mNum; i++) {
J3DAnmTransform* transform = mAnmRatio[i].getAnmTransform();
@@ -1143,7 +1147,7 @@ void mDoExt_MtxCalcAnmBlendTbl::calc(u16 jnt_no) {
J3DTransformInfo info3;
transform->getTransform(jnt_no, &info3);
f32 ratio = mAnmRatio[i].getRatio();
f32 f30 = 1.0f - ratio;
f30 = 1.0f - ratio;
JMAEulerToQuat(info3.mRotation.x, info3.mRotation.y, info3.mRotation.z, &quat2);
JMAQuatLerp(&quat1, &quat2, ratio, &quat3);
quat1 = quat3;
@@ -1316,7 +1320,7 @@ mDoExt_McaMorf::mDoExt_McaMorf(J3DModelData* modelData, mDoExt_McaMorfCallBack1_
J3DTransformInfo* info = mpTransformInfo;
Quaternion* quat = mpQuat;
J3DModelData* r23 = mpModel->getModelData();
u16 jointNum = r23->getJointNum();
int jointNum = r23->getJointNum();
for (int i = 0; i < jointNum; i++) {
*info = r23->getJointNodePointer(i)->getTransformInfo();
JMAEulerToQuat(info->mRotation.x, info->mRotation.y, info->mRotation.z, quat);
@@ -1604,7 +1608,7 @@ mDoExt_McaMorf2::mDoExt_McaMorf2(J3DModelData* modelData, mDoExt_McaMorfCallBack
J3DTransformInfo* info = mpTransformInfo;
Quaternion* quat = mpQuat;
J3DModelData* r23 = mpModel->getModelData();
u16 jointNum = r23->getJointNum();
int jointNum = r23->getJointNum();
for (int i = 0; i < jointNum; i++) {
*info = r23->getJointNodePointer(i)->getTransformInfo();
JMAEulerToQuat(info->mRotation.x, info->mRotation.y, info->mRotation.z, quat);
@@ -1954,9 +1958,9 @@ void mDoExt_3DlineMat0_c::setMaterial() {
{0xC0, 0x00, 0x00},
};
j3dSys.reinitGX();
#if VERSION > VERSION_JPN
#if VERSION > VERSION_JPN
GXSetNumIndStages(0);
#endif
#endif
dKy_setLight_again();
GXClearVtxDesc();
@@ -2220,9 +2224,9 @@ void mDoExt_3DlineMat1_c::setMaterial() {
{0xC0, 0x00, 0x00},
};
j3dSys.reinitGX();
#if VERSION > VERSION_JPN
#if VERSION > VERSION_JPN
GXSetNumIndStages(0);
#endif
#endif
dKy_setLight_again();
GXClearVtxDesc();
@@ -2341,7 +2345,7 @@ void mDoExt_3DlineMat1_c::update(u16 i_segs, f32 i_size, GXColor& i_color, u16 i
delta = delta.outprod(eyeDelta);
f32 scale = delta.abs();
if (scale != 0.0f) {
scale = i_size / scale;
scale = r_size / scale;
delta *= scale;
}
@@ -2531,9 +2535,9 @@ void mDoExt_3DlineMatSortPacket::draw() {
lineMat->draw();
lineMat = lineMat->mpNextLineMat;
} while (lineMat);
#if VERSION > VERSION_JPN
#if VERSION > VERSION_JPN
J3DShape::resetVcdVatCache();
#endif
#endif
}
/* 800165E4-8001683C .text mDoExt_initFontCommon__FPP7JUTFontPP7ResFONTP7JKRHeapPCcP10JKRArchiveUcUlUl */
@@ -2549,11 +2553,11 @@ void mDoExt_initFontCommon(JUTFont** p_font, ResFONT** p_resfont, JKRHeap* p_hea
JUT_ASSERT(VERSION_SELECT(6544, 6637, 6651, 6651), mDoExt_resfont != NULL);
if (param_6 == 0) {
#if VERSION <= VERSION_JPN
#if VERSION <= VERSION_JPN
u32 temp = (param_8 + 0x40) * param_7;
#else
#else
u32 temp = (((param_8+0x1F) & ~0x1F) + 0x40) * param_7;
#endif
#endif
JUTCacheFont* cacheFont = new(p_heap, 0) JUTCacheFont(*p_resfont, temp, p_heap);
if (cacheFont->isValid()) {
*p_font = cacheFont;
@@ -2576,18 +2580,29 @@ void mDoExt_initFontCommon(JUTFont** p_font, ResFONT** p_resfont, JKRHeap* p_hea
JUT_ASSERT(VERSION_SELECT(6575, 6668, 6685, 6685), mDoExt_font != NULL);
}
#if VERSION == VERSION_DEMO
JUTFont* mDoExt_font0;
ResFONT* mDoExt_resfont0;
JUTFont* mDoExt_font1;
s32 mDoExt_font0_getCount;
s32 mDoExt_font1_getCount;
ResFONT* mDoExt_resfont0;
ResFONT* mDoExt_resfont1;
#else
JUTFont* mDoExt_font0;
s32 mDoExt_font0_getCount;
ResFONT* mDoExt_resfont0;
JUTFont* mDoExt_font1;
s32 mDoExt_font1_getCount;
ResFONT* mDoExt_resfont1;
#endif
#if VERSION <= VERSION_JPN
void mDoExt_initFont0() {
/* Nonmatching */
static const char* fontdata[] = {
static const char* const fontdata[] = {
"rock_24_20_4i1.bfn",
"rock_e_24_20_4i.bfn",
};
u8 r30 = g_msgDHIO.field_0x08;
const u8 r30 = g_msgDHIO.field_0x08;
mDoExt_initFontCommon(&mDoExt_font0, &mDoExt_resfont0, mDoExt_getZeldaHeap(), fontdata[r30], dComIfGp_getFontArchive(), r30, 0xB4, 0x800);
}
#else
@@ -2598,10 +2613,6 @@ void mDoExt_initFont0() {
}
#endif
JUTFont* mDoExt_font1;
ResFONT* mDoExt_resfont1;
s32 mDoExt_font1_getCount;
#if VERSION <= VERSION_JPN
void mDoExt_initFont1() {
mDoExt_initFontCommon(&mDoExt_font1, &mDoExt_resfont1, mDoExt_getZeldaHeap(), "rodb_16_11_4i.bfn", dComIfGp_getRubyArchive(), 1, 1, 0x8000);
@@ -2640,11 +2651,11 @@ void mDoExt_removeMesgFont() {
mDoExt_font0 = NULL;
if (mDoExt_resfont0) {
#if VERSION <= VERSION_JPN
#if VERSION <= VERSION_JPN
if (g_msgDHIO.field_0x08 == 0) {
JKRFileLoader::removeResource(mDoExt_resfont0, NULL);
} else
#endif
#endif
{
JKRHeap::free(mDoExt_resfont0, NULL);
}
@@ -2657,12 +2668,12 @@ void mDoExt_removeMesgFont() {
#if VERSION > VERSION_JPN
/* 80016A1C-80016A7C .text mDoExt_initFont1__Fv */
void mDoExt_initFont1() {
#if VERSION <= VERSION_JPN
#if VERSION <= VERSION_JPN
mDoExt_initFontCommon(&mDoExt_font1, &mDoExt_resfont1, mDoExt_getZeldaHeap(), "rodb_16_11_4i.bfn", dComIfGp_getRubyArchive(), 1, 1, 0x8000);
#else
#else
static const char fontdata[] = "hyrule.bfn";
mDoExt_initFontCommon(&mDoExt_font1, &mDoExt_resfont1, mDoExt_getZeldaHeap(), fontdata, dComIfGp_getRubyArchive(), 1, 1, 0x8000);
#endif
#endif
}
#endif