diff --git a/configure.py b/configure.py index 55c503b4f..543fa01ab 100755 --- a/configure.py +++ b/configure.py @@ -494,7 +494,7 @@ config.libs = [ Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_attention.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_att_dist.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_acch.cpp"), + Object(Matching, "d/d_bg_s_acch.cpp"), Object(Matching, "d/d_bg_s_func.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_lin_chk.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_movebg_actor.cpp"), @@ -1460,7 +1460,7 @@ config.libs = [ ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_wbird"), ActorRel(NonMatching, "d_a_ykgr"), ActorRel(Matching, "d_a_alldie"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_am", extra_cflags=['-pragma "nosyminline on"']), + ActorRel(Matching, "d_a_am", extra_cflags=['-pragma "nosyminline on"']), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_am2", extra_cflags=["-sym off"]), ActorRel(NonMatching, "d_a_amiprop"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_arrow_iceeff", extra_cflags=['-pragma "nosyminline on"']), diff --git a/include/d/actor/d_a_am.h b/include/d/actor/d_a_am.h index 484350a6f..54078ab84 100644 --- a/include/d/actor/d_a_am.h +++ b/include/d/actor/d_a_am.h @@ -39,6 +39,9 @@ public: /* 0x0324 */ cXyz mSpawnPos; /* 0x0330 */ csXyz mEyeRot; /* 0x0336 */ csXyz mTargetEyeRot; +#if VERSION == VERSION_DEMO + /* 0x033C */ JPABaseEmitter* m033C_demo; +#endif /* 0x033C */ JPABaseEmitter* m033C; /* 0x0340 */ JPABaseEmitter* m0340; /* 0x0344 */ dPa_smokeEcallBack mSmokeCbs[4]; diff --git a/include/d/actor/d_a_player_main.h b/include/d/actor/d_a_player_main.h index 249024e3e..757d2700c 100644 --- a/include/d/actor/d_a_player_main.h +++ b/include/d/actor/d_a_player_main.h @@ -209,7 +209,7 @@ public: ~daPy_dmEcallBack_c() {} daPy_dmEcallBack_c() {} - static int getTimer() { return m_timer; } + static s16 getTimer() { return m_timer; } static void setTimer(s16 timer) { m_timer = timer; } static void decTimer() { m_timer--; } @@ -1237,7 +1237,9 @@ public: BOOL dProcOpenTreasure_init(); BOOL dProcOpenTreasure(); void setGetItemSound(u16, int); +#if VERSION > VERSION_DEMO BOOL setGetDemo(); +#endif BOOL dProcGetItem_init(); BOOL dProcGetItem(); BOOL dProcUnequip_init(); @@ -1677,8 +1679,12 @@ public: BOOL procFoodSet(); void setSwordModel(BOOL); void setLightSaver(); +#if VERSION == VERSION_DEMO + BOOL checkLastDemoSwordNoDraw(int); +#else BOOL checkDemoShieldNoDraw(); BOOL checkDemoSwordNoDraw(BOOL); +#endif BOOL checkChanceMode(); BOOL checkCutRollChange() const; int getSwordBlurColor(); @@ -2204,7 +2210,9 @@ public: /* 0x362C */ fpc_ProcID mTactZevPartnerId; /* 0x3630 */ fpc_ProcID m3630; /* 0x3634 */ fpc_ProcID mWhirlId; +#if VERSION > VERSION_DEMO /* 0x3638 */ fpc_ProcID mMsgId; +#endif /* 0x363C */ J3DFrameCtrl* mpSeAnmFrameCtrl; /* 0x3640 */ s16 m3640; /* 0x3644 */ f32 m3644; diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index 42fbfe438..2310e6922 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -91,7 +91,7 @@ public: cXyz* speed = NULL, csXyz* angle = NULL, csXyz* shape_angle = NULL); void GroundCheckInit(dBgS&); void GroundCheck(dBgS&); - f32 GroundRoofProc(dBgS&); + void GroundRoofProc(dBgS&); void LineCheck(dBgS&); void CrrPos(dBgS&); f32 GetWallAllR(); diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 267ee99cb..967253aec 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -413,7 +413,11 @@ public: class dDlst_mirrorPacket : public J3DPacket { public: void init(ResTIMG*); +#if VERSION == VERSION_DEMO + void update(Mtx, u8); +#else void update(Mtx, u8, f32); +#endif virtual void draw(); /* 0x0010 */ u8 field_0x0010[0x0040 - 0x0010]; diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index a5ea8ecab..770c91447 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -430,15 +430,14 @@ inline f32 fopAcM_searchActorDistanceY(fopAc_ac_c* actorA, fopAc_ac_c* actorB) { return actorB->current.pos.y - actorA->current.pos.y; } -inline u16 fopAcM_GetSetId(fopAc_ac_c* p_actor) { +inline int fopAcM_GetSetId(fopAc_ac_c* p_actor) { return p_actor->setID; } inline void dComIfGs_onActor(int bitNo, int roomNo); inline void fopAcM_onActor(fopAc_ac_c* p_actor) { - int setId = fopAcM_GetSetId(p_actor); - dComIfGs_onActor(setId, fopAcM_GetHomeRoomNo(p_actor)); + dComIfGs_onActor(fopAcM_GetSetId(p_actor), fopAcM_GetHomeRoomNo(p_actor)); } inline bool fopAcM_IsFirstCreating(void* i_actor) { diff --git a/src/d/actor/d_a_am.cpp b/src/d/actor/d_a_am.cpp index a69abe01e..92270d597 100644 --- a/src/d/actor/d_a_am.cpp +++ b/src/d/actor/d_a_am.cpp @@ -57,7 +57,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { am_class* i_this = (am_class*)model->getUserArea(); if (i_this) { if (jntNo >= 1 && jntNo <= 4) { - cMtx_copy(model->getAnmMtx(jntNo), *calc_mtx); + MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); } cXyz offset; @@ -369,6 +369,7 @@ static void bomb_move_set(am_class* i_this, u8 alwaysMoveY) { /* 00000F04-00001138 .text bomb_nomi_check__FP8am_class */ static BOOL bomb_nomi_check(am_class* i_this) { fopAc_ac_c* actor = i_this; + fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); i_this->mStts.Move(); if (i_this->mCurrBckIdx != AM_BCK_OPEN && i_this->mCurrBckIdx != AM_BCK_OPEN_LOOP && @@ -391,8 +392,7 @@ static BOOL bomb_nomi_check(am_class* i_this) { if (fpcM_GetName(hitActor) == PROC_BOMB) { daBomb_c* bomb = (daBomb_c*)hitActor; if (!bomb->getBombCheck_Flag() && bomb->getBombRestTime() > 1) { - f32 offsetY = 20.0f + REG8_F(1); - if (i_this->mMouthPos.y - offsetY < bomb->current.pos.y) { + if (i_this->mMouthPos.y - (20.0f + REG8_F(1)) < bomb->current.pos.y) { // Swallow the bomb. bomb->setBombCheck_Flag(); bomb->change_state((daBomb_c::State_e)2); @@ -407,8 +407,7 @@ static BOOL bomb_nomi_check(am_class* i_this) { } else if (fpcM_GetName(hitActor) == PROC_Bomb2) { daBomb2::Act_c* bomb2 = (daBomb2::Act_c*)hitActor; if (!bomb2->chk_eat() && bomb2->get_time() > 1) { - f32 offsetY = 20.0f + REG8_F(1); - if (i_this->mMouthPos.y - offsetY < bomb2->current.pos.y) { + if (i_this->mMouthPos.y - (20.0f + REG8_F(1)) < bomb2->current.pos.y) { // Swallow the bomb. bomb2->set_eat(); i_this->mSwallowedActorPID = fopAcM_GetID(bomb2); @@ -429,9 +428,7 @@ static BOOL bomb_nomi_check(am_class* i_this) { /* 00001138-000011E4 .text BG_check__FP8am_class */ static void BG_check(am_class* i_this) { - f32 halfHeight = 30.0f + REG12_F(3); - f32 radius = 150.0f + REG12_F(4); - i_this->mAcchCir.SetWall(halfHeight, radius); + i_this->mAcchCir.SetWall(30.0f + REG12_F(3), 150.0f + REG12_F(4)); i_this->current.pos.y -= i_this->mCorrectionOffsetY; i_this->old.pos.y -= i_this->mCorrectionOffsetY; @@ -495,17 +492,20 @@ static void action_dousa(am_class* i_this) { anm_init(i_this, AM_BCK_SLEEP_LOOP, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mMode += 1; // Fall-through - case 1: + case 1: { if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF && !dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { break; } fopAcM_OnStatus(i_this, fopAcStts_SHOWMAP_e); - if (fopAcM_searchPlayerDistance(i_this) < 1000.0f) { + f32 f31 = 1000.0f; + if (fopAcM_searchPlayerDistance(i_this) < f31) { +#if VERSION > VERSION_DEMO f32 yDist = player->current.pos.y - i_this->current.pos.y; yDist = std::sqrtf(yDist*yDist); // ??? if (yDist > 300.0f) { break; } +#endif if (Line_check(i_this, player->current.pos)) { anm_init(i_this, AM_BCK_OKIRU, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); fopAcM_monsSeStart(i_this, JA_SE_CV_AM_AWAKE, 0); @@ -516,6 +516,7 @@ static void action_dousa(am_class* i_this) { } } break; + } case MODE_DOUSA_OKIRU: if (!i_this->mpMorf->isStop()) { break; @@ -554,16 +555,19 @@ static void action_dousa(am_class* i_this) { return; } } else { - if (fopAcM_searchPlayerDistance(i_this) > 2000.0f) { + f32 f31 = 2000.0f; + if (fopAcM_searchPlayerDistance(i_this) > f31) { i_this->mMode = MODE_DOUSA_SLEEP_INIT; break; } +#if VERSION > VERSION_DEMO f32 yDist = player->current.pos.y - i_this->current.pos.y; yDist = std::sqrtf(yDist*yDist); // ??? if (yDist > 300.0f) { i_this->mMode = MODE_DOUSA_SLEEP_INIT; break; } +#endif } s16 yRotDiff = cLib_distanceAngleS(i_this->shape_angle.y, i_this->mTargetAngleY); if (yRotDiff < 0x100) { @@ -621,7 +625,16 @@ static void action_dousa(am_class* i_this) { fopAcM_monsSeStart(i_this, JA_SE_CV_AM_OPEN_MOUTH, 0); i_this->mNeedleCyl.OffAtSetBit(); i_this->mNeedleCyl.OffAtSetBit(); - if (i_this->mSmokeCbs[2].getEmitter() == NULL) { +#if VERSION == VERSION_DEMO + if (i_this->m033C_demo == NULL) +#else + if (i_this->mSmokeCbs[2].getEmitter() == NULL) +#endif + { +#if VERSION == VERSION_DEMO + i_this->mSmokeCbs[2].remove(); + i_this->m033C_demo = +#endif dComIfGp_particle_setToon( dPa_name::ID_SCENE_A154, &i_this->mWaistPos, &i_this->shape_angle, NULL, 0xB9, &i_this->mSmokeCbs[2], fopAcM_GetRoomNo(i_this) @@ -640,7 +653,15 @@ static void action_dousa(am_class* i_this) { i_this->mTargetAngleY = fopAcM_searchPlayerAngleY(i_this); } if (i_this->mCountDownTimers[0] == 0) { +#if VERSION == VERSION_DEMO + if (i_this->m033C_demo) { + i_this->m033C_demo->becomeInvalidEmitter(); + i_this->m033C_demo = NULL; + i_this->mSmokeCbs[2].remove(); + } +#else i_this->mSmokeCbs[2].remove(); +#endif i_this->mMode = 3; } break; @@ -662,9 +683,25 @@ static void action_dousa(am_class* i_this) { medama_move(i_this); if (i_this->mMode != 2 && medama_atari_check(i_this)) { +#if VERSION == VERSION_DEMO + if (i_this->m033C_demo) { + i_this->m033C_demo->becomeInvalidEmitter(); + i_this->m033C_demo = NULL; + i_this->mSmokeCbs[2].remove(); + } +#else i_this->mSmokeCbs[2].remove(); +#endif } else if (bomb_nomi_check(i_this)) { +#if VERSION == VERSION_DEMO + if (i_this->m033C_demo) { + i_this->m033C_demo->becomeInvalidEmitter(); + i_this->m033C_demo = NULL; + i_this->mSmokeCbs[2].remove(); + } +#else i_this->mSmokeCbs[2].remove(); +#endif } } @@ -946,7 +983,8 @@ static BOOL daAM_Execute(am_class* i_this) { fopAcM_setGbaName(i_this, dItem_BOW_e, 0xC, 0x2A); if (enemy_ice(&i_this->mEnemyIce)) { - i_this->mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + J3DModel* model = i_this->mpMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); i_this->mpMorf->calc(); return TRUE; } @@ -1067,8 +1105,14 @@ static BOOL daAM_Delete(am_class* i_this) { for (int i = 0; i < 4; i++) { i_this->mSmokeCbs[i].remove(); } +#if VERSION == VERSION_DEMO + if (i_this->m033C_demo) { + i_this->m033C_demo->becomeInvalidEmitter(); + i_this->m033C_demo = NULL; + } +#else i_this->mSmokeCbs[2].remove(); - +#endif if (i_this->m033C) { i_this->m033C->becomeInvalidEmitter(); i_this->m033C = NULL; diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index 17bee58cc..f56d80536 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -365,8 +365,7 @@ static BOOL body_atari_check(am2_class* i_this) { /* 00000F54-00000FF4 .text BG_check__FP9am2_class */ static void BG_check(am2_class* i_this) { - f32 halfHeight = 40.0f + REG8_F(12); - i_this->mAcchCir.SetWall(halfHeight, i_this->mAcchRadius); + i_this->mAcchCir.SetWall(40.0f + REG8_F(12), i_this->mAcchRadius); i_this->current.pos.y -= i_this->mCorrectionOffsetY; i_this->old.pos.y -= i_this->mCorrectionOffsetY; diff --git a/src/d/actor/d_a_npc_md.cpp b/src/d/actor/d_a_npc_md.cpp index d7af68d2d..b8adc0ddc 100644 --- a/src/d/actor/d_a_npc_md.cpp +++ b/src/d/actor/d_a_npc_md.cpp @@ -3211,7 +3211,11 @@ BOOL daNpc_Md_c::draw() { f32 temp = mCps.GetAtVecP()->abs(); mDoMtx_stack_c::scaleM(0.1f, 0.1f, temp * (1.0f/9600.0f)); mDoMtx_stack_c::revConcat(mtx); +#if VERSION == VERSION_DEMO + m0B70.update(mDoMtx_stack_c::get(), 0xFF); +#else m0B70.update(mDoMtx_stack_c::get(), 0xFF, 90.0f); +#endif dComIfGd_getXluList()->entryImm(&m0B70, 0x1F); } diff --git a/src/d/actor/d_a_obj_figure.cpp b/src/d/actor/d_a_obj_figure.cpp index 99a95cf2a..58cd244f7 100644 --- a/src/d/actor/d_a_obj_figure.cpp +++ b/src/d/actor/d_a_obj_figure.cpp @@ -90,680 +90,158 @@ static dCcD_SrcCyl l_cyl_src = { struct FigureData { /* 0x00 */ int mBmdId; /* 0x04 */ int mModelAttr; +#if VERSION > VERSION_DEMO /* 0x08 */ int mRoomId; +#endif }; // Size: 0x0C +#if VERSION == VERSION_DEMO +#define FIGUREDAT(bmdIdx, dlistFlags, roomId) \ + { \ + bmdIdx, dlistFlags \ + } +#else +#define FIGUREDAT(bmdIdx, dlistFlags, roomId) \ + { \ + bmdIdx, dlistFlags, roomId \ + } +#endif + static const FigureData l_figure_dat_tbl[TOTAL_FIGURE_COUNT] = { - { - 0, - 0x37441422, - -1 - }, - { - 1, - 0x37441422, - -1 - }, - { - 2, - 0x37441422, - -1 - }, - { - 3, - 0x37441422, - -1 - }, - { - 0xA, - 0x37441422, - -1 - }, - { - 4, - 0x37441422, - -1 - }, - { - 5, - 0x37441422, - -1 - }, - { - 6, - 0x37441422, - -1 - }, - { - 7, - 0x37441422, - -1 - }, - { - 8, - 0x37441422, - -1 - }, - { - 9, - 0x11001222, - -1 - }, - { - 0xB, - 0x37441422, - -1 - }, - { - 0xC, - 0x37441422, - -1 - }, - { - 0xD, - 0x37441422, - -1 - }, - { - 0, - 0x37441422, - -1 - }, - { - 1, - 0x37441422, - -1 - }, - { - 2, - 0x37441422, - -1 - }, - { - 4, - 0x37441422, - -1 - }, - { - 5, - 0x37441422, - -1 - }, - { - 7, - 0x37441422, - -1 - }, - { - 8, - 0x37441422, - -1 - }, - { - 9, - 0x37441422, - -1 - }, - { - 0xA, - 0x37441422, - -1 - }, - { - 0xB, - 0x37441422, - -1 - }, - { - 0xC, - 0x37441422, - -1 - }, - { - 0xD, - 0x37441422, - -1 - }, - { - 0xE, - 0x37441422, - -1 - }, - { - 0xF, - 0x37441422, - -1 - }, - { - 0x10, - 0x37441422, - -1 - }, - { - 0x11, - 0x37441422, - -1 - }, - { - 0x12, - 0x37441422, - -1 - }, - { - 0x13, - 0x37441422, - -1 - }, - { - 0x14, - 0x37441422, - -1 - }, - { - 0x15, - 0x37441422, - -1 - }, - { - 0x16, - 0x37441422, - -1 - }, - { - 0x17, - 0x37441422, - -1 - }, - { - 0x18, - 0x37441422, - -1 - }, - { - 0x19, - 0x37441422, - -1 - }, - { - 0x1A, - 0x37441422, - -1 - }, - { - 0x1B, - 0x37441422, - -1 - }, - { - 0x1C, - 0x37441422, - -1 - }, - { - 0, - 0x37441422, - 8 - }, - { - 1, - 0x37441422, - 8 - }, - { - 2, - 0x37441422, - 8 - }, - { - 3, - 0x37441422, - 8 - }, - { - 4, - 0x37441422, - 8 - }, - { - 5, - 0x37441422, - 8 - }, - { - 6, - 0x37441422, - 8 - }, - { - 7, - 0x37441422, - 8 - }, - { - 8, - 0x37441422, - 8 - }, - { - 9, - 0x37441422, - 8 - }, - { - 0xA, - 0x37441422, - 8 - }, - { - 0xB, - 0x37441422, - 8 - }, - { - 0xC, - 0x37441422, - 8 - }, - { - 0xD, - 0x37441422, - 8 - }, - { - 0xE, - 0x37441422, - 8 - }, - { - 0xF, - 0x37441422, - 8 - }, - { - 0x10, - 0x37441422, - 8 - }, - { - 0x11, - 0x37441422, - 8 - }, - { - 0x12, - 0x37441422, - 8 - }, - { - 0x13, - 0x37441422, - 8 - }, - { - 6, - 0x37441422, - 9 - }, - { - 1, - 0x37441422, - 9 - }, - { - 2, - 0x37441422, - 9 - }, - { - 5, - 0x37441422, - 9 - }, - { - 0, - 0x11001222, - -1 - }, - { - 1, - 0x37441422, - -1 - }, - { - 2, - 0x37441422, - -1 - }, - { - 3, - 0x37441422, - -1 - }, - { - 4, - 0x37441422, - -1 - }, - { - 5, - 0x37441422, - -1 - }, - { - 6, - 0x37441422, - -1 - }, - { - 7, - 0x37441422, - -1 - }, - { - 8, - 0x37441422, - -1 - }, - { - 9, - 0x37441422, - -1 - }, - { - 0xA, - 0x37441422, - -1 - }, - { - 0xB, - 0x37441422, - -1 - }, - { - 0xC, - 0x37441422, - -1 - }, - { - 0xD, - 0x37441422, - -1 - }, - { - 0xE, - 0x37441422, - -1 - }, - { - 0xF, - 0x37441422, - -1 - }, - { - 0x10, - 0x37441422, - -1 - }, - { - 0x11, - 0x11001222, - -1 - }, - { - 0, - 0x37441422, - -1 - }, - { - 5, - 0x37441422, - -1 - }, - { - 6, - 0x37441422, - -1 - }, - { - 7, - 0x37441422, - -1 - }, - { - 8, - 0x37441422, - -1 - }, - { - 9, - 0x37441422, - -1 - }, - { - 0xA, - 0x37441422, - -1 - }, - { - 0xB, - 0x37441422, - -1 - }, - { - 0xC, - 0x37441422, - -1 - }, - { - 0xD, - 0x37441422, - -1 - }, - { - 1, - 0x37441422, - -1 - }, - { - 2, - 0x37441422, - -1 - }, - { - 3, - 0x37441422, - -1 - }, - { - 4, - 0x37441422, - -1 - }, - { - 0, - 0x37441422, - -1 - }, - { - 1, - 0x37441422, - -1 - }, - { - 2, - 0x37441422, - -1 - }, - { - 3, - 0x37441422, - -1 - }, - { - 4, - 0x37441422, - -1 - }, - { - 5, - 0x37441422, - -1 - }, - { - 6, - 0x37441422, - -1 - }, - { - 7, - 0x37441422, - -1 - }, - { - 8, - 0x37441422, - -1 - }, - { - 9, - 0x37441422, - -1 - }, - { - 0x12, - 0x37441422, - -1 - }, - { - 0xA, - 0x11001222, - -1 - }, - { - 0xB, - 0x11001222, - -1 - }, - { - 0xC, - 0x11001222, - -1 - }, - { - 0xD, - 0x37441422, - -1 - }, - { - 0xE, - 0x37441422, - -1 - }, - { - 0xF, - 0x37441422, - -1 - }, - { - 0x10, - 0x37441422, - -1 - }, - { - 0x11, - 0x37441422, - -1 - }, - { - 0, - 0x37441422, - 0xA - }, - { - 1, - 0x37441422, - 0xA - }, - { - 2, - 0x11001222, - 0xA - }, - { - 3, - 0x11001222, - 0xA - }, - { - 4, - 0x11001222, - 0xA - }, - { - 5, - 0x37441422, - 0xA - }, - { - 6, - 0x37441422, - 0xA - }, - { - 7, - 0x37441422, - 0xA - }, - { - 0, - 0x37441422, - 0xB - }, - { - 1, - 0x11001222, - 0xB - }, - { - 2, - 0x11001222, - 0xB - }, - { - 3, - 0x37441422, - 0xB - }, - { - 4, - 0x37441422, - 0xB - }, - { - 0, - 0x11001222, - 0xC - }, - { - 1, - 0x37441422, - 0xC - }, - { - 2, - 0x11001222, - 0xC - }, - { - 3, - 0x11001222, - 0xC - }, - { - 4, - 0x37441422, - 0xC - }, + FIGUREDAT(0x00, 0x37441422, -1), + FIGUREDAT(0x01, 0x37441422, -1), + FIGUREDAT(0x02, 0x37441422, -1), + FIGUREDAT(0x03, 0x37441422, -1), + FIGUREDAT(0x0A, 0x37441422, -1), + FIGUREDAT(0x04, 0x37441422, -1), + FIGUREDAT(0x05, 0x37441422, -1), + FIGUREDAT(0x06, 0x37441422, -1), + FIGUREDAT(0x07, 0x37441422, -1), + FIGUREDAT(0x08, 0x37441422, -1), + FIGUREDAT(0x09, 0x11001222, -1), + FIGUREDAT(0x0B, 0x37441422, -1), + FIGUREDAT(0x0C, 0x37441422, -1), + FIGUREDAT(0x0D, 0x37441422, -1), + FIGUREDAT(0x00, 0x37441422, -1), + FIGUREDAT(0x01, 0x37441422, -1), + FIGUREDAT(0x02, 0x37441422, -1), + FIGUREDAT(0x04, 0x37441422, -1), + FIGUREDAT(0x05, 0x37441422, -1), + FIGUREDAT(0x07, 0x37441422, -1), + FIGUREDAT(0x08, 0x37441422, -1), + FIGUREDAT(0x09, 0x37441422, -1), + FIGUREDAT(0x0A, 0x37441422, -1), + FIGUREDAT(0x0B, 0x37441422, -1), + FIGUREDAT(0x0C, 0x37441422, -1), + FIGUREDAT(0x0D, 0x37441422, -1), + FIGUREDAT(0x0E, 0x37441422, -1), + FIGUREDAT(0x0F, 0x37441422, -1), + FIGUREDAT(0x10, 0x37441422, -1), + FIGUREDAT(0x11, 0x37441422, -1), + FIGUREDAT(0x12, 0x37441422, -1), + FIGUREDAT(0x13, 0x37441422, -1), + FIGUREDAT(0x14, 0x37441422, -1), + FIGUREDAT(0x15, 0x37441422, -1), + FIGUREDAT(0x16, 0x37441422, -1), + FIGUREDAT(0x17, 0x37441422, -1), + FIGUREDAT(0x18, 0x37441422, -1), + FIGUREDAT(0x19, 0x37441422, -1), + FIGUREDAT(0x1A, 0x37441422, -1), + FIGUREDAT(0x1B, 0x37441422, -1), + FIGUREDAT(0x1C, 0x37441422, -1), + FIGUREDAT(0x00, 0x37441422, 8), + FIGUREDAT(0x01, 0x37441422, 8), + FIGUREDAT(0x02, 0x37441422, 8), + FIGUREDAT(0x03, 0x37441422, 8), + FIGUREDAT(0x04, 0x37441422, 8), + FIGUREDAT(0x05, 0x37441422, 8), + FIGUREDAT(0x06, 0x37441422, 8), + FIGUREDAT(0x07, 0x37441422, 8), + FIGUREDAT(0x08, 0x37441422, 8), + FIGUREDAT(0x09, 0x37441422, 8), + FIGUREDAT(0x0A, 0x37441422, 8), + FIGUREDAT(0x0B, 0x37441422, 8), + FIGUREDAT(0x0C, 0x37441422, 8), + FIGUREDAT(0x0D, 0x37441422, 8), + FIGUREDAT(0x0E, 0x37441422, 8), + FIGUREDAT(0x0F, 0x37441422, 8), + FIGUREDAT(0x10, 0x37441422, 8), + FIGUREDAT(0x11, 0x37441422, 8), + FIGUREDAT(0x12, 0x37441422, 8), + FIGUREDAT(0x13, 0x37441422, 8), + FIGUREDAT(0x06, 0x37441422, 9), + FIGUREDAT(0x01, 0x37441422, 9), + FIGUREDAT(0x02, 0x37441422, 9), + FIGUREDAT(0x05, 0x37441422, 9), + FIGUREDAT(0x00, 0x11001222, -1), + FIGUREDAT(0x01, 0x37441422, -1), + FIGUREDAT(0x02, 0x37441422, -1), + FIGUREDAT(0x03, 0x37441422, -1), + FIGUREDAT(0x04, 0x37441422, -1), + FIGUREDAT(0x05, 0x37441422, -1), + FIGUREDAT(0x06, 0x37441422, -1), + FIGUREDAT(0x07, 0x37441422, -1), + FIGUREDAT(0x08, 0x37441422, -1), + FIGUREDAT(0x09, 0x37441422, -1), + FIGUREDAT(0x0A, 0x37441422, -1), + FIGUREDAT(0x0B, 0x37441422, -1), + FIGUREDAT(0x0C, 0x37441422, -1), + FIGUREDAT(0x0D, 0x37441422, -1), + FIGUREDAT(0x0E, 0x37441422, -1), + FIGUREDAT(0x0F, 0x37441422, -1), + FIGUREDAT(0x10, 0x37441422, -1), + FIGUREDAT(0x11, 0x11001222, -1), + FIGUREDAT(0x00, 0x37441422, -1), + FIGUREDAT(0x05, 0x37441422, -1), + FIGUREDAT(0x06, 0x37441422, -1), + FIGUREDAT(0x07, 0x37441422, -1), + FIGUREDAT(0x08, 0x37441422, -1), + FIGUREDAT(0x09, 0x37441422, -1), + FIGUREDAT(0x0A, 0x37441422, -1), + FIGUREDAT(0x0B, 0x37441422, -1), + FIGUREDAT(0x0C, 0x37441422, -1), + FIGUREDAT(0x0D, 0x37441422, -1), + FIGUREDAT(0x01, 0x37441422, -1), + FIGUREDAT(0x02, 0x37441422, -1), + FIGUREDAT(0x03, 0x37441422, -1), + FIGUREDAT(0x04, 0x37441422, -1), + FIGUREDAT(0x00, 0x37441422, -1), + FIGUREDAT(0x01, 0x37441422, -1), + FIGUREDAT(0x02, 0x37441422, -1), + FIGUREDAT(0x03, 0x37441422, -1), + FIGUREDAT(0x04, 0x37441422, -1), + FIGUREDAT(0x05, 0x37441422, -1), + FIGUREDAT(0x06, 0x37441422, -1), + FIGUREDAT(0x07, 0x37441422, -1), + FIGUREDAT(0x08, 0x37441422, -1), + FIGUREDAT(0x09, 0x37441422, -1), + FIGUREDAT(0x12, 0x37441422, -1), + FIGUREDAT(0x0A, 0x11001222, -1), + FIGUREDAT(0x0B, 0x11001222, -1), + FIGUREDAT(0x0C, 0x11001222, -1), + FIGUREDAT(0x0D, 0x37441422, -1), + FIGUREDAT(0x0E, 0x37441422, -1), + FIGUREDAT(0x0F, 0x37441422, -1), + FIGUREDAT(0x10, 0x37441422, -1), + FIGUREDAT(0x11, 0x37441422, -1), + FIGUREDAT(0x00, 0x37441422, 0xA), + FIGUREDAT(0x01, 0x37441422, 0xA), + FIGUREDAT(0x02, 0x11001222, 0xA), + FIGUREDAT(0x03, 0x11001222, 0xA), + FIGUREDAT(0x04, 0x11001222, 0xA), + FIGUREDAT(0x05, 0x37441422, 0xA), + FIGUREDAT(0x06, 0x37441422, 0xA), + FIGUREDAT(0x07, 0x37441422, 0xA), + FIGUREDAT(0x00, 0x37441422, 0xB), + FIGUREDAT(0x01, 0x11001222, 0xB), + FIGUREDAT(0x02, 0x11001222, 0xB), + FIGUREDAT(0x03, 0x37441422, 0xB), + FIGUREDAT(0x04, 0x37441422, 0xB), + FIGUREDAT(0x00, 0x11001222, 0xC), + FIGUREDAT(0x01, 0x37441422, 0xC), + FIGUREDAT(0x02, 0x11001222, 0xC), + FIGUREDAT(0x03, 0x11001222, 0xC), + FIGUREDAT(0x04, 0x37441422, 0xC), }; struct FigureCheckTbl { @@ -901,9 +379,11 @@ static cPhs_State phase_2(daObjFigure_c* i_this) { i_this->setResFlag(0x2); u8 figureNo = i_this->getFigureNo(); int id = dSnap_GetFigRoomId(figureNo); +#if VERSION > VERSION_DEMO if(l_figure_dat_tbl[figureNo].mRoomId >= 0) { id = l_figure_dat_tbl[figureNo].mRoomId; } +#endif cPhs_State status = dComIfG_resLoad(i_this->getPhase2P(), l_arcname_tbl[id]); @@ -933,9 +413,11 @@ cPhs_State daObjFigure_c::_create() { /* 00000720-00000A90 .text createHeap__13daObjFigure_cFv */ BOOL daObjFigure_c::createHeap() { int id = dSnap_GetFigRoomId(getFigureNo()); +#if VERSION > VERSION_DEMO if(l_figure_dat_tbl[getFigureNo()].mRoomId >= 0) { id = l_figure_dat_tbl[getFigureNo()].mRoomId; } +#endif J3DModelData* pModelData; const char* arcname = l_arcname_tbl[id]; @@ -1040,14 +522,16 @@ cPhs_State daObjFigure_c::createInit() { /* 00000BF4-00000C78 .text _delete__13daObjFigure_cFv */ BOOL daObjFigure_c::_delete() { - dComIfG_resDelete(getPhase1P(), "Figure"); + dComIfG_resDeleteDemo(getPhase1P(), "Figure"); int id = dSnap_GetFigRoomId(getFigureNo()); +#if VERSION > VERSION_DEMO if(l_figure_dat_tbl[getFigureNo()].mRoomId >= 0) { id = l_figure_dat_tbl[getFigureNo()].mRoomId; } +#endif - dComIfG_resDelete(getPhase2P(), l_arcname_tbl[id]); + dComIfG_resDeleteDemo(getPhase2P(), l_arcname_tbl[id]); return true; } @@ -1497,11 +981,13 @@ void linkDraw(mDoExt_McaMorf* pMorf) { /* Nonmatching - regalloc (maybe the same issue as daPy_lk_c::draw?) */ pMorf->calc(); +#if VERSION > VERSION_DEMO J3DModel* model = pMorf->getModel(); J3DModelData* modelData = model->getModelData(); j3dSys.setModel(model); j3dSys.setTexture(modelData->getTexture()); model->unlock(); +#endif static mDoExt_offCupOnAupPacket l_offCupOnAupPacket1; static mDoExt_offCupOnAupPacket l_offCupOnAupPacket2; @@ -1512,6 +998,11 @@ void linkDraw(mDoExt_McaMorf* pMorf) { J3DShape* ZOffNoneShape[4]; J3DShape* ZOnShape[4]; +#if VERSION == VERSION_DEMO + J3DModel* model = pMorf->getModel(); + J3DModelData* modelData = model->getModelData(); +#endif + J3DJoint* link_root_joint = modelData->getJointNodePointer(0x00); // link_root joint J3DJoint* cl_eye_joint = modelData->getJointNodePointer(0x13); // cl_eye joint J3DJoint* cl_mayu_joint = modelData->getJointNodePointer(0x15); // cl_mayu joint @@ -1528,14 +1019,14 @@ void linkDraw(mDoExt_McaMorf* pMorf) { if (mtl->getZMode()->getCompareEnable() == 0) { if ((u8)mtl->getBlend()->getType() == GX_BM_BLEND) { ZOffBlendShape[zoff_blend_cnt++] = mtl->getShape(); - JUT_ASSERT(1767, zoff_blend_cnt <= 4); + JUT_ASSERT(VERSION_SELECT(1713, 1767, 1767, 1767), zoff_blend_cnt <= 4); } else { ZOffNoneShape[zoff_none_cnt++] = mtl->getShape(); - JUT_ASSERT(1770, zoff_none_cnt <= 4); + JUT_ASSERT(VERSION_SELECT(1717, 1770, 1770, 1770), zoff_none_cnt <= 4); } } else { ZOnShape[zon_cnt++] = mtl->getShape(); - JUT_ASSERT(1774, zon_cnt <= 4); + JUT_ASSERT(VERSION_SELECT(1722, 1774, 1774, 1774), zon_cnt <= 4); } mtl = mtl->getNext(); } @@ -1572,6 +1063,7 @@ void linkDraw(mDoExt_McaMorf* pMorf) { link_root_joint->entryIn(); +#if VERSION > VERSION_DEMO for (i = 0, mtl = link_root_joint->getMesh(); mtl != NULL; i++, mtl = mtl->getNext()) { if (i != 2 && i != 5) { mtl->getShape()->show(); @@ -1579,6 +1071,7 @@ void linkDraw(mDoExt_McaMorf* pMorf) { mtl->getShape()->hide(); } } +#endif l_onCupOffAupPacket1.entryOpa(); @@ -1597,8 +1090,12 @@ void linkDraw(mDoExt_McaMorf* pMorf) { ZOnShape[i]->hide(); } +#if VERSION == VERSION_DEMO + pMorf->entryDL(); +#else dComIfGd_setList(); mDoExt_modelEntryDL(pMorf->getModel()); +#endif for (mtl = link_root_joint->getMesh(); mtl != NULL; mtl = mtl->getNext()) { mtl->getShape()->show(); @@ -1606,6 +1103,10 @@ void linkDraw(mDoExt_McaMorf* pMorf) { modelData->getJointNodePointer(0x14)->getMesh()->getShape()->show(); // cl_hana joint modelData->getJointNodePointer(0x29)->getMesh()->getShape()->show(); // cl_back joint + +#if VERSION == VERSION_DEMO + dComIfGd_setList(); +#endif } static actor_method_class daSampleMethodTable = { diff --git a/src/d/actor/d_a_player_dproc.inc b/src/d/actor/d_a_player_dproc.inc index f5578b6c8..5de3e829c 100644 --- a/src/d/actor/d_a_player_dproc.inc +++ b/src/d/actor/d_a_player_dproc.inc @@ -418,6 +418,7 @@ void daPy_lk_c::setGetItemSound(u16 param_1, int param_2) { } } +#if VERSION > VERSION_DEMO /* 8012E418-8012E6B4 .text setGetDemo__9daPy_lk_cFv */ BOOL daPy_lk_c::setGetDemo() { int staffIdx = dComIfGp_evmng_getMyStaffId("Link", this); @@ -488,6 +489,7 @@ BOOL daPy_lk_c::setGetDemo() { m34CE = 0; return FALSE; } +#endif /* 8012E6B4-8012E8B0 .text dProcGetItem_init__9daPy_lk_cFv */ BOOL daPy_lk_c::dProcGetItem_init() { diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index ab6e78792..c69193bf6 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -50,9 +50,11 @@ JGeometry::TVec3 l_hammer_splash_particle_scale(0.67f, 0.67f, 0.67f); #include "d/actor/d_a_player_HIO_data.inc" +#if VERSION > VERSION_DEMO cXyz l_debug_keep_pos; csXyz l_debug_current_angle; csXyz l_debug_shape_angle; +#endif GXColor l_freeze_fade_color = {0xFF, 0xFF, 0xFF, 0xFF}; @@ -1325,9 +1327,10 @@ s32 daPy_lk_c::setItemModel() { ((m_anm_heap_under[UNDER_MOVE0_e].mIdx == LKANM_BCK_DASHS || (m_anm_heap_under[UNDER_MOVE0_e].mIdx == LKANM_BCK_DASH)))))) { - dVar16 = mDoMtx_stack_c::now[0][3]; - dVar15 = mDoMtx_stack_c::now[1][3]; - dVar17 = mDoMtx_stack_c::now[2][3]; + MtxP mtx = mDoMtx_stack_c::get(); + dVar16 = mtx[0][3]; + dVar15 = mtx[1][3]; + dVar17 = mtx[2][3]; u16 uVar10 = cM_rad2s(((6.2831855f * (mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() - 22.0f)) / mFrameCtrlUnder[UNDER_MOVE0_e].getEnd())); @@ -1532,7 +1535,11 @@ void daPy_lk_c::drawMirrorLightModel() { mDoMtx_stack_c::transS(l_ms_light_local_start); mDoMtx_stack_c::YrotM(-0x8000); mDoMtx_stack_c::revConcat(mpEquippedShieldModel->getBaseTRMtx()); +#if VERSION == VERSION_DEMO + mMirrorPacket.update(mDoMtx_stack_c::get(), 0xFF); +#else mMirrorPacket.update(mDoMtx_stack_c::get(), 0xFF, 60.0f); +#endif dComIfGd_getXluList()->entryImm(&mMirrorPacket, 0xFF); updateDLSetLight(mpYmsls00Model, 0); } @@ -1563,37 +1570,55 @@ void daPy_lk_c::drawShadow() { } mtl->getShape()->hide(); } - f32 fVar1; + f32 f31; if (checkModeFlg(ModeFlg_HANG)) { - fVar1 = m35DC; + f31 = m35DC; } else { - fVar1 = mAcch.GetGroundH(); + f31 = mAcch.GetGroundH(); } - f32 dVar9 = fVar1; - if ((!strcmp(dComIfGp_getStartStageName(), "M_DaiB")) || - (!strcmp(dComIfGp_getStartStageName(), "Xboss2"))) + f32 f1; + if (!strcmp(dComIfGp_getStartStageName(), "M_DaiB") || + !strcmp(dComIfGp_getStartStageName(), "Xboss2")) { - fVar1 = 1400.0f; + f1 = 1400.0f; } else { - fVar1 = daPy_HIO_basic_c0::m.field_0x10; + f1 = daPy_HIO_basic_c0::m.field_0x10; } - int iVar4 = dComIfGd_setShadow(m3614, 0, mpCLModel, &local_30, fVar1, 30.0f, current.pos.y, - dVar9, mAcch.m_gnd, &tevStr, 0, 1.0f, + int iVar4 = dComIfGd_setShadow(m3614, 0, mpCLModel, &local_30, f1, 30.0f, current.pos.y, + f31, mAcch.m_gnd, &tevStr, 0, 1.0f, &dDlst_shadowControl_c::mSimpleTexObj); m3614 = iVar4; if ((u32)m3614 != 0) { if ((checkNoResetFlg1(daPyFlg1_CASUAL_CLOTHES)) && (!checkCaughtShapeHide())) { dComIfGd_addRealShadow(m3614, mpKatsuraModel); } - if ((checkSwordEquip()) && (!checkDemoSwordNoDraw(1))) { + if (checkSwordEquip() +#if VERSION == VERSION_DEMO + && !checkLastDemoSwordNoDraw(1) +#else + && !checkDemoSwordNoDraw(1) +#endif + ) { dComIfGd_addRealShadow(m3614, mpEquippedSwordModel); } - if (((mpEquipItemModel != NULL) && (!checkDemoSwordNoDraw(0))) && + if ((mpEquipItemModel != NULL +#if VERSION == VERSION_DEMO + && !checkLastDemoSwordNoDraw(0) +#else + && !checkDemoSwordNoDraw(0) +#endif + ) && ((!checkBowItem(mEquipItem) || (!checkPlayerGuard())))) { dComIfGd_addRealShadow(m3614, mpEquipItemModel); } - if ((dComIfGs_getSelectEquip(1) != dItem_NONE_e) && (!checkDemoShieldNoDraw())) { + if (dComIfGs_getSelectEquip(1) != dItem_NONE_e +#if VERSION == VERSION_DEMO + && !checkLastDemoSwordNoDraw(1) +#else + && !checkDemoShieldNoDraw() +#endif + ) { dComIfGd_addRealShadow(m3614, mpEquippedShieldModel); } fopAc_ac_c* pfVar10; @@ -1813,9 +1838,13 @@ BOOL daPy_lk_c::draw() { } else { hideHatAndBackle(link_root_joint->getMesh()); } - if ((!checkNormalSwordEquip() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e) || - checkCaughtShapeHide() || checkDemoShieldNoDraw()) - { + if ( + (!checkNormalSwordEquip() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e) + || checkCaughtShapeHide() +#if VERSION > VERSION_DEMO + || checkDemoShieldNoDraw() +#endif + ) { mpCLModelData->getJointNodePointer(0x0D)->getMesh()->getShape()->hide(); // cl_podA joint } else { mpCLModelData->getJointNodePointer(0x0D)->getMesh()->getShape()->show(); // cl_podA joint @@ -1838,7 +1867,11 @@ BOOL daPy_lk_c::draw() { mpCLModelData->getJointNodePointer(0x29)->getMesh()->getShape()->show(); // cl_back joint if (!r24) { entryDLSetLight(mpHandsModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); - if (checkNoResetFlg1(daPyFlg1_CASUAL_CLOTHES) && !checkCaughtShapeHide() && !dComIfGp_checkCameraAttentionStatus(mCameraInfoIdx, 0x20)) { + if (checkNoResetFlg1(daPyFlg1_CASUAL_CLOTHES) && !checkCaughtShapeHide() +#if VERSION > VERSION_DEMO + && !dComIfGp_checkCameraAttentionStatus(mCameraInfoIdx, 0x20) +#endif + ) { entryDLSetLight(mpKatsuraModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } if (checkFreezeState() && checkMaskDraw()) { @@ -1847,7 +1880,11 @@ BOOL daPy_lk_c::draw() { if (dComIfGs_getSelectEquip(2) == dItem_POWER_BRACELETS_e) { entryDLSetLight(mpPringModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } - if (checkMasterSwordEquip() && !checkCaughtShapeHide() && !checkDemoShieldNoDraw()) { + if (checkMasterSwordEquip() && !checkCaughtShapeHide() +#if VERSION > VERSION_DEMO + && !checkDemoShieldNoDraw() +#endif + ) { updateDLSetLight(mpPodmsModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } } @@ -1880,11 +1917,23 @@ BOOL daPy_lk_c::draw() { mDoExt_modelUpdateDL(mpSuimenMunyaModel); } if (!r24 && !dComIfGp_checkCameraAttentionStatus(mCameraInfoIdx, 0x20)) { - if (checkSwordEquip() && !checkDemoSwordNoDraw(TRUE)) { + if (checkSwordEquip() +#if VERSION == VERSION_DEMO + && !checkLastDemoSwordNoDraw(1) +#else + && !checkDemoSwordNoDraw(1) +#endif + ) { entryDLSetLight(mpEquippedSwordModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } } - if (dComIfGs_getSelectEquip(1) != dItem_NONE_e && !checkCaughtShapeHide() && !checkDemoShieldNoDraw()) { + if (dComIfGs_getSelectEquip(1) != dItem_NONE_e && !checkCaughtShapeHide() +#if VERSION == VERSION_DEMO + && !checkLastDemoSwordNoDraw(1) +#else + && !checkDemoShieldNoDraw() +#endif + ) { entryDLSetLight(mpEquippedShieldModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } dComIfGd_setList(); @@ -1894,7 +1943,13 @@ BOOL daPy_lk_c::draw() { if (mpBottleContentsModel != NULL) { updateDLSetLight(mpBottleContentsModel, 0); } - if (mpEquipItemModel && !checkCaughtShapeHide() && !checkDemoSwordNoDraw(FALSE)) { + if (mpEquipItemModel && !checkCaughtShapeHide() +#if VERSION == VERSION_DEMO + && !checkLastDemoSwordNoDraw(0) +#else + && !checkDemoSwordNoDraw(0) +#endif + ) { if (!checkBowItem(mEquipItem) || !checkPlayerGuard()) { if (mEquipItem == dItem_HOOKSHOT_e) { if (mActorKeepEquip.getActor()) { @@ -8973,8 +9028,8 @@ void daPy_lk_c::setNeckAngle() { r28 = true; } else if (checkModeFlg(ModeFlg_00000080 | ModeFlg_08000000)) { if ((!dComIfGp_event_runCheck()) || (mDemo.getDemoMode() == daPy_demo_c::DEMO_UNK39_e)) { - if (dComIfGp_getAttention().getLookTarget() != NULL) { - sp18 = &dComIfGp_getAttention().getLookTarget()->eyePos; + if (dComIfGp_att_getLookTarget() != NULL) { + sp18 = &dComIfGp_att_getLookTarget()->eyePos; r28 = true; } else { if ((((checkAttentionPosAngle(r23_2, &sp18)) || @@ -11157,9 +11212,11 @@ void daPy_lk_c::checkRoofRestart() { /* 80121870-80122D30 .text execute__9daPy_lk_cFv */ BOOL daPy_lk_c::execute() { /* Nonmatching - regalloc */ +#if VERSION > VERSION_DEMO if (setGetDemo()) { return TRUE; } +#endif if (checkNoResetFlg1(daPyFlg1_UNK200)) { fopMsgM_demoMsgFlagOn(); @@ -11179,9 +11236,11 @@ BOOL daPy_lk_c::execute() { dComIfGs_setBottleItemIn(dItem_FOREST_WATER_e, dItem_WATER_BOTTLE_e); mDemo.setDemoType(5); m3628 = fpcM_ERROR_PROCESS_ID_e; +#if VERSION > VERSION_DEMO if (mCurProc == daPyProc_SCOPE_e) { procWait_init(); } +#endif } } } @@ -11229,9 +11288,11 @@ BOOL daPy_lk_c::execute() { } } +#if VERSION > VERSION_DEMO current.pos = l_debug_keep_pos; shape_angle = l_debug_shape_angle; current.angle = l_debug_current_angle; +#endif mCameraInfoIdx = dComIfGp_getPlayerCameraID(0); m3748 = current.pos; @@ -11503,7 +11564,7 @@ BOOL daPy_lk_c::execute() { m357C = m3580; m3580 = -1; mCurrAttributeCode = dBgS_Attr_UNK1B_e; - roomNo = current.roomNo; + roomNo = fopAcM_GetRoomNo(this); checkFallCode(); } @@ -11541,7 +11602,9 @@ BOOL daPy_lk_c::execute() { mpCLModelData->getJointNodePointer(0x02)->setMtxCalc(m_pbCalc[PART_UPPER_e]); // body_chn joint mpCLModelData->getJointNodePointer(0x1D)->setMtxCalc(m_pbCalc[PART_UNDER_e]); // wash_chn joint +#if VERSION > VERSION_DEMO checkOriginalHatAnimation(); +#endif static const Vec nsword_top = {45.0f, -31.0f, 0.0f}; static const Vec msword_top = {57.0f, 48.0f, 0.0f}; @@ -11578,7 +11641,11 @@ BOOL daPy_lk_c::execute() { m36D0 = mSwordTopPos; m36DC = m36C4; - if (mEquipItem == daPyItem_BOKO_e && mActorKeepEquip.getActor()) { + if (mEquipItem == daPyItem_BOKO_e +#if VERSION > VERSION_DEMO + && mActorKeepEquip.getActor() +#endif + ) { daBoko_c* boko = static_cast(mActorKeepEquip.getActor()); boko->getTopPos(&mSwordTopPos); boko->getBlurRootPos(&m36C4); @@ -11618,7 +11685,9 @@ BOOL daPy_lk_c::execute() { eventInfo.onCondition(dEvtCnd_CANTALK_e); } } +#if VERSION > VERSION_DEMO eventInfo.onCondition(dEvtCnd_CANGETITEM_e); +#endif JPABaseEmitter* emitter = mSmokeEcallBack.getEmitter(); if (emitter) { @@ -11650,9 +11719,11 @@ BOOL daPy_lk_c::execute() { if (dComIfGp_getDoStatus() == dActStts_UNK43) { dComIfGp_setDoStatus(dActStts_JUMP_e); } +#if VERSION > VERSION_DEMO if (checkResetFlg0(daPyRFlg0_UNK10000000)) { dComIfGp_setAStatus(dActStts_BLANK_e); } +#endif } offNoResetFlg1((daPy_FLG1)(daPyFlg1_UNK4 | daPyFlg1_FORCE_VOMIT_JUMP | daPyFlg1_FORCE_VOMIT_JUMP_SHORT | daPyFlg1_UNK10000000)); @@ -11681,9 +11752,11 @@ BOOL daPy_lk_c::execute() { mWhirlId = fpcM_ERROR_PROCESS_ID_e; +#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; +#endif return TRUE; } @@ -12583,9 +12656,11 @@ cPhs_State daPy_lk_c::makeBgWait() { if ((dComIfGs_getLastSceneMode() & 0x4000) != 0) { onNoResetFlg1(daPyFlg1_UNK8000); } +#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; +#endif return cPhs_NEXT_e; } @@ -12956,9 +13031,11 @@ void daPy_lk_c::setPlayerPosAndAngle(cXyz* param_1, s16 param_2) { shape_angle.y = param_2; current.angle.y = param_2; m34DE = shape_angle.y; +#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; +#endif } /* 80128C10-80128CE4 .text setPlayerPosAndAngle__9daPy_lk_cFP4cXyzP5csXyz */ @@ -12975,9 +13052,11 @@ void daPy_lk_c::setPlayerPosAndAngle(cXyz* param_1, csXyz* param_2) { current.angle.y = shape_angle.y; m34DE = shape_angle.y; } +#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; +#endif } /* 80128CE4-80128DC0 .text setPlayerPosAndAngle__9daPy_lk_cFPA4_f */ @@ -12990,9 +13069,11 @@ void daPy_lk_c::setPlayerPosAndAngle(MtxP param_1) { mDoMtx_MtxToRot(param_1, &shape_angle); current.angle.y = shape_angle.y; m34DE = shape_angle.y; +#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; +#endif } } diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index 8d3b24809..b069689d9 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -154,7 +154,12 @@ void daPy_lk_c::setLightSaver() { mpEquipItemBrk->setFrame(2.0f); } mpSwordModel1->setBaseTRMtx(mpEquipItemModel->getBaseTRMtx()); - if (!checkDemoSwordNoDraw(0) && + if ( +#if VERSION == VERSION_DEMO + !checkLastDemoSwordNoDraw(0) && +#else + !checkDemoSwordNoDraw(0) && +#endif ((checkChanceMode() || checkNoResetFlg1(daPyFlg1_UNK8000)) || checkFinalMasterSwordEquip())) { simpleAnmPlay(mpSwordBtk); @@ -221,6 +226,17 @@ void daPy_lk_c::setLightSaver() { } } +#if VERSION == VERSION_DEMO +BOOL daPy_lk_c::checkLastDemoSwordNoDraw(BOOL param_0) { + if ((mEquipItem == daPyItem_SWORD_e || param_0) && + dComIfGs_isEventBit(0x3f40)) + { + return TRUE; + } else { + return FALSE; + } +} +#else /* 80155490-801554C8 .text checkDemoShieldNoDraw__9daPy_lk_cFv */ BOOL daPy_lk_c::checkDemoShieldNoDraw() { if (dComIfGs_isEventBit(0x3f40)) { @@ -240,6 +256,7 @@ BOOL daPy_lk_c::checkDemoSwordNoDraw(BOOL param_0) { return false; } } +#endif /* 80155544-80155574 .text checkChanceMode__9daPy_lk_cFv */ BOOL daPy_lk_c::checkChanceMode() { diff --git a/src/d/d_bg_s_acch.cpp b/src/d/d_bg_s_acch.cpp index c28f50a04..c8cc4ee10 100644 --- a/src/d/d_bg_s_acch.cpp +++ b/src/d/d_bg_s_acch.cpp @@ -154,28 +154,22 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) { } /* 800A305C-800A313C .text GroundRoofProc__9dBgS_AcchFR4dBgS */ -f32 dBgS_Acch::GroundRoofProc(dBgS& i_bgs) { - f32 y = -G_CM3D_F_INF; +void dBgS_Acch::GroundRoofProc(dBgS& i_bgs) { if (m_ground_h != -G_CM3D_F_INF) { - // y = m_roof_height; - // fakematch to fix load order - if (field_0xb8 < (y = m_roof_height) && y < pm_pos->y) { - pm_pos->y = y; + if (field_0xb8 < m_roof_height && m_roof_height < pm_pos->y) { + pm_pos->y = m_roof_height; } if (!(m_flags & ROOF_NONE)) { - y = m_ground_h; - if (y >= m_roof_y) { + if (m_ground_h >= m_roof_y) { m_roof.SetExtChk(*this); ClrRoofHit(); cXyz pos = *pm_pos; m_roof.SetPos(pos); - y = i_bgs.RoofChk(&m_roof); - m_roof_y = y; + m_roof_y = i_bgs.RoofChk(&m_roof); } } } - return y; } /* 800A313C-800A3460 .text LineCheck__9dBgS_AcchFR4dBgS */ @@ -199,7 +193,7 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) { cM3dGPla* pla = i_bgs.GetTriPla(linChk); if (!cBgW_CheckBGround(pla->GetNP()->y)) { - VECAdd(pm_pos, pla->GetNP(), pm_pos); + VECAdd(GetPos(), pla->GetNP(), GetPos()); if (!cM3d_IsZero(std::sqrtf(pla->GetNP()->x*pla->GetNP()->x + pla->GetNP()->z*pla->GetNP()->z))) pm_acch_cir[i].SetWallHDirect(pm_pos->y); @@ -232,15 +226,12 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) { Init(); f32 lowH_R = GetWallAllLowH_R(); - cXyz* temp9 = pm_old_pos; - cXyz* temp10 = pm_pos; - f32 distXZ2 = temp9->abs2XZ(*temp10); - f32 distY = pm_old_pos->y - pm_pos->y; + f32 distXZ2 = GetOldPos()->abs2XZ(*GetPos()); + f32 distY = GetOldPos()->y - GetPos()->y; f32 lowH = GetWallAllLowH(); - field_0xb4 = pm_pos->y; - f32 oldY = pm_old_pos->y; - f32 temp7 = lowH + oldY; - f32 temp8 = m_ground_check_offset + pm_pos->y; + field_0xb4 = GetPos()->y; + f32 temp7 = lowH + GetOldPos()->y; + f32 temp8 = m_ground_check_offset + GetPos()->y; bool ranLineCheck = false; OffLineCheckHit(); @@ -330,10 +321,12 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) { } } +#if VERSION > VERSION_DEMO CHECK_FLOAT_CLASS(780, pm_pos->x); CHECK_FLOAT_CLASS(781, pm_pos->y); CHECK_FLOAT_CLASS(782, pm_pos->z); CHECK_PVEC3_RANGE(786, pm_pos); +#endif } /* 800A3F50-800A3F8C .text GetWallAllR__9dBgS_AcchFv */ @@ -368,11 +361,10 @@ void dBgS_Acch::CalcWallBmdCyl() { f32 max_h = min_h; if (m_tbl_size >= 1) { for (s32 i = 0; i < m_tbl_size; i++) { - f32 h = pm_acch_cir[i].GetWallH(); - if (min_h > h) - min_h = h; - if (max_h < h) - max_h = h; + if (min_h > pm_acch_cir[i].GetWallH()) + min_h = pm_acch_cir[i].GetWallH(); + if (max_h < pm_acch_cir[i].GetWallH()) + max_h = pm_acch_cir[i].GetWallH(); } } diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index 275f473c8..c680ca1f4 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -1953,8 +1953,13 @@ void mirrorPolygonCheck(cXyz* min_p, cXyz* max_p, f32 rad, dDlst_shadowPoly_c* p dComIfG_Bgsp()->ShdwDraw(&shdwDraw); } +#if VERSION == VERSION_DEMO +void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha) +#else /* 80085808-800859DC .text update__18dDlst_mirrorPacketFPA4_fUcf */ -void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha, f32 rad) { +void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha, f32 rad) +#endif +{ mShadowPoly.mCount = 0; static cXyz l_p1Offset(0.0f, 0.0f, 0.0f); static cXyz l_p2Offset(0.0f, 0.0f, 10000.0f); @@ -1962,7 +1967,11 @@ void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha, f32 rad) { cXyz offs, offs2; mDoMtx_multVec(mtx, &l_p1Offset, &offs); mDoMtx_multVec(mtx, &l_p2Offset, &offs2); +#if VERSION == VERSION_DEMO + mirrorPolygonCheck(&offs, &offs2, 60.0f, &mShadowPoly); +#else mirrorPolygonCheck(&offs, &offs2, rad, &mShadowPoly); +#endif Mtx viewMtx; mDoMtx_lookAt(viewMtx, &offs, &offs2, 0);