From 2bd38293a84939674a331627ede40e90141c57df Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sun, 22 Oct 2023 03:33:14 -0400 Subject: [PATCH] d_a_bg match + fix link's actor profile --- configure.py | 2 +- include/f_op/f_op_actor.h | 2 +- src/d/actor/d_a_bg.cpp | 24 ++++++++++++++++-------- src/d/actor/d_a_player_main.cpp | 3 ++- src/d/actor/d_a_player_tact.inc | 8 ++++---- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/configure.py b/configure.py index 5b2704bd9..e10a82de0 100644 --- a/configure.py +++ b/configure.py @@ -415,7 +415,7 @@ config.libs = [ Object(Matching, "d/d_point_wind.cpp"), Object(NonMatching, "d/actor/d_a_agb.cpp"), Object(Matching, "d/actor/d_a_arrow.cpp", extra_cflags=["-sym off"]), - Object(NonMatching, "d/actor/d_a_bg.cpp"), + Object(Matching, "d/actor/d_a_bg.cpp"), Object(NonMatching, "d/actor/d_a_bomb.cpp"), Object(NonMatching, "d/actor/d_a_bomb2.cpp"), Object(NonMatching, "d/actor/d_a_boomerang.cpp"), diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index 912dd309e..f738b3333 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -97,7 +97,7 @@ struct actor_process_profile_definition { /* 0x2D */ u8 mCullType; }; -// Unclear what this is. Only appears in 4 profiles (BG,DSHUTTER,PATH,SCENE_EXIT) +// Unclear what this is. Only appears in 2 profiles (PLAYER,BG) struct actor_process_profile_definition2 { /* 0x00 */ actor_process_profile_definition def; /* 0x30 */ u32 field_0x30; diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp index 75b6fde26..0b925aea3 100644 --- a/src/d/actor/d_a_bg.cpp +++ b/src/d/actor/d_a_bg.cpp @@ -47,7 +47,7 @@ class daBg_c : public fopAc_ac_c { public: ~daBg_c(); const char * setArcName(); - BOOL createHeap(); + inline BOOL createHeap(); s32 create(); inline BOOL execute(); inline BOOL draw(); @@ -165,7 +165,7 @@ void daBg_brkAnm_c::play() { } /* 800D88D8-800D88F8 .text checkCreateHeap__FP10fopAc_ac_c */ -BOOL checkCreateHeap(fopAc_ac_c* i_ac) { +static BOOL checkCreateHeap(fopAc_ac_c* i_ac) { return ((daBg_c*)i_ac)->createHeap(); } @@ -200,9 +200,8 @@ BOOL daBg_c::createHeap() { const char * arcName = setArcName(); u32 roomNo = fopAcM_GetParam(this); - for (u32 i = 0; i < 4; i++) { - BgModel * bgm = &bg[i]; - + BgModel * bgm = bg; + for (int i = 0; i < 4; bgm++, i++) { J3DModelData * modelData = (J3DModelData *) dComIfG_getStageRes(arcName, l_modelName[i]); if (modelData == NULL) modelData = (J3DModelData *) dComIfG_getStageRes(arcName, l_modelName2[i]); @@ -221,7 +220,7 @@ BOOL daBg_c::createHeap() { return FALSE; if (!bgm->btk->create(modelData, btk)) return FALSE; - diffFlag = 0x12000000; + diffFlag |= 0x00001200; } else { bgm->btk = NULL; } @@ -321,17 +320,25 @@ BOOL daBg_Draw(daBg_c* i_this) { BOOL daBg_c::execute() { if (mUnloadTimer != 0) { +#if VERSION == VERSION_JPN + mUnloadTimer = 0; + fopAcM_delete(this); +#else if (cLib_calcTimer(&mUnloadTimer) == 0) fopAcM_delete(this); - +#endif return TRUE; } if (dComIfGp_roomControl_checkStatusFlag(fopAcM_GetParam(this), 0x04)) { +#if VERSION == VERSION_JPN + mUnloadTimer = 1; +#else if (strcmp(dComIfGp_getStartStageName(), "sea") == 0) mUnloadTimer = 16; else mUnloadTimer = 1; +#endif } else { BgModel * bgm = &bg[0]; for (s32 i = 0; i < 4; i++, bgm++) { @@ -446,7 +453,7 @@ actor_method_class l_daBg_Method = { (process_method_func)daBg_Draw, }; -actor_process_profile_definition g_profile_BG = { +actor_process_profile_definition2 g_profile_BG = { fpcLy_CURRENT_e, 7, fpcPi_CURRENT_e, @@ -461,4 +468,5 @@ actor_process_profile_definition g_profile_BG = { fopAcStts_UNK4000_e | fopAcStts_UNK40000_e, fopAc_ACTOR_e, fopAc_CULLBOX_0_e, + 0, }; diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 1f0476055..d46eaf8d6 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -1998,7 +1998,7 @@ actor_method_class l_daPy_Method = { (process_method_func)daPy_Draw, }; -actor_process_profile_definition g_profile_PLAYER = { +actor_process_profile_definition2 g_profile_PLAYER = { /* LayerID */ fpcLy_CURRENT_e, /* ListID */ 5, /* ListPrio */ fpcLy_CURRENT_e, @@ -2013,4 +2013,5 @@ actor_process_profile_definition g_profile_PLAYER = { /* Status */ fopAcStts_FREEZE_e, /* Group */ fopAc_PLAYER_e, /* CullType */ fopAc_CULLBOX_0_e, + /* field_0x30 */ 2, }; diff --git a/src/d/actor/d_a_player_tact.inc b/src/d/actor/d_a_player_tact.inc index 0e4ac8726..60f6e64e2 100644 --- a/src/d/actor/d_a_player_tact.inc +++ b/src/d/actor/d_a_player_tact.inc @@ -43,12 +43,12 @@ void daPy_lk_c::checkEndTactMusic() const { } /* 8014D9A4-8014D9D0 .text getTactMetronomeRate__9daPy_lk_cFv */ -void daPy_lk_c::getTactMetronomeRate() { +f32 daPy_lk_c::getTactMetronomeRate() { /* Nonmatching */ } /* 8014D9D0-8014D9F8 .text checkTactLastInput__9daPy_lk_cFv */ -void daPy_lk_c::checkTactLastInput() { +int daPy_lk_c::checkTactLastInput() { /* Nonmatching */ } @@ -58,7 +58,7 @@ void daPy_lk_c::setTactZev(unsigned int, int, char*) { } /* 8014DA78-8014DACC .text getTactTopPos__9daPy_lk_cFP4cXyz */ -void daPy_lk_c::getTactTopPos(cXyz*) { +int daPy_lk_c::getTactTopPos(cXyz*) { /* Nonmatching */ } @@ -78,7 +78,7 @@ int daPy_lk_c::getTactTimerCancel() const { } /* 8014DB74-8014DB9C .text checkTactPlayMelody__9daPy_lk_cFv */ -void daPy_lk_c::checkTactPlayMelody() { +int daPy_lk_c::checkTactPlayMelody() { /* Nonmatching */ }