Work on Z2AudioLib (#2032)

This commit is contained in:
hatal175
2024-01-13 15:41:29 +02:00
committed by GitHub
parent 6260020b3e
commit ead852383f
42 changed files with 853 additions and 1572 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ class JAISeqMgr : public JAISeqDataUser, public JASGlobalInstance<JAISeqMgr> {
public:
/* 802A1914 */ JAISeqMgr(bool);
/* 802A1A08 */ void freeDeadSeq_();
/* 802A1B48 */ void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
/* 802A1B48 */ int startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
/* 802A1C90 */ void calc();
/* 802A1DFC */ void stop();
/* 802A1E3C */ void stop(u32);
+7 -1
View File
@@ -8,7 +8,7 @@
class JAISoundID {
public:
operator u32() const { return this->mId.mFullId; }
void operator=(JAISoundID const& other) { mId.mFullId = other.mId.mFullId; };
const JAISoundID& operator=(JAISoundID const& other) { mId.mFullId = other.mId.mFullId; return *this; };
JAISoundID(u32 pId) { mId.mFullId = pId; };
@@ -16,6 +16,10 @@ public:
JAISoundID() {}
// Helps solve some JAISoundID ctor/assignment operator stack issues
// Remove when solved
void stackCopyHelper(JAISoundID other) { mId = other.mId; }
bool isAnonymous() { return mId.mFullId == 0xffffffff; }
void setAnonymous() { mId.mFullId = -1; }
@@ -284,6 +288,8 @@ public:
return;
}
JAISoundParamsProperty& getProperty() { return params.mProperty; }
s32 getCount() const { return mCount; }
JAISoundParamsMove& getAuxiliary() { return params.mMove; }
+2 -11
View File
@@ -3,26 +3,17 @@
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JAudio2/JAIStream.h"
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JUtility/JUTAssert.h"
class JAIStreamAramMgr;
class JAIStreamDataMgr;
class JAIStreamMgr;
class JAIStream {
public:
/* 802A3104 */ JAIStream(JAIStreamMgr*, JAISoundStrategyMgr<JAIStream>*);
/* 802A319C */ void JAIStreamMgr_startID_(JAISoundID, s32, JGeometry::TVec3<f32> const*,
JAIAudience*, int);
/* 802A34E4 */ void JAIStreamMgr_mixOut_(JASSoundParams const&, JAISoundActivity);
/* 802A388C */ void JAIStreamMgr_calc_();
};
class JAIStreamMgr : public JASGlobalInstance<JAIStreamMgr> {
public:
/* 802A3B68 */ JAIStreamMgr(bool);
/* 802A3C3C */ void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
/* 802A3C3C */ int startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
/* 802A3D70 */ void freeDeadStream_();
/* 802A3EBC */ void calc();
/* 802A4028 */ void stop();
+1 -4
View File
@@ -13,10 +13,7 @@ struct JAUAudibleParam {
u16 f1;
} half;
struct {
u8 b0_0 : 1;
u8 b0_1 : 1;
u8 b0_2 : 1;
u8 b0_3 : 1;
u8 b0_0 : 4;
u8 b0_4 : 1;
u8 b0_5 : 1;
u8 b0_6 : 1;
+2 -1
View File
@@ -3,11 +3,12 @@
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JAudio2/JAUAudibleParam.h"
class JAUSoundInfo : public JASGlobalInstance<JAUSoundInfo> {
public:
JAUSoundInfo(bool param_0) : JASGlobalInstance<JAUSoundInfo>(param_0) {}
virtual void getAudibleSw(JAISoundID) const = 0;
virtual u16 getAudibleSw(JAISoundID) const = 0;
virtual u16 getBgmSeqResourceID(JAISoundID) const = 0;
};
+13 -3
View File
@@ -4,6 +4,14 @@
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
struct JAUSoundTableItem {
u8 mPriority;
u8 field_0x1;
u16 mResourceId;
u32 field_0x4;
f32 field_0x8;
};
template<typename Root, typename Section, typename Group, typename Typename_0>
struct JAUSoundTable_ {
JAUSoundTable_() {
@@ -116,16 +124,18 @@ struct JAUSoundTable : public JASGlobalInstance<JAUSoundTable> {
/* 802A7114 */ void init(void const*);
/* 802A7160 */ u8 getTypeID(JAISoundID) const;
/* 802A728C */ void* getData(JAISoundID) const;
/* 802A728C */ JAUSoundTableItem* getData(JAISoundID) const;
void* getItem(JAUSoundTableGroup* group, int index) const {
JAUSoundTableItem* getItem(JAUSoundTableGroup* group, int index) const {
u32 offset = group->getItemOffset(index);
if (offset == 0) {
return NULL;
}
return (void*)((u8*)field_0x0.field_0x0 + offset);
return (JAUSoundTableItem*)((u8*)field_0x0.field_0x0 + offset);
}
const void* getResource() { return field_0x0.field_0x0; }
JAUSoundTable_<JAUSoundTableRoot,JAUSoundTableSection,JAUSoundTableGroup,void> field_0x0;
};
+4
View File
@@ -15,6 +15,10 @@ struct TRandom_fast_ {
u32 get_bit32(void) { return this->get(); }
s8 get_uint8(u8 param_0) {
return get_ufloat_1() * param_0;
}
// due to the float constant, having this function inlined adds that float to data,
// making it not match
float get_ufloat_1(void) {