diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2022-02-10 07:06:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-10 07:06:04 -0800 |
| commit | d85ab6d159201ae41110a7b80f3fcbdca0b8efeb (patch) | |
| tree | fdb879517d4a42a802db03dfd15297e8503bb824 /include | |
| parent | 3a79e96e8b033e26a3970da68d0633010fac0f03 (diff) | |
| parent | ef903f4ab3f10aa97bb78aaf385cb9b3a3905775 (diff) | |
Merge pull request #180 from TakaRikka/dylink
c_dylink
Diffstat (limited to 'include')
| -rw-r--r-- | include/DynamicLink.h | 16 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRArchive.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRDvdRipper.h | 8 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRFileCache.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRFileLoader.h | 8 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRHeap.h | 8 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_phase.h | 2 | ||||
| -rw-r--r-- | include/c/c_dylink.h | 14 | ||||
| -rw-r--r-- | include/d/cc/d_cc_uty.h | 2 | ||||
| -rw-r--r-- | include/d/com/d_com_inf_game.h | 4 | ||||
| -rw-r--r-- | include/d/d_stage.h | 24 | ||||
| -rw-r--r-- | include/d/d_tresure.h | 54 | ||||
| -rw-r--r-- | include/d/map/d_map_path_dmap.h | 17 |
13 files changed, 125 insertions, 40 deletions
diff --git a/include/DynamicLink.h b/include/DynamicLink.h index 36c91d44e0..053bf375b6 100644 --- a/include/DynamicLink.h +++ b/include/DynamicLink.h @@ -20,38 +20,38 @@ struct DynamicModuleControlBase { /* 80262470 */ virtual void dump(); /* 802631FC */ virtual void dump2(); /* 802631DC */ virtual bool do_load(); - /* 802631F4 */ virtual bool do_load_async(); + /* 802631F4 */ virtual BOOL do_load_async(); /* 802631E4 */ virtual bool do_unload(); /* 802631D4 */ virtual BOOL do_link(); /* 802631EC */ virtual bool do_unlink(); /* 80262284 */ DynamicModuleControlBase(); - /* 802622D0 */ bool link(); - /* 80262364 */ bool unlink(); - /* 802623EC */ bool load_async(); + /* 802622D0 */ BOOL link(); + /* 80262364 */ BOOL unlink(); + /* 802623EC */ BOOL load_async(); /* 8026242C */ bool force_unlink(); static inline DynamicModuleControlBase* getFirstClass() { return mFirst; } inline DynamicModuleControlBase* getNextClass() { return mNext; } + bool isLinked() const { return mLinkCount != 0; } static DynamicModuleControlBase* mFirst; static DynamicModuleControlBase* mLast; }; struct DynamicModuleControl : DynamicModuleControlBase { - /* 800188E4 */ virtual ~DynamicModuleControl(); + /* 800188E4 */ virtual ~DynamicModuleControl() {} /* 80263218 */ virtual const char* getModuleName() const; /* 80263000 */ virtual int getModuleSize() const; /* 80263070 */ virtual const char* getModuleTypeString() const; - virtual void dump() = 0; /* 80262C0C */ virtual void dump2(); /* 802627E8 */ virtual bool do_load(); - /* 80262AFC */ virtual bool do_load_async(); + /* 80262AFC */ virtual BOOL do_load_async(); /* 80262BC4 */ virtual bool do_unload(); /* 80262C5C */ virtual BOOL do_link(); /* 80262F28 */ virtual bool do_unlink(); /* 80262660 */ DynamicModuleControl(char const*); /* 802626D0 */ static JKRArchive* mountCallback(void*); - /* 8026275C */ bool initialize(); + /* 8026275C */ static bool initialize(); /* 80262794 */ static void* callback(void*); /* 0x10 */ OSModuleInfo* mModule; diff --git a/include/JSystem/JKernel/JKRArchive.h b/include/JSystem/JKernel/JKRArchive.h index 9c413274ec..31991837d2 100644 --- a/include/JSystem/JKernel/JKRArchive.h +++ b/include/JSystem/JKernel/JKRArchive.h @@ -222,4 +222,8 @@ inline void* JKRGetTypeResource(u32 tag, const char* name, JKRArchive* arc) { return JKRArchive::getGlbResource(tag, name, arc); } +inline void* JKRGetResource(u32 tag, const char* name, JKRArchive* arc) { + return JKRArchive::getGlbResource(tag, name, arc); +} + #endif
\ No newline at end of file diff --git a/include/JSystem/JKernel/JKRDvdRipper.h b/include/JSystem/JKernel/JKRDvdRipper.h index b333a87de0..8248d167a2 100644 --- a/include/JSystem/JKernel/JKRDvdRipper.h +++ b/include/JSystem/JKernel/JKRDvdRipper.h @@ -43,4 +43,12 @@ inline void* JKRDvdToMainRam(s32 entryNum, u8* dst, JKRExpandSwitch expandSwitch offset, compression, returnSize); } +inline void* JKRDvdToMainRam(char const* param_0, u8* dst, JKRExpandSwitch expandSwitch, + u32 dstLength, JKRHeap* heap, + JKRDvdRipper::EAllocDirection allocDirection, u32 offset, + JKRCompression* compression, u32* returnSize) { + return JKRDvdRipper::loadToMainRAM(param_0, dst, expandSwitch, dstLength, heap, allocDirection, + offset, compression, returnSize); +} + #endif /* JKRDVDRIPPER_H */ diff --git a/include/JSystem/JKernel/JKRFileCache.h b/include/JSystem/JKernel/JKRFileCache.h index 69e4b8d3d3..07da8f05b2 100644 --- a/include/JSystem/JKernel/JKRFileCache.h +++ b/include/JSystem/JKernel/JKRFileCache.h @@ -60,4 +60,8 @@ public: static JKRFileCache* mount(const char*, JKRHeap*, const char*); }; +inline JKRFileCache* JKRMountDvdDrive(const char* path, JKRHeap* heap, const char* param_2) { + return JKRFileCache::mount(path, heap, param_2); +} + #endif /* JKRFILECACHE_H */ diff --git a/include/JSystem/JKernel/JKRFileLoader.h b/include/JSystem/JKernel/JKRFileLoader.h index afe86b085d..501fdda7d9 100644 --- a/include/JSystem/JKernel/JKRFileLoader.h +++ b/include/JSystem/JKernel/JKRFileLoader.h @@ -58,4 +58,12 @@ inline void* JKRGetNameResource(const char* name, JKRFileLoader* loader) { return JKRFileLoader::getGlbResource(name, loader); } +inline void* JKRGetResource(const char* name) { + return JKRFileLoader::getGlbResource(name); +} + +inline bool JKRDetachResource(void* resource, JKRFileLoader* loader) { + return JKRFileLoader::detachResource(resource, loader); +} + #endif /* JKRFILELOADER_H */ diff --git a/include/JSystem/JKernel/JKRHeap.h b/include/JSystem/JKernel/JKRHeap.h index 74fd1e2840..f2194cb7a8 100644 --- a/include/JSystem/JKernel/JKRHeap.h +++ b/include/JSystem/JKernel/JKRHeap.h @@ -225,4 +225,12 @@ inline u32 JKRGetMemBlockSize(JKRHeap* heap, void* block) { return JKRHeap::getSize(block, heap); } +inline void* JKRAlloc(u32 size, int alignment) { + return JKRHeap::alloc(size, alignment, NULL); +} + +inline s32 JKRResizeMemBlock(JKRHeap* heap, void* ptr, u32 size) { + return JKRHeap::resize(ptr, size, heap); +} + #endif /* JKRHEAP_H */ diff --git a/include/SSystem/SComponent/c_phase.h b/include/SSystem/SComponent/c_phase.h index 5ab4f80537..883422a6b1 100644 --- a/include/SSystem/SComponent/c_phase.h +++ b/include/SSystem/SComponent/c_phase.h @@ -20,6 +20,8 @@ typedef struct request_of_phase_process_class { int mPhaseStep; } request_of_phase_process_class; +typedef int (**request_of_phase_process_fn)(void*); + void cPhs_Reset(request_of_phase_process_class* pPhase); void cPhs_Set(request_of_phase_process_class* pPhase, cPhs__Handler* pHandlerTable); void cPhs_UnCompleate(request_of_phase_process_class* pPhase); diff --git a/include/c/c_dylink.h b/include/c/c_dylink.h index 2a7a2c1a40..6d511b2c12 100644 --- a/include/c/c_dylink.h +++ b/include/c/c_dylink.h @@ -2,5 +2,19 @@ #define C_C_DYLINK_H #include "dolphin/types.h" +#include "f_op/f_op_scene_mng.h" + +struct cDylPhs { + /* 80018804 */ static int phase_01(void*); + /* 8001880C */ static int phase_02(s16*); + /* 80018844 */ static int phase_03(void*); + /* 8001884C */ static int Link(request_of_phase_process_class*, s16); + /* 80018890 */ static int Unlink(request_of_phase_process_class*, s16); +}; + +struct DynamicNameTableEntry { + s16 mKey; + char* name; +}; #endif /* C_C_DYLINK_H */ diff --git a/include/d/cc/d_cc_uty.h b/include/d/cc/d_cc_uty.h index 1182425f29..877354fbd5 100644 --- a/include/d/cc/d_cc_uty.h +++ b/include/d/cc/d_cc_uty.h @@ -1,9 +1,9 @@ #ifndef D_CC_D_CC_UTY_H #define D_CC_D_CC_UTY_H +#include "d/com/d_com_inf_game.h" #include "dolphin/types.h" #include "f_op/f_op_actor_mng.h" -#include "d/com/d_com_inf_game.h" struct dCcU_AtInfo { /* 0x00 */ cCcD_Obj* mpCollider; diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index 050868de06..e27e8be59f 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -555,8 +555,6 @@ extern GXColor g_blackColor; extern GXColor g_clearColor; extern GXColor g_whiteColor; -typedef int (**request_of_phase_process_fn)(void*); - void dComIfGp_setItemLifeCount(float, u8); void dComIfGp_setItemRupeeCount(long); int dComIfGs_isItemFirstBit(u8); @@ -580,7 +578,7 @@ void dComIfGs_setWarpMarkFlag(u8); void dComIfGs_setSelectEquipSword(u8); void dComIfGs_setSelectEquipShield(u8); void* dComIfG_getStageRes(char const*); -void dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn, void*); +int dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn, void*); void dComIfGp_addSelectItemNum(int, s16); BOOL dComIfGs_isOneZoneSwitch(int, int); u8 dComIfGp_getSelectItem(int); diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 8ded7ec695..95f062496e 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -43,15 +43,7 @@ struct stage_stag_info_class { /* 0x20 */ u8 field_0x20[8]; /* 0x28 */ u8 mMsgGroup; /* 0x2A */ u16 mStageTitleNo; -}; // Size: Unknown - -inline s16 dStage_stagInfo_GetUpButton(stage_stag_info_class* p_info) { - return p_info->field_0x0a & 7; -} - -inline u32 dStage_stagInfo_GetArg0(stage_stag_info_class* p_info) { - return (p_info->field_0x0c >> 0x14) & 0xFF; -} +}; // Size: 0x2C struct stage_scls_info_class { /* 0x0 */ char mStage[8]; @@ -701,11 +693,11 @@ inline u8 dStage_roomRead_dt_c_GetLoadRoomIndex(u8 param_0) { } inline u32 dStage_stagInfo_GetSTType(stage_stag_info_class* pstag) { - return pstag->field_0x0c >> 0x10 & 7; + return (pstag->field_0x0c >> 16) & 7; } -inline u32 dStage_stagInfo_GetEscapeWarp(stage_stag_info_class* pstag) { - return pstag->field_0x10 >> 0x18; +inline int dStage_stagInfo_GetEscapeWarp(stage_stag_info_class* pstag) { + return (pstag->field_0x10 >> 24); } inline u32 dStage_stagInfo_GetMiniMap(stage_stag_info_class* pstag) { @@ -716,6 +708,14 @@ inline u8 dStage_stagInfo_GetParticleNo(stage_stag_info_class* p_info) { return (p_info->field_0x0a >> 0x3) & 0xFF; } +inline s16 dStage_stagInfo_GetUpButton(stage_stag_info_class* p_info) { + return p_info->field_0x0a & 7; +} + +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) { return p_info->field_0xb & 0xF; } diff --git a/include/d/d_tresure.h b/include/d/d_tresure.h index 953c1533f0..3494a350e5 100644 --- a/include/d/d_tresure.h +++ b/include/d/d_tresure.h @@ -1,6 +1,60 @@ #ifndef D_D_TRESURE_H #define D_D_TRESURE_H +#include "dolphin/mtx/mtxvec.h" #include "dolphin/types.h" +class dTres_c { +public: + struct data_s { + /* 0x00 */ u8 mNo; + /* 0x01 */ s8 mRoomNo; + /* 0x02 */ u8 mStatus; + /* 0x03 */ u8 mArg1; + /* 0x04 */ Vec mPos; + /* 0x10 */ u8 mSwBit; + /* 0x11 */ u8 mType; + /* 0x12 */ u8 mArg2; + /* 0x13 */ u8 mAngleY; + }; + + class typeGroupData_c { + public: + data_s* getDataPointer() { return &mData; } + void setNextDataPointer(typeGroupData_c* data) { mNextData = data; } + void setTypeGroupNo(u8 no) { mTypeGroupNo = no; } + + /* 0x00 */ data_s mData; + /* 0x14 */ typeGroupData_c* mNextData; + /* 0x18 */ u8 mTypeGroupNo; + }; // Size: 0x1C + + struct list_class { + /* 0x0 */ int field_0x0; + /* 0x4 */ typeGroupData_c* field_0x4; + /* 0x8 */ u8 field_0x8; + }; + + /* 8009BBD8 */ static int createWork(); + /* 8009BC18 */ static void create(); + /* 8009BC60 */ void remove(); + /* 8009BC6C */ static void reset(); + /* 8009BCB4 */ static void addData(dTres_c::list_class*, s8); + /* 8009BE28 */ static void checkTreasureBox(dTres_c::data_s*); + /* 8009C168 */ void onStatus(u8, int, int); + /* 8009C1F0 */ void offStatus(u8, int, int); + /* 8009C27C */ void getBossIconFloorNo(int*); + /* 8009C360 */ void getFirstData(u8); + /* 8009C39C */ void getNextData(dTres_c::typeGroupData_c*); + /* 8009C3B4 */ void getNextData(dTres_c::typeGroupData_c const*); + /* 8009C3CC */ void setPosition(int, u8, Vec const*, int); + /* 8009C49C */ void getTypeGroupNoToType(u8); + /* 8009C4B0 */ static u8 getTypeToTypeGroupNo(u8); + + static u8 const typeToTypeGroup[34]; + static list_class mTypeGroupListAll[17]; + static typeGroupData_c* mTypeGroupData; + static u16 mNum; +}; + #endif /* D_D_TRESURE_H */ diff --git a/include/d/map/d_map_path_dmap.h b/include/d/map/d_map_path_dmap.h index b80b343860..02a1b34362 100644 --- a/include/d/map/d_map_path_dmap.h +++ b/include/d/map/d_map_path_dmap.h @@ -2,25 +2,10 @@ #define D_MAP_D_MAP_PATH_DMAP_H #include "d/d_stage.h" +#include "d/d_tresure.h" #include "d/map/d_map_path.h" #include "dolphin/types.h" -struct dTres_c { - struct data_s {}; - - struct typeGroupData_c {}; - - struct list_class {}; - - /* 8009BCB4 */ void addData(dTres_c::list_class*, s8); - /* 8009C360 */ void getFirstData(u8); - /* 8009C3B4 */ void getNextData(dTres_c::typeGroupData_c const*); - /* 8009C39C */ void getNextData(dTres_c::typeGroupData_c*); - /* 8009C4B0 */ void getTypeToTypeGroupNo(u8); - - static u8 mTypeGroupListAll[204 + 4 /* padding */]; -}; - class dMpath_c { public: /* 8003F758 */ static u8 isExistMapPathData(); |
