diff --git a/configure.py b/configure.py index a927a7f23..e72fc4673 100755 --- a/configure.py +++ b/configure.py @@ -350,7 +350,7 @@ config.libs = [ Object(Matching, "m_Do/m_Do_mtx.cpp", extra_cflags=['-pragma "nosyminline on"']), Object(NonMatching, "m_Do/m_Do_ext.cpp", extra_cflags=["-sym off"]), Object(NonMatching, "m_Do/m_Do_lib.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_hostIO.cpp"), + Object(Matching, "m_Do/m_Do_hostIO.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_Reset.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_dvd_thread.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_DVDError.cpp"), @@ -542,7 +542,7 @@ config.libs = [ Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_ib.cpp", extra_cflags=['-pragma "nosyminline on"']), Object(NonMatching, "d/actor/d_a_item.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_itembase.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_nh.cpp"), + Object(Matching, "d/actor/d_a_nh.cpp"), Object(NonMatching, "d/actor/d_a_npc_fa1.cpp"), Object(NonMatching, "d/actor/d_a_obj_search.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_player.cpp"), @@ -562,9 +562,9 @@ config.libs = [ Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_kankyo.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_kyeff.cpp"), Object(Matching, "d/d_kyeff2.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_ky_thunder.cpp"), + Object(Matching, "d/d_ky_thunder.cpp"), Object(Matching, "d/d_letter.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_level_se.cpp"), + Object(Matching, "d/d_level_se.cpp"), Object(NonMatching, "d/d_menu_cloth.cpp"), Object(NonMatching, "d/d_menu_collect.cpp"), Object(NonMatching, "d/d_menu_dmap.cpp"), @@ -600,9 +600,9 @@ config.libs = [ Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_s_title.cpp"), Object(NonMatching, "d/d_scope.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_throwstone.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_timer.cpp"), + Object(Matching, "d/d_timer.cpp"), Object(NonMatching, "d/d_water_mark.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_wind_arrow.cpp"), + Object(Matching, "d/d_wind_arrow.cpp"), Object(NonMatching, "d/d_wpillar.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_wpot_water.cpp"), ], diff --git a/include/JSystem/JParticle/JPAEmitter.h b/include/JSystem/JParticle/JPAEmitter.h index 910445352..7bd2d7929 100644 --- a/include/JSystem/JParticle/JPAEmitter.h +++ b/include/JSystem/JParticle/JPAEmitter.h @@ -195,7 +195,7 @@ public: void setStatus(u32 status) { mFlags |= status; } void clearStatus(u32 status) { mFlags &= ~status; } - bool checkStatus(u32 status) { return mFlags & status; } + u32 checkStatus(u32 status) { return mFlags & status; } void initStatus(u32 status) { mFlags = status; } bool checkEmDataFlag(u32 mask) { return mDataFlag & mask; } diff --git a/include/d/actor/d_a_rd.h b/include/d/actor/d_a_rd.h index 87767d339..ee03bc857 100644 --- a/include/d/actor/d_a_rd.h +++ b/include/d/actor/d_a_rd.h @@ -47,7 +47,13 @@ public: /* 0x7C */ JntHit_HIO_c m7C; }; -class daRd_c : public fopEn_enemy_c { +class daRd_c +#if VERSION == VERSION_DEMO +: public fopAc_ac_c +#else +: public fopEn_enemy_c +#endif +{ public: enum Proc_e { PROC_INIT = 0, diff --git a/include/d/d_demo.h b/include/d/d_demo.h index 78249f105..875c04a0a 100644 --- a/include/d/d_demo.h +++ b/include/d/d_demo.h @@ -352,6 +352,10 @@ private: }; class mDoExt_McaMorf; -BOOL dDemo_setDemoData(fopAc_ac_c*, u8, mDoExt_McaMorf*, const char*, int, u16*, u32, s8); +#if VERSION == VERSION_DEMO +BOOL dDemo_setDemoData(fopAc_ac_c*, u8, mDoExt_McaMorf*, const char*, int = 0, u16* = NULL); +#else +BOOL dDemo_setDemoData(fopAc_ac_c*, u8, mDoExt_McaMorf*, const char*, int = 0, u16* = NULL, u32 = 0, s8 = 0); +#endif #endif /* D_DEMO_H */ diff --git a/include/d/d_ky_thunder.h b/include/d/d_ky_thunder.h index 068142002..71e09e9ac 100644 --- a/include/d/d_ky_thunder.h +++ b/include/d/d_ky_thunder.h @@ -25,11 +25,18 @@ public: public: /* 0x0F8 */ JKRSolidHeap * solid_heap; /* 0x0FC */ dThunder_modelInfo_c mModelInfo; +#if VERSION == VERSION_DEMO + /* 0x134 */ cXyz mPos; + /* 0x140 */ f32 mBtkTime; + /* 0x144 */ cXyz mScale; + /* 0x150 */ f32 mRot; +#else /* 0x134 */ cXyz mScale; /* 0x140 */ cXyz mPos; /* 0x14C */ cXyz mPosNeg; /* 0x158 */ f32 mRot; /* 0x15C */ f32 mBtkTime; +#endif }; #endif /* D_KY_THUNDER_H */ diff --git a/include/d/d_timer.h b/include/d/d_timer.h index b13354f29..dd5b07f88 100644 --- a/include/d/d_timer.h +++ b/include/d/d_timer.h @@ -13,7 +13,7 @@ class JKRSolidHeap; class dDlst_TimerScrnDraw_c : public dDlst_base_c { public: dDlst_TimerScrnDraw_c() { - field_0x234 = 0; + mAnimeTimer = 0; mRupeeNum = -1; field_0x235 = 0; } @@ -36,7 +36,7 @@ public: f32 acc(s16 param_0, s16 param_1, s16 param_2) { return ((f32)(param_1 - param_2) * (f32)(param_1 - param_2)) / ((f32)(param_0 - param_2) * (f32)(param_0 - param_2)); } - void animeTimerReset() {} + void animeTimerReset() { mAnimeTimer = 0; } public: /* 0x004 */ J2DScreen* scrn; @@ -54,7 +54,7 @@ public: /* 0x220 */ J2DPane* mRupeeNumberShadow[3]; /* 0x22C */ J2DPicture* mIconPicture; /* 0x230 */ s32 mRupeeNum; - /* 0x234 */ s8 field_0x234; + /* 0x234 */ s8 mAnimeTimer; /* 0x235 */ u8 field_0x235; /* 0x236 */ u8 field_0x236; /* 0x237 */ u8 field_0x237; @@ -81,6 +81,13 @@ public: s32 getLimitTimeMs(); s32 getRestTimeMs(); + void setTimerPos(f32 x, f32 y) { mpScrnDraw->setTimerPos(x, y); } + void setRupeePos(f32 x, f32 y) { mpScrnDraw->setRupeePos(x, y); } + void setShowType(u8 type) { mpScrnDraw->setShowType(type); } + void setIconType(void* tex, u8 type) { mpScrnDraw->setIconType(tex, type); } + void timerHide() { mpScrnDraw->hide(); } + u8 getStatus() { return mStatus; } + /* 0x0FC */ dDlst_TimerScrnDraw_c* mpScrnDraw; /* 0x100 */ void* iconTex; /* 0x104 */ request_of_phase_process_class mPhs; @@ -101,7 +108,7 @@ public: /* 0x160 */ s16 field_0x160; /* 0x162 */ u8 field_0x162; /* 0x163 */ u8 field_0x163; - /* 0x164 */ u8 mState; + /* 0x164 */ u8 mStatus; /* 0x168 */ s32 mSeTimeLeft; /* 0x16C */ u32 mSeTableIndex; /* 0x170 */ JKRSolidHeap* mpSolidHeap; diff --git a/include/m_Do/m_Do_hostIO.h b/include/m_Do/m_Do_hostIO.h index b78be7e36..c405851a2 100644 --- a/include/m_Do/m_Do_hostIO.h +++ b/include/m_Do/m_Do_hostIO.h @@ -2,6 +2,7 @@ #define M_DO_M_DO_HOSTIO_H #include "dolphin/types.h" +#include // move JOR stuff later class JOREventListener; @@ -41,14 +42,19 @@ class mDoHIO_child_c { public: mDoHIO_child_c() { field_0x18 = 0; - mReflexible = NULL; + mPt = NULL; } ~mDoHIO_child_c() {} + const char* getName() { return mName; } + void setName(const char* i_name) { strncpy(mName, i_name, sizeof(mName)); } + JORReflexible* getPt() { return mPt; } + void setPt(JORReflexible* i_pt) { mPt = i_pt; } + /* 0x00 */ char mName[24]; /* 0x18 */ u8 field_0x18; - /* 0x1C */ JORReflexible* mReflexible; + /* 0x1C */ JORReflexible* mPt; }; class mDoHIO_subRoot_c { @@ -82,7 +88,18 @@ public: class mDoHIO_entry_c : public JORReflexible { public: +#if VERSION == VERSION_DEMO + /* 0x00 */ s8 mNo; + /* 0x01 */ u8 mCount; + /* 0x04 */ /* vtable */ + + mDoHIO_entry_c(); + virtual ~mDoHIO_entry_c(); + void entryHIO(const char*); + void removeHIO(); +#else virtual ~mDoHIO_entry_c() {} +#endif }; extern mDoHIO_root_c mDoHIO_root; diff --git a/src/d/actor/d_a_auction.cpp b/src/d/actor/d_a_auction.cpp index 1030aa6ee..05323a4fb 100644 --- a/src/d/actor/d_a_auction.cpp +++ b/src/d/actor/d_a_auction.cpp @@ -699,7 +699,7 @@ bool daAuction_c::eventStart() { mpTimer = (dTimer_c*)fopMsgM_SearchByID(mTimerID); if (mpTimer != NULL) { - mpTimer->mpScrnDraw->setShowType(0); + mpTimer->setShowType(0); } } @@ -929,7 +929,7 @@ void daAuction_c::eventMainKai() { dComIfGp_setMessageSetNumber(mCurrBid + 1); end = 0x1CFA; setLinkAnm(daPy_demo_c::DEMO_UNK48_e); - mpTimer->mpScrnDraw->setShowType(1); + mpTimer->setShowType(1); dAuction_screen_gaugeUp(); dComIfGp_getVibration().StartShock(5, 1, cXyz(0.0f, 1.0f, 0.0f)); @@ -1137,7 +1137,7 @@ void daAuction_c::eventMainMsgEnd() { m798 = l_camera_pos[m82F][1]; } - mpTimer->mpScrnDraw->setShowType(0); + mpTimer->setShowType(0); dAuction_screen_gaugeDown(); m834 &= ~0x29; dAuction_screen_talkEnd(); diff --git a/src/d/actor/d_a_branch.cpp b/src/d/actor/d_a_branch.cpp index 1536f9c29..9a8130381 100644 --- a/src/d/actor/d_a_branch.cpp +++ b/src/d/actor/d_a_branch.cpp @@ -15,8 +15,8 @@ static u16 anim_table[] = { KWOOD_00_BCK_SWING02, KWOOD_00_BAS_SWING02, - KWOOD_00_BCK_SWING, KWOOD_00_BAS_SWING, - KWOOD_00_BCK_BREAK, KWOOD_00_BAS_BREAK, + KWOOD_00_BCK_SWING, KWOOD_00_BAS_SWING, + KWOOD_00_BCK_BREAK, KWOOD_00_BAS_BREAK, }; char daBranch_c::m_arcname[] = "Kwood_00"; @@ -51,7 +51,12 @@ void daBranch_c::set_anim(int i_animIdx, int i_bckIdx, int i_basIdx) { /* 000001E4-00000228 .text demoPlay__10daBranch_cFP14mDoExt_McaMorf */ void daBranch_c::demoPlay(mDoExt_McaMorf* morf) { - dDemo_setDemoData(this, 0x20, morf, m_arcname, 3, anim_table, 0, 0); + dDemo_setDemoData( + this, + dDemo_actor_c::ENABLE_ANM_e, + morf, m_arcname, + ARRAY_SIZE(anim_table) / 2, anim_table + ); } /* 00000228-00000248 .text solidHeapCB__10daBranch_cFP10fopAc_ac_c */ diff --git a/src/d/actor/d_a_nh.cpp b/src/d/actor/d_a_nh.cpp index f758dc1b0..9970f05f8 100644 --- a/src/d/actor/d_a_nh.cpp +++ b/src/d/actor/d_a_nh.cpp @@ -28,7 +28,11 @@ static dCcD_SrcCyl l_cyl_src = { /* SrcObjAt SPrm */ 0, /* SrcObjTg Type */ AT_TYPE_ALL, /* SrcObjTg SPrm */ cCcD_TgSPrm_Set_e | cCcD_TgSPrm_IsEnemy_e, +#if VERSION == VERSION_DEMO + /* SrcObjCo SPrm */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsPlayer_e | cCcD_CoSPrm_VsGrpAll_e, +#else /* SrcObjCo SPrm */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e, +#endif /* SrcGObjAt Se */ 0, /* SrcGObjAt HitMark */ 0, /* SrcGObjAt Spl */ 0, @@ -38,7 +42,11 @@ static dCcD_SrcCyl l_cyl_src = { /* SrcGObjTg HitMark */ 0, /* SrcGObjTg Spl */ 0, /* SrcGObjTg Mtrl */ 0, +#if VERSION == VERSION_DEMO + /* SrcGObjTg SPrm */ 0, +#else /* SrcGObjTg SPrm */ dCcG_TgSPrm_NoHitMark_e, +#endif /* SrcGObjCo SPrm */ 0, }, // cM3dGCylS @@ -104,7 +112,7 @@ void daNh_c::setBaseMtx() { /* 800F9980-800F9A54 .text createHeap__6daNh_cFv */ BOOL daNh_c::createHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Always", ALWAYS_BDL_NH); - JUT_ASSERT(359, modelData != NULL); + JUT_ASSERT(VERSION_SELECT(357, 359, 359, 359), modelData != NULL); mpModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203); if (!mpModel) { @@ -337,7 +345,8 @@ BOOL daNh_c::escapeAction(void*) { mWobbleTimer = cLib_getRndValue(15, 20); } targetAngle += mWobbleDir ? -0x2000 : 0x2000; - moveProc(5.0f, 0.5f, targetAngle); + f32 targetSpeed = 5.0f; + moveProc(targetSpeed, 0.5f, targetAngle); } } return TRUE; @@ -372,7 +381,8 @@ BOOL daNh_c::returnAction(void*) { mWobbleTimer = cLib_getRndValue(15, 20); } targetAngle += mWobbleDir ? -0x2000 : 0x2000; - moveProc(5.0f, 0.5f, targetAngle); + f32 targetSpeed = 5.0f; + moveProc(targetSpeed, 0.5f, targetAngle); } } return TRUE; @@ -428,7 +438,7 @@ BOOL daNh_c::initBrkAnm(bool i_modify) { bool success = false; J3DAnmTevRegKey* a_brk = (J3DAnmTevRegKey*)dComIfG_getObjectRes("Always", ALWAYS_BRK_TNH); - JUT_ASSERT(883, a_brk != NULL); + JUT_ASSERT(VERSION_SELECT(881, 883, 883, 883), a_brk != NULL); if (mBrkAnm.init(modelData, a_brk, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, i_modify, false)) { success = true; diff --git a/src/d/actor/d_a_obj_Vteng.cpp b/src/d/actor/d_a_obj_Vteng.cpp index cdd72ca73..f2b733ff8 100644 --- a/src/d/actor/d_a_obj_Vteng.cpp +++ b/src/d/actor/d_a_obj_Vteng.cpp @@ -71,7 +71,11 @@ bool daObjVteng_c::create_heap() { bool daObjVteng_c::jokai_demo() { bool ret = false; - if (dDemo_setDemoData(this, 0x60, mpMorf, "Vteng", 0, NULL, 0, 0) == TRUE) + if (dDemo_setDemoData( + this, + dDemo_actor_c::ENABLE_ANM_e | dDemo_actor_c::ENABLE_ANM_FRAME_e, + mpMorf, "Vteng" + ) == TRUE) ret = true; return ret; diff --git a/src/d/actor/d_a_obj_gong.cpp b/src/d/actor/d_a_obj_gong.cpp index 9168b8400..ca2fd2f82 100644 --- a/src/d/actor/d_a_obj_gong.cpp +++ b/src/d/actor/d_a_obj_gong.cpp @@ -110,7 +110,11 @@ void daObjGong::Act_c::init_mtx() { /* 00000454-000004A4 .text demo_move__Q29daObjGong5Act_cFv */ bool daObjGong::Act_c::demo_move() { - return dDemo_setDemoData(this, 0x6A, mpMorf, "Vdora", 0, NULL, 0, 0); + return dDemo_setDemoData( + this, + dDemo_actor_c::ENABLE_TRANS_e | dDemo_actor_c::ENABLE_ROTATE_e | dDemo_actor_c::ENABLE_ANM_e | dDemo_actor_c::ENABLE_ANM_FRAME_e, + mpMorf, "Vdora" + ); } /* 000004A4-000004F0 .text _execute__Q29daObjGong5Act_cFv */ diff --git a/src/d/actor/d_a_obj_zouK.cpp b/src/d/actor/d_a_obj_zouK.cpp index 95bb37fb4..6d8062947 100644 --- a/src/d/actor/d_a_obj_zouK.cpp +++ b/src/d/actor/d_a_obj_zouK.cpp @@ -215,7 +215,11 @@ void daObjZouk::Act_c::play_stop_joint_anime() { /* 00001270-000012F0 .text jokai_demo__Q29daObjZouk5Act_cFv */ BOOL daObjZouk::Act_c::jokai_demo() { if (dComIfGp_demo_getActor(demoActorID) != NULL) { - dDemo_setDemoData(this, 0x6a, M_anm, "VzouK", 0, 0, 0, 0); + dDemo_setDemoData( + this, + dDemo_actor_c::ENABLE_TRANS_e | dDemo_actor_c::ENABLE_ROTATE_e | dDemo_actor_c::ENABLE_ANM_e | dDemo_actor_c::ENABLE_ANM_FRAME_e, + M_anm, "VzouK" + ); return true; } else { return false; diff --git a/src/d/actor/d_a_rd.cpp b/src/d/actor/d_a_rd.cpp index d6364e7d4..d80b43e94 100644 --- a/src/d/actor/d_a_rd.cpp +++ b/src/d/actor/d_a_rd.cpp @@ -199,7 +199,7 @@ static BOOL createHeap_CB(fopAc_ac_c* i_this) { /* 000006C0-0000096C .text _createHeap__6daRd_cFv */ BOOL daRd_c::_createHeap() { J3DModelData* modelData = static_cast(dComIfG_getObjectRes(m_arc_name, RD_BDL_RD)); - JUT_ASSERT(504, modelData != NULL); + JUT_ASSERT(VERSION_SELECT(502, 504, 504, 504), modelData != NULL); mpMorf = new mDoExt_McaMorf( modelData, @@ -220,7 +220,7 @@ BOOL daRd_c::_createHeap() { } J3DAnmTextureSRTKey* btk = static_cast(dComIfG_getObjectRes(m_arc_name, RD_BTK_RD_CLOSE)); - JUT_ASSERT(525, btk != NULL); + JUT_ASSERT(VERSION_SELECT(528, 525, 525, 525), btk != NULL); if (!mBtkAnm.init(modelData, btk, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false, 0)) { return FALSE; } @@ -228,7 +228,7 @@ BOOL daRd_c::_createHeap() { modelData->getJointNodePointer(0x0C)->setCallBack(nodeHeadControl_CB); // ree_atama_1 J3DAnmTevRegKey* brk = static_cast(dComIfG_getObjectRes(m_arc_name, RD_BRK_NML)); - JUT_ASSERT(550, brk != NULL); + JUT_ASSERT(VERSION_SELECT(553, 550, 550, 550), brk != NULL); if (!mBrkAnm.init(modelData, brk, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false, 0)) { return FALSE; } @@ -399,12 +399,14 @@ bool daRd_c::createArrowHeap() { /* 000009D0-00000A38 .text checkPlayerInAttack__6daRd_cFv */ bool daRd_c::checkPlayerInAttack() { - return dLib_checkActorInFan(current.pos, dComIfGp_getLinkPlayer(), shape_angle.y, l_HIO.mAttackSpreadAngle, l_HIO.mAttackRadius, 100.0f); + daPy_py_c* player = (daPy_py_c*)dComIfGp_getLinkPlayer(); + return dLib_checkActorInFan(current.pos, player, shape_angle.y, l_HIO.mAttackSpreadAngle, l_HIO.mAttackRadius, 100.0f); } /* 00000A38-00000AA0 .text checkPlayerInCry__6daRd_cFv */ bool daRd_c::checkPlayerInCry() { - return dLib_checkActorInFan(current.pos, dComIfGp_getLinkPlayer(), mHeadAngle, l_HIO.mCrySpreadAngle, l_HIO.mCryRadius, 100.0f); + daPy_py_c* player = (daPy_py_c*)dComIfGp_getLinkPlayer(); + return dLib_checkActorInFan(current.pos, player, mHeadAngle, l_HIO.mCrySpreadAngle, l_HIO.mCryRadius, 100.0f); } /* 00000AA0-00000D78 .text lookBack__6daRd_cFv */ @@ -459,7 +461,12 @@ void daRd_c::lookBack() { mTargetPos = player->getHeadTopPos(); break; case MODE_RETURN: - if (dLib_checkActorInCircle(mSpawnPos, this, 100.0f, 1000.0f)) { +#if VERSION == VERSION_DEMO + if (dLib_checkActorInCircle(mSpawnPos, this, 100.0f, 100.0f)) +#else + if (dLib_checkActorInCircle(mSpawnPos, this, 100.0f, 1000.0f)) +#endif + { mJntCtrl.clrTrn(); mJntCtrl.onHeadLock(); mJntCtrl.onBackBoneLock(); @@ -494,7 +501,9 @@ bool daRd_c::checkTgHit() { if (mCyl.ChkTgHit()) { hitObj = mCyl.GetTgHitObj(); if (hitObj->GetAtType() == AT_TYPE_LIGHT) { +#if VERSION > VERSION_DEMO fopAcM_seStart(this, JA_SE_CM_PW_BECOME_SOLID, 0); +#endif modeProcInit(MODE_PARALYSIS); return true; } @@ -647,7 +656,9 @@ bool daRd_c::checkTgHit() { } if (dComIfGp_getDetect().chk_light(¤t.pos)) { +#if VERSION > VERSION_DEMO fopAcM_seStart(this, JA_SE_CM_PW_BECOME_SOLID, 0); +#endif modeProcInit(MODE_PARALYSIS); return true; } @@ -1059,9 +1070,13 @@ void daRd_c::modeAttack() { if (dist <= 20.0f + REG12_F(2)) { cLib_addCalcPosXZ2(¤t.pos, player->current.pos, 0.3f, 1.0f); if (cLib_calcTimer(&mTimer2) == 0) { +#if VERSION == VERSION_DEMO + dComIfGp_setItemLifeCount(-1.0f); +#else if (!daPy_getPlayerLinkActorClass()->checkNoDamageMode()) { daPy_getPlayerLinkActorClass()->setDamagePoint(-1.0f); } +#endif mTimer2 = 30; } } else if (mAcch.ChkWallHit()) { @@ -1753,14 +1768,20 @@ void daRd_c::createInit() { } } +#if VERSION > VERSION_DEMO setBrkAnm(0); +#endif setMtx(); +#if VERSION > VERSION_DEMO mBtkAnm.play(); mBrkAnm.play(); mpMorf->play(¤t.pos, 0, 0); mBrkAnm.setFrame(0.0f); +#endif mpMorf->calc(); +#if VERSION > VERSION_DEMO g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); +#endif fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx()); fopAcM_setCullSizeBox(this, -100.0f, -10.0f, -100.0f, 100.0f, 250.0f, 150.0f); @@ -1838,9 +1859,11 @@ cPhs_State daRd_c::_create() { bool daRd_c::_delete() { dComIfG_resDelete(&mPhs, m_arc_name); enemy_fire_remove(&mEnemyFire); +#if VERSION > VERSION_DEMO if (heap) { mpMorf->stopZelAnime(); } +#endif return true; } diff --git a/src/d/d_demo.cpp b/src/d/d_demo.cpp index 463ce6ef2..0f493f74b 100644 --- a/src/d/d_demo.cpp +++ b/src/d/d_demo.cpp @@ -124,9 +124,15 @@ void* dDemo_getJaiPointer(const char* a_name, u32 bck, int num, u16* tbl) { return NULL; } +#if VERSION == VERSION_DEMO +BOOL dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, const char* i_arcName, + int p5, u16* p6) +#else /* 800698C0-80069BC0 .text dDemo_setDemoData__FP10fopAc_ac_cUcP14mDoExt_McaMorfPCciPUsUlSc */ BOOL dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, const char* i_arcName, - int p5, u16* p6, u32 mtrlSndId, s8 i_reverb) { + int p5, u16* p6, u32 mtrlSndId, s8 i_reverb) +#endif +{ dDemo_actor_c* demo_actor = dComIfGp_demo_getActor(i_actor->demoActorID); if (demo_actor == NULL) return FALSE; @@ -175,12 +181,20 @@ BOOL dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, if (anm_frame > 1.0f) { anm_frame -= 1.0f; i_morf->setFrame(anm_frame); +#if VERSION == VERSION_DEMO + i_morf->play(&i_actor->current.pos, 0, 0); +#else i_morf->play(&i_actor->current.pos, mtrlSndId, i_reverb); +#endif } else { i_morf->setFrame(anm_frame); } } else { +#if VERSION == VERSION_DEMO + i_morf->play(&i_actor->current.pos, 0, 0); +#else i_morf->play(&i_actor->current.pos, mtrlSndId, i_reverb); +#endif } return TRUE; diff --git a/src/d/d_envse.cpp b/src/d/d_envse.cpp index 38948b5ea..c9da779ab 100644 --- a/src/d/d_envse.cpp +++ b/src/d/d_envse.cpp @@ -4,6 +4,7 @@ // #include "d/d_envse.h" +#include "d/d_priority.h" #include "f_op/f_op_kankyo.h" #include "f_op/f_op_kankyo_mng.h" #include "f_op/f_op_camera.h" @@ -189,15 +190,15 @@ kankyo_method_class l_dEnvSe_Method = { }; kankyo_process_profile_definition g_profile_ENVSE = { - fpcLy_CURRENT_e, - 2, - fpcPi_CURRENT_e, - PROC_ENVSE, - &g_fpcLf_Method.base, - sizeof(dEnvSe_c), - 0, - 0, - &g_fopKy_Method, - 0xA9, - &l_dEnvSe_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x0002, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_ENVSE, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dEnvSe_c), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_ENVSE, + /* Actor SubMtd */ &l_dEnvSe_Method, }; diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index 723da2396..cc0b00662 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -9,6 +9,7 @@ #include "d/d_kankyo_data.h" #include "d/d_kankyo_rain.h" #include "d/d_kankyo_wether.h" +#include "d/d_priority.h" #include "d/d_procname.h" #include "d/d_s_play.h" #include "d/d_stage.h" @@ -2451,17 +2452,17 @@ kankyo_method_class l_dKy_Method = { }; kankyo_process_profile_definition g_profile_KANKYO = { - fpcLy_CURRENT_e, - 1, - fpcPi_CURRENT_e, - PROC_KANKYO, - &g_fpcLf_Method.base, - sizeof(sub_kankyo__class), - 0, - 0, - &g_fopKy_Method, - 0x002, - &l_dKy_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x0001, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_KANKYO, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(sub_kankyo__class), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_KANKYO, + /* Actor SubMtd */ &l_dKy_Method, }; /* 80194974-80194BDC .text dKy_setLight_init__Fv */ diff --git a/src/d/d_ky_thunder.cpp b/src/d/d_ky_thunder.cpp index 54c616c89..19daa5186 100644 --- a/src/d/d_ky_thunder.cpp +++ b/src/d/d_ky_thunder.cpp @@ -4,6 +4,7 @@ // #include "d/d_ky_thunder.h" +#include "d/d_priority.h" #include "f_op/f_op_kankyo.h" #include "f_op/f_op_kankyo_mng.h" #include "f_op/f_op_camera.h" @@ -87,8 +88,10 @@ static BOOL dThunder_IsDelete(dThunder_c* i_this) { /* 80198ABC-80198B68 .text dThunder_Delete__FP10dThunder_c */ static BOOL dThunder_Delete(dThunder_c* i_this) { +#if VERSION > VERSION_DEMO mDoAud_seDeleteObject(&i_this->mPos); mDoAud_seDeleteObject(&i_this->mPosNeg); +#endif i_this->~dThunder_c(); return TRUE; } @@ -109,9 +112,9 @@ cPhs_State dThunder_c::create() { dScnKy_env_light_c& envLight = dKy_getEnvlight(); camera_class *pCamera = (camera_class*)dComIfGp_getCamera(0); - new(this) dThunder_c(); + new (this) dThunder_c(); J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Always", ALWAYS_BDL_YTHDR00); - JUT_ASSERT(0x6e, modelData != NULL); + JUT_ASSERT(VERSION_SELECT(111, 110, 110, 110), modelData != NULL); mModelInfo.mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x01000200); if (mModelInfo.mpModel == NULL) @@ -121,29 +124,35 @@ cPhs_State dThunder_c::create() { return cPhs_ERROR_e; J3DAnmTextureSRTKey * anm = (J3DAnmTextureSRTKey *)dComIfG_getObjectRes("Always", ALWAYS_BTK_YTHDR00); - JUT_ASSERT(0x7d, anm != NULL); + JUT_ASSERT(VERSION_SELECT(126, 125, 125, 125), anm != NULL); if (!mModelInfo.mBtk.init(modelData, anm, false, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0)) return cPhs_ERROR_e; J3DAnmTevRegKey * canm = (J3DAnmTevRegKey *)dComIfG_getObjectRes("Always", ALWAYS_BRK_YTHDR00); - JUT_ASSERT(0x8c, canm != NULL); + JUT_ASSERT(VERSION_SELECT(141, 140, 140, 140), canm != NULL); if (!mModelInfo.mBrk.init(modelData, canm, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false, 0)) return cPhs_ERROR_e; mBtkTime = cM_rndF(1.0f); + f32 f31; + f32 f30; + f32 f29; f32 size = envLight.mThunderEff.mState < 10 ? 1.0f : 0.5f; cXyz fwd; + f31 = 5.0f; + f30 = 20.0f; + f29 = 80.0f; cXyz offs(120000.0f, 2000.0f, 0.0f); mRot = 4000.0f; mRot = size * cM_rndFX(mRot); - f32 f1 = cM_rndF(15.0f); - mScale.x = size * (f1 + 5.0f); + f32 f1 = cM_rndF(f30 - f31); + mScale.x = size * (f31 + f1); if (cM_rndFX(1.0f) >= 0.5) mScale.x *= -1.0f; - f1 = cM_rndF(60.0f); - mScale.y = size * (f1 + 20.0f); + f1 = cM_rndF(f29 - f30); + mScale.y = size * (f30 + f1); mScale.z = 1.0f; dKyr_get_vectle_calc(&pCamera->mLookat.mEye, &pCamera->mLookat.mCenter, &fwd); @@ -168,10 +177,18 @@ cPhs_State dThunder_c::create() { mPos.z = pCamera->mLookat.mEye.z + fwd.z * 100000.0f + rot.z * baseXZ; if (cM_rndF(1.0f) < 0.3f) { +#if VERSION == VERSION_DEMO + cXyz sp14; + sp14.x = -mPos.x; + sp14.y = -mPos.y; + sp14.z = -mPos.z; + mDoAud_seStart(JA_SE_OBJ_THUNDER_FAR, &sp14); +#else mPosNeg.x = -mPos.x; mPosNeg.y = -mPos.y; mPosNeg.z = -mPos.z; mDoAud_seStart(JA_SE_OBJ_THUNDER_FAR, &mPosNeg); +#endif } return cPhs_COMPLEATE_e; @@ -186,15 +203,15 @@ kankyo_method_class l_dThunder_Method = { }; kankyo_process_profile_definition g_profile_KY_THUNDER = { - fpcLy_CURRENT_e, - 7, - fpcPi_CURRENT_e, - PROC_KY_THUNDER, - &g_fpcLf_Method.base, - sizeof(dThunder_c), - 0, - 0, - &g_fopKy_Method, - 0x006, - &l_dThunder_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x0007, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_KY_THUNDER, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dThunder_c), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_KY_THUNDER, + /* Actor SubMtd */ &l_dThunder_Method, }; diff --git a/src/d/d_kyeff.cpp b/src/d/d_kyeff.cpp index 50d2e73a5..e7e74b474 100644 --- a/src/d/d_kyeff.cpp +++ b/src/d/d_kyeff.cpp @@ -4,6 +4,7 @@ // #include "d/d_kyeff.h" +#include "d/d_priority.h" #include "f_op/f_op_kankyo.h" #include "f_op/f_op_camera.h" #include "d/d_com_inf_game.h" @@ -171,15 +172,15 @@ kankyo_method_class l_dKyeff_Method = { }; kankyo_process_profile_definition g_profile_KYEFF = { - fpcLy_CURRENT_e, - 12, - fpcPi_CURRENT_e, - PROC_KYEFF, - &g_fpcLf_Method.base, - sizeof(dKyeff_c), - 0, - 0, - &g_fopKy_Method, - 0x005, - &l_dKyeff_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x000C, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_KYEFF, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dKyeff_c), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_KYEFF, + /* Actor SubMtd */ &l_dKyeff_Method, }; diff --git a/src/d/d_kyeff2.cpp b/src/d/d_kyeff2.cpp index 9bec87308..5b715d189 100644 --- a/src/d/d_kyeff2.cpp +++ b/src/d/d_kyeff2.cpp @@ -4,6 +4,7 @@ // #include "d/d_kyeff2.h" +#include "d/d_priority.h" #include "f_op/f_op_kankyo.h" #include "f_op/f_op_camera.h" #include "d/d_kankyo_wether.h" @@ -52,15 +53,15 @@ kankyo_method_class l_dKyeff2_Method = { }; kankyo_process_profile_definition g_profile_KYEFF2 = { - fpcLy_CURRENT_e, - 12, - fpcPi_CURRENT_e, - PROC_KYEFF2, - &g_fpcLf_Method.base, - sizeof(dKyeff2_c), - 0, - 0, - &g_fopKy_Method, - 0x003, - &l_dKyeff2_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x000C, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_KYEFF2, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dKyeff2_c), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_KYEFF2, + /* Actor SubMtd */ &l_dKyeff2_Method, }; diff --git a/src/d/d_level_se.cpp b/src/d/d_level_se.cpp index 3585d36d8..fbca11947 100644 --- a/src/d/d_level_se.cpp +++ b/src/d/d_level_se.cpp @@ -4,6 +4,7 @@ // #include "d/d_level_se.h" +#include "d/d_priority.h" #include "f_op/f_op_kankyo.h" #include "f_op/f_op_kankyo_mng.h" #include "d/d_procname.h" @@ -49,15 +50,15 @@ kankyo_method_class l_dLevelSe_Method = { }; kankyo_process_profile_definition g_profile_LEVEL_SE = { - fpcLy_CURRENT_e, - 2, - fpcPi_CURRENT_e, - PROC_LEVEL_SE, - &g_fpcLf_Method.base, - sizeof(dLevelSe_c), - 0, - 0, - &g_fopKy_Method, - 0x1CD, - &l_dLevelSe_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x0002, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_LEVEL_SE, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dLevelSe_c), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_LEVEL_SE, + /* Actor SubMtd */ &l_dLevelSe_Method, }; diff --git a/src/d/d_throwstone.cpp b/src/d/d_throwstone.cpp index e6cd579e6..6711050c3 100644 --- a/src/d/d_throwstone.cpp +++ b/src/d/d_throwstone.cpp @@ -60,7 +60,7 @@ static s32 daThrowstoneCreate(void* ptr) { } bool daThrowstone_c::_delete() { - dComIfG_resDelete(&mPhs, M_arcname); + dComIfG_resDeleteDemo(&mPhs, M_arcname); return TRUE; } @@ -70,13 +70,15 @@ static BOOL daThrowstoneDelete(void* ptr) { } bool daThrowstone_c::_execute() { - dDemo_setDemoData(this, 0x6a, NULL, NULL, 0, NULL, 0, 0); + dDemo_setDemoData( + this, + dDemo_actor_c::ENABLE_TRANS_e | dDemo_actor_c::ENABLE_ROTATE_e | dDemo_actor_c::ENABLE_ANM_e | dDemo_actor_c::ENABLE_ANM_FRAME_e, + NULL, NULL + ); mpModel->setBaseScale(scale); - f32 pos_x = current.pos.x; - mDoMtx_stack_c::transS(pos_x, current.pos.y, current.pos.z); - s16 rot_x = shape_angle.x; - mDoMtx_stack_c::ZXYrotM(rot_x, shape_angle.y, shape_angle.z); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::ZXYrotM(shape_angle); mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); mDoMtx_copy(mDoMtx_stack_c::get(), mMtx); diff --git a/src/d/d_timer.cpp b/src/d/d_timer.cpp index fea43bb46..6463c5721 100644 --- a/src/d/d_timer.cpp +++ b/src/d/d_timer.cpp @@ -15,34 +15,39 @@ #include "JSystem/JKernel/JKRSolidHeap.h" u32 ShipRaceSeTable[] = { - 0x7530, JA_SE_SGAME_TIMER_30, - 0x4E20, JA_SE_SGAME_TIMER_30, - 0x2710, JA_SE_SGAME_TIMER_10, - 0x2328, JA_SE_SGAME_TIMER_10, - 0x1F40, JA_SE_SGAME_TIMER_10, - 0x1B58, JA_SE_SGAME_TIMER_10, - 0x1770, JA_SE_SGAME_TIMER_10, - 0x1388, JA_SE_SGAME_TIMER_10, - 0x0FA0, JA_SE_SGAME_TIMER_10, - 0x0BB8, JA_SE_SGAME_TIMER_10, - 0x07D0, JA_SE_SGAME_TIMER_10, - 0x03E8, JA_SE_SGAME_TIMER_10, + 30000, JA_SE_SGAME_TIMER_30, + 20000, JA_SE_SGAME_TIMER_30, + 10000, JA_SE_SGAME_TIMER_10, + 9000, JA_SE_SGAME_TIMER_10, + 8000, JA_SE_SGAME_TIMER_10, + 7000, JA_SE_SGAME_TIMER_10, + 6000, JA_SE_SGAME_TIMER_10, + 5000, JA_SE_SGAME_TIMER_10, + 4000, JA_SE_SGAME_TIMER_10, + 3000, JA_SE_SGAME_TIMER_10, + 2000, JA_SE_SGAME_TIMER_10, + 1000, JA_SE_SGAME_TIMER_10, 0xFFFFFFFF, 0x0000, }; u32 VolcanoSeTable[] = { - 0xEA60, JA_SE_MINIGAME_TIMER_30, - 0x7530, JA_SE_MINIGAME_TIMER_30, - 0x2710, JA_SE_MINIGAME_TIMER_10, - 0x2328, JA_SE_MINIGAME_TIMER_10, - 0x1F40, JA_SE_MINIGAME_TIMER_10, - 0x1B58, JA_SE_MINIGAME_TIMER_10, - 0x1770, JA_SE_MINIGAME_TIMER_10, - 0x1388, JA_SE_MINIGAME_TIMER_10, - 0x0FA0, JA_SE_MINIGAME_TIMER_10, - 0x0BB8, JA_SE_MINIGAME_TIMER_10, - 0x07D0, JA_SE_MINIGAME_TIMER_10, - 0x03E8, JA_SE_MINIGAME_TIMER_10, + 60000, JA_SE_MINIGAME_TIMER_30, + 30000, JA_SE_MINIGAME_TIMER_30, +#if VERSION > VERSION_DEMO + 10000, JA_SE_MINIGAME_TIMER_10, +#endif + 9000, JA_SE_MINIGAME_TIMER_10, + 8000, JA_SE_MINIGAME_TIMER_10, + 7000, JA_SE_MINIGAME_TIMER_10, + 6000, JA_SE_MINIGAME_TIMER_10, + 5000, JA_SE_MINIGAME_TIMER_10, + 4000, JA_SE_MINIGAME_TIMER_10, + 3000, JA_SE_MINIGAME_TIMER_10, + 2000, JA_SE_MINIGAME_TIMER_10, + 1000, JA_SE_MINIGAME_TIMER_10, +#if VERSION == VERSION_DEMO + 0, JA_SE_ISLE_TIMER_0, +#endif 0xFFFFFFFF, 0x0000, }; @@ -70,7 +75,7 @@ cPhs_State dTimer_c::_create() { if (prm->mIconType != 0) { iconTex = mpSolidHeap->alloc(0xC00, 0x20); JUT_ASSERT(0x5a, iconTex != NULL); - mpScrnDraw->setIconType(iconTex, prm->mIconType); + setIconType(iconTex, prm->mIconType); } mDoExt_restoreCurrentHeap(); @@ -82,29 +87,29 @@ cPhs_State dTimer_c::_create() { return rt; } - mpScrnDraw->setRupeePos(prm->mRupeePos.x, prm->mRupeePos.y); - mpScrnDraw->setTimerPos(prm->mTimerPos.x, prm->mTimerPos.y); - mpScrnDraw->setShowType(prm->mShowType); + setRupeePos(prm->mRupeePos.x, prm->mRupeePos.y); + setTimerPos(prm->mTimerPos.x, prm->mTimerPos.y); + setShowType(prm->mShowType); mTimerMode = prm->mTimerMode; if (mTimerMode == 7) { mLimitTime = OSMillisecondsToTicks((OSTime)dComIfG_getTimerLimitTimeMs()); OSTime curTime = OSGetTime(); mTime = mStartTime = curTime; mStartTime -= OSMillisecondsToTicks((OSTime)dComIfG_getTimerNowTimeMs()); - mState = 0; + mStatus = 0; mTimerMode = dComIfG_getTimerMode(); dComIfG_setTimerNowTimeMs(getTimeMs()); dComIfG_setTimerLimitTimeMs(getLimitTimeMs()); dComIfG_setTimerMode(mTimerMode); dComIfG_setTimerPtr(this); if (dComIfG_getTimerMode() == 3) - mpScrnDraw->setShowType(1); + setShowType(1); stock_start(10); } else { mLimitTime = OSSecondsToTicks((OSTime)prm->mLimitTimeMs); mStartTime = 0; mTime = 0; - mState = 0; + mStatus = 0; dComIfG_setTimerNowTimeMs(getTimeMs()); dComIfG_setTimerLimitTimeMs(getLimitTimeMs()); dComIfG_setTimerMode(mTimerMode); @@ -143,18 +148,18 @@ cPhs_State dTimer_c::_create() { BOOL dTimer_c::_execute() { if (field_0x162 != 1) { field_0x150 = getRestTimeMs(); - if (mState == 0 || mState == 1 || mState == 3) { + if (mStatus == 0 || mStatus == 1 || mStatus == 3) { mStartTime = 0; mTime = 0; - if (mState == 1 || mState == 3) { + if (mStatus == 1 || mStatus == 3) { if (--field_0x160 <= 0) { - if (mState == 3) + if (mStatus == 3) stock_start(); else start(); } } - } else if (mState == 2) { + } else if (mStatus == 2) { mTime = OSGetTime(); dComIfG_setTimerNowTimeMs(getTimeMs()); dComIfG_setTimerLimitTimeMs(getLimitTimeMs()); @@ -170,24 +175,24 @@ BOOL dTimer_c::_execute() { } } - if (mState == 0 || mState == 2) { + if (mStatus == 0 || mStatus == 2) { if (mTimerMode == 3 || mTimerMode == 2) { if (dMenu_flag() || dComIfGp_event_getMode() == dEvtMode_TALK_e) stop(1); else restart(1); } - } else if (mState == 6) { + } else if (mStatus == 6) { if (mpScrnDraw->closeAnime()) fopMsgM_Delete(this); - } else if (mState != 5 && mState == 4) { + } else if (mStatus != 5 && mStatus == 4) { if (field_0x158 <= 0) { if (mTimerMode == 3) { deleteRequest(); - mpScrnDraw->field_0x234 = 0; + mpScrnDraw->animeTimerReset(); } else { - mpScrnDraw->field_0x234 = 0; - mState = 5; + mpScrnDraw->animeTimerReset(); + mStatus = 5; } } else { field_0x158--; @@ -218,7 +223,7 @@ BOOL dTimer_c::_delete() { if (mpSolidHeap != NULL) mDoExt_destroySolidHeap(mpSolidHeap); - if (mTimerMode == 3 && mState != 6 && mState != 5 && mState != 4) { + if (mTimerMode == 3 && mStatus != 6 && mStatus != 5 && mStatus != 4) { dComIfG_setTimerNowTimeMs(getTimeMs()); dComIfG_setTimerLimitTimeMs(getLimitTimeMs()); dComIfG_setTimerMode(mTimerMode); @@ -229,7 +234,7 @@ BOOL dTimer_c::_delete() { } dComIfG_setTimerPtr(NULL); - dComIfG_resDelete(&mPhs, "Timer"); + dComIfG_resDeleteDemo(&mPhs, "Timer"); return TRUE; } @@ -243,7 +248,7 @@ BOOL dTimer_c::RestTimeCheck(int time) { /* 8023C110-8023C124 .text deleteCheck__8dTimer_cFv */ BOOL dTimer_c::deleteCheck() { - return mState == 5; + return mStatus == 5; } /* 8023C124-8023C268 .text SetSE__8dTimer_cFv */ @@ -268,8 +273,8 @@ void dTimer_c::SetSE() { /* 8023C268-8023C2CC .text start__8dTimer_cFv */ bool dTimer_c::start() { - if (mState == 0 || mState == 1) { - mState = 2; + if (mStatus == 0 || mStatus == 1) { + mStatus = 2; mTime = mStartTime = OSGetTime(); return true; } else { @@ -279,9 +284,9 @@ bool dTimer_c::start() { /* 8023C2CC-8023C2F4 .text start__8dTimer_cFs */ bool dTimer_c::start(s16 param_1) { - if (mState == 0) { + if (mStatus == 0) { field_0x160 = param_1; - mState = 1; + mStatus = 1; return true; } else { return false; @@ -290,8 +295,8 @@ bool dTimer_c::start(s16 param_1) { /* 8023C2F4-8023C3A8 .text stock_start__8dTimer_cFv */ bool dTimer_c::stock_start() { - if (mState == 3) { - mState = 2; + if (mStatus == 3) { + mStatus = 2; OSTime time = OSGetTime(); mStartTime = time; mTime = time; @@ -304,9 +309,9 @@ bool dTimer_c::stock_start() { /* 8023C3A8-8023C3D0 .text stock_start__8dTimer_cFs */ bool dTimer_c::stock_start(s16 param_1) { - if (mState == 0) { + if (mStatus == 0) { field_0x160 = param_1; - mState = 3; + mStatus = 3; return true; } else { return false; @@ -318,7 +323,7 @@ bool dTimer_c::stop(u8 param_1) { if (field_0x162 == 1 || field_0x163 != 0) return false; - if (mState != 2) + if (mStatus != 2) return false; field_0x130 = OSGetTime(); @@ -332,11 +337,12 @@ bool dTimer_c::restart(u8 param_1) { if (field_0x162 != 1 || field_0x163 != param_1) return false; - if (mState != 2) + if (mStatus != 2) return false; mTime = OSGetTime(); - field_0x138 += mTime - field_0x130; + OSTime temp = mTime - field_0x130; + field_0x138 += temp; field_0x162 = 0; field_0x163 = 0; return true; @@ -344,11 +350,11 @@ bool dTimer_c::restart(u8 param_1) { /* 8023C500-8023C56C .text end__8dTimer_cFi */ bool dTimer_c::end(int param_1) { - if (mState != 2) + if (mStatus != 2) return false; field_0x120 = OSGetTime(); - mState = 4; + mStatus = 4; if (param_1 != -1) field_0x158 = param_1; return true; @@ -356,7 +362,7 @@ bool dTimer_c::end(int param_1) { /* 8023C56C-8023C57C .text deleteRequest__8dTimer_cFv */ bool dTimer_c::deleteRequest() { - mState = 6; + mStatus = 6; return true; } @@ -607,17 +613,18 @@ void dDlst_TimerScrnDraw_c::setIconType(void* tex, u8 type) { /* 8023D318-8023D644 .text anime__21dDlst_TimerScrnDraw_cFv */ void dDlst_TimerScrnDraw_c::anime() { static const s16 animeFrame[] = { 7, 15, 22 }; + f32 f31 = -50.0f; if (field_0x235 == 0) { - if (field_0x234 < animeFrame[2]) { - field_0x234++; + if (mAnimeTimer < animeFrame[2]) { + mAnimeTimer++; } else { field_0x235 = 1; } - if (field_0x234 <= animeFrame[1]) { - f32 temp_f31 = acc(animeFrame[1], field_0x234, 0); - f32 temp_f1 = (1.0f - temp_f31) * -50.0f; + if (mAnimeTimer <= animeFrame[1]) { + f32 temp_f31 = acc(animeFrame[1], mAnimeTimer, 0); + f32 temp_f1 = f31 * (1.0f - temp_f31); fopMsgM_paneTrans(&mClockIcon, temp_f1, 0.0f); fopMsgM_paneTrans(&mClockBG, temp_f1, 0.0f); @@ -638,9 +645,9 @@ void dDlst_TimerScrnDraw_c::anime() { dTm_parentPaneScale(&mTimerBGShadow, &mClockIcon, g_menuHIO.field_0x94); } - if (field_0x234 > animeFrame[0] && field_0x234 <= animeFrame[2]) { - f32 temp_f31 = acc(animeFrame[1], field_0x234 - animeFrame[0], 0); - f32 temp_f1 = (1.0f - temp_f31) * -50.0f; + if (mAnimeTimer > animeFrame[0] && mAnimeTimer <= animeFrame[2]) { + f32 temp_f31 = acc(animeFrame[1], mAnimeTimer - animeFrame[0], 0); + f32 temp_f1 = f31 * (1.0f - temp_f31); fopMsgM_paneTrans(&mRupee, temp_f1 + g_menuHIO.field_0x9a, g_menuHIO.field_0x9c); fopMsgM_setNowAlpha(&mRupee, temp_f31); @@ -654,12 +661,13 @@ void dDlst_TimerScrnDraw_c::anime() { /* 8023D644-8023D848 .text closeAnime__21dDlst_TimerScrnDraw_cFv */ BOOL dDlst_TimerScrnDraw_c::closeAnime() { + f32 f5 = -50.0f; BOOL ret = FALSE; - field_0x234++; - if (field_0x234 <= 7) { - f32 temp = acc(7, field_0x234, 0); - f32 alpha = acc(7, 7 - field_0x234, 0); - f32 x = temp * -50.0f; + mAnimeTimer++; + if (mAnimeTimer <= 7) { + f32 temp = acc(7, mAnimeTimer, 0); + f32 alpha = acc(7, 7 - mAnimeTimer, 0); + f32 x = f5 * temp; fopMsgM_paneTrans(&mClockIcon, x, 0.0f); fopMsgM_paneTrans(&mClockBG, x, 0.0f); fopMsgM_paneTrans(&mTimerNumberBG, x, 0.0f); @@ -677,7 +685,7 @@ BOOL dDlst_TimerScrnDraw_c::closeAnime() { fopMsgM_setNowAlpha(&mRupeeShadow, alpha); } - if (field_0x234 >= 7) + if (mAnimeTimer >= 7) ret = TRUE; return ret; diff --git a/src/d/d_wind_arrow.cpp b/src/d/d_wind_arrow.cpp index 692a21581..9d7c6dc2f 100644 --- a/src/d/d_wind_arrow.cpp +++ b/src/d/d_wind_arrow.cpp @@ -5,6 +5,7 @@ #include "d/d_wind_arrow.h" #include "d/d_kankyo_wether.h" +#include "d/d_priority.h" #include "d/d_procname.h" #include "d/res/res_always.h" #include "m_Do/m_Do_graphic.h" @@ -108,7 +109,7 @@ static BOOL dWindArrow_Delete(dWindArrow_c* i_this) { } cPhs_State dWindArrow_c::create() { - new(this) dWindArrow_c(); + new (this) dWindArrow_c(); J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Always", ALWAYS_BDL_YA); JUT_ASSERT(0x56, modelData != NULL); @@ -151,15 +152,15 @@ kankyo_method_class l_dWindArrow_Method = { }; kankyo_process_profile_definition g_profile_WIND_ARROW = { - fpcLy_CURRENT_e, - 2, - fpcPi_CURRENT_e, - PROC_WIND_ARROW, - &g_fpcLf_Method.base, - sizeof(dWindArrow_c), - 0, - 0, - &g_fopKy_Method, - 0x01CB, - &l_dWindArrow_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x0002, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_WIND_ARROW, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dWindArrow_c), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_WIND_ARROW, + /* Actor SubMtd */ &l_dWindArrow_Method, }; diff --git a/src/d/d_wpot_water.cpp b/src/d/d_wpot_water.cpp index 2384fa713..3cb0b76a1 100644 --- a/src/d/d_wpot_water.cpp +++ b/src/d/d_wpot_water.cpp @@ -6,6 +6,7 @@ #include "d/d_wpot_water.h" #include "d/d_bg_s_gnd_chk.h" #include "d/d_com_inf_game.h" +#include "d/d_priority.h" #include "d/d_procname.h" #include "f_op/f_op_kankyo_mng.h" @@ -60,7 +61,7 @@ static BOOL dWpotWater_Delete(dWpotWater_c* i_this) { } cPhs_State dWpotWater_c::create() { - new(this) dWpotWater_c(); + new (this) dWpotWater_c(); dComIfGp_particle_set(dPa_name::ID_SCENE_8083, &mPos); dComIfGp_particle_set(dPa_name::ID_SCENE_8084, &mPos); emtr = dComIfGp_particle_set(dPa_name::ID_SCENE_8086, &mPos, NULL, NULL, 0xAA, &dWpotWater_c::mEcallback); @@ -73,8 +74,8 @@ cPhs_State dWpotWater_c::create() { } /* 8023F750-8023FFCC .text dWpotWater_Create__FP12kankyo_class */ -static cPhs_State dWpotWater_Create(kankyo_class* i_k) { - dWpotWater_c* i_this = (dWpotWater_c*)i_k; +static cPhs_State dWpotWater_Create(kankyo_class* i_this) { + dWpotWater_c* a_this = (dWpotWater_c*)i_this; dBgS_GndChk gndChk; dBgS_ObjGndChk_Yogan lavaChk; @@ -112,7 +113,7 @@ static cPhs_State dWpotWater_Create(kankyo_class* i_k) { if (groundY != -G_CM3D_F_INF) { cXyz sp18(i_this->mPos.x, i_this->mPos.y, i_this->mPos.z); fopAcM_create(PROC_HITOBJ, 0, &sp18, i_this->mParam); - return i_this->create(); + return a_this->create(); } return cPhs_ERROR_e; @@ -127,15 +128,15 @@ kankyo_method_class l_dWpotWater_Method = { }; kankyo_process_profile_definition g_profile_WPOT_WATER = { - fpcLy_CURRENT_e, - 2, - fpcPi_CURRENT_e, - PROC_WPOT_WATER, - &g_fpcLf_Method.base, - sizeof(dWpotWater_c), - 0, - 0, - &g_fopKy_Method, - 0x01CC, - &l_dWpotWater_Method, + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 0x0002, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_WPOT_WATER, + /* Proc SubMtd */ &g_fpcLf_Method.base, + /* Size */ sizeof(dWpotWater_c), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopKy_Method, + /* Priority */ PRIO_WPOT_WATER, + /* Actor SubMtd */ &l_dWpotWater_Method, }; diff --git a/src/m_Do/m_Do_hostIO.cpp b/src/m_Do/m_Do_hostIO.cpp index 99b02c9b5..24bdb3f30 100644 --- a/src/m_Do/m_Do_hostIO.cpp +++ b/src/m_Do/m_Do_hostIO.cpp @@ -15,7 +15,7 @@ void mDoHIO_root_c::update() {} /* 80017A50-80017B20 .text createChild__16mDoHIO_subRoot_cFPCcP13JORReflexible */ s8 mDoHIO_subRoot_c::createChild(const char* i_name, JORReflexible* i_reflexible) { for (int i = 0; i < 64; i++) { - if (mChild[i].mReflexible == i_reflexible) { + if (mChild[i].getPt() == i_reflexible) { // "Danger: Trying to register an already registered HostIO<%s>\n" OSReport_Error("危険:既に登録されているホストIOをふたたび登録しようとしています<%s>\n", i_name); return -1; @@ -23,9 +23,9 @@ s8 mDoHIO_subRoot_c::createChild(const char* i_name, JORReflexible* i_reflexible } for (int i = 0; i < 64; i++) { - if (mChild[i].mReflexible == NULL) { - strncpy(mChild[i].mName, i_name, sizeof(mChild[i].mName)); - mChild[i].mReflexible = i_reflexible; + if (mChild[i].getPt() == NULL) { + mChild[i].setName(i_name); + mChild[i].setPt(i_reflexible); return i; } } @@ -38,11 +38,40 @@ s8 mDoHIO_subRoot_c::createChild(const char* i_name, JORReflexible* i_reflexible /* 80017B20-80017B88 .text deleteChild__16mDoHIO_subRoot_cFSc */ void mDoHIO_subRoot_c::deleteChild(s8 i_childID) { if (i_childID >= 0) { - if (mChild[i_childID].mReflexible == NULL) { + if (mChild[i_childID].getPt() == NULL) { // "Danger: Trying to delete HostIO that has already been deleted<%s>\n" - OSReport_Error("危険:すでに削除されているホストIOをさらに削除しようとしています<%s>\n", mChild[i_childID].mName); + OSReport_Error("危険:すでに削除されているホストIOをさらに削除しようとしています<%s>\n", mChild[i_childID].getName()); } else { - mChild[i_childID].mReflexible = NULL; + mChild[i_childID].setPt(NULL); } } } + +#if VERSION == VERSION_DEMO +mDoHIO_entry_c::mDoHIO_entry_c() { + mNo = 0; + mCount = 0; +} + +mDoHIO_entry_c::~mDoHIO_entry_c() { + if (mCount != 0) { + OSReport_Error("~mDoHIO_entry_c mCount=%d mNo=%d\n", mCount, mNo); + mDoHIO_deleteChild(mNo); + mDoHIO_deleteChild(mNo); + } +} + +void mDoHIO_entry_c::entryHIO(const char* name) { + if (mCount == 0) { + mNo = mDoHIO_createChild(name, this); + } + mCount++; +} + +void mDoHIO_entry_c::removeHIO() { + mCount--; + if (mCount == 0) { + mDoHIO_deleteChild(mNo); + } +} +#endif