diff --git a/include/DynamicLink.h b/include/DynamicLink.h index 109f4821..1e9e3319 100644 --- a/include/DynamicLink.h +++ b/include/DynamicLink.h @@ -80,8 +80,6 @@ struct DynamicModuleControl : DynamicModuleControlBase { UNKWORD unk2; UNKWORD unk3; UNKWORD unk4; - UNKWORD unk5; - UNKWORD unk6; static u32 sAllocBytes; static mDvd_toMainRam_base_c *sDvdFile; diff --git a/src/d/d_dylink.cpp b/src/d/d_dylink.cpp index a0e742d0..3bec3f39 100644 --- a/src/d/d_dylink.cpp +++ b/src/d/d_dylink.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -11,44 +12,6 @@ struct RelNamePtr { const char *name; }; -struct DynamicModuleControl { - u16 loadCount; - - DynamicModuleControl *mpPrev; - DynamicModuleControl *mpNext; - - DynamicModuleControl(const char *name, EGG::Heap *heap); - virtual ~DynamicModuleControl(); - virtual const char *getModuleName(); - virtual UNKWORD getModuleSize(); - virtual const char *getModuleTypeString(); - virtual void dump(); - virtual bool do_load(); - virtual bool do_load_async(); - virtual bool do_unload(); - virtual bool do_link(); - virtual bool do_unlink(); - - bool link(); - bool unlink(); - bool load_async(); - - void *rel; - void *bss; - bool dataFromProlog; - const char *name; - bool includesType; - mDvd_callback_c *dvdCallbackRequest; - EGG::Heap *heap; - bool relMapFile; - UNKWORD unk1; - UNKWORD unk2; - UNKWORD unk3; - UNKWORD unk4; - UNKWORD unk5; - UNKWORD unk6; -}; - static RelNamePtr *pDynamicNameTable; static int nDynamicNameTable; @@ -98,7 +61,7 @@ extern "C" int fn_80052E00(int maxRelId, RelNamePtr *dynNameTable, int dynNameTa // isLoaded? extern "C" bool fn_80052FA0(u16 relId) { - return pDMC[relId] != nullptr ? (bool)pDMC[relId]->loadCount : true; + return pDMC[relId] != nullptr ? pDMC[relId]->isLinked() : true; } bool dDyl::Unlink(u16 relId) { @@ -118,6 +81,7 @@ extern "C" int fn_80052FF0(u16 relId) { DynamicModuleControl *dmc = pDMC[relId]; if (dmc != nullptr) { if (dmc->load_async()) { + // what is going on here? return (bool)dmc->link() + 2; } else { return 0;