From fdbac96f9a868ce2defe1b1b9b01e07e182212ac Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Mon, 27 Apr 2026 19:05:33 -0400 Subject: [PATCH] Demo work --- configure.py | 12 ++++---- include/d/actor/d_a_npc_kamome.h | 7 +++++ include/d/actor/d_a_title.h | 4 ++- src/d/actor/d_a_npc_bs1.cpp | 44 +++++++++++++++++++---------- src/d/actor/d_a_npc_kamome.cpp | 48 ++++++++++++++++++++++++++------ src/d/actor/d_a_title.cpp | 4 +++ src/d/actor/d_a_tori_flag.cpp | 29 ++++++++++++++++++- src/d/actor/d_a_ygcwp.cpp | 8 ++++-- src/d/d_com_static.cpp | 2 ++ src/d/d_s_play.cpp | 15 ++++++---- src/d/d_s_title.cpp | 9 ++++-- 11 files changed, 141 insertions(+), 41 deletions(-) diff --git a/configure.py b/configure.py index d1298ddf3..409196330 100755 --- a/configure.py +++ b/configure.py @@ -639,7 +639,7 @@ config.libs = [ Object(NonMatching, "d/d_s_open_sub.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_s_play.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_s_room.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_s_title.cpp"), + Object(Matching, "d/d_s_title.cpp"), Object(NonMatching, "d/d_scope.cpp"), Object(Matching, "d/d_throwstone.cpp"), Object(Matching, "d/d_timer.cpp"), @@ -1629,7 +1629,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_npc_bmcon1"), ActorRel(NonMatching, "d_a_npc_bms1"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_bmsw"), - ActorRel(NonMatching, "d_a_npc_bs1"), # regalloc + ActorRel(MatchingFor("D44J01"), "d_a_npc_bs1"), # regalloc ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_btsw"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_btsw2"), ActorRel(NonMatching, "d_a_npc_co1"), @@ -1642,7 +1642,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_npc_hr"), ActorRel(NonMatching, "d_a_npc_jb1"), ActorRel(NonMatching, "d_a_npc_ji1"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_kamome"), + ActorRel(Matching, "d_a_npc_kamome"), ActorRel(NonMatching, "d_a_npc_kf1"), ActorRel(NonMatching, "d_a_npc_kg1"), ActorRel(NonMatching, "d_a_npc_kg2"), @@ -1785,7 +1785,7 @@ config.libs = [ ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_title"), ActorRel(NonMatching, "d_a_tn"), ActorRel(Matching, "d_a_toge"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_tori_flag"), + ActorRel(Matching, "d_a_tori_flag"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_wall"), ActorRel(Matching, "d_a_warpfout"), ActorRel(Matching, "d_a_warpgn"), @@ -1794,8 +1794,8 @@ config.libs = [ ActorRel(NonMatching, "d_a_waterfall"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_windmill"), ActorRel(NonMatching, "d_a_wz"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_ygcwp"), - ActorRel(Matching, "d_a_yougan"), + ActorRel(Matching, "d_a_ygcwp"), + ActorRel(Matching, "d_a_yougan"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_ghostship"), ActorRel(NonMatching, "d_a_movie_player", extra_cflags=["-O3,p"]), ] diff --git a/include/d/actor/d_a_npc_kamome.h b/include/d/actor/d_a_npc_kamome.h index 2eee198ea..e5c79bc18 100644 --- a/include/d/actor/d_a_npc_kamome.h +++ b/include/d/actor/d_a_npc_kamome.h @@ -90,6 +90,10 @@ public: void animationPlay(); BOOL execute(); BOOL draw(); +#if VERSION == VERSION_DEMO + void emitterDelete(JPABaseEmitter**); +#endif + f32 getGroundY() { return mAcch.GetGroundH(); } MtxP getLeftHandMatrix() { return cullMtx; } MtxP getRightHandMatrix() { return cullMtx; } @@ -109,6 +113,9 @@ public: /* 0x7E4 */ dCcD_Sph mAtSph; /* 0x910 */ dCcD_Sph mTgSph; /* 0xA3C */ dCcD_Cps mCps; +#if VERSION == VERSION_DEMO + JPABaseEmitter* mB74; +#endif /* 0xB74 */ cXyz mDescendStartPos; /* 0xB80 */ cXyz mDescendStartPosUnangled; /* 0xB8C */ csXyz mDescendStartAngle; diff --git a/include/d/actor/d_a_title.h b/include/d/actor/d_a_title.h index 8285f2e83..468ed9756 100644 --- a/include/d/actor/d_a_title.h +++ b/include/d/actor/d_a_title.h @@ -20,9 +20,11 @@ public: inline void draw(); s32 getEnterMode() { return mEnterMode; } +#if VERSION > VERSION_DEMO static void daTitle_Kirakira_Sound_flag_on(); - static bool daTitle_Kirakira_Sound_flag; +#endif + public: /* 0x004 */ JPABaseEmitter* mpEmitter; /* 0x008 */ JPABaseEmitter* mpEmitter2; diff --git a/src/d/actor/d_a_npc_bs1.cpp b/src/d/actor/d_a_npc_bs1.cpp index cc77afdae..de2734538 100644 --- a/src/d/actor/d_a_npc_bs1.cpp +++ b/src/d/actor/d_a_npc_bs1.cpp @@ -195,7 +195,7 @@ static BOOL nodeCallBack_Bs(J3DNode* node, int calcTiming) { if (jntNo == i_this->getHeadJntNum()) { cXyz offset(0.0f, 0.0f, 0.0f); mDoMtx_XrotM(*calc_mtx, i_this->getHead_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->getHead_x()); + cMtx_ZrotM(*calc_mtx, -i_this->getHead_x()); cXyz pos; MtxPosition(&offset, &pos); i_this->setAttentionBasePos(pos); @@ -207,7 +207,7 @@ static BOOL nodeCallBack_Bs(J3DNode* node, int calcTiming) { i_this->incAttnSetCount(); } else if (jntNo == i_this->getBackboneJntNum()) { mDoMtx_XrotM(*calc_mtx, i_this->getBackbone_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->getBackbone_x()); + cMtx_ZrotM(*calc_mtx, -i_this->getBackbone_x()); } cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); model->setAnmMtx(jntNo, *calc_mtx); @@ -471,7 +471,7 @@ static void daNpc_Bs1_setPayRupee(int unknownParam1, int unknownParam2) { /* 000010EC-00001F7C .text next_msgStatus__11daNpc_Bs1_cFPUl */ u16 daNpc_Bs1_c::next_msgStatus(u32* pMsgNo) { - /* Nonmatching */ + /* Nonmatching - retail-only regalloc */ u16 msgStatus = fopMsgStts_MSG_CONTINUES_e; switch(*pMsgNo) { @@ -1218,11 +1218,13 @@ void daNpc_Bs1_c::setCollision() { offset.z = -16.0f; cXyz out; MtxTrans(current.pos.x, current.pos.y, current.pos.z, false); - mDoMtx_YrotM(*calc_mtx, m726.y); + cMtx_YrotM(*calc_mtx, m726.y); MtxPosition(&offset, &out); + f32 radius = 46.0f; + f32 height = 130.0f; mCyl.SetC(out); - mCyl.SetR(46.0f); - mCyl.SetH(130.0f); + mCyl.SetR(radius); + mCyl.SetH(height); dComIfG_Ccsp()->Set(&mCyl); } @@ -1787,7 +1789,7 @@ BOOL daNpc_Bs1_c::getdemo_action(void*) { m830 = m831; mShopCamAction.Reset(); u16 itemNo = mShopItems.getSelectItemNo(); - fpc_ProcID itemPID = fopAcM_createItemForPresentDemo(¤t.pos, itemNo, 0, -1, current.roomNo); + fpc_ProcID itemPID = fopAcM_createItemForPresentDemo(¤t.pos, itemNo, 0, -1, DEMO_SELECT(-1, current.roomNo)); if (itemPID != fpcM_ERROR_PROCESS_ID_e) { dComIfGp_event_setItemPartnerId(itemPID); } @@ -2137,7 +2139,12 @@ BOOL daNpc_Bs1_c::_execute() { /* 000048D4-00004960 .text _delete__11daNpc_Bs1_cFv */ BOOL daNpc_Bs1_c::_delete() { dComIfG_resDelete(&mPhase, "Bs"); - if (heap != NULL && mpMorf != NULL) { + if ( +#if VERSION > VERSION_DEMO + heap != NULL && +#endif + mpMorf != NULL + ) { mpMorf->stopZelAnime(); } if (l_HIO.m8 >= 0 && (l_HIO.m8 -= 1) < 0) { @@ -2153,10 +2160,15 @@ static BOOL CheckCreateHeap(fopAc_ac_c* i_this) { /* 00004980-00004AD8 .text _create__11daNpc_Bs1_cFv */ cPhs_State daNpc_Bs1_c::_create() { +#if VERSION > VERSION_DEMO fopAcM_SetupActor(this, daNpc_Bs1_c); +#endif cPhs_State phase_state = dComIfG_resLoad(&mPhase, "Bs"); if (phase_state == cPhs_COMPLEATE_e) { +#if VERSION == VERSION_DEMO + fopAcM_SetupActor(this, daNpc_Bs1_c); +#endif mType = fopAcM_GetParamBit(fopAcM_GetParam(this), 0x14, 0x4); switch (mType) { case 0: @@ -2200,14 +2212,16 @@ BOOL daNpc_Bs1_c::CreateHeap() { 0, 0x11020203 ); if (!mpMorf || !mpMorf->getModel()) { +#if VERSION > VERSION_DEMO mpMorf = NULL; +#endif return FALSE; } m_head_jnt_num = modelData->getJointName()->getIndex("head"); - JUT_ASSERT(0xa68, m_head_jnt_num >= 0); + JUT_ASSERT(DEMO_SELECT(2660, 2664), m_head_jnt_num >= 0); m_backbone_jnt_num = modelData->getJointName()->getIndex("backbone1"); - JUT_ASSERT(0xa6a, m_backbone_jnt_num >= 0); + JUT_ASSERT(DEMO_SELECT(2662, 2666), m_backbone_jnt_num >= 0); switch (mType) { case 0: @@ -2219,7 +2233,9 @@ BOOL daNpc_Bs1_c::CreateHeap() { } if (!initTexPatternAnm(FALSE)) { +#if VERSION > VERSION_DEMO return FALSE; +#endif } mpHelmetModel = mDoExt_J3DModel__create((J3DModelData*)dComIfG_getObjectRes("Bs", BS_INDEX_BDL_BS_MET), 0, 0x11020203); @@ -2235,16 +2251,16 @@ BOOL daNpc_Bs1_c::CreateHeap() { } for (u16 jntNo = 0; jntNo < modelData->getJointNum(); jntNo++) { - if (jntNo == getHeadJntNum() || jntNo == getBackboneJntNum()) { + if (jntNo == m_head_jnt_num || jntNo == m_backbone_jnt_num) { mpMorf->getModel()->getModelData()->getJointNodePointer(jntNo)->setCallBack(nodeCallBack_Bs); } } mpMorf->getModel()->setUserArea((u32)this); mAcchCir.SetWall(30.0f, 0.0f); mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, fopAcM_GetSpeed_p(this)); - mpShopCursor = ShopCursor_create((J3DModelData*)dComIfG_getObjectRes("Bs", BS_INDEX_BMD_SHOP_CURSOR01), - (J3DAnmTevRegKey*)dComIfG_getObjectRes("Bs", BS_INDEX_BRK_SHOP_CURSOR01), - l_HIO.mChild[mType].m30); + J3DAnmTevRegKey* brk = (J3DAnmTevRegKey*)dComIfG_getObjectRes("Bs", BS_INDEX_BRK_SHOP_CURSOR01); + modelData = (J3DModelData*)dComIfG_getObjectRes("Bs", BS_INDEX_BMD_SHOP_CURSOR01); + mpShopCursor = ShopCursor_create(modelData, brk, l_HIO.mChild[mType].m30); if (mpShopCursor != NULL) { return TRUE; diff --git a/src/d/actor/d_a_npc_kamome.cpp b/src/d/actor/d_a_npc_kamome.cpp index 684b06523..8b6bbc235 100644 --- a/src/d/actor/d_a_npc_kamome.cpp +++ b/src/d/actor/d_a_npc_kamome.cpp @@ -147,16 +147,17 @@ BOOL daNpc_kam_c::callDemoStartCheck() { cXyz line_start_pos; cXyz line_end_pos; - s16 angle = link->shape_angle.y + 0x8000; + s16 angleY = link->shape_angle.y + 0x8000; + s16 angleX = -0x1555; mLinChk.OnBackFlag(); line_end_pos = hyoi_pear_pos; // Check if there are any straight lines from any angle around the Hyoi Pear that the Hyoi Seagull can descend from. for (int i = 0; i < 0x10; i++) { - mDoMtx_stack_c::YrotS(angle + 0x8000); + mDoMtx_stack_c::YrotS(angleY + 0x8000); mDoMtx_stack_c::multVec(&l_call_local_kyori, &line_end_pos); - mDoMtx_stack_c::YrotS(angle); + mDoMtx_stack_c::YrotS(angleY); mDoMtx_stack_c::multVec(&l_call_local_kyori, &line_start_pos); mDoMtx_stack_c::XrotM(-0x1555); mDoMtx_stack_c::multVec(&l_call_local_kyori, &descend_start_pos); @@ -172,14 +173,14 @@ BOOL daNpc_kam_c::callDemoStartCheck() { // Found a direction with no collisions. mDescendStartPos = descend_start_pos; mDescendStartPosUnangled = line_start_pos; // Unused - mDescendStartAngle.set(0x1555, angle + 0x8000, 0); + mDescendStartAngle.set(-angleX, angleY + 0x8000, 0); mLinChk.OffBackFlag(); l_demo_start_chk_flag = 1; return TRUE; } } - angle = angle + 0x2000; + angleY = angleY + 0x2000; } mLinChk.OffBackFlag(); @@ -207,9 +208,13 @@ daNpc_kam_c::~daNpc_kam_c() { dComIfG_resDelete(&mPhs, "Kamome"); +#if VERSION == VERSION_DEMO + emitterDelete(&mB74); +#else if (heap) { mpMorf->stopZelAnime(); } +#endif if (l_HIO.mNo >= 0) { mDoHIO_deleteChild(l_HIO.mNo); @@ -219,6 +224,16 @@ daNpc_kam_c::~daNpc_kam_c() { offHyoiKamome(); } +#if VERSION == VERSION_DEMO +void daNpc_kam_c::emitterDelete(JPABaseEmitter** pEmitter) { + if (*pEmitter) { + (*pEmitter)->quitImmortalEmitter(); + (*pEmitter)->becomeInvalidEmitter(); + *pEmitter = NULL; + } +} +#endif + /* 00000A6C-00000B20 .text setAttention__11daNpc_kam_cFbi */ void daNpc_kam_c::setAttention(bool param_1, int param_2) { if (param_1) { @@ -262,7 +277,7 @@ static int headNodeCallBack(J3DNode* node, int calcTiming) { /* 00000CD0-00000EB8 .text createHeap__11daNpc_kam_cFv */ BOOL daNpc_kam_c::createHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Kamome", KAMOME_BDL_KA_HYOI); - JUT_ASSERT(763, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(762, 763), modelData != NULL); mpMorf = new mDoExt_McaMorf( modelData, @@ -283,7 +298,7 @@ BOOL daNpc_kam_c::createHeap() { modelData->getJointNodePointer(head1JntIdx)->setCallBack(headNodeCallBack); } m_jnt_body = modelData->getJointName()->getIndex("j_ka_spin1"); - JUT_ASSERT(783, m_jnt_body >= 0); + JUT_ASSERT(DEMO_SELECT(782, 783), m_jnt_body >= 0); mpMorf->getModel()->setUserArea((u32)this); @@ -297,7 +312,9 @@ static BOOL checkCreateHeap(fopAc_ac_c* i_this) { /* 00000ED8-0000101C .text create__11daNpc_kam_cFv */ cPhs_State daNpc_kam_c::create() { +#if VERSION > VERSION_DEMO fopAcM_SetupActor(this, daNpc_kam_c); +#endif if (l_act != NULL && l_act != this) { return cPhs_ERROR_e; @@ -309,8 +326,14 @@ cPhs_State daNpc_kam_c::create() { cPhs_State phase_state = dComIfG_resLoad(&mPhs, "Kamome"); if (phase_state == cPhs_COMPLEATE_e) { +#if VERSION == VERSION_DEMO + fopAcM_SetupActor(this, daNpc_kam_c); +#endif + if (!fopAcM_entrySolidHeap(this, checkCreateHeap, l_heap_size)) { +#if VERSION > VERSION_DEMO mpMorf = NULL; +#endif return cPhs_ERROR_e; } @@ -1046,7 +1069,9 @@ BOOL daNpc_kam_c::actionWaitEvent(int evtStaffId) { /* 000035C8-0000361C .text initialChangeEvent__11daNpc_kam_cFi */ void daNpc_kam_c::initialChangeEvent(int evtStaffId) { +#if VERSION > VERSION_DEMO fopAcM_SetRoomNo(this, fopAcM_GetHomeRoomNo(this)); +#endif changePlayer(this); dComIfGs_setBaitItemEmpty(); offNoBgCheck(); @@ -1098,7 +1123,11 @@ BOOL daNpc_kam_c::actionDescendEvent(int evtStaffId) { return TRUE; } - return cLib_calcTimer(&mWaitTimer) == 0 ? TRUE : FALSE; + if (cLib_calcTimer(&mWaitTimer) == 0) { + return TRUE; + } + + return FALSE; } /* 00003864-00003884 .text initialAreaOutTurn__11daNpc_kam_cFi */ @@ -1216,7 +1245,8 @@ void daNpc_kam_c::setAnm(int anmIdx) { /* 00003B14-00003C80 .text setCollision__11daNpc_kam_cFv */ void daNpc_kam_c::setCollision() { - MtxP mtx = mpMorf->getModel()->getAnmMtx(m_jnt_body); + J3DModel* model = mpMorf->getModel(); + MtxP mtx = model->getAnmMtx(m_jnt_body); cXyz center; center.set(mtx[0][3], mtx[1][3], mtx[2][3]); diff --git a/src/d/actor/d_a_title.cpp b/src/d/actor/d_a_title.cpp index 53579bcb6..f83aa168b 100644 --- a/src/d/actor/d_a_title.cpp +++ b/src/d/actor/d_a_title.cpp @@ -189,7 +189,9 @@ daTitle_proc_c::~daTitle_proc_c() { mDoExt_destroySolidHeap(m_solid_heap); m_solid_heap = NULL; mDoExt_setCurrentHeap(oldHeap); +#if VERSION > VERSION_DEMO fopMsgM_destroyExpHeap(m_exp_heap); +#endif } /* 00000D7C-00000D94 .text setEnterMode__14daTitle_proc_cFv */ @@ -279,10 +281,12 @@ void daTitle_proc_c::calc_2d_alpha() { #endif if (m018 == 80) { +#if VERSION > VERSION_DEMO if (daTitle_Kirakira_Sound_flag == true) { mDoAud_seStart(JA_SE_TITLE_KIRA); daTitle_Kirakira_Sound_flag = false; } +#endif m00C.set(pane[4].mPosTopLeftOrig.x - 320.0f, pane[4].mPosTopLeftOrig.y - 240.0f, 0.0f); diff --git a/src/d/actor/d_a_tori_flag.cpp b/src/d/actor/d_a_tori_flag.cpp index a892f71f5..9b11b14fe 100644 --- a/src/d/actor/d_a_tori_flag.cpp +++ b/src/d/actor/d_a_tori_flag.cpp @@ -102,13 +102,39 @@ cPhs_State daTori_Flag_c::CreateInit() { mWindvec.y = wind_vec->y; mWindvec.z = wind_vec->z; set_mtx(); +#if VERSION > VERSION_DEMO dKy_tevstr_init(&mClothTevStr, current.roomNo, 0xFF); +#endif fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); return cPhs_COMPLEATE_e; } /* 000003C4-00000478 .text _create__13daTori_Flag_cFv */ cPhs_State daTori_Flag_c::_create() { +#if VERSION == VERSION_DEMO + cPhs_State result1 = dComIfG_resLoad(&mPhsTrflag, M_arcname); + cPhs_State result2 = dComIfG_resLoad(&mPhsCloth, "Cloth"); + if (result1 == cPhs_ERROR_e || result2 == cPhs_ERROR_e) { + return cPhs_ERROR_e; + } + if (result1 != cPhs_COMPLEATE_e) { + return result1; + } + if (result2 != cPhs_COMPLEATE_e) { + return result2; + } + cPhs_State result3 = cPhs_COMPLEATE_e; + if (result3 == cPhs_COMPLEATE_e) { + fopAcM_SetupActor(this, daTori_Flag_c); + if (fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x1020)) { + result3 = CreateInit(); + } + else { + result3 = cPhs_ERROR_e; + } + } + return result3; +#else fopAcM_SetupActor(this, daTori_Flag_c); cPhs_State result = dComIfG_resLoad(&mPhsTrflag, M_arcname); if (result != cPhs_COMPLEATE_e) { @@ -125,6 +151,7 @@ cPhs_State daTori_Flag_c::_create() { result = cPhs_ERROR_e; } return result; +#endif } /* 000003A4-000003C4 .text daTori_FlagCreate__FPv */ @@ -148,7 +175,7 @@ bool daTori_Flag_c::_execute() { set_mtx(); mStts.Move(); if (mCyl.ChkTgHit()) { - daObj::HitSeStart(¤t.pos, current.roomNo, &mCyl, 0x0B); + daObj::HitSeStart(¤t.pos, fopAcM_GetRoomNo(this), &mCyl, 0x0B); } fopAcM_rollPlayerCrash(this, 40.0f, 7); cXyz wind; diff --git a/src/d/actor/d_a_ygcwp.cpp b/src/d/actor/d_a_ygcwp.cpp index 8a1e557cd..33c0ed4ca 100644 --- a/src/d/actor/d_a_ygcwp.cpp +++ b/src/d/actor/d_a_ygcwp.cpp @@ -48,9 +48,11 @@ BOOL daYgcwp_c::solidHeapCB(fopAc_ac_c* i_ac) { /* 00000098-0000023C .text create_heap__9daYgcwp_cFv */ BOOL daYgcwp_c::create_heap() { + J3DModelData* mdl_data; + J3DAnmTevRegKey* brk_p; s32 i; BOOL ret = FALSE; - J3DModelData* mdl_data = static_cast(dComIfG_getObjectRes(M_arcname, YGCWP_BDL_YGCWP00)); + mdl_data = static_cast(dComIfG_getObjectRes(M_arcname, YGCWP_BDL_YGCWP00)); JUT_ASSERT(0xBE, mdl_data != NULL); if (mdl_data != NULL) { @@ -59,7 +61,7 @@ BOOL daYgcwp_c::create_heap() { ret = TRUE; for (i = 0; i < (s32)ARRAY_SIZE(mBrkAnm); i++) { - J3DAnmTevRegKey* brk_p = static_cast(dComIfG_getObjectRes(M_arcname, M_brk_table[i])); + brk_p = static_cast(dComIfG_getObjectRes(M_arcname, M_brk_table[i])); JUT_ASSERT(0xC9, brk_p != NULL); if (brk_p != NULL) { if (!mBrkAnm[i].init(mdl_data, brk_p, TRUE, M_brk_mode_table[i])) { @@ -106,7 +108,7 @@ cPhs_State daYgcwp_c::_create() { /* 00000470-000004A0 .text _delete__9daYgcwp_cFv */ bool daYgcwp_c::_delete() { - dComIfG_resDelete(&mPhs, M_arcname); + dComIfG_resDeleteDemo(&mPhs, M_arcname); return true; } diff --git a/src/d/d_com_static.cpp b/src/d/d_com_static.cpp index f5ed2286b..a208f04a5 100644 --- a/src/d/d_com_static.cpp +++ b/src/d/d_com_static.cpp @@ -448,12 +448,14 @@ void daTagKbItem_c::dig_main() { field_0x299 = 0; } +#if VERSION > VERSION_DEMO bool daTitle_proc_c::daTitle_Kirakira_Sound_flag = true; /* 80056CC0-80056CCC .text daTitle_Kirakira_Sound_flag_on__14daTitle_proc_cFv */ void daTitle_proc_c::daTitle_Kirakira_Sound_flag_on() { daTitle_Kirakira_Sound_flag = true; } +#endif /* 80056CCC-80056DE0 .text daiItemNodeCallBack__13daStandItem_cFP7J3DNodei */ BOOL daStandItem_c::daiItemNodeCallBack(J3DNode* node, int calcTiming) { diff --git a/src/d/d_s_play.cpp b/src/d/d_s_play.cpp index c21a4ee90..6fdbd27f4 100644 --- a/src/d/d_s_play.cpp +++ b/src/d/d_s_play.cpp @@ -1179,6 +1179,14 @@ BOOL heapSizeCheck() { /* 802355A8-802356B0 .text phase_00__FP13dScnPly_ply_c */ cPhs_State phase_00(dScnPly_ply_c* i_this) { +#if VERSION == VERSION_DEMO + if (fpcM_GetName(i_this) == PROC_OPENING_SCENE) { + if (mDoRst::isReset()) { + mDoRst_reset(0, 0, 0); + } + } + return cPhs_NEXT_e; +#else if (mDoAud_isUsedHeapForStreamBuffer()) { return cPhs_INIT_e; } @@ -1186,11 +1194,9 @@ cPhs_State phase_00(dScnPly_ply_c* i_this) { mDoGph_gInf_c::offBlure(); if (fpcM_GetName(i_this) != PROC_PLAY_SCENE) { - #if VERSION > VERSION_DEMO if (!heapSizeCheck()) { mDoRst_reset(0, 0x80000000, 0); } - #endif if (mDoRst::isReset()) { if (mDoAud_zelAudio_c::isResetFlag()) { @@ -1208,14 +1214,13 @@ cPhs_State phase_00(dScnPly_ply_c* i_this) { dComIfGs_init(); } else { - #if VERSION > VERSION_DEMO if (!heapSizeCheck()) { - JUT_WARN(VERSION_SELECT(3356, 3356, 3372, 3372), "%s", "Memory Danger !!"); + JUT_WARN(VERSION_SELECT(0, 3356, 3372, 3372), "%s", "Memory Danger !!"); } - #endif } return cPhs_NEXT_e; +#endif } /* 802356B0-802356E0 .text phase_01__FP13dScnPly_ply_c */ diff --git a/src/d/d_s_title.cpp b/src/d/d_s_title.cpp index 65ef5ef62..657341d98 100644 --- a/src/d/d_s_title.cpp +++ b/src/d/d_s_title.cpp @@ -72,11 +72,15 @@ static BOOL dScnTitle_Execute(title_of_scene_class* i_this) { if (fpcM_GetName(i_this) == PROC_ENDING_SCENE) { if (movie->mpCallBack1() == 0) { +#if VERSION == VERSION_DEMO + fopScnM_ChangeReq(i_this, PROC_NAMEEX_SCENE, PROC_OVERLAP0, 5); +#else if (dComIfGs_getClearCount() == 0) { fopScnM_ChangeReq(i_this, PROC_NAMEEX_SCENE, PROC_OVERLAP0, 5); } else { dComIfG_changeOpeningScene(i_this, PROC_OPENING_SCENE); } +#endif movie->mpCallBack2(0.0f); } } else { @@ -111,10 +115,11 @@ static cPhs_State dScnTitle_Create(scene_class* i_scn) { dMenu_flagSet(0); fopAc_ac_c::setStopStatus(0); +#if VERSION > VERSION_DEMO dComIfGp_offEnableNextStage(); - u32 parameter = fpcM_GetName(i_this) == PROC_TITLE_SCENE ? 0 : 1; +#endif - i_this->mMoviePId = fopAcM_create(PROC_MP, parameter); + i_this->mMoviePId = fopAcM_create(PROC_MP, fpcM_GetName(i_this) == PROC_TITLE_SCENE ? 0 : 1); #if VERSION == VERSION_PAL dScnTitle_c::mMp = NULL;