diff --git a/configure.py b/configure.py index d0784e882..e0f0b7931 100644 --- a/configure.py +++ b/configure.py @@ -672,7 +672,7 @@ config.libs = [ Object(Matching, "JSystem/JAudio/JASTrackInterrupt.cpp"), Object(Matching, "JSystem/JAudio/JASTrackPort.cpp"), Object(Matching, "JSystem/JAudio/JASBank.cpp"), - Object(NonMatching, "JSystem/JAudio/JASWaveBank.cpp"), + Object(Matching, "JSystem/JAudio/JASWaveBank.cpp"), Object(Matching, "JSystem/JAudio/JASBasicBank.cpp"), Object(NonMatching, "JSystem/JAudio/JASBasicInst.cpp"), Object(NonMatching, "JSystem/JAudio/JASDrumSet.cpp"), diff --git a/include/JSystem/JAudio/JASWaveBank.h b/include/JSystem/JAudio/JASWaveBank.h new file mode 100644 index 000000000..1c891f887 --- /dev/null +++ b/include/JSystem/JAudio/JASWaveBank.h @@ -0,0 +1,47 @@ +#ifndef JASWAVEBANK_H +#define JASWAVEBANK_H + +#include "dolphin/types.h" + +class JKRHeap; + +namespace JASystem { + class TWaveArc; + + struct TWaveInfo { + /* 0x00 */ u8 field_0x0; + /* 0x01 */ u8 field_0x1; + /* 0x02 */ u8 field_0x2; + /* 0x04 */ f32 field_0x4; + /* 0x08 */ int field_0x8; + /* 0x0C */ int field_0xc; + /* 0x10 */ int field_0x10; + /* 0x14 */ int field_0x14; + /* 0x18 */ int field_0x18; + /* 0x1C */ int field_0x1c; + /* 0x20 */ s16 field_0x20; + /* 0x22 */ s16 field_0x22; + /* 0x24 */ void* field_0x24; + /* 0x28 */ int field_0x28; + }; + + class TWaveHandle { + public: + virtual ~TWaveHandle() {} + virtual const TWaveInfo* getWaveInfo() const = 0; + virtual const void* getWavePtr() const = 0; + }; + + class TWaveBank { + public: + TWaveBank() {} + virtual ~TWaveBank() {} + virtual TWaveHandle* getWaveHandle(u32) const = 0; + virtual TWaveArc* getWaveArc(int) = 0; + static JKRHeap* getCurrentHeap(); + + static JKRHeap* sCurrentHeap; + }; +} + +#endif /* JASWAVEBANK_H */ diff --git a/src/JSystem/JAudio/JASWaveBank.cpp b/src/JSystem/JAudio/JASWaveBank.cpp index 14cab90f4..d8509058d 100644 --- a/src/JSystem/JAudio/JASWaveBank.cpp +++ b/src/JSystem/JAudio/JASWaveBank.cpp @@ -3,11 +3,16 @@ // Translation Unit: JASWaveBank.cpp // -#include "JASWaveBank.h" -#include "dolphin/types.h" +#include "JSystem/JAudio/JASWaveBank.h" +#include "JSystem/JAudio/JASSystemHeap.h" +#include "JSystem/JKernel/JKRSolidHeap.h" + +JKRHeap* JASystem::TWaveBank::sCurrentHeap; /* 8028455C-80284570 .text getCurrentHeap__Q28JASystem9TWaveBankFv */ -void JASystem::TWaveBank::getCurrentHeap() { - /* Nonmatching */ +JKRHeap* JASystem::TWaveBank::getCurrentHeap() { + if (sCurrentHeap) { + return sCurrentHeap; + } + return JASDram; } -