diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2022-06-27 17:23:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-27 17:23:08 -0700 |
| commit | cd5b02450cf278cbeb2c8bb90be1ad22518938c7 (patch) | |
| tree | d69e02aa4b1e45ae2865389a4d70c28969ebe475 /include/d | |
| parent | fb9dd3cdee440e61d96ddd2efd0216a99df14997 (diff) | |
| parent | 0b060164da0da9062813792880eb1304652022f1 (diff) | |
Merge pull request #200 from lepelog/event_data
Event data
Diffstat (limited to 'include/d')
| -rw-r--r-- | include/d/a/d_a_player.h | 4 | ||||
| -rw-r--r-- | include/d/com/d_com_inf_game.h | 32 | ||||
| -rw-r--r-- | include/d/d_demo.h | 38 | ||||
| -rw-r--r-- | include/d/d_drawlist.h | 3 | ||||
| -rw-r--r-- | include/d/d_gameover.h | 46 | ||||
| -rw-r--r-- | include/d/d_stage.h | 17 | ||||
| -rw-r--r-- | include/d/event/d_event.h | 3 | ||||
| -rw-r--r-- | include/d/event/d_event_data.h | 64 | ||||
| -rw-r--r-- | include/d/event/d_event_lib.h | 39 | ||||
| -rw-r--r-- | include/d/event/d_event_manager.h | 3 | ||||
| -rw-r--r-- | include/d/kankyo/d_kankyo.h | 2 | ||||
| -rw-r--r-- | include/d/msg/d_msg_object.h | 5 |
12 files changed, 231 insertions, 25 deletions
diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h index 64b84b96de..5d19bbbc74 100644 --- a/include/d/a/d_a_player.h +++ b/include/d/a/d_a_player.h @@ -181,7 +181,7 @@ public: enum daPy_FLG0 { FLG0_UNK_40000000 = 0x40000000, EQUIP_HEAVY_BOOTS = 0x2000000, - FLG0_UNK_8000000 = 0x8000000, + PLAYER_NO_DRAW = 0x8000000, FLG0_UNK_1000000 = 0x1000000, UNDER_WATER_MOVEMENT = 0x800000, FLG0_UNK_80000 = 0x80000, @@ -552,6 +552,8 @@ public: BOOL i_checkEquipHeavyBoots() const { return i_checkNoResetFlg0(EQUIP_HEAVY_BOOTS); } BOOL i_checkMagneBootsOn() const { return i_checkNoResetFlg0(MAGNE_BOOTS_ON); } bool i_checkMidnaRide() const { return i_checkNoResetFlg0(MIDNA_RIDE); } + void i_onPlayerNoDraw() { i_onNoResetFlg0(PLAYER_NO_DRAW); } + void i_offPlayerNoDraw() { i_offNoResetFlg0(PLAYER_NO_DRAW); } inline static u32 getLastSceneMode(); inline static bool checkWoodSwordEquip(); diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index ce6b801e64..022784b66c 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -389,6 +389,10 @@ public: mWindow[i].setMode(mode); } + char* getLastPlayStageName() { return mLastPlayStageName; } + + u8 getGameoverStatus() { return mGameoverStatus; } + public: /* 0x00000 */ dBgS mBgs; /* 0x01404 */ dCcS mCcs; @@ -613,6 +617,7 @@ public: dComIfG_inf_c() { this->ct(); } ~dComIfG_inf_c() {} void ct(); + dComIfG_play_c& getPlay() { return play; } /* 0x00000 */ dSv_info_c info; /* 0x00F38 */ dComIfG_play_c play; @@ -651,6 +656,9 @@ void dComIfG_get_timelayer(int* layer); int dComIfG_resDelete(request_of_phase_process_class* i_phase, char const* resName); int dComIfG_changeOpeningScene(scene_class* scene, s16 procName); int dComIfG_resLoad(request_of_phase_process_class* i_phase, char const* arc_name); +BOOL dComIfGs_isStageSwitch(int i_stageNo, int i_no); +void dComIfGs_onStageSwitch(int i_stageNo, int i_no); +void dComIfGs_offStageSwitch(int i_stageNo, int i_no); inline void dComIfG_setBrightness(u8 brightness) { g_dComIfG_gameInfo.mFadeBrightness = brightness; @@ -2059,6 +2067,14 @@ inline void dComIfGp_evmng_cutEnd(int param_0) { dComIfGp_getPEvtManager()->cutEnd(param_0); } +inline int i_dComIfGp_evmng_getMyStaffId(const char* pName, fopAc_ac_c* pActor, int param_2) { + return dComIfGp_getPEvtManager()->getMyStaffId(pName, pActor, param_2); +} + +inline int dComIfGp_evmng_getIsAddvance(int param_0) { + return dComIfGp_getPEvtManager()->getIsAddvance(param_0); +} + inline int* dComIfGp_evmng_getMyIntegerP(int index, char* name) { return (int*)dComIfGp_getPEvtManager()->getMySubstanceP(index, name, dEvDtData_c::TYPE_INT); } @@ -2071,6 +2087,14 @@ inline f32* dComIfGp_evmng_getMyFloatP(int index, char* name) { return (f32*)dComIfGp_getPEvtManager()->getMySubstanceP(index, name, dEvDtData_c::TYPE_FLOAT); } +inline cXyz* dComIfGp_evmng_getMyXyzP(int index, char* name) { + return (cXyz*)dComIfGp_getPEvtManager()->getMySubstanceP(index, name, dEvDtData_c::TYPE_VEC); +} + +inline int dComIfGp_evmng_getMySubstanceNum(int index, char* name) { + return dComIfGp_getPEvtManager()->getMySubstanceNum(index, name); +} + inline void dComIfGp_evmng_create() { g_dComIfG_gameInfo.play.getEvtManager().create(); } @@ -2253,4 +2277,12 @@ inline daAlink_c* daAlink_getAlinkActorClass() { return (daAlink_c*)g_dComIfG_gameInfo.play.getPlayerPtr(LINK_PTR); } +inline char* dComIfGp_getLastPlayStageName() { + return g_dComIfG_gameInfo.play.getLastPlayStageName(); +} + +inline u8 dComIfGp_getGameoverStatus() { + return g_dComIfG_gameInfo.play.getGameoverStatus(); +} + #endif /* D_COM_D_COM_INF_GAME_H */ diff --git a/include/d/d_demo.h b/include/d/d_demo.h index 003c01ad63..842508ea5c 100644 --- a/include/d/d_demo.h +++ b/include/d/d_demo.h @@ -1,6 +1,44 @@ #ifndef D_D_DEMO_H #define D_D_DEMO_H +#include "JSystem/JStudio/JStudio/stb.h" #include "dolphin/types.h" +class cXyz; +struct dDemo_c { + /* 80039678 */ void create(); + /* 80039910 */ void remove(); + /* 80039B6C */ static void start(u8 const*, cXyz*, f32); + /* 80039CF8 */ static void end(); + /* 80039D4C */ void branch(); + /* 80039DA4 */ void update(); + /* 80039EDC */ void setBranchType(u16); + /* 80039EEC */ void setBranchId(u16, s16); + /* 80039F04 */ void reset(); + + static u32 getFrameNoMsg() { return m_frameNoMsg; } + static s32 getMode() { return m_mode; } + static JStudio::stb::TControl* getControl() { return m_control; } + + static u16 m_branchId[1 + 3 /* padding */]; + static u8 m_system[4]; + static JStudio::stb::TControl* m_control; + static u8 m_stage[4]; + static u8 m_audio[4]; + static u8 m_particle[4]; + static u8 m_message[4]; + static u8 m_factory[4]; + static u8 m_mesgControl[4]; + static u8 m_object[4]; + static u8 m_data[4]; + static u8 m_frame[4]; + static u8 m_translation[4]; + static f32 m_rotationY; + static u32 m_frameNoMsg; + static s32 m_mode; + static u8 m_status[4]; + static u8 m_branchType[2 + 2 /* padding */]; + static u8 m_branchData[4]; +}; + #endif /* D_D_DEMO_H */ diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index eb4bf4efd6..f175a6a3bc 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -219,7 +219,7 @@ public: /* 80056794 */ int set(dDlst_base_c**&, dDlst_base_c**&, dDlst_base_c*); /* 800567C4 */ void draw(dDlst_base_c**, dDlst_base_c**); /* 8005681C */ void wipeIn(f32, _GXColor&); - /* 800568D8 */ void wipeIn(f32); + /* 800568D8 */ static void wipeIn(f32); /* 80056900 */ void calcWipe(); void set2DOpa(dDlst_base_c* dlst) { set(field_0x1b4, field_0x1b8, dlst); } @@ -258,6 +258,7 @@ public: } static void offWipe() { data_80450ED0 = 0; } + static f32 getWipeRate() { return mWipeRate; } static u8 mWipeDlst[72]; static u8 mWipeColor[4]; diff --git a/include/d/d_gameover.h b/include/d/d_gameover.h index a4e496374c..318cf8756b 100644 --- a/include/d/d_gameover.h +++ b/include/d/d_gameover.h @@ -1,6 +1,52 @@ #ifndef D_D_GAMEOVER_H #define D_D_GAMEOVER_H +#include "d/msg/d_msg_class.h" #include "dolphin/types.h" +#include "f_op/f_op_msg_mng.h" + +struct dGameover_c : msg_class { + /* 8019B044 */ void _create(); + /* 8019B2F4 */ void _execute(); + /* 8019B384 */ void playerAnmWait_init(); + /* 8019B388 */ void playerAnmWait_proc(); + /* 8019B3A0 */ void dispFadeOut_init(); + /* 8019B3E8 */ void dispFadeOut_proc(); + /* 8019B40C */ void dispWait_init(); + /* 8019B454 */ void dispWait_proc(); + /* 8019B478 */ void demoFadeIn_init(); + /* 8019B484 */ void demoFadeIn_proc(); + /* 8019B4D8 */ void demoFadeOut_init(); + /* 8019B4E4 */ void demoFadeOut_proc(); + /* 8019B560 */ void saveOpen_init(); + /* 8019B564 */ void saveOpen_proc(); + /* 8019B5A4 */ void saveMove_init(); + /* 8019B5A8 */ void saveMove_proc(); + /* 8019B5F0 */ void saveClose_init(); + /* 8019B5F4 */ void saveClose_proc(); + /* 8019B7BC */ void deleteWait_init(); + /* 8019B7C0 */ void deleteWait_proc(); + /* 8019B7C4 */ void _draw(); + /* 8019B864 */ void _delete(); + s32 deleteCheck() { return _0x108 == 8; } + + /* 0x100 */ u8 _0x100[0x118 - 0x100]; + /* 0x108 */ u8 _0x108; +}; // size unknown + +s32 d_GameOver_Create(u8 param_0); +void d_GameOver_Delete(unsigned int& param_0); +inline s32 d_GameOver_CheckDelete(unsigned int& id) { + if (id != UINT32_MAX) { + dGameover_c* gameover = (dGameover_c*)fopMsgM_SearchByID(id); + if (gameover != NULL) { + return gameover->deleteCheck(); + } else { + return 0; + } + } else { + return 0; + } +} #endif /* D_D_GAMEOVER_H */ diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 032fac58c6..db454c2d19 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -57,6 +57,10 @@ struct stage_scls_info_class { /* 0xA */ u8 field_0xa; /* 0xB */ u8 field_0xb; /* 0xC */ s8 mWipe; + + char* getStage() { return mStage; } + + int getRoom() { return mRoom; } }; // Size: 0xD struct stage_scls_info_dummy_class { @@ -245,7 +249,9 @@ struct dStage_MapEvent_dt_c { u8 field_0x8; u8 field_0x9; u8 field_0xA[0xD - 0xA]; - char mName[10]; + char mName[6]; + u16 field_0x14; + u8 field_0x16; u8 field_0x17; u8 field_0x18; u8 field_0x19[0x1B - 0x19]; @@ -889,8 +895,7 @@ inline s16 dStage_stagInfo_GetUpButton(stage_stag_info_class* p_info) { inline u32 dStage_stagInfo_GetArg0(stage_stag_info_class* p_info) { return (p_info->field_0x0c >> 0x14) & 0xFF; } - -inline s8 dStage_sclsInfo_getSceneLayer(stage_scls_info_class* p_info) { +inline u32 dStage_sclsInfo_getSceneLayer(stage_scls_info_class* p_info) { return p_info->field_0xb & 0xF; } @@ -898,12 +903,12 @@ inline s8 dStage_sclsInfo_getWipe(stage_scls_info_class* p_info) { return p_info->mWipe; } -inline s8 dStage_sclsInfo_getWipeTime(stage_scls_info_class* p_info) { - return p_info->field_0xb >> 5; +inline s32 dStage_sclsInfo_getWipeTime(stage_scls_info_class* p_info) { + return (p_info->field_0xb >> 5) & 7; } inline int dStage_sclsInfo_getTimeH(stage_scls_info_class* p_info) { - return ((p_info->field_0xb & 0xF0) >> 4) | ((p_info->field_0xa & 0x0F) << 4); + return (u8)((p_info->field_0xa >> 4) & 0xF) | (p_info->field_0xb & 0x10 & ~0xF); } inline u32 dStage_FileList_dt_getMiniMap(dStage_FileList_dt_c* p_fList) { diff --git a/include/d/event/d_event.h b/include/d/event/d_event.h index 52d9896d30..3559a31f4d 100644 --- a/include/d/event/d_event.h +++ b/include/d/event/d_event.h @@ -66,7 +66,7 @@ public: void sceneChange(int); u32 getPId(void*); void* convPId(unsigned int); - void getStbDemoData(char*); + void* getStbDemoData(char*); static dStage_MapEvent_dt_c* searchMapEventData(u8, s32); static dStage_MapEvent_dt_c* searchMapEventData(u8); s16 runningEventID(s16); @@ -86,6 +86,7 @@ public: u8 getMode() const { return mMode; } u16 checkHind(u16 flag) { return flag & mHindFlag; } u8 checkCompulsory() { return mCompulsory; } + void setCullRate(f32 f) { mCullRate = f; } bool i_isOrderOK() { return field_0xe5 == 0 || field_0xe5 == 2; } void* getPt1() { return convPId(mPt1); } diff --git a/include/d/event/d_event_data.h b/include/d/event/d_event_data.h index 1d2e77e357..5d3a09031c 100644 --- a/include/d/event/d_event_data.h +++ b/include/d/event/d_event_data.h @@ -2,6 +2,7 @@ #define D_EVENT_D_EVENT_DATA_H #include "d/d_stage.h" +#include "d/msg/d_msg_class.h" #include "d/save/d_save.h" #include "dolphin/types.h" @@ -49,11 +50,13 @@ public: class dEvDtCut_c { public: - void startCheck(); + int startCheck(); int getDataTop() { return mDataTop; } int getFlagId() { return mFlagId; } char* getName() { return mName; } + int getNext() { return mNext; } + int getStartFlag(int idx) { return mFlags[idx]; } private: /* 0x00 */ char mName[32]; @@ -72,7 +75,8 @@ public: /* 0x0 */ TYPE_DEFAULT, /* 0x1 */ TYPE_ALL, /* 0x2 */ TYPE_CAMERA, - /* 0x4 */ TYPE_TIMEKEEPER = 4, + /* 0x3 */ TYPE_EFFECT, + /* 0x4 */ TYPE_TIMEKEEPER, /* 0x6 */ TYPE_DIRECTOR = 6, /* 0x7 */ TYPE_MESSAGE, /* 0x8 */ TYPE_SOUND, @@ -81,6 +85,37 @@ public: /* 0xC */ TYPE_CREATE, }; + struct StaffWork { + unsigned int _0; + msg_class* mLMsg; + unsigned int mMsgNo; + s32 mMsgSubstanceNum; + int* mMsgSubstanceP; + }; + + struct MessageData { + s16 unk; + }; + + struct SoundData { + s16 unk; + s16 timer; + }; + + struct TimerKeeperData { + s32 timer; + }; + + struct DirectorData { + s16 unk; + s16 unk2; + }; + + struct EffectData { + u8 pad[8]; + s32 unk; + }; + void specialProc_WaitStart(int); void specialProc_WaitProc(int); void specialProc(); @@ -101,27 +136,29 @@ public: int getStartCut() { return mStartCut; } // private: - /* 0x00 */ char mName[32]; + /* 0x00 */ char mName[8]; + /* 0x08 */ StaffWork mWork; + /* 0x0C */ u8 field_0x1C[0x20 - 0x1C]; /* 0x20 */ s32 mTagID; /* 0x24 */ u32 mIndex; /* 0x28 */ u32 mFlagID; /* 0x2C */ int mType; /* 0x30 */ int mStartCut; /* 0x34 */ u8 field_0x34[2]; - /* 0x36 */ s16 field_0x36; + /* 0x36 */ s16 mWaitTimer; /* 0x38 */ int mCurrentCut; /* 0x3C */ s32 field_0x3c; /* 0x40 */ bool field_0x40; /* 0x41 */ bool field_0x41; - /* 0x42 */ s16 field_0x42; - /* 0x44 */ s16 mSoundWait; - /* 0x46 */ u8 field_0x46[10]; + /* 0x42 */ u8 mData[0x50 - 0x42]; }; // Size: 0x50 +STATIC_ASSERT(sizeof(dEvDtStaff_c) == 0x50); + class dEvDtEvent_c { public: int finishCheck(); - void forceFinish(); + int forceFinish(); void specialStaffProc(dEvDtStaff_c*); int getNStaff() { return mNStaff; } int getStaff(int idx) { return mStaff[idx]; } @@ -136,8 +173,7 @@ public: /* 0x7C */ int mNStaff; /* 0x80 */ u8 field_0x80[4]; /* 0x84 */ int field_0x84; - /* 0x88 */ int field_0x88[2]; - /* 0x90 */ int field_0x90; + /* 0x88 */ int field_0x88[3]; /* 0x94 */ bool mPlaySound; /* 0x95 */ u8 field_0x95[0xF]; /* 0xA4 */ int mEventState; @@ -147,9 +183,9 @@ public: class dEvDtFlag_c { public: dEvDtFlag_c() {} - void flagCheck(int); - void flagSet(int); - bool flagMaxCheck(int); + BOOL flagCheck(int); + BOOL flagSet(int); + BOOL flagMaxCheck(int); void init(); #define FlagMax 0x2800 @@ -165,7 +201,7 @@ public: int init(); int init(char*, int); void advanceCut(dEvDtEvent_c*); - void advanceCutLocal(dEvDtStaff_c*); + BOOL advanceCutLocal(dEvDtStaff_c*); event_binary_data_header* getHeaderP() { return mHeaderP; } dEvDtStaff_c* getStaffP(int i) { return &mStaffP[i]; } diff --git a/include/d/event/d_event_lib.h b/include/d/event/d_event_lib.h index 4153188f74..4594bc142c 100644 --- a/include/d/event/d_event_lib.h +++ b/include/d/event/d_event_lib.h @@ -2,5 +2,44 @@ #define D_EVENT_D_EVENT_LIB_H #include "dolphin/types.h" +#include "f_op/f_op_actor.h" + +template <typename A0> +struct action_class { + typedef BOOL (A0::*fptr)(); + fptr init; + fptr execute; + + action_class(fptr pInit, fptr pExecute) { + init = pInit; + execute = pExecute; + } + + fptr& getInit() { return init; } + + fptr& getExecute() { return execute; } +}; + +struct dEvLib_callback_c { + /* 8004886C */ BOOL eventUpdate(); + /* 800488A4 */ BOOL setEvent(int, int, int); + /* 80048940 */ void orderEvent(int, int, int); + /* 80048970 */ BOOL setAction(action_class<dEvLib_callback_c>*); + /* 800489A8 */ BOOL initAction(); + /* 800489F8 */ BOOL executeAction(); + /* 80048A50 */ BOOL initStart(); + /* 80048A70 */ BOOL executeStart(); + /* 80048B1C */ BOOL initRun(); + /* 80048B48 */ BOOL executeRun(); + + virtual ~dEvLib_callback_c() {} + virtual BOOL eventStart() { return TRUE; } + virtual BOOL eventRun() { return TRUE; } + virtual BOOL eventEnd() { return TRUE; } + + fopAc_ac_c* mActor; + action_class<dEvLib_callback_c>* mAction; + u16 _C; +}; #endif /* D_EVENT_D_EVENT_LIB_H */ diff --git a/include/d/event/d_event_manager.h b/include/d/event/d_event_manager.h index 344f1f59ad..116876a27c 100644 --- a/include/d/event/d_event_manager.h +++ b/include/d/event/d_event_manager.h @@ -48,7 +48,7 @@ public: int startCheckOld(char const*); int endCheck(s16); int endCheckOld(char const*); - s32 getMyStaffId(char const*, fopAc_ac_c*, int); + int getMyStaffId(char const*, fopAc_ac_c*, int); int getIsAddvance(int); int getMyActIdx(int, char const* const*, int, int, int); char* getMyNowCutName(int); @@ -72,6 +72,7 @@ public: dEvDtBase_c& getBase() { return mEventList[mCurrentEventType]; } void setFlag(int flag) { mFlags.flagSet(flag); } + int flagCheck(int flag) { return mFlags.flagCheck(flag); } static int getIndexCompositId(s16 param_0) { return param_0 != -1 ? (u8)param_0 : -1; } static int getTypeCompositId(s16 param_0) { return param_0 == -1 ? 0 : param_0 >> 8; } diff --git a/include/d/kankyo/d_kankyo.h b/include/d/kankyo/d_kankyo.h index 11b0607e4c..ccdd271eaa 100644 --- a/include/d/kankyo/d_kankyo.h +++ b/include/d/kankyo/d_kankyo.h @@ -24,6 +24,8 @@ s32 dKy_daynight_check(); void dKy_clear_game_init(); void dKy_setLight_init(); u8 dKy_pol_sound_get(cBgS_PolyInfo const* param_0); +void dKy_instant_rainchg(); +void dKy_instant_timechg(f32); struct LIGHT_INFLUENCE { /* 800CFC7C */ ~LIGHT_INFLUENCE(); diff --git a/include/d/msg/d_msg_object.h b/include/d/msg/d_msg_object.h index 58b0912dbb..741538ae21 100644 --- a/include/d/msg/d_msg_object.h +++ b/include/d/msg/d_msg_object.h @@ -109,7 +109,7 @@ public: /* 80237F10 */ void setTalkActorLocal(fopAc_ac_c*); /* 8023800C */ static void readMessageGroup(mDoDvdThd_mountXArchive_c**); /* 8023803C */ static void changeFlowGroup(s32); - /* 8023806C */ void demoMessageGroup(); + /* 8023806C */ static void demoMessageGroup(); /* 80238098 */ void endFlowGroup(); /* 802380C4 */ void changeGroup(s16); /* 802380F4 */ void getString(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, char*, @@ -248,6 +248,9 @@ u16 dMsgObject_getOffering(); inline dMsgObject_c* dMsgObject_getMsgObjectClass() { return dComIfGp_getMsgObjectClass(); } +inline void dMsgObject_demoMessageGroup() { + dMsgObject_c::demoMessageGroup(); +} inline bool dMsgObject_isTalkNowCheck() { return dMsgObject_getMsgObjectClass()->getStatus() != 1 ? true : false; |
