diff --git a/include/JSystem/JAudio/JAD/JADDataMgr.h b/include/JSystem/JAudio/JAD/JADDataMgr.h index a29b3ba89..b1c84dfc9 100644 --- a/include/JSystem/JAudio/JAD/JADDataMgr.h +++ b/include/JSystem/JAudio/JAD/JADDataMgr.h @@ -1,6 +1,8 @@ #ifndef _JSYSTEM_JAD_JADDATAMGR_H #define _JSYSTEM_JAD_JADDATAMGR_H +#include "stl/string.h" +#include "JSystem/JSupport/JSUStream.h" #include "types.h" #include "JSystem/JKernel/JKRDisposer.h" #include "JSystem/JKernel/JKRHeap.h" @@ -16,46 +18,69 @@ struct DataMgrBase : public JKRDisposer { DataMgrBase(); virtual ~DataMgrBase(); // _08 - virtual void init(); // _0C (weak) + virtual void init() + { + JKRHeap::free(_18, nullptr); + _18 = nullptr; + } // _0C (weak) // _00 = VTABLE // _04-_18 = JKRDisposer - JKRHeap* _18; // _18 - u32 _1C; // _1C - unknown -}; - -// idk if this should exist, but _00 in DataLoadMgrNode needs to be a DataMgrBase* -// rather than a vtable so... -struct _DataLoadMgrBase { - DataMgrBase* _00; // _00 + void* _18; // _18 }; /** * @size = 0x234 - could be wrong, inheritance is confusing */ -struct DataLoadMgrNode : public _DataLoadMgrBase { - virtual ~DataLoadMgrNode(); // _08 (weak) - virtual void isTempBuffaMode(); // _0C (weak) - virtual void init(); // _10 (weak) - virtual void getObjHeap() = 0; // _14 +struct DataLoadMgrNode : virtual public DataMgrBase { + enum ObjStatus {}; + + DataLoadMgrNode(); + + virtual ~DataLoadMgrNode(); // _08 (weak) + virtual bool isTempBuffaMode(); // _0C (weak) + virtual void init() + { + _08 = 0; + DataMgrBase::init(); + } // _10 (weak) + + virtual JKRHeap* getObjHeap() = 0; // _14 virtual void getDataHeap() = 0; // _18 - virtual void initInstance(void*, long) = 0; // _1C - virtual void initInstance() = 0; // _20 - virtual void getPath() = 0; // _24 - virtual void setPath(char*) = 0; // _28 + virtual bool initInstance(void*, long) = 0; // _1C + virtual bool initInstance() = 0; // _20 - void initInstanceExt(void*, long); + bool initInstanceExt(void*, long); void setFlagsAsExternal(void*); - // _00 = DataMgrBase* - // _04 = VTABLE - int _08; // _08 - char _0C[0x100]; // _0C - path buffer? - char _10C[0x100]; // _10C - string buffer? + // unused/inlined: + void setLoadPath(char const* path) + { + if (strlen(path) <= 0xFF) { + strcpy(mLoadPath, path); + } + } + // void load(JADUtility::DataLoadMgrNode::ObjStatus, bool); + // bool initInstanceExt(); + // void loadDvd(unsigned long*); + + /** @fabricated */ + inline void setPath(char const* path) + { + if (strlen(path) <= 0xFF) { + strcpy(mPath, path); + } + } -private: - u8 _20C[0x8]; // _20C - unknown - DataMgrBase _214; // _214 + // _00 = DataMgrBase* + // _04 = VTABLE + int _08; // _08 + char mPath[0x100]; // _0C + char mLoadPath[0x100]; // _10C, best guess as to name + u32 _20C; // _20C + u32 _210; // _210 + + // _214 - _234 = DataMgrBase (virtual) }; /** @@ -64,38 +89,55 @@ struct DataLoadMgrNode : public _DataLoadMgrBase { struct DataMgrNode : public DataLoadMgrNode { DataMgrNode(); - virtual ~DataMgrNode(); // _08 (weak) - virtual void init(); // _10 (weak) - virtual void getObjHeap() = 0; // _14 - virtual void getDataHeap() = 0; // _18 - virtual void initInstance(void*, long) = 0; // _1C - virtual void initInstance() = 0; // _20 - virtual void getPath(); // _24 (weak) - virtual void setPath(char*); // _28 (weak) - // virtual void _2C() = 0; // _2C - maybe - // virtual void _30() = 0; // _30 - maybe + virtual ~DataMgrNode() { } // _08 (weak) + virtual void init() { DataLoadMgrNode::init(); } // _10 (weak) + virtual JKRHeap* getObjHeap() = 0; // _14 + virtual void getDataHeap() = 0; // _18 + virtual bool initInstance(void*, long) = 0; // _1C + virtual bool initInstance() = 0; // _20 + virtual char* getPath() { return mPath; } // _24 (weak) + virtual void setPath(char* path) { DataLoadMgrNode::setPath(path); } // _28 (weak) // _00 = DataMgrBase* // _04 = VTABLE - // _08-_20C = DataLoadMgrNode - u32 _20C; // _20C - int _210; // _210 - StrPrm _214; // _214 - u32 _244; // _244 - u32 _248; // _248 - int _24C; // _24C - DataMgrBase _250; // _250 + // _08-_214 = DataLoadMgrNode + StrPrm _214; // _214 + + // _250 - _270 = DataMgrBase (virtual) }; template struct PrmDataMgrNode : public DataMgrNode { - virtual ~PrmDataMgrNode(); // _08 (weak) - virtual void isTempBuffaMode() = 0; // _0C - virtual void init() = 0; // _10 - virtual void getObjHeap(); // _14 (weak) - virtual void getDataHeap(); // _18 (weak) - virtual void initInstance(void*, long); // _1C (weak) - virtual void initInstance(); // _20 (weak) + virtual ~PrmDataMgrNode(); // _08 (weak) + virtual bool isTempBuffaMode() = 0; // _0C + virtual void init() = 0; // _10 + virtual JKRHeap* getObjHeap(); // _14 (weak) + virtual void getDataHeap(); // _18 (weak) + virtual bool initInstance(void* buffer, long bufferLength) + { + bool success = initInstance(); + if (success != false) { + JSUMemoryInputStream input; + input.setBuffer(buffer, bufferLength); + // TODO: vt _250 + 0x10 + } + return success; + } // _1C (weak) + virtual bool initInstance() { } // _20 (weak) +}; + +struct DataLoadMgrVirNode { + DataLoadMgrVirNode(unsigned long); + ~DataLoadMgrVirNode(); + void init(); + const char* getPath(); +}; + +struct DataMgrVirNode { + DataMgrVirNode(unsigned long); + ~DataMgrVirNode(); + void init(); + const char* getPath(); }; } // namespace JADUtility diff --git a/include/JSystem/JAudio/JAD/JADStr.h b/include/JSystem/JAudio/JAD/JADStr.h index ca4d3d23f..017853870 100644 --- a/include/JSystem/JAudio/JAD/JADStr.h +++ b/include/JSystem/JAudio/JAD/JADStr.h @@ -6,18 +6,50 @@ #include "JSystem/JSupport/JSUStream.h" namespace JADUtility { +struct DataMgrBase; /** - * @size = 0x30 + * @size = 0x3C */ struct StrPrm : public PrmHio { - virtual ~StrPrm(); // _08 (weak) - virtual void save(JSUMemoryOutputStream&); // _0C (weak) - virtual void load(JSUMemoryInputStream&); // _10 (weak) + typedef void (*Callback)(void*, u32); + StrPrm() + : PrmHio() + , _30(0) + , _34(0) + , _38(0) + { + } + virtual ~StrPrm() { } // _08 (weak) + virtual void save(JSUMemoryOutputStream& output) + { + if (_30 > 0) { + output.write(mValue, _30); + } else { + output.write(mValue); + } + PrmBase::save(output); + } // _0C (weak) + virtual void load(JSUMemoryInputStream& input) + { + if (_30 > 0) { + input.read(mValue, _30); + } else { + input.read(mValue); + } + PrmBase::load(input); + if (_34 != nullptr && _38) { + _34(this, _38); + } + } // _10 (weak) + + s32 _30; + Callback _34; + u32 _38; }; /** - * @size = 0x30 + * @size = 0x3C */ struct StrEditBox : public StrPrm { virtual ~StrEditBox(); // _08 (weak) diff --git a/include/JSystem/JAudio/JAD/JADUtility.h b/include/JSystem/JAudio/JAD/JADUtility.h index 1977fa818..76d6f7c87 100644 --- a/include/JSystem/JAudio/JAD/JADUtility.h +++ b/include/JSystem/JAudio/JAD/JADUtility.h @@ -1,6 +1,7 @@ #ifndef _JSYSTEM_JAD_JADUTILITY_H #define _JSYSTEM_JAD_JADUTILITY_H +#include "JSystem/JKernel/JKRHeap.h" #include "types.h" #include "JSystem/JSupport/JSUStream.h" #include "JSystem/JKernel/JKRDisposer.h" @@ -8,74 +9,120 @@ namespace JADUtility { struct PrmSetBase; +struct PrmBase; +struct DataMgrBase; /** - * @size = 0x1C + * @size = 0x38 */ template -struct NodeTree { - virtual void beforeRemovingChild(T*); // _08 (weak) - virtual void beforeRemovingThis(T*); // _0C (weak) - virtual void afterRemovingChildButton(T*); // _10 (weak) - virtual void afterRemovingThisButton(T*); // _14 (weak) - - u32 _04; // _04 - unknown - u32 _08; // _08 - unknown - u32 _0C; // _0C - unknown - u32 _10; // _10 - unknown - void* _14; // _04 - function pointer for removeCallback() - u32 _18; // _08 - unknown +struct NodeTree : public JSUTree { + inline NodeTree(T* owner) + : JSUTree(owner) + , _20(0) + , _24(0) + , _28(0) + , _2C(0) + , _30(nullptr) + , _34(0) + { + } + + virtual void beforeRemovingChild(T*) { } // _08 (weak) + virtual void beforeRemovingThis(T*) { } // _0C (weak) + virtual void afterRemovingChildButton(T*) { } // _10 (weak) + virtual void afterRemovingThisButton(T*, T*) { } // _14 (weak) + + // unused/inlined: + inline ~NodeTree() { } + + // _00-_1C = JSUTree + // _1C = VTABLE + u32 _20; // _20 - unknown + u32 _24; // _24 - unknown + u32 _28; // _28 - unknown + u32 _2C; // _2C - unknown + void* _30; // _30 - function pointer for removeCallback() + u32 _34; // _34 - unknown }; // TODO: this struct AccessMode; /** - * @size = 0x1C + * @size = 0x3C */ struct PrmSetTree : public NodeTree { - inline ~PrmSetTree(); + inline PrmSetTree(PrmSetBase* owner) + : NodeTree(owner) + { + } + + inline ~PrmSetTree() { } }; /** * @size = 0x64 */ -struct PrmSetBase { +struct PrmSetBase : public JKRDisposer { PrmSetBase(bool); - virtual ~PrmSetBase(); // _08 (weak) - virtual void appendAfter(); // _0C (weak) - virtual void load(JSUMemoryInputStream&); // _10 - virtual void afterRemovingChildButton(PrmSetBase*); // _14 (weak) - virtual void afterRemovingThisButton(PrmSetBase*); // _18 (weak) - virtual void getEraseLink(); // _1C (weak) - virtual void afterGetFromFree(); // _20 (weak) - - u8 _04[0x14]; // _04 - unknown - u8 _18; // _18 - u8 _19; // _19 - bool _1A; // _1A - u8 _1B; // _1B - possibly padding - JSUPtrList _1C; // _1C - u8 _28[0x4]; // _28 - unknown - JSUPtrList _2C; // _2C - JSUPtrLink _38; // _38 - PrmSetTree _48; // _48 + virtual ~PrmSetBase() + { + JSULink* link; + while ((link = _1C.getFirst()) != nullptr) { + _1C.remove(link); + } + } // _08 (weak) + + virtual void appendAfter() { } // _0C (weak) + virtual void load(JSUMemoryInputStream&); // _10 + virtual void afterRemovingChildButton(PrmSetBase*) { } // _14 (weak) + virtual void afterRemovingThisButton(PrmSetBase*) { } // _18 (weak) + virtual void* getEraseLink() { return nullptr; } // _1C (weak) + virtual void afterGetFromFree() { } // _20 (weak) + + // unused/inlined: + // void appendDummy(u8); + + u8 _18; // _18 + u8 _19; // _19 + bool _1A; // _1A + u8 _1B; // _1B - possibly padding + JSUList _1C; // _1C + u8 _28[0x4]; // _28 - unknown + PrmSetTree _2C; // _48 }; /** * @size = 0x2C */ struct PrmBase : public JKRDisposer { - virtual ~PrmBase(); // _08 (weak) - virtual void save(JSUMemoryOutputStream&); // _0C (weak) - virtual void load(JSUMemoryInputStream&); // _10 (weak) + PrmBase() + : _18(0) + , _1C(this) + { + } + virtual ~PrmBase() { } // _08 (weak) + virtual void save(JSUMemoryOutputStream& output) + { + for (u8 i = 0; i < _18; i++) { + u8 padding = 0; + output.write(&padding, 1); + } + + } // _0C (weak) + virtual void load(JSUMemoryInputStream& input) + { + if (_18 != 0) { + input.skip(_18); + } + } // _10 (weak) // _00 = VTABLE // _04-_18 = JKRDisposer - u8 _18; // _18 - u8 _19[0x3]; // _19 - unknown, could be padding - JSUPtrLink _1C; // _1C + u8 _18; // _18 + JSULink _1C; // _1C }; /** @@ -83,50 +130,126 @@ struct PrmBase : public JKRDisposer { */ template struct Prm : public PrmBase { + Prm() + : PrmBase() + { + } + + virtual ~Prm() { } // _08 (weak) + virtual void save(JSUMemoryOutputStream& output) + { + output.write(mValue, sizeof(T)); + PrmBase::save(output); + } // _0C (weak) + virtual void load(JSUMemoryInputStream& input) + { + input.read(mValue, sizeof(T)); + PrmBase::load(input); + } // _10 (weak) + // _00 = VTABLE // _04-_2C = PrmBase - T* mValue; // _2C + T mValue; // _2C + + // T* mValue; // _2C }; +template <> +inline void Prm::save(JSUMemoryOutputStream& output) +{ + output.write(mValue); + PrmBase::save(output); +} + +template <> +inline void Prm::load(JSUMemoryInputStream& input) +{ + input.read(mValue); + PrmBase::load(input); +} + /** * @size = 0x98 */ template struct PrmSetRc : public PrmSetBase { + PrmSetRc() + : PrmSetBase(true) + , _64(0) + , _68(this) + { + } + + T getChildNum() { return _68.mValue; } + + virtual ~PrmSetRc(); // _08 (weak) + virtual void load(JSUMemoryInputStream& input) + { + PrmSetBase::load(input); + JKRHeap* currentHeap = JKRHeap::sCurrentHeap; + if (getChildNum() != 0) { + if (getPrmObjHeap() != nullptr) { + getPrmObjHeap()->becomeCurrentHeap(); + } + T* childObjects = new T[getChildNum()]; + for (int i = 0; i < getChildNum(); i++) { + PrmSetBase* object = static_cast(childObjects[i]); + _2C.append(object->_2C); + object->appendAfter(); + object->load(input); + } + } + currentHeap->becomeCurrentHeap(); + } // _10 (weak) + virtual JKRHeap* getPrmObjHeap(); // _24 (weak) + + T* getChild(u8 n) + { + JSUPtrLink* link = _2C.getNthLink(n); + return (link != nullptr ? static_cast(link->getObjectPtr()) : nullptr); + } + // _00 = VTABLE // _04-_64 = PrmBase - u8 _64[0x4]; // _64 - unknown + u32 _64; // _64 - unknown Prm _68; // _68 - should this be T? it's u8 in ghidra }; /** * @size = 0x30 + * Likely an abstract base class for binding parameters to UI elements. */ template struct PrmHio : public Prm { + PrmHio() + : Prm() + { + } + + virtual ~PrmHio() { } // _08 (weak) + // _00 = VTABLE // _04-_30 = Prm - // idk why this seems to just be a copy of Prm but w/e }; /** * @size = 0x30 + * Likely had code for binding parameters to radio buttons. */ template struct PrmRadioButton : public PrmHio { // _00 = VTABLE // _04-_30 = Prm - // idk why this seems to just be a copy of Prm but w/e }; /** * @size = 0x30 + * Likely had code for binding parameters to sliders. */ template struct PrmSlider : public PrmHio { // _00 = VTABLE // _04-_30 = Prm - // idk why this seems to just be a copy of Prm but w/e }; } // namespace JADUtility diff --git a/include/JSystem/JSupport/JSUStream.h b/include/JSystem/JSupport/JSUStream.h index b15eb0cf1..6b1de3671 100644 --- a/include/JSystem/JSupport/JSUStream.h +++ b/include/JSystem/JSupport/JSUStream.h @@ -152,7 +152,15 @@ struct JSUOutputStream : public JSUIosBase { // _00-_08 = JSUIosBase }; -// TODO: this. -struct JSUMemoryOutputStream; +struct JSUMemoryOutputStream : public JSUOutputStream { + // Unused/inlined: + virtual ~JSUMemoryOutputStream(); // _08 + virtual long writeData(const void*, long); // _10 + virtual int getLength() const; // _14? + virtual int getPosition() const; // _18? + virtual int seekPos(long, JSUStreamSeekFrom); // _1C? + + void setBuffer(void*, long); +}; #endif diff --git a/src/JSystem/JAudio/JAU/JAUData.cpp b/src/JSystem/JAudio/JAU/JAUData.cpp index fc2d36d73..8a1594ed1 100644 --- a/src/JSystem/JAudio/JAU/JAUData.cpp +++ b/src/JSystem/JAudio/JAU/JAUData.cpp @@ -1,3 +1,4 @@ +#include "JSystem/JAudio/JAD/JADUtility.h" #include "types.h" /* @@ -49,52 +50,14 @@ * Address: 800BA564 * Size: 0000AC */ -JADUtility::PrmSetBase::PrmSetBase(bool) +JADUtility::PrmSetBase::PrmSetBase(bool p1) + : JKRDisposer() + , _18(0) + , _19(0) + , _1A(p1) + , _1C() + , _2C(this) { - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - mr r30, r3 - bl __ct__11JKRDisposerFv - lis r3, __vt__Q210JADUtility10PrmSetBase@ha - li r0, 0 - addi r4, r3, __vt__Q210JADUtility10PrmSetBase@l - addi r3, r30, 0x1c - stw r4, 0(r30) - stb r0, 0x18(r30) - stb r0, 0x19(r30) - stb r31, 0x1a(r30) - bl initiate__10JSUPtrListFv - addi r31, r30, 0x2c - mr r3, r31 - bl initiate__10JSUPtrListFv - mr r4, r30 - addi r3, r31, 0xc - bl __ct__10JSUPtrLinkFPv - lis r4, "__vt__Q210JADUtility36NodeTree"@ha - lis r3, __vt__Q210JADUtility10PrmSetTree@ha - addi r0, r4, - "__vt__Q210JADUtility36NodeTree"@l li r4, - 0 stw r0, 0x1c(r31) addi r0, r3, __vt__Q210JADUtility10PrmSetTree@l - mr r3, r30 - stw r4, 0x20(r31) - stw r4, 0x24(r31) - stw r4, 0x28(r31) - stw r4, 0x2c(r31) - stw r4, 0x30(r31) - stw r4, 0x34(r31) - stw r0, 0x1c(r31) - lwz r31, 0xc(r1) - lwz r30, 8(r1) - lwz r0, 0x14(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ } /* @@ -102,122 +65,83 @@ JADUtility::PrmSetBase::PrmSetBase(bool) * Address: ........ * Size: 000094 */ -JADUtility::PrmSetTree::~PrmSetTree() -{ - // UNUSED FUNCTION -} +// JADUtility::PrmSetTree::~PrmSetTree() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000084 */ -void __dt__Q210JADUtility36NodeTree Fv() -{ - // UNUSED FUNCTION -} +// JADUtility::NodeTree::~NodeTree() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000074 */ -void JSUTree::~JSUTree() -{ - // UNUSED FUNCTION -} +// void JSUTree::~JSUTree() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000054 */ -void JSULink::~JSULink() -{ - // UNUSED FUNCTION -} +// void JSULink::~JSULink() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000054 */ -void JSUList::~JSUList() -{ - // UNUSED FUNCTION -} +// void JSUList::~JSUList() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000054 */ -void JSUList::~JSUList() -{ - // UNUSED FUNCTION -} +// void JSUList::~JSUList() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000014 */ -void JADUtility::PrmSetBase::appendDummy(unsigned char) -{ - // UNUSED FUNCTION -} +// void JADUtility::PrmSetBase::appendDummy(unsigned char) +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: 800BA610 * Size: 000098 */ -void JADUtility::PrmSetBase::load(JSUMemoryInputStream&) +void JADUtility::PrmSetBase::load(JSUMemoryInputStream& input) { - /* - stwu r1, -0x20(r1) - mflr r0 - stw r0, 0x24(r1) - stw r31, 0x1c(r1) - stw r30, 0x18(r1) - mr r30, r4 - stw r29, 0x14(r1) - mr r29, r3 - mr r3, r30 - lwz r12, 0(r30) - lbz r4, 0x18(r29) - lwz r12, 0x10(r12) - mtctr r12 - bctrl - lwz r31, 0x1c(r29) - b lbl_800BA66C - -lbl_800BA650: - lwz r3, 0(r31) - mr r4, r30 - lwz r12, 0(r3) - lwz r12, 0x10(r12) - mtctr r12 - bctrl - lwz r31, 0xc(r31) - -lbl_800BA66C: - cmplwi r31, 0 - bne lbl_800BA650 - mr r3, r30 - lbz r4, 0x19(r29) - lwz r12, 0(r30) - lwz r12, 0x10(r12) - mtctr r12 - bctrl - lwz r0, 0x24(r1) - lwz r31, 0x1c(r1) - lwz r30, 0x18(r1) - lwz r29, 0x14(r1) - mtlr r0 - addi r1, r1, 0x20 - blr - */ + input.skip(_18); + for (JSULink* link = _1C.getFirst(); link != nullptr; link = link->getNext()) { + link->getObject()->load(input); + } + input.skip(_19); } /* @@ -225,168 +149,82 @@ void JADUtility::PrmSetBase::load(JSUMemoryInputStream&) * Address: 800BA6A8 * Size: 000040 */ -void JADUtility::PrmBase::load(JSUMemoryInputStream&) -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - lbz r0, 0x18(r3) - cmplwi r0, 0 - beq lbl_800BA6D8 - mr r3, r4 - mr r4, r0 - lwz r12, 0(r3) - lwz r12, 0x10(r12) - mtctr r12 - bctrl - -lbl_800BA6D8: - lwz r0, 0x14(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// void JADUtility::PrmBase::load(JSUMemoryInputStream&) +// { +// } /* * --INFO-- * Address: 800BA6E8 * Size: 0000E8 */ -JADUtility::PrmSetBase::~PrmSetBase() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BA7B4 - lis r3, __vt__Q210JADUtility10PrmSetBase@ha - addi r0, r3, __vt__Q210JADUtility10PrmSetBase@l - stw r0, 0(r30) - b lbl_800BA720 - -lbl_800BA718: - addi r3, r30, 0x1c - bl remove__10JSUPtrListFP10JSUPtrLink - -lbl_800BA720: - lwz r4, 0x1c(r30) - cmplwi r4, 0 - bne lbl_800BA718 - addic. r0, r30, 0x2c - beq lbl_800BA784 - lis r3, __vt__Q210JADUtility10PrmSetTree@ha - addic. r0, r30, 0x2c - addi r0, r3, __vt__Q210JADUtility10PrmSetTree@l - stw r0, 0x48(r30) - beq lbl_800BA784 - lis r3, "__vt__Q210JADUtility36NodeTree"@ha - addic. r0, r30, 0x2c - addi r0, r3, -"__vt__Q210JADUtility36NodeTree"@l stw r0, -0x48(r30) beq lbl_800BA784 addic. r0, r30, 0x38 beq lbl_800BA770 - addi r3, r30, 0x38 - li r4, 0 - bl __dt__10JSUPtrLinkFv - -lbl_800BA770: - addic. r0, r30, 0x2c - beq lbl_800BA784 - addi r3, r30, 0x2c - li r4, 0 - bl __dt__10JSUPtrListFv - -lbl_800BA784: - addic. r0, r30, 0x1c - beq lbl_800BA798 - addi r3, r30, 0x1c - li r4, 0 - bl __dt__10JSUPtrListFv - -lbl_800BA798: - mr r3, r30 - li r4, 0 - bl __dt__11JKRDisposerFv - extsh. r0, r31 - ble lbl_800BA7B4 - mr r3, r30 - bl __dl__FPv - -lbl_800BA7B4: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// JADUtility::PrmSetBase::~PrmSetBase() +// { +// JSULink* link; +// while ((link = _1C.getFirst()) != nullptr) { +// _1C.remove(link); +// } +// } /* * --INFO-- * Address: 800BA7D0 * Size: 000004 */ -void JADUtility::PrmSetBase::appendAfter() { } +// void JADUtility::PrmSetBase::appendAfter() { } /* * --INFO-- * Address: 800BA7D4 * Size: 000004 */ -void JADUtility::PrmSetBase::afterRemovingChildButton(JADUtility::PrmSetBase*) { } +// void JADUtility::PrmSetBase::afterRemovingChildButton(JADUtility::PrmSetBase*) { } /* * --INFO-- * Address: 800BA7D8 * Size: 000004 */ -void JADUtility::PrmSetBase::afterRemovingThisButton(JADUtility::PrmSetBase*) { } +// void JADUtility::PrmSetBase::afterRemovingThisButton(JADUtility::PrmSetBase*) { } /* * --INFO-- * Address: 800BA7DC * Size: 000008 */ -u32 JADUtility::PrmSetBase::getEraseLink() { return 0x0; } +// void* JADUtility::PrmSetBase::getEraseLink() { return nullptr; } /* * --INFO-- * Address: 800BA7E4 * Size: 000004 */ -void JADUtility::PrmSetBase::afterGetFromFree() { } +// void JADUtility::PrmSetBase::afterGetFromFree() { } /* * --INFO-- * Address: 800BA7E8 * Size: 000004 */ -void beforeRemovingChild__Q210JADUtility36NodeTree FPQ210JADUtility10PrmSetBase() { } +// void JADUtility::NodeTree::beforeRemovingChild(JADUtility::PrmSetBase*) { } /* * --INFO-- * Address: 800BA7EC * Size: 000004 */ -void beforeRemovingThis__Q210JADUtility36NodeTree FPQ210JADUtility10PrmSetBase() { } +// void JADUtility::NodeTree::beforeRemovingThis(JADUtility::PrmSetBase*) { } /* * --INFO-- * Address: 800BA7F0 * Size: 000004 */ -void afterRemovingChildButton__Q210JADUtility36NodeTree FPQ210JADUtility10PrmSetBase() { } +// void JADUtility::NodeTree::afterRemovingChildButton(JADUtility::PrmSetBase*) { } /* * --INFO-- * Address: 800BA7F4 * Size: 000004 */ -void afterRemovingThisButton__Q210JADUtility36NodeTree FPQ210JADUtility10PrmSetBasePQ210JADUtility10PrmSetBase() { } +// void JADUtility::NodeTree::afterRemovingThisButton(JADUtility::PrmSetBase*, JADUtility::PrmSetBase*) { } diff --git a/src/JSystem/JAudio/JAU/JAUDataMgr.cpp b/src/JSystem/JAudio/JAU/JAUDataMgr.cpp index cfb375262..49c2d62df 100644 --- a/src/JSystem/JAudio/JAU/JAUDataMgr.cpp +++ b/src/JSystem/JAudio/JAU/JAUDataMgr.cpp @@ -1,3 +1,6 @@ +#include "JSystem/JAudio/JAD/JADDataMgr.h" +#include "JSystem/JAudio/JAD/JADUtility.h" +#include "JSystem/JSupport/JSUStream.h" #include "types.h" /* @@ -84,26 +87,9 @@ * Size: 000044 */ JADUtility::DataMgrBase::DataMgrBase() + : JKRDisposer() + , _18(nullptr) { - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r3 - bl __ct__11JKRDisposerFv - lis r3, __vt__Q210JADUtility11DataMgrBase@ha - li r0, 0 - addi r4, r3, __vt__Q210JADUtility11DataMgrBase@l - mr r3, r31 - stw r4, 0(r31) - stw r0, 0x18(r31) - lwz r31, 0xc(r1) - lwz r0, 0x14(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ } /* @@ -113,42 +99,9 @@ JADUtility::DataMgrBase::DataMgrBase() */ JADUtility::DataMgrBase::~DataMgrBase() { - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BA898 - lis r3, __vt__Q210JADUtility11DataMgrBase@ha - addi r0, r3, __vt__Q210JADUtility11DataMgrBase@l - stw r0, 0(r30) - lwz r3, 0x18(r30) - cmplwi r3, 0 - beq lbl_800BA87C - li r4, 0 - bl free__7JKRHeapFPvP7JKRHeap - -lbl_800BA87C: - mr r3, r30 - li r4, 0 - bl __dt__11JKRDisposerFv - extsh. r0, r31 - ble lbl_800BA898 - mr r3, r30 - bl __dl__FPv - -lbl_800BA898: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ + if (_18 != nullptr) { + JKRHeap::free(_18, nullptr); + } } /* @@ -156,9 +109,14 @@ JADUtility::DataMgrBase::~DataMgrBase() * Address: ........ * Size: 0000D0 */ -JADUtility::DataLoadMgrNode::DataLoadMgrNode() +inline JADUtility::DataLoadMgrNode::DataLoadMgrNode() + : DataMgrBase() + , _08(0) + , _20C(0) + , _210(0) { - // UNUSED FUNCTION + setPath("\0"); + setLoadPath("\0"); } /* @@ -168,66 +126,9 @@ JADUtility::DataLoadMgrNode::DataLoadMgrNode() */ JADUtility::DataLoadMgrNode::~DataLoadMgrNode() { - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BA960 - lis r3, __vt__Q210JADUtility15DataLoadMgrNode@ha - addi r0, r30, 0x214 - addi r3, r3, __vt__Q210JADUtility15DataLoadMgrNode@l - stw r3, 4(r30) - addi r4, r3, 0x24 - lwz r3, 0(r30) - stw r4, 0(r3) - lwz r3, 0(r30) - subf r0, r3, r0 - stw r0, 0x1c(r3) - lwz r0, 8(r30) - cmpwi r0, 3 - bne lbl_800BA914 - lwz r3, 0(r30) - li r0, 0 - stw r0, 0x18(r3) - -lbl_800BA914: - extsh. r0, r31 - beq lbl_800BA950 - addic. r0, r30, 0x214 - beq lbl_800BA950 - lis r3, __vt__Q210JADUtility11DataMgrBase@ha - addi r0, r3, __vt__Q210JADUtility11DataMgrBase@l - stw r0, 0x214(r30) - lwz r3, 0x22c(r30) - cmplwi r3, 0 - beq lbl_800BA944 - li r4, 0 - bl free__7JKRHeapFPvP7JKRHeap - -lbl_800BA944: - addi r3, r30, 0x214 - li r4, 0 - bl __dt__11JKRDisposerFv - -lbl_800BA950: - extsh. r0, r31 - ble lbl_800BA960 - mr r3, r30 - bl __dl__FPv - -lbl_800BA960: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ + if (_08 == 3) { + _18 = nullptr; + } } /* @@ -235,115 +136,59 @@ JADUtility::DataLoadMgrNode::~DataLoadMgrNode() * Address: ........ * Size: 000050 */ -void JADUtility::DataLoadMgrNode::setLoadPath(char const*) -{ - // UNUSED FUNCTION -} +// void JADUtility::DataLoadMgrNode::setLoadPath(char const*) +// { +// } /* * --INFO-- * Address: ........ * Size: 000230 */ -void JADUtility::DataLoadMgrNode::load(JADUtility::DataLoadMgrNode::ObjStatus, bool) -{ - // UNUSED FUNCTION -} +// void JADUtility::DataLoadMgrNode::load(JADUtility::DataLoadMgrNode::ObjStatus, bool) +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: 800BA97C * Size: 000008 */ -u32 JADUtility::DataLoadMgrNode::isTempBuffaMode() { return 0x0; } +bool JADUtility::DataLoadMgrNode::isTempBuffaMode() { return false; } /* * --INFO-- * Address: ........ * Size: 0000B8 */ -void JADUtility::DataLoadMgrNode::initInstanceExt() -{ - // UNUSED FUNCTION -} +// bool JADUtility::DataLoadMgrNode::initInstanceExt() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: 800BA984 * Size: 0000F0 */ -void JADUtility::DataLoadMgrNode::initInstanceExt(void*, long) +bool JADUtility::DataLoadMgrNode::initInstanceExt(void* p1, long p2) { - /* - stwu r1, -0x20(r1) - mflr r0 - stw r0, 0x24(r1) - stw r31, 0x1c(r1) - mr r31, r5 - stw r30, 0x18(r1) - stw r29, 0x14(r1) - mr r29, r4 - stw r28, 0x10(r1) - mr r28, r3 - lwz r12, 4(r3) - lwz r30, sCurrentHeap__7JKRHeap@sda21(r13) - lwz r12, 0x14(r12) - mtctr r12 - bctrl - cmplwi r3, 0 - beq lbl_800BA9E0 - mr r3, r28 - lwz r12, 4(r28) - lwz r12, 0x14(r12) - mtctr r12 - bctrl - bl becomeCurrentHeap__7JKRHeapFv - -lbl_800BA9E0: - mr r3, r28 - mr r4, r29 - lwz r12, 4(r28) - mr r5, r31 - lwz r12, 0x1c(r12) - mtctr r12 - bctrl - mr r31, r3 - mr r3, r28 - lwz r12, 4(r28) - lwz r12, 0x14(r12) - mtctr r12 - bctrl - cmplwi r3, 0 - beq lbl_800BAA24 - mr r3, r30 - bl becomeCurrentHeap__7JKRHeapFv - -lbl_800BAA24: - clrlwi. r0, r31, 0x18 - bne lbl_800BAA44 - li r0, 0 - li r3, 0 - stw r0, 8(r28) - lwz r4, 0(r28) - stw r0, 0x18(r4) - b lbl_800BAA54 - -lbl_800BAA44: - mr r3, r28 - mr r4, r29 - bl setFlagsAsExternal__Q210JADUtility15DataLoadMgrNodeFPv - li r3, 1 - -lbl_800BAA54: - lwz r0, 0x24(r1) - lwz r31, 0x1c(r1) - lwz r30, 0x18(r1) - lwz r29, 0x14(r1) - lwz r28, 0x10(r1) - mtlr r0 - addi r1, r1, 0x20 - blr - */ + JKRHeap* existingHeap = JKRHeap::sCurrentHeap; + if (getObjHeap() != nullptr) { + getObjHeap()->becomeCurrentHeap(); + } + bool success = initInstance(p1, p2); + if (getObjHeap() != nullptr) { + existingHeap->becomeCurrentHeap(); + } + if (success == false) { + _08 = 0; + _18 = nullptr; + return false; + } + setFlagsAsExternal(p1); + return true; } /* @@ -351,15 +196,10 @@ void JADUtility::DataLoadMgrNode::initInstanceExt(void*, long) * Address: 800BAA74 * Size: 000014 */ -void JADUtility::DataLoadMgrNode::setFlagsAsExternal(void*) +void JADUtility::DataLoadMgrNode::setFlagsAsExternal(void* p1) { - /* - lwz r5, 0(r3) - li r0, 3 - stw r4, 0x18(r5) - stw r0, 8(r3) - blr - */ + _18 = p1; + _08 = 3; } /* @@ -367,10 +207,10 @@ void JADUtility::DataLoadMgrNode::setFlagsAsExternal(void*) * Address: ........ * Size: 0000C4 */ -void JADUtility::DataLoadMgrNode::loadDvd(unsigned long*) -{ - // UNUSED FUNCTION -} +// void JADUtility::DataLoadMgrNode::loadDvd(unsigned long*) +// { +// // UNUSED FUNCTION +// } /* * --INFO-- @@ -378,102 +218,9 @@ void JADUtility::DataLoadMgrNode::loadDvd(unsigned long*) * Size: 00015C */ JADUtility::DataMgrNode::DataMgrNode() + : DataLoadMgrNode() + , _214() { - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - extsh. r0, r4 - stw r31, 0xc(r1) - mr r31, r3 - stw r30, 8(r1) - beq lbl_800BAACC - addi r3, r31, 0x250 - stw r3, 0(r31) - mr r30, r3 - bl __ct__11JKRDisposerFv - lis r3, __vt__Q210JADUtility11DataMgrBase@ha - li r0, 0 - addi r3, r3, __vt__Q210JADUtility11DataMgrBase@l - stw r3, 0(r30) - stw r0, 0x18(r30) - -lbl_800BAACC: - lis r3, __vt__Q210JADUtility15DataLoadMgrNode@ha - addi r4, r31, 0x214 - addi r3, r3, __vt__Q210JADUtility15DataLoadMgrNode@l - li r0, 0 - stw r3, 4(r31) - addi r6, r3, 0x24 - mr r30, r31 - addi r3, r2, lbl_80517090@sda21 - lwz r5, 0(r31) - stw r6, 0(r5) - lwz r5, 0(r31) - subf r4, r5, r4 - stw r4, 0x1c(r5) - stw r0, 8(r31) - stw r0, 0x20c(r31) - stw r0, 0x210(r31) - bl strlen - cmplwi r3, 0xff - bgt lbl_800BAB24 - addi r3, r31, 0xc - addi r4, r2, lbl_80517090@sda21 - bl strcpy - -lbl_800BAB24: - addi r3, r2, lbl_80517090@sda21 - bl strlen - cmplwi r3, 0xff - bgt lbl_800BAB40 - addi r3, r30, 0x10c - addi r4, r2, lbl_80517090@sda21 - bl strcpy - -lbl_800BAB40: - lis r3, __vt__Q210JADUtility11DataMgrNode@ha - addi r0, r31, 0x250 - addi r3, r3, __vt__Q210JADUtility11DataMgrNode@l - addi r30, r31, 0x214 - stw r3, 4(r31) - addi r5, r3, 0x2c - mr r3, r30 - lwz r4, 0(r31) - stw r5, 0(r4) - lwz r4, 0(r31) - subf r0, r4, r0 - stw r0, 0x1c(r4) - bl __ct__11JKRDisposerFv - lis r3, __vt__Q210JADUtility7PrmBase@ha - li r0, 0 - addi r3, r3, __vt__Q210JADUtility7PrmBase@l - mr r4, r30 - stw r3, 0(r30) - addi r3, r30, 0x1c - stb r0, 0x18(r30) - bl __ct__10JSUPtrLinkFPv - lis r3, "__vt__Q210JADUtility7Prm"@ha - lis r4, "__vt__Q210JADUtility10PrmHio"@ha - addi r0, r3, "__vt__Q210JADUtility7Prm"@l - lis r3, __vt__Q210JADUtility6StrPrm@ha - stw r0, 0(r30) - addi r5, r4, "__vt__Q210JADUtility10PrmHio"@l - addi r4, r3, __vt__Q210JADUtility6StrPrm@l - li r0, 0 - stw r5, 0(r30) - mr r3, r31 - stw r4, 0(r30) - stw r0, 0x30(r30) - stw r0, 0x34(r30) - stw r0, 0x38(r30) - lwz r31, 0xc(r1) - lwz r30, 8(r1) - lwz r0, 0x14(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ } /* @@ -481,889 +228,305 @@ JADUtility::DataMgrNode::DataMgrNode() * Address: 800BABE4 * Size: 0000A8 */ -JADUtility::StrPrm::~StrPrm() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BAC70 - lis r3, __vt__Q210JADUtility6StrPrm@ha - addi r0, r3, __vt__Q210JADUtility6StrPrm@l - stw r0, 0(r30) - beq lbl_800BAC60 - lis r3, "__vt__Q210JADUtility10PrmHio"@ha - addi r0, r3, "__vt__Q210JADUtility10PrmHio"@l - stw r0, 0(r30) - beq lbl_800BAC60 - lis r3, "__vt__Q210JADUtility7Prm"@ha - addi r0, r3, "__vt__Q210JADUtility7Prm"@l - stw r0, 0(r30) - beq lbl_800BAC60 - lis r3, __vt__Q210JADUtility7PrmBase@ha - addic. r0, r30, 0x1c - addi r0, r3, __vt__Q210JADUtility7PrmBase@l - stw r0, 0(r30) - beq lbl_800BAC54 - addi r3, r30, 0x1c - li r4, 0 - bl __dt__10JSUPtrLinkFv - -lbl_800BAC54: - mr r3, r30 - li r4, 0 - bl __dt__11JKRDisposerFv - -lbl_800BAC60: - extsh. r0, r31 - ble lbl_800BAC70 - mr r3, r30 - bl __dl__FPv - -lbl_800BAC70: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// JADUtility::StrPrm::~StrPrm() +// { +// } /* * --INFO-- * Address: 800BAC8C * Size: 000098 */ -void __dt__Q210JADUtility10PrmHio Fv() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BAD08 - lis r3, "__vt__Q210JADUtility10PrmHio"@ha - addi r0, r3, "__vt__Q210JADUtility10PrmHio"@l - stw r0, 0(r30) - beq lbl_800BACF8 - lis r3, "__vt__Q210JADUtility7Prm"@ha - addi r0, r3, "__vt__Q210JADUtility7Prm"@l - stw r0, 0(r30) - beq lbl_800BACF8 - lis r3, __vt__Q210JADUtility7PrmBase@ha - addic. r0, r30, 0x1c - addi r0, r3, __vt__Q210JADUtility7PrmBase@l - stw r0, 0(r30) - beq lbl_800BACEC - addi r3, r30, 0x1c - li r4, 0 - bl __dt__10JSUPtrLinkFv - -lbl_800BACEC: - mr r3, r30 - li r4, 0 - bl __dt__11JKRDisposerFv - -lbl_800BACF8: - extsh. r0, r31 - ble lbl_800BAD08 - mr r3, r30 - bl __dl__FPv - -lbl_800BAD08: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// JADUtility::PrmHio::~PrmHio() +// { +// } /* * --INFO-- * Address: 800BAD24 * Size: 000088 */ -void __dt__Q210JADUtility7Prm Fv() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BAD90 - lis r3, "__vt__Q210JADUtility7Prm"@ha - addi r0, r3, "__vt__Q210JADUtility7Prm"@l - stw r0, 0(r30) - beq lbl_800BAD80 - lis r3, __vt__Q210JADUtility7PrmBase@ha - addic. r0, r30, 0x1c - addi r0, r3, __vt__Q210JADUtility7PrmBase@l - stw r0, 0(r30) - beq lbl_800BAD74 - addi r3, r30, 0x1c - li r4, 0 - bl __dt__10JSUPtrLinkFv - -lbl_800BAD74: - mr r3, r30 - li r4, 0 - bl __dt__11JKRDisposerFv - -lbl_800BAD80: - extsh. r0, r31 - ble lbl_800BAD90 - mr r3, r30 - bl __dl__FPv - -lbl_800BAD90: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// JADUtility::Prm::~Prm() +// { +// } /* * --INFO-- * Address: 800BADAC * Size: 000078 */ -JADUtility::PrmBase::~PrmBase() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BAE08 - lis r3, __vt__Q210JADUtility7PrmBase@ha - addic. r0, r30, 0x1c - addi r0, r3, __vt__Q210JADUtility7PrmBase@l - stw r0, 0(r30) - beq lbl_800BADEC - addi r3, r30, 0x1c - li r4, 0 - bl __dt__10JSUPtrLinkFv - -lbl_800BADEC: - mr r3, r30 - li r4, 0 - bl __dt__11JKRDisposerFv - extsh. r0, r31 - ble lbl_800BAE08 - mr r3, r30 - bl __dl__FPv - -lbl_800BAE08: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// JADUtility::PrmBase::~PrmBase() +// { +// } /* * --INFO-- * Address: ........ * Size: 000054 */ -void JSULink::~JSULink() -{ - // UNUSED FUNCTION -} +// void JSULink::~JSULink() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 0000FC */ -JADUtility::DataLoadMgrVirNode::DataLoadMgrVirNode(unsigned long) -{ - // UNUSED FUNCTION -} +// JADUtility::DataLoadMgrVirNode::DataLoadMgrVirNode(unsigned long) +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 0000FC */ -JADUtility::DataMgrVirNode::DataMgrVirNode(unsigned long) -{ - // UNUSED FUNCTION -} +// JADUtility::DataMgrVirNode::DataMgrVirNode(unsigned long) +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 0000F0 */ -JADUtility::DataMgrVirNode::~DataMgrVirNode() -{ - // UNUSED FUNCTION -} +// JADUtility::DataMgrVirNode::~DataMgrVirNode() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000008 */ -void JADUtility::DataMgrVirNode::getPath() -{ - // UNUSED FUNCTION -} +// const char* JADUtility::DataMgrVirNode::getPath() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000044 */ -void JADUtility::DataMgrVirNode::init() -{ - // UNUSED FUNCTION -} +// void JADUtility::DataMgrVirNode::init() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000008 */ -void JADUtility::DataLoadMgrVirNode::getPath() -{ - // UNUSED FUNCTION -} +// const char* JADUtility::DataLoadMgrVirNode::getPath() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000044 */ -void JADUtility::DataLoadMgrVirNode::init() -{ - // UNUSED FUNCTION -} +// void JADUtility::DataLoadMgrVirNode::init() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 0000F0 */ -JADUtility::DataLoadMgrVirNode::~DataLoadMgrVirNode() -{ - // UNUSED FUNCTION -} +// JADUtility::DataLoadMgrVirNode::~DataLoadMgrVirNode() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: 800BAE24 * Size: 0000A0 */ -void JADUtility::StrPrm::save(JSUMemoryOutputStream&) -{ - /* - stwu r1, -0x20(r1) - mflr r0 - stw r0, 0x24(r1) - stw r31, 0x1c(r1) - stw r30, 0x18(r1) - stw r29, 0x14(r1) - mr r29, r4 - stw r28, 0x10(r1) - mr r28, r3 - lwz r5, 0x30(r3) - cmpwi r5, 0 - ble lbl_800BAE64 - lwz r4, 0x2c(r28) - mr r3, r29 - bl write__15JSUOutputStreamFPCvl - b lbl_800BAE70 - -lbl_800BAE64: - lwz r4, 0x2c(r28) - mr r3, r29 - bl write__15JSUOutputStreamFPCc - -lbl_800BAE70: - li r30, 0 - mr r31, r30 - b lbl_800BAE94 - -lbl_800BAE7C: - stb r31, 8(r1) - mr r3, r29 - addi r4, r1, 8 - li r5, 1 - bl write__15JSUOutputStreamFPCvl - addi r30, r30, 1 - -lbl_800BAE94: - lbz r0, 0x18(r28) - clrlwi r3, r30, 0x18 - cmplw r3, r0 - blt lbl_800BAE7C - lwz r0, 0x24(r1) - lwz r31, 0x1c(r1) - lwz r30, 0x18(r1) - lwz r29, 0x14(r1) - lwz r28, 0x10(r1) - mtlr r0 - addi r1, r1, 0x20 - blr - */ -} +// void JADUtility::StrPrm::save(JSUMemoryOutputStream& output) +// { +// if (_30 > 0) { +// output.write(mValue, _30); +// } else { +// output.write(mValue); +// } +// PrmBase::save(output); +// } /* * --INFO-- * Address: 800BAEC4 * Size: 0000A0 */ -void JADUtility::StrPrm::load(JSUMemoryInputStream&) -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - mr r30, r3 - lwz r5, 0x30(r3) - cmpwi r5, 0 - ble lbl_800BAEFC - lwz r4, 0x2c(r30) - mr r3, r31 - bl read__14JSUInputStreamFPvl - b lbl_800BAF08 - -lbl_800BAEFC: - lwz r4, 0x2c(r30) - mr r3, r31 - bl read__14JSUInputStreamFPc - -lbl_800BAF08: - lbz r4, 0x18(r30) - cmplwi r4, 0 - beq lbl_800BAF28 - lwz r12, 0(r31) - mr r3, r31 - lwz r12, 0x10(r12) - mtctr r12 - bctrl - -lbl_800BAF28: - lwz r12, 0x34(r30) - cmplwi r12, 0 - beq lbl_800BAF4C - lwz r4, 0x38(r30) - cmplwi r4, 0 - beq lbl_800BAF4C - mr r3, r30 - mtctr r12 - bctrl - -lbl_800BAF4C: - lwz r0, 0x14(r1) - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// void JADUtility::StrPrm::load(JSUMemoryInputStream& input) +// { +// if (_30 > 0) { +// input.read(mValue, _30); +// } else { +// input.read(mValue); +// } +// PrmBase::load(input); +// if (_34 != nullptr && _38) { +// _34(this, _38); +// } +// } /* * --INFO-- * Address: 800BAF64 * Size: 000078 */ -void JADUtility::PrmBase::save(JSUMemoryOutputStream&) -{ - /* - stwu r1, -0x20(r1) - mflr r0 - stw r0, 0x24(r1) - stw r31, 0x1c(r1) - li r31, 0 - stw r30, 0x18(r1) - li r30, 0 - stw r29, 0x14(r1) - mr r29, r4 - stw r28, 0x10(r1) - mr r28, r3 - b lbl_800BAFAC - -lbl_800BAF94: - stb r31, 8(r1) - mr r3, r29 - addi r4, r1, 8 - li r5, 1 - bl write__15JSUOutputStreamFPCvl - addi r30, r30, 1 - -lbl_800BAFAC: - lbz r0, 0x18(r28) - clrlwi r3, r30, 0x18 - cmplw r3, r0 - blt lbl_800BAF94 - lwz r0, 0x24(r1) - lwz r31, 0x1c(r1) - lwz r30, 0x18(r1) - lwz r29, 0x14(r1) - lwz r28, 0x10(r1) - mtlr r0 - addi r1, r1, 0x20 - blr - */ -} +// void JADUtility::PrmBase::save(JSUMemoryOutputStream&) +// { +// } /* * --INFO-- * Address: 800BAFDC * Size: 000164 */ -JADUtility::DataMgrNode::~DataMgrNode() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - or. r30, r3, r3 - beq lbl_800BB124 - lis r4, __vt__Q210JADUtility11DataMgrNode@ha - addi r3, r30, 0x250 - addi r4, r4, __vt__Q210JADUtility11DataMgrNode@l - addic. r0, r30, 0x214 - stw r4, 4(r30) - addi r0, r4, 0x2c - lwz r4, 0(r30) - stw r0, 0(r4) - lwz r4, 0(r30) - subf r0, r4, r3 - stw r0, 0x1c(r4) - beq lbl_800BB090 - lis r3, __vt__Q210JADUtility6StrPrm@ha - addic. r0, r30, 0x214 - addi r0, r3, __vt__Q210JADUtility6StrPrm@l - stw r0, 0x214(r30) - beq lbl_800BB090 - lis r3, "__vt__Q210JADUtility10PrmHio"@ha - addic. r0, r30, 0x214 - addi r0, r3, "__vt__Q210JADUtility10PrmHio"@l - stw r0, 0x214(r30) - beq lbl_800BB090 - lis r3, "__vt__Q210JADUtility7Prm"@ha - addic. r0, r30, 0x214 - addi r0, r3, "__vt__Q210JADUtility7Prm"@l - stw r0, 0x214(r30) - beq lbl_800BB090 - lis r4, __vt__Q210JADUtility7PrmBase@ha - addic. r3, r30, 0x230 - addi r0, r4, __vt__Q210JADUtility7PrmBase@l - stw r0, 0x214(r30) - beq lbl_800BB084 - li r4, 0 - bl __dt__10JSUPtrLinkFv - -lbl_800BB084: - addi r3, r30, 0x214 - li r4, 0 - bl __dt__11JKRDisposerFv - -lbl_800BB090: - cmplwi r30, 0 - beq lbl_800BB0D8 - lis r3, __vt__Q210JADUtility15DataLoadMgrNode@ha - addi r0, r30, 0x214 - addi r3, r3, __vt__Q210JADUtility15DataLoadMgrNode@l - stw r3, 4(r30) - addi r4, r3, 0x24 - lwz r3, 0(r30) - stw r4, 0(r3) - lwz r3, 0(r30) - subf r0, r3, r0 - stw r0, 0x1c(r3) - lwz r0, 8(r30) - cmpwi r0, 3 - bne lbl_800BB0D8 - lwz r3, 0(r30) - li r0, 0 - stw r0, 0x18(r3) - -lbl_800BB0D8: - extsh. r0, r31 - beq lbl_800BB114 - addic. r0, r30, 0x250 - beq lbl_800BB114 - lis r3, __vt__Q210JADUtility11DataMgrBase@ha - addi r0, r3, __vt__Q210JADUtility11DataMgrBase@l - stw r0, 0x250(r30) - lwz r3, 0x268(r30) - cmplwi r3, 0 - beq lbl_800BB108 - li r4, 0 - bl free__7JKRHeapFPvP7JKRHeap - -lbl_800BB108: - addi r3, r30, 0x250 - li r4, 0 - bl __dt__11JKRDisposerFv - -lbl_800BB114: - extsh. r0, r31 - ble lbl_800BB124 - mr r3, r30 - bl __dl__FPv - -lbl_800BB124: - lwz r0, 0x14(r1) - mr r3, r30 - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// JADUtility::DataMgrNode::~DataMgrNode() { } /* * --INFO-- * Address: 800BB140 * Size: 000008 */ -void JADUtility::DataMgrNode::getPath() -{ - /* - addi r3, r3, 0xc - blr - */ -} +// char* JADUtility::DataMgrNode::getPath() { return mPath; } /* * --INFO-- * Address: 800BB148 * Size: 000050 */ -void JADUtility::DataMgrNode::setPath(char*) -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - mr r30, r3 - mr r3, r31 - bl strlen - cmplwi r3, 0xff - bgt lbl_800BB180 - mr r4, r31 - addi r3, r30, 0xc - bl strcpy - -lbl_800BB180: - lwz r0, 0x14(r1) - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// void JADUtility::DataMgrNode::setPath(char* path) { DataLoadMgrNode::setPath(path); } /* * --INFO-- * Address: 800BB198 * Size: 000044 */ -void JADUtility::DataMgrNode::init() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - li r4, 0 - stw r0, 0x14(r1) - li r0, 0 - stw r31, 0xc(r1) - stw r0, 8(r3) - lwz r31, 0(r3) - lwz r3, 0x18(r31) - bl free__7JKRHeapFPvP7JKRHeap - li r0, 0 - stw r0, 0x18(r31) - lwz r0, 0x14(r1) - lwz r31, 0xc(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// void JADUtility::DataMgrNode::init() { DataLoadMgrNode::init(); } /* * --INFO-- * Address: 800BB1DC * Size: 000044 */ -void JADUtility::DataLoadMgrNode::init() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - li r4, 0 - stw r0, 0x14(r1) - li r0, 0 - stw r31, 0xc(r1) - stw r0, 8(r3) - lwz r31, 0(r3) - lwz r3, 0x18(r31) - bl free__7JKRHeapFPvP7JKRHeap - li r0, 0 - stw r0, 0x18(r31) - lwz r0, 0x14(r1) - lwz r31, 0xc(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// void JADUtility::DataLoadMgrNode::init() +// { +// } /* * --INFO-- * Address: 800BB220 * Size: 00003C */ -void JADUtility::DataMgrBase::init() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - li r4, 0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r3 - lwz r3, 0x18(r3) - bl free__7JKRHeapFPvP7JKRHeap - li r0, 0 - stw r0, 0x18(r31) - lwz r0, 0x14(r1) - lwz r31, 0xc(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// void JADUtility::DataMgrBase::init() +// { +// } /* * --INFO-- * Address: 800BB25C * Size: 000084 */ -void save__Q210JADUtility7Prm FR21JSUMemoryOutputStream() -{ - /* - stwu r1, -0x20(r1) - mflr r0 - stw r0, 0x24(r1) - stw r31, 0x1c(r1) - stw r30, 0x18(r1) - stw r29, 0x14(r1) - mr r29, r4 - stw r28, 0x10(r1) - mr r28, r3 - lwz r4, 0x2c(r3) - mr r3, r29 - bl write__15JSUOutputStreamFPCc - li r30, 0 - mr r31, r30 - b lbl_800BB2B0 - -lbl_800BB298: - stb r31, 8(r1) - mr r3, r29 - addi r4, r1, 8 - li r5, 1 - bl write__15JSUOutputStreamFPCvl - addi r30, r30, 1 - -lbl_800BB2B0: - lbz r0, 0x18(r28) - clrlwi r3, r30, 0x18 - cmplw r3, r0 - blt lbl_800BB298 - lwz r0, 0x24(r1) - lwz r31, 0x1c(r1) - lwz r30, 0x18(r1) - lwz r29, 0x14(r1) - lwz r28, 0x10(r1) - mtlr r0 - addi r1, r1, 0x20 - blr - */ -} +// void JADUtility::Prm::save(JSUMemoryOutputStream& output) +// { +// } /* * --INFO-- * Address: 800BB2E0 * Size: 000060 */ -void load__Q210JADUtility7Prm FR20JSUMemoryInputStream() -{ - /* - stwu r1, -0x10(r1) - mflr r0 - stw r0, 0x14(r1) - stw r31, 0xc(r1) - mr r31, r4 - stw r30, 8(r1) - mr r30, r3 - lwz r4, 0x2c(r3) - mr r3, r31 - bl read__14JSUInputStreamFPc - lbz r4, 0x18(r30) - cmplwi r4, 0 - beq lbl_800BB328 - lwz r12, 0(r31) - mr r3, r31 - lwz r12, 0x10(r12) - mtctr r12 - bctrl - -lbl_800BB328: - lwz r0, 0x14(r1) - lwz r31, 0xc(r1) - lwz r30, 8(r1) - mtlr r0 - addi r1, r1, 0x10 - blr - */ -} +// void JADUtility::Prm::load(JSUMemoryInputStream& input) +// { +// } /* * --INFO-- * Address: 800BB340 * Size: 000014 */ -void @532 @28 @JADUtility::DataLoadMgrNode::init() -{ - /* - li r11, 0x1c - lwzx r11, r3, r11 - add r3, r3, r11 - addi r3, r3, -532 - b init__Q210JADUtility15DataLoadMgrNodeFv - */ -} +// void @532 @28 @JADUtility::DataLoadMgrNode::init() +// { +// } /* * --INFO-- * Address: 800BB354 * Size: 000014 */ -@532 @28 @JADUtility::DataLoadMgrNode::~DataLoadMgrNode() -{ - /* - li r11, 0x1c - lwzx r11, r3, r11 - add r3, r3, r11 - addi r3, r3, -532 - b __dt__Q210JADUtility15DataLoadMgrNodeFv - */ -} +// @532 @28 @JADUtility::DataLoadMgrNode::~DataLoadMgrNode() +// { +// } /* * --INFO-- * Address: 800BB368 * Size: 000014 */ -void @592 @28 @JADUtility::DataMgrNode::init() -{ - /* - li r11, 0x1c - lwzx r11, r3, r11 - add r3, r3, r11 - addi r3, r3, -592 - b init__Q210JADUtility11DataMgrNodeFv - */ -} +// void @592 @28 @JADUtility::DataMgrNode::init() +// { +// } /* * --INFO-- * Address: 800BB37C * Size: 000014 */ -@592 @28 @JADUtility::DataMgrNode::~DataMgrNode() -{ - /* - li r11, 0x1c - lwzx r11, r3, r11 - add r3, r3, r11 - addi r3, r3, -592 - b __dt__Q210JADUtility11DataMgrNodeFv - */ -} +// @592 @28 @JADUtility::DataMgrNode::~DataMgrNode() +// { +// } /* * --INFO-- * Address: ........ * Size: 000014 */ -void @532 @28 @JADUtility::DataLoadMgrVirNode::init() -{ - // UNUSED FUNCTION -} +// void @532 @28 @JADUtility::DataLoadMgrVirNode::init() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000014 */ -@532 @28 @JADUtility::DataLoadMgrVirNode::~DataLoadMgrVirNode() -{ - // UNUSED FUNCTION -} +// @532 @28 @JADUtility::DataLoadMgrVirNode::~DataLoadMgrVirNode() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000014 */ -void @532 @28 @JADUtility::DataMgrVirNode::init() -{ - // UNUSED FUNCTION -} +// void @532 @28 @JADUtility::DataMgrVirNode::init() +// { +// // UNUSED FUNCTION +// } /* * --INFO-- * Address: ........ * Size: 000014 */ -@532 @28 @JADUtility::DataMgrVirNode::~DataMgrVirNode() -{ - // UNUSED FUNCTION -} +// @532 @28 @JADUtility::DataMgrVirNode::~DataMgrVirNode() +// { +// // UNUSED FUNCTION +// } diff --git a/src/JSystem/JAudio/JAU/Makefile b/src/JSystem/JAudio/JAU/Makefile index 975b164fb..16684a291 100644 --- a/src/JSystem/JAudio/JAU/Makefile +++ b/src/JSystem/JAudio/JAU/Makefile @@ -1,5 +1,5 @@ JAUDIO_JAU_FILES:=\ - $(BUILD_DIR)/asm/JSystem/JAudio/JAU/JAUData.o\ + $(BUILD_DIR)/src/JSystem/JAudio/JAU/JAUData.o\ $(BUILD_DIR)/asm/JSystem/JAudio/JAU/JAUDataMgr.o\ DEPENDS += $(JAUDIO_JAU_FILES:.o=.d)