2023-09-10 04:42:26 +00:00
|
|
|
#ifndef DYNAMICLINK_H
|
|
|
|
#define DYNAMICLINK_H
|
|
|
|
|
2024-07-07 17:24:14 +00:00
|
|
|
#include "dolphin/os/OS.h"
|
2023-09-10 04:42:26 +00:00
|
|
|
|
|
|
|
class JKRArchive;
|
|
|
|
class JKRFileCache;
|
|
|
|
class mDoDvdThd_callback_c;
|
|
|
|
|
|
|
|
struct DynamicModuleControlBase {
|
|
|
|
/* 0x00 */ u16 mLinkCount;
|
|
|
|
/* 0x02 */ u16 mDoLinkCount;
|
|
|
|
/* 0x04 */ DynamicModuleControlBase* mPrev;
|
|
|
|
/* 0x08 */ DynamicModuleControlBase* mNext;
|
|
|
|
|
|
|
|
/* 0x0C */ /*vtable*/
|
|
|
|
virtual ~DynamicModuleControlBase();
|
|
|
|
virtual const char* getModuleName() const { return NULL; }
|
|
|
|
virtual int getModuleSize() const { return 0; }
|
|
|
|
virtual const char* getModuleTypeString() const { return "Base"; }
|
2024-10-18 01:35:18 +00:00
|
|
|
#ifdef __MWERKS__
|
2023-09-10 04:42:26 +00:00
|
|
|
virtual void dump();
|
2024-10-18 01:35:18 +00:00
|
|
|
#endif
|
|
|
|
static void dump();
|
2023-10-13 21:21:53 +00:00
|
|
|
virtual void dump2() {}
|
2023-09-10 04:42:26 +00:00
|
|
|
virtual bool do_load() { return true; }
|
2024-10-18 01:35:18 +00:00
|
|
|
virtual BOOL do_load_async() { return TRUE; }
|
2023-09-10 04:42:26 +00:00
|
|
|
virtual bool do_unload() { return true; }
|
|
|
|
virtual BOOL do_link() { return TRUE; }
|
|
|
|
virtual bool do_unlink() { return true; }
|
|
|
|
DynamicModuleControlBase();
|
|
|
|
BOOL link();
|
|
|
|
BOOL unlink();
|
|
|
|
BOOL load_async();
|
|
|
|
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 {
|
|
|
|
virtual ~DynamicModuleControl() {}
|
|
|
|
virtual const char* getModuleName() const { return mName; }
|
|
|
|
virtual int getModuleSize() const;
|
|
|
|
virtual const char* getModuleTypeString() const;
|
|
|
|
virtual void dump2();
|
|
|
|
virtual bool do_load();
|
|
|
|
virtual BOOL do_load_async();
|
|
|
|
virtual bool do_unload();
|
|
|
|
virtual BOOL do_link();
|
|
|
|
virtual bool do_unlink();
|
|
|
|
DynamicModuleControl(char const*);
|
|
|
|
static JKRArchive* mountCallback(void*);
|
|
|
|
static bool initialize();
|
|
|
|
static bool callback(void*);
|
|
|
|
|
2024-07-07 17:24:14 +00:00
|
|
|
/* 0x10 */ OSModuleHeader* mModule;
|
2023-09-10 04:42:26 +00:00
|
|
|
/* 0x14 */ void* mBss;
|
|
|
|
/* 0x18 */ u32 unk_24;
|
|
|
|
/* 0x1c */ const char* mName;
|
|
|
|
/* 0x20 */ u8 mResourceType;
|
|
|
|
/* 0x21 */ u8 unk_33;
|
|
|
|
/* 0x22 */ u16 mChecksum;
|
|
|
|
/* 0x24 */ s32 mSize;
|
|
|
|
/* 0x28 */ mDoDvdThd_callback_c* mAsyncLoadCallback;
|
|
|
|
|
|
|
|
static u32 sAllocBytes;
|
|
|
|
static JKRArchive* sArchive;
|
|
|
|
static JKRFileCache* sFileCache;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DYNAMICLINK_H */
|