Z2AudioLib work (#2339)

* Z2LinkMgr work, Z2AudioArcLoader matching

* Z2SeMgr matching

* Z2SpeechMgr2 almost done, Z2SoundHandles matching
This commit is contained in:
Caroline Madsen
2025-03-21 23:03:43 -07:00
committed by GitHub
parent cf87a207b6
commit 5a7b9f62d6
43 changed files with 1832 additions and 1194 deletions
+6 -1
View File
@@ -49,7 +49,12 @@ public:
/* 8029FE78 */ void stopSoundID(JAISoundID);
/* 8029FEEC */ void pause(bool);
/* 8029FF18 */ void JAISeMgr_mixOut_(JAISoundParamsMove const&, JAISoundActivity);
/* 802A0994 */ JAISeCategoryMgr();
/* 802A0994 */ JAISeCategoryMgr() {
mParams.init();
mMaxActiveSe = 0;
mMaxInactiveSe = 0;
field_0x4.field_0x0 = 0;
}
/* 800078DC */ virtual ~JAISeCategoryMgr() {}
/* 8029F8B0 */ virtual bool isUsingSeqData(JAISeqDataRegion const&);
+4 -4
View File
@@ -241,23 +241,23 @@ template <typename T>
class JASPoolAllocObject {
public:
static void* operator new(size_t n) {
JASMemPool<T>* memPool = getMemPool();
JASMemPool<T>* memPool = getMemPool_();
return memPool->alloc(sizeof(T));
}
static void* operator new(size_t n, void* ptr) {
return ptr;
}
static void operator delete(void* ptr, size_t n) {
JASMemPool<T>* memPool_ = getMemPool();
JASMemPool<T>* memPool_ = getMemPool_();
memPool_->free(ptr, sizeof(T));
}
static void newMemPool(int param_0) {
JASMemPool<T>* memPool_ = getMemPool();
JASMemPool<T>* memPool_ = getMemPool_();
memPool_->newMemPool(param_0);
}
private:
static JASMemPool<T>* getMemPool() {
static JASMemPool<T>* getMemPool_() {
static JASMemPool<T> memPool_;
return &memPool_;
}
+11 -1
View File
@@ -169,7 +169,17 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
/* 0x000 */ JASSeqCtrl mSeqCtrl;
/* 0x05C */ JASTrackPort mTrackPort;
/* 0x080 */ JASRegisterParam mRegisterParam;
/* 0x09C */ MoveParam_ mMoveParam[6]; // volume, pitch, fxmix, pan, dolby, distFilter
/* 0x09C */ union {
struct {
MoveParam_ volume;
MoveParam_ pitch;
MoveParam_ fxmix;
MoveParam_ pan;
MoveParam_ dolby;
MoveParam_ distFilter;
} params;
MoveParam_ array[6];
} mMoveParam;
/* 0x0e4 */ JASOscillator::Data mOscParam[2];
/* 0x114 */ JASOscillator::Point mOscPoint[4];
/* 0x12C */ JASTrack* mParent;
+3
View File
@@ -22,7 +22,9 @@ public:
struct TNodeLinkList {
struct iterator {
iterator() { node = NULL; }
explicit iterator(TLinkListNode* pNode) { node = pNode; }
iterator& operator=(const iterator& other) { node = other.node; return *this; }
iterator& operator++() { node = node->getNext(); return *this; }
iterator& operator--() { node = node->getPrev(); return *this; }
@@ -117,6 +119,7 @@ struct TLinkList : public TNodeLinkList {
TLinkList() : TNodeLinkList() {}
struct iterator {
iterator() {}
explicit iterator(TNodeLinkList::iterator iter) : base(iter) {}
iterator& operator++() {
+6 -1
View File
@@ -238,6 +238,11 @@ inline bool JKRRemoveResource(void* resource, JKRFileLoader* fileLoader) {
return JKRFileLoader::removeResource(resource, fileLoader);
}
inline JKRArchive* JKRMountArchive(void* ptr, JKRHeap* heap,
JKRArchive::EMountDirection mountDirection) {
return JKRArchive::mount(ptr, heap, mountDirection);
}
inline void JKRUnmountArchive(JKRArchive* arc) {
arc->unmount();
}
@@ -246,4 +251,4 @@ inline void JKRReadIdxResource(void* param_1, u32 param_2, u32 param_3, JKRArchi
param_4->readIdxResource(param_1, param_2, param_3);
}
#endif
#endif
+1 -1
View File
@@ -12,7 +12,7 @@ void JMAVECScaleAdd(register const Vec* vec1, register const Vec* vec2, register
register f32 scale);
inline int JMAAbs(int value) {
return (value >> 0x1f ^ value) - (value >> 0x1f);
return value > 0 ? value : -value;
}
inline f32 JMAFastReciprocal(f32 value) {
+1 -1
View File
@@ -20,7 +20,7 @@ struct TRandom_fast_ {
u32 get_bit32(void) { return this->get(); }
s8 get_uint8(u8 param_0) {
u8 get_uint8(u8 param_0) {
return get_ufloat_1() * param_0;
}