Z2AudioMgr / various JAudio setup (#152)

* audioMgr setup

* bunch of JAudio setup
This commit is contained in:
TakaRikka
2021-09-30 07:13:49 -07:00
committed by GitHub
parent 4efaff5faf
commit 5390dfe55f
103 changed files with 1329 additions and 2696 deletions
+6
View File
@@ -3,4 +3,10 @@
#include "dolphin/types.h"
struct JAIAudible {
virtual ~JAIAudible();
virtual void getOuterParams(int) = 0;
virtual void calc() = 0;
};
#endif /* JAIAUDIBLE_H */
+16
View File
@@ -1,6 +1,22 @@
#ifndef JAIAUDIENCE_H
#define JAIAUDIENCE_H
#include "JSystem/JAudio2/JAIAudible.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JGeometry.h"
#include "dolphin/types.h"
class JAISoundID;
struct JASSoundParams;
struct JAIAudience {
virtual ~JAIAudience();
virtual JAIAudible* newAudible(JGeometry::TVec3<f32> const&, JAISoundID,
JGeometry::TVec3<f32> const*, u32) = 0;
virtual void getMaxChannels() = 0;
virtual void deleteAudible(JAIAudible*) = 0;
virtual void calcPriority(JAIAudible*) = 0;
virtual void mixChannelOut(JASSoundParams const&, JAIAudible*, int) = 0;
};
#endif /* JAIAUDIENCE_H */
+73
View File
@@ -1,6 +1,79 @@
#ifndef JAISEMGR_H
#define JAISEMGR_H
#include "JSystem/JAudio2/JAIAudience.h"
#include "JSystem/JAudio2/JAISeqDataMgr.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/types.h"
struct JASNonCopyable {
/* 0x0 */ int field_0x0;
}; // Size: 0x4
struct JAISeCategoryArrangement {};
class JAISeMgr;
struct JAISe {
/* 8029F03C */ JAISe(JAISeMgr*, JAISoundStrategyMgr<JAISe>*, u32);
/* 8029F304 */ void JAISeCategoryMgr_mixOut_(bool, JASSoundParams const&, JAISoundActivity);
/* 8029F4CC */ void JAISeCategoryMgr_calc_();
/* 8029F650 */ void JAISeMgr_startID_(JAISoundID, JGeometry::TVec3<f32> const*, JAIAudience*);
};
class JAISeCategoryMgr : public JAISeqDataUser {
public:
/* 8029F9C4 */ void JAISeMgr_calc_();
/* 8029FB30 */ void JAISeMgr_freeDeadSe_();
/* 8029FC88 */ void JAISeMgr_acceptsNewSe_(u32) const;
/* 8029FD40 */ void sortByPriority_();
/* 8029FDE0 */ void stop(u32);
/* 8029FE34 */ void stop();
/* 8029FE78 */ void stopSoundID(JAISoundID);
/* 8029FEEC */ void pause(bool);
/* 8029FF18 */ void JAISeMgr_mixOut_(JAISoundParamsMove const&, JAISoundActivity);
/* 802A0994 */ JAISeCategoryMgr();
/* 800078DC */ virtual ~JAISeCategoryMgr() {}
/* 8029F8B0 */ virtual bool isUsingSeqData(JAISeqDataRegion const&);
/* 8029F91C */ virtual void releaseSeqData(JAISeqDataRegion const&);
/* 0x04 */ JASNonCopyable field_0x4;
/* 0x08 */ JAISoundParamsMove mParams;
/* 0x58 */ JSUList<JAISe> mSeList;
/* 0x64 */ int mMaxInactiveSe;
/* 0x68 */ int mMaxActiveSe;
}; // Size: 0x6C
class JAISeMgr : public JAISeqDataUser, public JAISoundActivity {
public:
/* 802A0074 */ JAISeMgr(bool);
/* 802A0268 */ void setCategoryArrangement(JAISeCategoryArrangement const&);
/* 802A02A0 */ void stop();
/* 802A02F4 */ void stopSoundID(JAISoundID);
/* 802A0358 */ void initParams();
/* 802A03D8 */ void setAudience(JAIAudience*);
/* 802A03E0 */ void setSeqDataMgr(JAISeqDataMgr*);
/* 802A0434 */ void resetSeqDataMgr();
/* 802A0484 */ void newSe_(int, u32);
/* 802A0574 */ void calc();
/* 802A0704 */ void mixOut();
/* 802A0768 */ void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
/* 802A08D0 */ void getNumActiveSe() const;
/* 802A08FC */ virtual ~JAISeMgr(); // inline?
/* 802A0168 */ virtual bool isUsingSeqData(JAISeqDataRegion const&);
/* 802A01D8 */ virtual void releaseSeqData(JAISeqDataRegion const&);
private:
/* 0x008 */ JAIAudience* mAudience;
/* 0x00C */ JAISeqDataMgr* mSeqDataMgr;
/* 0x010 */ int field_0x10;
/* 0x014 */ JAISeCategoryMgr mCategoryMgrs[16];
/* 0x6D4 */ JAISoundParamsMove mParams;
}; // Size: 0x724
STATIC_ASSERT(sizeof(JAISeMgr) == 0x724);
#endif /* JAISEMGR_H */
+18
View File
@@ -1,6 +1,24 @@
#ifndef JAISEQDATAMGR_H
#define JAISEQDATAMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
struct JAISeqDataRegion {};
struct JAISeqData;
struct JAISeqDataUser {
virtual ~JAISeqDataUser();
virtual bool isUsingSeqData(JAISeqDataRegion const&) = 0;
virtual void releaseSeqData(JAISeqDataRegion const&) = 0;
};
struct JAISeqDataMgr {
virtual ~JAISeqDataMgr();
virtual void getSeqData(JAISoundID, JAISeqData*) = 0;
virtual void releaseSeqData() = 0;
virtual void setSeqDataUser(JAISeqDataUser*) = 0;
};
#endif /* JAISEQDATAMGR_H */
+33
View File
@@ -1,6 +1,39 @@
#ifndef JAISEQMGR_H
#define JAISEQMGR_H
#include "JSystem/JAudio2/JAIAudience.h"
#include "JSystem/JAudio2/JAISeqDataMgr.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/types.h"
struct JAISeq;
class JAISeqMgr : public JAISeqDataUser {
public:
/* 802A1914 */ JAISeqMgr(bool);
/* 802A1A08 */ void freeDeadSeq_();
/* 802A1B48 */ void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
/* 802A1C90 */ void calc();
/* 802A1DFC */ void stop();
/* 802A1E3C */ void stop(u32);
/* 802A1E8C */ void stopSoundID(JAISoundID);
/* 802A1EFC */ void mixOut();
/* 802A1F58 */ void beginStartSeq_();
/* 802A1FE8 */ void endStartSeq_(JAISeq*, JAISoundHandle*);
/* 802A20F0 */ virtual ~JAISeqMgr(); // inline?
/* 802A1804 */ virtual bool isUsingSeqData(JAISeqDataRegion const&);
/* 802A1870 */ virtual void releaseSeqData(JAISeqDataRegion const&);
private:
/* 0x04 */ JAISoundActivity mActivity;
/* 0x08 */ void* field_0x8;
/* 0x0C */ JAIAudience* mAudience;
/* 0x10 */ JAISeqDataMgr* seqDataMgr_;
/* 0x14 */ JAISoundParamsMove mMove;
/* 0x64 */ JSUList<JAISeq> mSeqList;
/* 0x70 */ int field_0x70;
}; // Size: 0x74
#endif /* JAISEQMGR_H */
+66 -133
View File
@@ -1,8 +1,10 @@
#ifndef JAISOUND_H
#define JAISOUND_H
#include "JSystem/JAudio2/JAIAudience.h"
#include "JSystem/JAudio2/JAISoundHandles.h"
#include "JSystem/JAudio2/JAISoundParams.h"
#include "JSystem/JGeometry.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/types.h"
#include "global.h"
@@ -15,25 +17,12 @@ public:
JAISoundID(JAISoundID const& other);
JAISoundID() {}
private:
u32 mId;
};
struct JASSoundParams {};
struct JAISoundParams {
/* 802A2280 */ void mixOutAll(JASSoundParams const&, JASSoundParams*, f32);
float field_0x0;
float field_0x4;
float field_0x8;
float field_0xc;
float field_0x10;
float field_0x14;
float field_0x18;
float field_0x1c;
};
struct JASTrack {
/* 80291444 */ void setChannelMgrCount(u32);
/* 802919F4 */ void assignExtBuffer(u32, JASSoundParams*);
@@ -42,6 +31,49 @@ struct JASTrack {
/* 8029297C */ void readPort(u32);
};
struct JAISoundStatus_ {
/* 802A2220 */ s32 lockWhenPrepared();
/* 802A2244 */ s32 unlockIfLocked();
void init() {
field_0x0 = 0;
field_0x1 = 0;
*((u16*)(this) + 2) = 0;
user_data = 0;
}
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 state[2]; // debug accesses like "state.flags.calcedOnce"
/* 0x4 */ u32 user_data;
}; // Size: 0x6
struct JAISoundFader {
void forceIn() {
mIntensity = 1.0f;
field_0x4.zero();
}
/* 0x00 */ f32 mIntensity;
/* 0x04 */ JAISoundParamsTransition::TTransition field_0x4;
}; // Size: 0x10
template <typename A0>
struct JAISoundStrategyMgr {};
/* JAISoundStrategyMgr<JAISe> */
struct JAISoundStrategyMgr__template0 {};
/* JAISoundStrategyMgr<JAISeq> */
struct JAISoundStrategyMgr__template1 {};
/* JAISoundStrategyMgr<JAIStream> */
struct JAISoundStrategyMgr__template2 {};
class JAISoundActivity {
public:
void init() { field_0x0 = 0; }
/* 0x0 */ u8 field_0x0;
};
class JAISoundHandle;
class JAIAudible;
class JAIAudience;
@@ -51,7 +83,7 @@ public:
/* 802A21BC */ void attachHandle(JAISoundHandle*);
/* 802A22F8 */ JAISound();
/* 802A2328 */ void start_JAISound_(JAISoundID, JGeometry::TVec3<f32> const*, JAIAudience*);
/* 802A244C */ void acceptsNewAudible() const;
/* 802A244C */ bool acceptsNewAudible() const;
/* 802A2474 */ void newAudible(JGeometry::TVec3<f32> const&, JGeometry::TVec3<f32> const*, u32,
JAIAudience*);
/* 802A2598 */ void stop();
@@ -64,124 +96,25 @@ public:
/* 802A26B8 */ void calc_JAISound_();
/* 802A29DC */ void initTrack_JAISound_(JASTrack*);
virtual void getNumChild() = 0;
JAISoundID getID() const;
u32 getUserData() const { return user_data; }
u32 getUserData() const { return status_.user_data; }
bool isHandleAttached() const { return handle_ != NULL; }
// TODO: do proper struct later
void* __vt;
struct JAISoundHandle* handle;
struct JAIAudible* audible;
struct JAIAudience* audience;
s32 field_0xc;
s32 num_prepare_steps;
struct JAISoundID sound_id;
u8 field_0x18;
u8 field_0x19;
u8 field_0x1a;
u8 field_0x1b;
u32 user_data;
float field_0x20;
float field_0x24;
float field_0x28;
s32 field_0x2c;
s32 audience_priority;
s32 field_0x34;
struct JAISoundParams params;
u8 field_0x58;
u8 field_0x59;
u8 field_0x5a;
u8 field_0x5b;
u8 field_0x5c;
u8 field_0x5d;
u8 field_0x5e;
u8 field_0x5f;
u8 field_0x60;
u8 field_0x61;
u8 field_0x62;
u8 field_0x63;
u8 field_0x64;
u8 field_0x65;
u8 field_0x66;
u8 field_0x67;
u8 field_0x68;
u8 field_0x69;
u8 field_0x6a;
u8 field_0x6b;
u8 field_0x6c;
u8 field_0x6d;
u8 field_0x6e;
u8 field_0x6f;
u8 field_0x70;
u8 field_0x71;
u8 field_0x72;
u8 field_0x73;
u8 field_0x74;
u8 field_0x75;
u8 field_0x76;
u8 field_0x77;
u8 field_0x78;
u8 field_0x79;
u8 field_0x7a;
u8 field_0x7b;
u8 field_0x7c;
u8 field_0x7d;
u8 field_0x7e;
u8 field_0x7f;
u8 field_0x80;
u8 field_0x81;
u8 field_0x82;
u8 field_0x83;
u8 field_0x84;
u8 field_0x85;
u8 field_0x86;
u8 field_0x87;
u8 field_0x88;
u8 field_0x89;
u8 field_0x8a;
u8 field_0x8b;
u8 field_0x8c;
u8 field_0x8d;
u8 field_0x8e;
u8 field_0x8f;
u8 field_0x90;
u8 field_0x91;
u8 field_0x92;
u8 field_0x93;
};
/* 0x04 */ JAISoundHandle* handle_;
/* 0x08 */ JAIAudible* audible_;
/* 0x0C */ JAIAudience* audience_;
/* 0x10 */ s32 lifeTime;
/* 0x14 */ s32 prepareCount;
/* 0x18 */ JAISoundID soundID;
/* 0x1C */ JAISoundStatus_ status_;
/* 0x24 */ JAISoundFader fader;
/* 0x34 */ s32 field_0x34;
/* 0x38 */ s32 mCount;
/* 0x3C */ JAISoundParams params;
}; // Size: 0x98
class JAISoundHandle {
public:
JAISoundHandle(); // noninline in JAUClusterSound.cpp
~JAISoundHandle();
bool isSoundAttached() const { return sound_ != NULL; }
JAISound* operator->() const {
JUT_ASSERT("JAISound.h", 0x3a, sound_ != 0);
return sound_;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
private:
JAISound* sound_; // member from assert in operator->()
};
class JAISoundHandles {
public:
JAISoundHandles(JAISoundHandle* pHandle, int param_1) {
mSoundHandle = pHandle;
field_0x04 = param_1;
};
void getHandleSoundID(JAISoundID);
void getFreeHandle();
private:
JAISoundHandle* mSoundHandle;
int field_0x04;
};
STATIC_ASSERT(sizeof(JAISound) == 0x98);
#endif /* JAISOUND_H */
+11
View File
@@ -1,6 +1,17 @@
#ifndef JAISOUNDCHILD_H
#define JAISOUNDCHILD_H
#include "JSystem/JAudio2/JAISoundParams.h"
#include "JSystem/JAudio2/JASTrack.h"
#include "dolphin/types.h"
struct JAISoundChild {
/* 802A2AB0 */ void init();
/* 802A2B28 */ void mixOut(JASTrack*);
/* 802A2B7C */ void calc();
/* 0x00 */ JAISoundParamsMove mMove;
/* 0x50 */ JASSoundParams mParams;
}; // Size: 0x64
#endif /* JAISOUNDCHILD_H */
+41
View File
@@ -1,6 +1,47 @@
#ifndef JAISOUNDHANDLES_H
#define JAISOUNDHANDLES_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/types.h"
class JAISound;
class JAISoundID;
class JAISoundHandle {
public:
JAISoundHandle();
~JAISoundHandle() {}
bool isSoundAttached() const { return sound_ != NULL; }
JAISound* operator->() const {
JUT_ASSERT("JAISound.h", 58, sound_ != 0);
return sound_;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
JAISound* getSound() { return sound_; }
JAISound* sound_; // member from assert in operator->()
};
class JAISoundHandles {
public:
JAISoundHandles(JAISoundHandle* pHandle, int param_1) {
*mSoundHandle = pHandle;
numHandles_ = param_1;
};
void getHandleSoundID(JAISoundID);
JAISoundHandle* getFreeHandle();
private:
JAISoundHandle** mSoundHandle;
int numHandles_;
};
#endif /* JAISOUNDHANDLES_H */
+102
View File
@@ -1,6 +1,108 @@
#ifndef JAISOUNDPARAMS_H
#define JAISOUNDPARAMS_H
#include "JSystem/JAudio2/JASSoundParams.h"
#include "dolphin/types.h"
struct JAISoundParamsProperty {
void init() {
field_0x0 = 1.0f;
field_0x4 = 0.0f;
field_0x8 = 1.0f;
}
/* 0x00 */ f32 field_0x0;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ f32 field_0x8;
}; // Size: 0xC
struct JAISoundParamsTransition {
struct TTransition {
void zero() {
field_0x0 = 0.0f;
mCount = 0;
field_0x4 = 0.0f;
}
void set(f32 newValue, f32 param_1, u32 param_2) {
mCount = param_2;
field_0x0 = (newValue - param_1) / mCount;
field_0x4 = newValue;
}
f32 apply(f32 param_0) {
if (mCount > 1) {
mCount--;
param_0 += field_0x0;
} else {
if (mCount == 1) {
mCount = 0;
param_0 = field_0x4;
}
}
return param_0;
}
/* 0x0 */ f32 field_0x0;
/* 0x4 */ f32 field_0x4;
/* 0x8 */ u32 mCount;
}; // Size: 0xC
void init() {
mVolume.zero();
mPitch.zero();
mFxMix.zero();
mPan.zero();
mDolby.zero();
}
void apply(JASSoundParams* pParams) {
pParams->mVolume = mVolume.apply(pParams->mVolume);
pParams->mPitch = mPitch.apply(pParams->mPitch);
pParams->mFxMix = mFxMix.apply(pParams->mFxMix);
pParams->mDolby = mDolby.apply(pParams->mDolby);
pParams->mPan = mPan.apply(pParams->mPan);
}
/* 0x00 */ TTransition mVolume;
/* 0x0C */ TTransition mPitch;
/* 0x18 */ TTransition mFxMix;
/* 0x24 */ TTransition mPan;
/* 0x30 */ TTransition mDolby;
}; // Size: 0x3C
struct JAISoundParamsMove {
JAISoundParamsMove() : mParams() {}
void init() {
mParams.init();
mTransition.init();
}
void calc() { mTransition.apply(&mParams); }
/* 802A2DB4 */ void moveVolume(f32, u32);
/* 802A2E0C */ void movePitch(f32, u32);
/* 802A2E64 */ void moveFxMix(f32, u32);
/* 802A2EBC */ void movePan(f32, u32);
/* 802A2F14 */ void moveDolby(f32, u32);
/* 0x00 */ JASSoundParams mParams;
/* 0x14 */ JAISoundParamsTransition mTransition;
}; // Size: 0x50
struct JAISoundParams {
JAISoundParams() : mMove() {}
void mixOutAll(JASSoundParams const&, JASSoundParams*, f32);
void init() {
mMove.init();
mProperty.init();
}
/* 0x0 */ JAISoundParamsProperty mProperty;
/* 0xC */ JAISoundParamsMove mMove;
}; // Size: 0x5C
// OG Size: 0x20
#endif /* JAISOUNDPARAMS_H */
@@ -1,6 +1,18 @@
#ifndef JAISTREAMDATAMGR_H
#define JAISTREAMDATAMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
struct JAIStreamDataMgr {
virtual void getStreamFileEntry(JAISoundID) = 0;
virtual ~JAIStreamDataMgr();
};
struct JAIStreamAramMgr {
virtual void newStreamAram(u32*) = 0;
virtual void deleteStreamAram(u32) = 0;
virtual ~JAIStreamAramMgr();
};
#endif /* JAISTREAMDATAMGR_H */
+35
View File
@@ -1,6 +1,41 @@
#ifndef JAISTREAMMGR_H
#define JAISTREAMMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/types.h"
class JAIStreamMgr;
struct JAIStream {
/* 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:
/* 802A3B68 */ JAIStreamMgr(bool);
/* 802A3C3C */ void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
/* 802A3D70 */ void freeDeadStream_();
/* 802A3EBC */ void calc();
/* 802A4028 */ void stop();
/* 802A4068 */ void stop(u32);
/* 802A40B8 */ void stopSoundID(JAISoundID);
/* 802A4118 */ void mixOut();
/* 802A4174 */ void newStream_();
/* 802B9978 */ void isActive() const;
private:
/* 0x00 */ JAISoundActivity mActivity;
/* 0x04 */ JAISoundParamsMove mParams;
/* 0x54 */ int field_0x54;
/* 0x58 */ JSUList<JAIStream> mStreamList;
/* 0x64 */ int field_0x64;
/* 0x68 */ int field_0x68;
/* 0x6C */ int field_0x6c;
}; // Size: 0x70
#endif /* JAISTREAMMGR_H */
+5 -4
View File
@@ -1,16 +1,17 @@
#ifndef JASAUDIORESETER_H
#define JASAUDIORESETER_H
#include "JSystem/JAudio2/JASDriverIF.h"
#include "dolphin/types.h"
struct JASAudioReseter {
/* 8029D0B4 */ JASAudioReseter();
/* 8029D0FC */ ~JASAudioReseter();
/* 8029D138 */ void start(u32, bool);
/* 8029D138 */ bool start(u32, bool);
/* 8029D1D4 */ void resume();
/* 8029D1F8 */ void checkDone() const;
/* 8029D200 */ void calc();
/* 8029D2D4 */ void callback(void*);
/* 8029D1F8 */ s32 checkDone() const;
/* 8029D200 */ static s32 calc();
/* 8029D2D4 */ static s32 callback(void*);
/* 0x0 */ u32 field_0x0;
/* 0x4 */ f32 mDSPLevel;
+24
View File
@@ -3,4 +3,28 @@
#include "dolphin/types.h"
typedef s32 (*DriverCallback)(void*);
struct JASDriver {
/* 8029E130 */ static void setDSPLevel(f32);
/* 8029E150 */ u16 getChannelLevel_dsp();
/* 8029E158 */ static f32 getDSPLevel();
/* 8029E178 */ static void setOutputMode(u32);
/* 8029E180 */ u32 getOutputMode();
/* 8029E188 */ void waitSubFrame();
/* 8029E1C4 */ void rejectCallback(DriverCallback, void*);
/* 8029E240 */ static bool registerDspSyncCallback(DriverCallback, void*);
/* 8029E274 */ static bool registerSubFrameCallback(DriverCallback, void*);
/* 8029E2A8 */ void subframeCallback();
/* 8029E2D0 */ void DSPSyncCallback();
/* 8029E2F8 */ void updateDacCallback();
/* 8029C9F0 */ static u32 getSubFrames();
static u8 sDspSyncCallback[256];
static u8 sSubFrameCallback[256];
static u8 sUpdateDacCallback[256 + 8 /* padding */];
static u16 MAX_MIXERLEVEL[1 + 1 /* padding */];
static u32 JAS_SYSTEM_OUTPUT_MODE;
};
#endif /* JASDRIVERIF_H */
+26
View File
@@ -3,4 +3,30 @@
#include "dolphin/types.h"
struct JASSoundParams {
/* 8029E3B0 */ void clamp();
/* 8029E47C */ void combine(JASSoundParams const&, JASSoundParams const&);
void initVolume() { mVolume = 1.0f; }
void initFxMix() { mFxMix = 0.0f; }
void initPitch() { mPitch = 1.0f; }
void initPan() { mPan = 0.5f; }
void initDolby() { mDolby = 0.0f; }
void init() {
initVolume();
initPitch();
initFxMix();
initPan();
initDolby();
}
JASSoundParams() { init(); }
/* 0x00 */ f32 mVolume;
/* 0x04 */ f32 mFxMix;
/* 0x08 */ f32 mPitch;
/* 0x0C */ f32 mPan;
/* 0x10 */ f32 mDolby;
}; // Size: 0x14
#endif /* JASSOUNDPARAMS_H */
+105
View File
@@ -1,6 +1,111 @@
#ifndef JASTRACK_H
#define JASTRACK_H
#include "JSystem/JAudio2/JASSoundParams.h"
#include "dolphin/types.h"
struct JASDsp {
struct TChannel {
/* 8029E00C */ void setFilterMode(u16);
/* 8029E044 */ void setIIRFilterParam(s16*);
/* 8029E06C */ void setFIR8FilterParam(s16*);
};
static u32 FILTER_MODE_IIR;
};
struct JASOscillator {
struct Point {};
struct Data {};
};
struct JASChannel {
/* 8029AAD0 */ void release(u16);
/* 8029AB64 */ void setOscInit(u32, JASOscillator::Data const*);
/* 8029AB98 */ void setMixConfig(u32, u16);
/* 8029ACD4 */ void setKeySweepTarget(s32, u32);
/* 8029BBFC */ void free();
};
struct JASTrack {
struct TChannelMgr {
/* 802930DC */ TChannelMgr(JASTrack*);
/* 80293148 */ void init();
/* 802931B0 */ void releaseAll();
/* 80293220 */ void noteOff(u32, u16);
/* 802932A0 */ void setPauseFlag(bool);
};
struct TList {
/* 80292F6C */ void cbSeqMain(void*);
/* 80292F90 */ void append(JASTrack*);
/* 8029301C */ void seqMain();
/* 8029345C */ ~TList();
};
struct MoveParam_ {
/* 802932C8 */ MoveParam_();
};
/* 80291228 */ JASTrack();
/* 8029131C */ ~JASTrack();
/* 80291444 */ void setChannelMgrCount(u32);
/* 802915D4 */ void init();
/* 802918FC */ void initTimed();
/* 8029194C */ void inherit(JASTrack const&);
/* 802919F4 */ void assignExtBuffer(u32, JASSoundParams*);
/* 80291A08 */ void setSeqData(void*, u32);
/* 80291A28 */ void startSeq();
/* 80291A78 */ void stopSeq();
/* 80291ABC */ void start();
/* 80291AC8 */ void close();
/* 80291B8C */ void connectChild(u32, JASTrack*);
/* 80291BB8 */ void closeChild(u32);
/* 80291C30 */ void openChild(u32);
/* 80291DAC */ void connectBus(int, int);
/* 80291DBC */ void setLatestKey(u8);
/* 80291DF8 */ void channelStart(JASTrack::TChannelMgr*, u32, u32, u32);
/* 80291F38 */ void noteOn(u32, u32, u32);
/* 80292008 */ void gateOn(u32, u32, f32, u32);
/* 80292198 */ void noteOff(u32, u16);
/* 80292220 */ void checkNoteStop(u32) const;
/* 8029226C */ void overwriteOsc(JASChannel*);
/* 802922D8 */ void updateTimedParam();
/* 80292348 */ void updateTrack(f32);
/* 802924E4 */ void updateTempo();
/* 80292580 */ void updateSeq(bool, f32);
/* 80292644 */ void seqTimeToDspTime(f32);
/* 802926E0 */ void setParam(u32, f32, u32);
/* 80292708 */ void noteOffAll(u16);
/* 802927A0 */ void mute(bool);
/* 802927D8 */ void setOscScale(u32, f32);
/* 802927E8 */ void setOscTable(u32, JASOscillator::Point const*);
/* 80292808 */ void setOscAdsr(s16, s16, s16, s16, u16);
/* 8029285C */ void setFIR(s16 const*);
/* 8029289C */ void setIIR(s16 const*);
/* 802928D0 */ void readPortSelf(u32);
/* 802928F4 */ void writePortSelf(u32, u16);
/* 80292918 */ void writePort(u32, u16);
/* 8029297C */ void readPort(u32);
/* 802929A0 */ void setChannelPauseFlag(bool);
/* 80292A3C */ void pause(bool);
/* 80292AA4 */ void getTransposeTotal() const;
/* 80292AF4 */ void isMute() const;
/* 80292B58 */ void setTempo(u16);
/* 80292B8C */ void setTempoRate(f32);
/* 80292BC0 */ void setTimebase(u16);
/* 80292BF4 */ void updateChannel(JASChannel*, JASDsp::TChannel*);
/* 80292CA4 */ void channelUpdateCallback(u32, JASChannel*, JASDsp::TChannel*, void*);
/* 80292D88 */ void getRootTrack();
/* 80292DA0 */ void tickProc();
/* 80292E9C */ void seqMain();
static u8 const sAdsTable[24];
static u8 const sEnvOsc[24];
static u8 const sPitchEnvOsc[24];
static u8 sDefaultBankTable[1036];
static u8 sTrackList[16];
};
#endif /* JASTRACK_H */