diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index ba4c1a1c..187b3e97 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -17740,8 +17740,8 @@ IsExistPath__4mDvdFPCc = .text:0x802EF0A0; // type:function size:0x30 __dt__14mDvd_command_cFv = .text:0x802EF0D0; // type:function size:0x60 __nw__14mDvd_command_cFUl = .text:0x802EF130; // type:function size:0xC __dl__14mDvd_command_cFPv = .text:0x802EF140; // type:function size:0x8 -doClear__14mDvd_command_cFv = .text:0x802EF150; // type:function size:0x10 -onComplete__14mDvd_command_cFv = .text:0x802EF160; // type:function size:0x4 +done__14mDvd_command_cFv = .text:0x802EF150; // type:function size:0x10 +doClear__14mDvd_command_cFv = .text:0x802EF160; // type:function size:0x4 waitDone__14mDvd_command_cFv = .text:0x802EF170; // type:function size:0x14 waitUntilDone__14mDvd_command_cFv = .text:0x802EF190; // type:function size:0x44 __ct__12mDvd_param_cFv = .text:0x802EF1E0; // type:function size:0x50 @@ -17770,7 +17770,7 @@ ConvertPathToEntrynum_Thunk__FPCcPUc = .text:0x802EF9D0; // type:function size:0 create__22mDvd_mountMemArchive_cFPCcUcPQ23EGG4Heap = .text:0x802EF9E0; // type:function size:0xA0 execute__22mDvd_mountMemArchive_cFv = .text:0x802EFA80; // type:function size:0xF8 getArcBinary__22mDvd_mountMemArchive_cFv = .text:0x802EFB80; // type:function size:0x18 -onComplete__22mDvd_mountMemArchive_cFv = .text:0x802EFBA0; // type:function size:0x64 +doClear__22mDvd_mountMemArchive_cFv = .text:0x802EFBA0; // type:function size:0x64 __ct__21mDvd_toMainRam_base_cFi = .text:0x802EFC10; // type:function size:0x6C __dt__21mDvd_toMainRam_base_cFv = .text:0x802EFC80; // type:function size:0x58 __dt__20mDvd_toMainRam_arc_cFv = .text:0x802EFCE0; // type:function size:0x58 @@ -17785,7 +17785,7 @@ fn_802F0030 = .text:0x802F0030; // type:function size:0x30 create2__23mDvd_toMainRam_normal_cFPP23mDvd_toMainRam_normal_cPCciPQ23EGG4Heap = .text:0x802F0060; // type:function size:0x48 __dt__23mDvd_toMainRam_normal_cFv = .text:0x802F00B0; // type:function size:0x58 execute__23mDvd_toMainRam_normal_cFv = .text:0x802F0110; // type:function size:0xA0 -onComplete__23mDvd_toMainRam_normal_cFv = .text:0x802F01B0; // type:function size:0x18 +doClear__23mDvd_toMainRam_normal_cFv = .text:0x802F01B0; // type:function size:0x18 __dt__Q24mDvd10MyThread_cFv = .text:0x802F01D0; // type:function size:0x58 __sinit_\m_dvd_cpp = .text:0x802F0230; // type:function size:0xE0 scope:local Construct__Q24mDvd41TUncompressInfo_cCFv = .text:0x802F0310; // type:function size:0x3C diff --git a/include/m/m_dvd.h b/include/m/m_dvd.h index 17087eb2..a780afd6 100644 --- a/include/m/m_dvd.h +++ b/include/m/m_dvd.h @@ -5,10 +5,6 @@ #include #include -// TODO these are scattered -int findPathWithCompressedExtension(const char *name, u8 *outType); -int ConvertPathToEntrynum(const char *path, u8 *outType); - // TODO onComplete -> doClear? namespace mDvd { @@ -38,13 +34,7 @@ public: virtual void Destruct() const {} }; -TUncompressInfo_Base_c *findUncompressInfo(u8 type); - void create(int priority, EGG::Heap *commandHeap, EGG::Heap *archiveHeap, EGG::Heap *threadHeap); -void *loadToMainRAM(u32 entryNum, char *dst, EGG::Heap *heap, EGG::DvdRipper::EAllocDirection allocDir, u32 offset, u32 *p6, u32 *p7, - u32 decompressorType); - -u32 IsExistPath(const char *path); OSThread *getOSThread(); EGG::Heap *getArchiveHeap(); @@ -56,9 +46,9 @@ public: virtual ~mDvd_command_c(); virtual u32 execute() = 0; - virtual void onComplete(); + virtual void doClear(); - void doClear(); + void done(); void waitDone(); void waitUntilDone(); static void destroy(mDvd_command_c **cmd); @@ -92,7 +82,7 @@ public: mDvd_mountMemArchive_c(int mountDirection); virtual ~mDvd_mountMemArchive_c(); virtual u32 execute(); - virtual void onComplete(); + virtual void doClear(); static mDvd_mountMemArchive_c *create(const char *path, u8 mountDirection, EGG::Heap *heap); void *getArcBinary(); @@ -133,7 +123,7 @@ public: mDvd_toMainRam_normal_c(int mountDirection); ~mDvd_toMainRam_normal_c(); virtual u32 execute(); - virtual void onComplete(); + virtual void doClear(); static mDvd_toMainRam_normal_c *create(const char *path, int mountDirection, EGG::Heap *heap); static void create2(mDvd_toMainRam_normal_c **cmd, const char *path, int mountDirection, EGG::Heap *heap); diff --git a/src/m/m_dvd.cpp b/src/m/m_dvd.cpp index 72e7d45f..3719b92a 100644 --- a/src/m/m_dvd.cpp +++ b/src/m/m_dvd.cpp @@ -11,6 +11,8 @@ #include // clang-format on +static int ConvertPathToEntrynum(const char *path, u8 *outType); + namespace mDvd { TUncompressInfo_c s_UncompressInfoSZS(3, ".szs"); @@ -60,7 +62,7 @@ extern "C" void fn_802EECF0() { } /** 802eed30 */ -TUncompressInfo_Base_c *findUncompressInfo(u8 type) { +static TUncompressInfo_Base_c *findUncompressInfo(u8 type) { TUncompressInfo_Base_c **ptr = compressors_ptr; while (ptr != compressors_last) { if ((*ptr)->mType == type) { @@ -72,7 +74,7 @@ TUncompressInfo_Base_c *findUncompressInfo(u8 type) { } /** 802eed70 */ -EGG::StreamDecomp *newUncompressObj(u8 type) { +static EGG::StreamDecomp *newUncompressObj(u8 type) { TUncompressInfo_Base_c *factory = findUncompressInfo(type); if (factory != nullptr) { return factory->Construct(); @@ -82,7 +84,7 @@ EGG::StreamDecomp *newUncompressObj(u8 type) { } /** 802eedb0 */ -void deleteUncompressObj(u8 type) { +static void deleteUncompressObj(u8 type) { TUncompressInfo_Base_c *factory = findUncompressInfo(type); if (factory != nullptr) { factory->Destruct(); @@ -125,7 +127,7 @@ void create(int priority, EGG::Heap *commandHeap, EGG::Heap *archiveHeap, EGG::H } /** 802eef30 */ -void *loadToMainRAM(int entryNum, char *dst, EGG::Heap *heap, EGG::DvdRipper::EAllocDirection allocDir, s32 offset, +static void *loadToMainRAM(int entryNum, char *dst, EGG::Heap *heap, EGG::DvdRipper::EAllocDirection allocDir, s32 offset, u32 *outAmountRead, u32 *outFileSize, u32 decompressorType) { void *result; u32 amountRead = 0; @@ -161,11 +163,11 @@ void *loadToMainRAM(int entryNum, char *dst, EGG::Heap *heap, EGG::DvdRipper::EA return result; } -int ConvertPathToEntrynum(const char *path) { +static int ConvertPathToEntrynum(const char *path) { return ::ConvertPathToEntrynum(path, nullptr); } -u32 IsExistPath(const char *path) { +static u32 IsExistPath(const char *path) { u32 entry = ConvertPathToEntrynum(path); return entry != -1; } @@ -189,12 +191,12 @@ void mDvd_command_c::operator delete(void *ptr) { } /** 802ef150 */ -void mDvd_command_c::doClear() { - onComplete(); +void mDvd_command_c::done() { + doClear(); } /** 802ef170 */ -void mDvd_command_c::onComplete() {} +void mDvd_command_c::doClear() {} void mDvd_command_c::waitDone() { mStatus = 1; @@ -315,7 +317,7 @@ extern "C" void fn_802EF480(mDvd_command_c *cmd) { void mDvd_command_c::destroy(mDvd_command_c **cmd) { // TODO fake match, this looks like an inlined dtor if (cmd != nullptr && cmd != nullptr && *cmd != nullptr) { - (*cmd)->doClear(); + (*cmd)->done(); fn_802EF480(*cmd); *cmd = nullptr; } @@ -434,7 +436,7 @@ bool getAutoStreamDecomp() { } /** 802ef950 */ -int ConvertPathToEntrynum(const char *path, u8 *outType) { +static int ConvertPathToEntrynum(const char *path, u8 *outType) { int num = DVDConvertPathToEntrynum(path); if (num != -1) { if (outType != nullptr) { @@ -447,7 +449,7 @@ int ConvertPathToEntrynum(const char *path, u8 *outType) { } /** 802ef9d0 */ -int ConvertPathToEntrynum_Thunk(const char *path, u8 *outType) { +static int ConvertPathToEntrynum_Thunk(const char *path, u8 *outType) { return ConvertPathToEntrynum(path, outType); } @@ -507,7 +509,7 @@ void *mDvd_mountMemArchive_c::getArcBinary() { } /** 802efba0 */ -void mDvd_mountMemArchive_c::onComplete() { +void mDvd_mountMemArchive_c::doClear() { if (mDataPtr != nullptr) { void *data = mDataPtr->mHandle.header; mDataPtr->unmount(); @@ -639,7 +641,7 @@ u32 mDvd_toMainRam_normal_c::execute() { } /** 802f01b0 */ -void mDvd_toMainRam_normal_c::onComplete() { +void mDvd_toMainRam_normal_c::doClear() { if (mDataPtr == nullptr) { return; }