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 */
+134
View File
@@ -1,6 +1,140 @@
#ifndef Z2AUDIENCE_H
#define Z2AUDIENCE_H
#include "JSystem/JAudio2/JAIAudience.h"
#include "JSystem/JGeometry.h"
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/types.h"
struct Z2Audible;
struct Z2AudioCamera {
/* 802BC758 */ Z2AudioCamera();
/* 802BC788 */ void init();
/* 802BC8AC */ void setCameraState(f32 (*)[4], Vec&, Vec&, f32, f32, bool, bool);
/* 802BC7DC */ void setCameraState(f32 const (*)[4], Vec&, bool);
/* 802BCBEC */ void convertAbsToRel(Z2Audible*, int);
/* 802BCC7C */ void convertAbsToRel(Vec&, Vec*) const;
/* 802BCCC0 */ void isInSight(Vec&) const;
/* 0x00 */ u8 field_0x0[0x30]; // set up JGeometry::TPosition3
/* 0x30 */ JGeometry::TVec3<f32> mVel;
/* 0x3C */ JGeometry::TVec3<f32> mPos;
/* 0x48 */ JGeometry::TVec3<f32> field_0x48;
/* 0x54 */ f32 mFovySin;
/* 0x58 */ f32 mVolCenterZ;
/* 0x5C */ f32 mTargetVolume;
/* 0x60 */ f32 mDolbyCenterZ;
/* 0x64 */ f32 mCamDist;
/* 0x68 */ f32 field_0x68;
/* 0x6C */ f32 field_0x6c;
/* 0x70 */ bool mSetMainCamera;
}; // Size: 0x74
struct Z2SpotMic {
/* 802BCD28 */ Z2SpotMic();
/* 802BCDA8 */ void clearMicState(int);
/* 802BCDE8 */ void calcVolumeFactor(int);
/* 802BCE14 */ void setMicState(Z2AudioCamera*, int);
/* 802BCF5C */ void calcMicDist(Z2Audible*);
/* 802BCFE4 */ void calcMicPriority(f32);
/* 802BD03C */ void calcMicVolume(f32, int, f32);
/* 0x00 */ f32 field_0x0;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ f32 field_0x8;
/* 0x0C */ f32 field_0xc;
/* 0x10 */ int field_0x10[1];
/* 0x14 */ Vec* mPosPtr;
/* 0x18 */ f32 field_0x18[1];
/* 0x1C */ f32 field_0x1c;
/* 0x20 */ f32 field_0x20[1];
/* 0x24 */ bool mIgnoreIfOut;
/* 0x25 */ bool mMicOn;
/* 0x26 */ u8 field_0x26[1];
}; // Size: 0x28
struct Z2Audience3DSetting {
/* 802BC248 */ Z2Audience3DSetting();
/* 802BC284 */ void init();
/* 802BC308 */ void initVolumeDist();
/* 802BC4D0 */ void updateVolumeDist(f32);
/* 802BC6A4 */ void initDolbyDist();
/* 802BC6F8 */ void updateDolbyDist(f32, f32);
/* 0x000 */ f32 field_0x0;
/* 0x004 */ f32 field_0x4;
/* 0x008 */ f32 field_0x8;
/* 0x00C */ f32 field_0xc;
/* 0x010 */ f32 field_0x10;
/* 0x014 */ f32 field_0x14;
/* 0x018 */ f32 field_0x18;
/* 0x01C */ f32 field_0x1c;
/* 0x020 */ f32 field_0x20;
/* 0x024 */ f32 field_0x24;
/* 0x028 */ f32 field_0x28;
/* 0x02C */ f32 field_0x2c;
/* 0x030 */ f32 field_0x30;
/* 0x034 */ f32 field_0x34;
/* 0x038 */ f32 field_0x38;
/* 0x03C */ f32 field_0x3c;
/* 0x040 */ f32 field_0x40;
/* 0x044 */ f32 field_0x44;
/* 0x048 */ f32 field_0x48;
/* 0x04C */ f32 field_0x4c;
/* 0x050 */ f32 field_0x50;
/* 0x054 */ f32 field_0x54;
/* 0x058 */ f32 field_0x58;
/* 0x05C */ f32 field_0x5c;
/* 0x060 */ f32 field_0x60;
/* 0x064 */ int field_0x64;
/* 0x068 */ f32 field_0x68;
/* 0x06C */ f32 field_0x6c;
/* 0x070 */ f32 field_0x70[15];
/* 0x0AC */ f32 field_0xac[15];
/* 0x0E8 */ f32 field_0xe8[15];
/* 0x124 */ bool mVolumeDistInit;
/* 0x125 */ bool mDolbyDistInit;
}; // Size: 0x128
struct Z2AudibleChannel {
/* 802BBE74 */ Z2AudibleChannel();
};
struct Z2Audience : public JAIAudience {
/* 802BD130 */ Z2Audience();
/* 802BD2DC */ void setAudioCamera(f32 (*)[4], Vec&, Vec&, f32, f32, bool, int, bool);
/* 802BD704 */ void calcOffMicSound(f32);
/* 802BD90C */ void setTargetVolume(f32, int);
/* 802BD92C */ void convertAbsToRel(Vec&, Vec*, int);
/* 802BD95C */ void calcRelPosVolume(Vec const&, f32, int);
/* 802BDA44 */ void calcRelPosPan(Vec const&, int);
/* 802BDB44 */ void calcRelPosDolby(Vec const&, int);
/* 802BDBDC */ void calcVolume_(f32, int) const;
/* 802BDC44 */ void calcDeltaPriority_(f32, int, bool) const;
/* 802BDCB0 */ void calcPitchDoppler_(JGeometry::TVec3<f32> const&,
JGeometry::TVec3<f32> const&,
JGeometry::TVec3<f32> const&, f32) const;
/* 802BDD00 */ void calcFxMix_(f32, int) const;
/* 802BDD48 */ void calcPitch_(Z2AudibleChannel*, Z2Audible const*, Z2AudioCamera const*) const;
/* 802BD1FC */ virtual ~Z2Audience();
/* 802BD338 */ virtual JAIAudible* newAudible(JGeometry::TVec3<f32> const&, JAISoundID,
JGeometry::TVec3<f32> const*, u32);
/* 802BDED4 */ virtual void getMaxChannels();
/* 802BD4D4 */ virtual void deleteAudible(JAIAudible*);
/* 802BD5B8 */ virtual void calcPriority(JAIAudible*);
/* 802BD71C */ virtual void mixChannelOut(JASSoundParams const&, JAIAudible*, int);
/* 0x004 */ f32 field_0x4;
/* 0x008 */ u8 field_0x8;
/* 0x00C */ Z2Audience3DSetting mSetting;
/* 0x134 */ Z2AudioCamera mAudioCamera[1];
/* 0x1A8 */ Z2SpotMic mSpotMic[1];
/* 0x1D0 */ Z2SpotMic* mLinkMic;
/* 0x1D4 */ s32 mNumPlayers;
/* 0x1D8 */ u8 field_0x1d8[4];
/* 0x1DC */ bool mUsingOffMicVol;
}; // Size: 0x1E0
#endif /* Z2AUDIENCE_H */
+24 -9
View File
@@ -5,41 +5,56 @@
#include "JSystem/JAudio2/JASAudioReseter.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "Z2AudioLib/Z2Audience.h"
#include "Z2AudioLib/Z2FxLineMgr.h"
#include "Z2AudioLib/Z2SceneMgr.h"
#include "Z2AudioLib/Z2SeMgr.h"
#include "Z2AudioLib/Z2SeqMgr.h"
#include "Z2AudioLib/Z2SoundMgr.h"
#include "Z2AudioLib/Z2SoundObjMgr.h"
#include "Z2AudioLib/Z2SoundStarter.h"
#include "Z2AudioLib/Z2SpeechMgr2.h"
#include "Z2AudioLib/Z2StatusMgr.h"
#include "dolphin/types.h"
class Z2AudioMgr {
public:
Z2AudioMgr();
~Z2AudioMgr() {}
void init(JKRSolidHeap*, u32, void*, JKRArchive*);
void setOutputMode(u32);
void zeldaGFrameWork();
void gframeProcess();
void resetProcess(u32, bool);
void resetRecover();
void hasReset() const;
void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
bool hasReset() const;
static Z2AudioMgr* getInterface() { return mAudioMgrPtr; }
static Z2AudioMgr* mAudioMgrPtr;
private:
/* 0x0000 */ Z2SeMgr mSeMgr;
/* 0x03D0 */ Z2SeqMgr mSeqMgr;
/* 0x04A4 */ Z2SceneMgr mSceneMgr;
/* 0x04C4 */ Z2StatusMgr mStatusMgr;
/* 0x04F4 */ Z2SoundObjMgr mSoundObjMgr;
/* 0x0514 */ /* virtual */ void startSound(JAISoundID, JAISoundHandle*,
JGeometry::TVec3<f32> const*);
/* 0x0514 */ void* vtable; // remove later
/* 0x0518 */ bool mResettingFlag;
/* 0x0519 */ bool field_0x519;
/* 0x051C */ JASAudioReseter mAudioReseter;
/* 0x052C */ Z2SoundStarter mSoundStarter;
/* 0x0530 */ // Z2SoundMgr mSoundMgr;
/* 0x0D40 */ // JAISoundInfo mSoundInfo;
/* 0x0D4C */ // Z2Audience mAudience;
/* 0x0F2C */ // Z2SpeechMgr2 mSpeechMgr;
/* 0x1370 */ // Z2FxLineMgr mFxLineMgr;
};
/* 0x0530 */ Z2SoundMgr mSoundMgr;
/* 0x0D40 */ // Z2SoundInfo mSoundInfo;
/* 0x0D40 */ void* mSoundInfo[3]; // remove later
/* 0x0D4C */ Z2Audience mAudience;
/* 0x0F2C */ Z2SpeechMgr2 mSpeechMgr;
/* 0x1370 */ Z2FxLineMgr mFxLineMgr;
}; // Size: 0x138C
STATIC_ASSERT(sizeof(Z2AudioMgr) == 0x138C);
#endif /* Z2AUDIOMGR_H */
+36 -28
View File
@@ -35,16 +35,16 @@ private:
};
struct Z2LinkSoundStarter : public Z2SoundStarter {
Z2LinkSoundStarter(void);
~Z2LinkSoundStarter();
/* 802C4928 */ void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*, u32,
f32, f32, f32, f32, f32, u32);
Z2LinkSoundStarter();
virtual ~Z2LinkSoundStarter();
virtual void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*, u32, f32,
f32, f32, f32, f32, u32);
};
#pragma pack(push, 1)
class Z2CreatureLink : public Z2Creature {
public:
Z2CreatureLink(void);
Z2CreatureLink();
~Z2CreatureLink();
void setLinkState(u8);
@@ -76,43 +76,51 @@ public:
private:
/* 0x90 */ Z2LinkSoundStarter mLinkSoundStarter;
/* 0x94 */ Z2SoundObjSimple mSoundObjSimple;
/* 0x94 */ Z2SoundObjSimple mKantera;
/* 0xB4 */ cXyz field_0xb4;
/* 0xC0 */ u8 mLinkState;
/* 0xC1 */ u8 unk193;
/* 0xC2 */ u8 unk194;
/* 0xC1 */ u8 field_0xc1;
/* 0xC2 */ u8 mMarkState;
/* 0xC3 */ u8 mLinkHp;
/* 0xC4 */ u8 mBootsType;
/* 0xC5 */ u8 mLanternState;
/* 0xC6 */ u8 unk198;
/* 0xC7 */ u8 unk199;
/* 0xC8 */ u8 unk200;
/* 0xC9 */ u8 unk201;
/* 0xCA */ u8 mSinkDepth;
/* 0xCB */ u8 flags1;
/* 0xCC */ u8 flags2;
};
#pragma pack(pop)
/* 0xC4 */ u8 mLinkBootsType;
/* 0xC5 */ u8 mKanteraState;
/* 0xC6 */ u8 mLinkSwordType;
/* 0xC7 */ u8 mLinkShieldType;
/* 0xC8 */ u8 mMoveSpeed;
/* 0xC9 */ u8 mMovingTime;
/* 0xCA */ s8 mSinkDepth;
/* 0xCB */ u8 mFlags;
/* 0xCC */ u8 mFlags2;
}; // Size: 0xD0
class Z2CreatureRide {
class Z2CreatureRide;
struct Z2RideSoundStarter : public Z2SoundStarter {
/* 802C5234 */ Z2RideSoundStarter(Z2CreatureRide*);
/* 802C5078 */ virtual ~Z2RideSoundStarter();
/* 802C5284 */ virtual void startSound(JAISoundID, JAISoundHandle*,
JGeometry::TVec3<f32> const*, u32, f32, f32, f32, f32,
f32, u32);
/* 0x4 */ Z2CreatureRide* mRide;
};
class Z2CreatureRide : public Z2Creature {
public:
Z2CreatureRide();
~Z2CreatureRide();
void deleteObject();
void init(Vec*, Vec*, u8, u8);
void setLinkRiding(bool);
virtual void deleteObject();
private:
/* 0x00 */ void* vtable;
/* 0x04 */ u8 Z2Creature_members[140];
/* 0x90 */ u8 Z2RideSoundStarter[8];
/* 0x90 */ Z2RideSoundStarter mSoundStarter;
/* 0x98 */ bool mLinkRiding;
/* 0x99 */ u8 padding[3];
};
}; // Size: 0x9C
class Z2CreatureEnemy : public Z2Creature {
public:
virtual void test(); // temp to build OK, remove later
/* 802C0F64 */ Z2CreatureEnemy();
/* 802C0FC4 */ virtual void deleteObject();
/* 802C1094 */ void init(Vec*, Vec*, u8, u8);
+23
View File
@@ -1,6 +1,29 @@
#ifndef Z2FXLINEMGR_H
#define Z2FXLINEMGR_H
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "dolphin/types.h"
struct Z2FxLineEditNode {};
struct Z2FxLineConfig {};
struct Z2FxLineMgr {
/* 802BA7DC */ Z2FxLineMgr();
/* 802BA7FC */ void initDataArc(JKRArchive*, JKRHeap*);
/* 802BAC28 */ void setLineID(s8, bool, bool);
/* 802BAC74 */ void setLine(Z2FxLineConfig*, bool, bool);
/* 802BAE1C */ void setFxForceOff(bool);
/* 802BAE48 */ void setUnderWaterFx(bool);
/* 802BAEB8 */ void setSceneFx(s32);
/* 0x00 */ int field_0x0;
/* 0x04 */ void* mFxLineBuffer[4];
/* 0x14 */ s8 mLineID;
/* 0x15 */ s8 mFxDataNum;
/* 0x16 */ bool mSetUnderWaterFx;
/* 0x18 */ Z2FxLineEditNode* mHIOEdit;
}; // Size: 0x1C
#endif /* Z2FXLINEMGR_H */
+39
View File
@@ -3,4 +3,43 @@
#include "dolphin/types.h"
struct Z2Param {
static f32 DISTANCE_MAX;
static f32 MAX_VOLUME_DISTANCE;
static f32 DOLBY_CENTER_VALUE;
static f32 DOLBY_FLONT_DISTANCE_MAX;
static f32 DOLBY_BEHIND_DISTANCE_MAX;
static f32 DISTANCE_FX_PARAM;
static f32 SONIC_SPEED;
static f32 VOL_BGM_DEFAULT;
static f32 VOL_SE_SYSTEM_DEFAULT;
static f32 VOL_SE_LINK_VOICE_DEFAULT;
static f32 VOL_SE_LINK_MOTION_DEFAULT;
static f32 VOL_SE_LINK_FOOTNOTE_DEFAULT;
static f32 VOL_SE_CHAR_VOICE_DEFAULT;
static f32 VOL_SE_CHAR_MOVE_DEFAULT;
static f32 VOL_SE_OBJECT_DEFAULT;
static f32 VOL_SE_ATMOSPHERE_DEFAULT;
static f32 VOL_BGM_TALKING;
static f32 VOL_SE_SYSTEM_TALKING;
static f32 VOL_SE_LINK_VOICE_TALKING;
static f32 VOL_SE_LINK_MOTION_TALKING;
static f32 VOL_SE_LINK_FOOTNOTE_TALKING;
static f32 VOL_SE_CHAR_VOICE_TALKING;
static f32 VOL_SE_CHAR_MOVE_TALKING;
static f32 VOL_SE_OBJECT_TALKING;
static f32 VOL_SE_ATMOSPHERE_TALKING;
static f32 VOL_BGM_PAUSING;
static f32 VOL_SE_SYSTEM_PAUSING;
static f32 VOL_SE_LINK_VOICE_PAUSING;
static f32 VOL_SE_LINK_MOTION_PAUSING;
static f32 VOL_SE_LINK_FOOTNOTE_PAUSING;
static f32 VOL_SE_CHAR_VOICE_PAUSING;
static f32 VOL_SE_CHAR_MOVE_PAUSING;
static f32 VOL_SE_OBJECT_PAUSING;
static f32 VOL_SE_ATMOSPHERE_PAUSING;
static f32 MIN_DISTANCE_VOLUME;
static f32 ENEMY_LASTHIT_MUTE_VOLUME;
};
#endif /* Z2PARAM_H */
+2 -1
View File
@@ -24,7 +24,7 @@ struct Z2MultiSeMgr {
struct Z2MultiSeObj : Z2MultiSeMgr {
Z2MultiSeObj();
~Z2MultiSeObj();
~Z2MultiSeObj() {}
/* 0x1C */ u32 field_0x1c;
/* 0x20 */ u8 field_0x20;
@@ -52,6 +52,7 @@ public:
/* 802AE184 */ void processSeFramework();
/* 802AE524 */ void isLevelSe(JAISoundID);
/* 802AE5B0 */ void isSoundCulling(JAISoundID);
/* 802B9AC4 */ void resetCrowdSize();
private:
/* 0x000 */ JAISoundHandle mSoundHandle[24];
+24 -4
View File
@@ -12,8 +12,13 @@ struct TTransition {
}; // Size = 0xC
struct Z2SoundFader {
void move(f32 vol, u32 count) {
mIntensity = vol;
mTransition.zero();
}
/* 0x0 */ float mIntensity;
/* 0x4 */ TTransition mTransition;
/* 0x4 */ JAISoundParamsTransition::TTransition mTransition;
}; // Size = 0x10
class Z2SeqMgr {
@@ -67,6 +72,21 @@ public:
void taktModeMute();
void taktModeMuteOff();
void setFieldBgmPlay(bool);
/* 802B99AC */ void unMuteSceneBgm(u32);
/* 802B9A24 */ void muteSceneBgm(u32, f32);
/* 802B9AD0 */ void setTwilightGateVol(f32);
/* 802B9AFC */ void setWindStoneVol(f32, u32);
void i_setTwilightGateVol(f32 vol) { mTwilightGateVol = vol; }
void i_setWindStoneVol(f32 vol, u32 count) { field_0x94.move(vol, count); }
void i_bgmAllUnMute(u32 count) { field_0x74.move(1.0f, count); }
void i_unMuteSceneBgm(u32 count) {
field_0x34.move(1.0f, 0);
field_0x44.move(1.0f, count);
}
private:
/* 0x00 */ JAISoundHandle mMainBgmHandle;
@@ -84,7 +104,7 @@ private:
/* 0x84 */ Z2SoundFader field_0x84;
/* 0x94 */ Z2SoundFader field_0x94;
/* 0xA4 */ Z2SoundFader field_0xa4;
/* 0xB4 */ float mTwilightGateVolume;
/* 0xB4 */ f32 mTwilightGateVol;
/* 0xB8 */ u16 field_0xb8;
/* 0xBA */ u8 field_0xba;
/* 0xBB */ u8 field_0xbb;
@@ -97,8 +117,8 @@ private:
/* 0xC2 */ u8 field_0xc2;
/* 0xC3 */ u8 field_0xc3;
/* 0xC4 */ u8 field_0xc4;
/* 0xC8 */ float field_0xc8;
/* 0xCC */ float field_0xcc;
/* 0xC8 */ f32 field_0xc8;
/* 0xCC */ f32 field_0xcc;
/* 0xD0 */ u8 mFlags;
}; // Size = 0xD4
+48
View File
@@ -3,4 +3,52 @@
#include "dolphin/types.h"
struct JAISeq {};
struct JAISound {};
struct JAIStream {};
struct JAISe {};
struct JAISoundID {};
struct JAISoundInfo {
virtual void getSoundType(JAISoundID) const = 0;
virtual void getCategory(JAISoundID) const = 0;
virtual void getPriority(JAISoundID) const = 0;
virtual void getSeInfo(JAISoundID, JAISe*) const = 0;
virtual void getSeqInfo(JAISoundID, JAISeq*) const = 0;
virtual void getStreamInfo(JAISoundID, JAIStream*) const = 0;
virtual ~JAISoundInfo();
};
struct JAUSoundInfo {
virtual void getAudibleSw(JAISoundID) const = 0;
virtual void getBgmSeqResourceID(JAISoundID) const = 0;
};
struct JAIStreamDataMgr {
virtual void getStreamFileEntry(JAISoundID) = 0;
virtual ~JAIStreamDataMgr();
};
struct Z2SoundInfo /* : public JAISoundInfo, public JAUSoundInfo, public JAIStreamDataMgr */ {
/* 802BB00C */ void getBgmSeqResourceID(JAISoundID) const;
/* 802BB158 */ void getAudibleSwFull(JAISoundID);
/* 802BB448 */ void getAudibleSw(JAISoundID) const;
/* 802BBA10 */ void getStreamFilePath(JAISoundID);
/* 802BBA88 */ void getStreamFileEntry(JAISoundID);
/* 802BBAC8 */ void getSwBit(JAISoundID) const;
/* 802BBB48 */ void getSoundInfo_(JAISoundID, JAISound*) const;
/* 802BB090 */ void getSoundType(JAISoundID) const;
/* 802BB0D8 */ void getCategory(JAISoundID) const;
/* 802BB0E0 */ void getPriority(JAISoundID) const;
/* 802BB6DC */ void getSeInfo(JAISoundID, JAISe*) const;
/* 802BB8B4 */ void getSeqInfo(JAISoundID, JAISeq*) const;
/* 802BB8E0 */ void getStreamInfo(JAISoundID, JAIStream*) const;
/* 802BBBE0 */ virtual ~Z2SoundInfo();
};
#endif /* Z2SOUNDINFO_H */
+33
View File
@@ -1,6 +1,39 @@
#ifndef Z2SOUNDMGR_H
#define Z2SOUNDMGR_H
#include "JSystem/JAudio2/JAISeMgr.h"
#include "JSystem/JAudio2/JAISeqMgr.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JAIStreamMgr.h"
#include "dolphin/types.h"
class Z2SoundMgr {
public:
/* 802A9E80 */ Z2SoundMgr();
/* 802AA1B0 */ void calc();
/* 802AA270 */ void setIIR(JAISound*, s16 const*);
/* 802AA33C */ void setFilterOff(JAISound*);
/* 802AA430 */ void resetFilterAll();
/* 802AA528 */ void mixOut();
/* 802AA67C */ void framework();
/* 802AA6B0 */ void pauseAllGameSound(bool);
/* 802AA7DC */ void stopSoundID(JAISoundID);
/* 802AA84C */ void stopSync();
/* 802AA8C8 */ void stop();
/* 802AA908 */ void initParams();
/* 802AA9E8 */ void multiVolumeSoundID(JAISoundID, f32);
/* 802AAAC4 */ void isPlayingSoundID(JAISoundID);
/* 802A9EE8 */ /* virtual */ void startSound(JAISoundID, JAISoundHandle*,
JGeometry::TVec3<f32> const*);
/* 0x000 */ void* vtable; // remove later
private:
/* 0x004 */ JAISeMgr mSeMgr;
/* 0x728 */ JAISeqMgr mSeqMgr;
/* 0x79C */ JAIStreamMgr mStreamMgr;
/* 0x80C */ JAISoundID field_0x80c;
}; // Size: 0x810
STATIC_ASSERT(sizeof(Z2SoundMgr) == 0x810);
#endif /* Z2SOUNDMGR_H */
+4 -6
View File
@@ -18,7 +18,6 @@ public:
bool isAlive() const { return mIsInitialized; }
virtual void temp(); // temp to build OK, remove later
virtual void framework(u32, s8);
virtual void dispose();
virtual bool stopOK(Z2SoundHandlePool& pool);
@@ -26,7 +25,6 @@ public:
virtual void startSound(JAISoundID, u32, s8);
virtual void startLevelSound(JAISoundID, u32, s8);
// Z2SoundObjBase_vtable* vtable;
/* 0x14 */ Z2SoundStarter* mSoundStarter;
/* 0x18 */ Vec* mSoundPos;
/* 0x1C */ u16 field_0x1c;
@@ -34,9 +32,10 @@ public:
/* 0x1F */ bool mIsInitialized;
};
class Z2SoundObjSimple : protected Z2SoundObjBase {
class Z2SoundObjSimple : public Z2SoundObjBase {
public:
Z2SoundObjSimple();
~Z2SoundObjSimple();
virtual void temp(); // temp to build OK, remove later
virtual void init(Vec* pSoundPos, u8 pNumHandles);
@@ -44,7 +43,7 @@ public:
virtual void startLevelSound(JAISoundID, u32, s8);
};
class Z2SoundObjAnime : protected Z2SoundObjBase {
class Z2SoundObjAnime : public Z2SoundObjBase {
public:
/* 802BEB94 */ Z2SoundObjAnime();
/* 802BEBFC */ void initAnime(void*, bool, f32, f32);
@@ -58,7 +57,6 @@ public:
/* 802BF898 */ void playsSound(JAUSoundAnimationSound const*, JGeometry::TVec3<f32> const&,
f32);
virtual void temp(); // temp to build OK, remove later
/* 802BEBDC */ virtual void init(Vec*, u8);
/* 0x20 */ void* field_0x20; // JAUSoundAnimation*
@@ -73,7 +71,7 @@ public:
/* 0x44 */ bool field_0x44;
};
class Z2DopplerSoundObjBase : protected Z2SoundHandles {
class Z2DopplerSoundObjBase : public Z2SoundHandles {
Z2DopplerSoundObjBase();
~Z2DopplerSoundObjBase();
+6 -13
View File
@@ -4,26 +4,19 @@
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
struct Z2SoundStarter_vtable {
void* field_0x0;
void* field_0x4;
void* dtor;
void* startSound1;
void* startSound2;
struct JAISoundStarter {
virtual ~JAISoundStarter();
};
struct Z2SoundStarter {
// Z2SoundStarter_vtable* vtable;
struct Z2SoundStarter : public JAISoundStarter {
Z2SoundStarter(bool);
virtual ~Z2SoundStarter();
void setPortData(JAISoundHandle*, u32, u16, s8);
void getPortData(JAISoundHandle*, u32, s8);
virtual ~Z2SoundStarter();
virtual void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
virtual void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*, u32, float,
float, float, float, float, u32);
void setPortData(JAISoundHandle*, u32, u16, s8);
void getPortData(JAISoundHandle*, u32, s8);
};
#endif /* Z2SOUNDSTARTER_H */
+42
View File
@@ -1,6 +1,48 @@
#ifndef Z2SPEECHMGR2_H
#define Z2SPEECHMGR2_H
#include "JSystem/JAudio2/JAISoundHandles.h"
#include "JSystem/JMath/random.h"
#include "Z2AudioLib/Z2SoundStarter.h"
#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
struct Z2SpeechStarter : public Z2SoundStarter {
/* 802CCFB8 */ Z2SpeechStarter();
/* 802CBCEC */ virtual ~Z2SpeechStarter();
/* 802CCFF8 */ virtual void startSound(JAISoundID, JAISoundHandle*,
JGeometry::TVec3<f32> const*, u32, f32, f32, f32, f32,
f32, u32);
};
struct Z2SpeechMgr2 {
/* 802CBC60 */ Z2SpeechMgr2();
/* 802CBD88 */ void setString(u16 const*, s16, u8, u16);
/* 802CBF60 */ void setTextCount(s16);
/* 802CC190 */ void speakOneWord(bool);
/* 802CC2FC */ void isNonVerbal();
/* 802CC4C0 */ void selectUnit(bool);
/* 802CC738 */ void selectTail();
/* 802CC9D0 */ void framework();
/* 802CCA18 */ void playOneShotVoice(u8, u16, Vec*, s8);
/* 802CCF88 */ void isMidnaSpeak();
/* 0x000 */ JAISoundHandle field_0x0;
/* 0x004 */ JAISoundHandle field_0x4;
/* 0x008 */ JMath::TRandom_fast_ random;
/* 0x00C */ Z2SpeechStarter mSpeech;
/* 0x010 */ u16 field_0x10[500];
/* 0x3F8 */ u16 field_0x3f8;
/* 0x3FA */ u16 field_0x3fa;
/* 0x3FC */ u16 field_0x3fc;
/* 0x3FE */ u8 field_0x3fe;
/* 0x3FF */ u8 field_0x3ff;
/* 0x400 */ u8 field_0x400;
/* 0x401 */ u8 field_0x401;
/* 0x402 */ u8 field_0x402[64];
}; // Size: 0x444
STATIC_ASSERT(sizeof(Z2SpeechMgr2) == 0x444);
#endif /* Z2SPEECHMGR2_H */
-1
View File
@@ -2349,7 +2349,6 @@ private:
/* 0x02C48 */ Mtx field_0x2c48;
/* 0x02C78 */ Mtx field_0x2c78;
/* 0x02CA8 */ Z2CreatureLink mZ2Link;
/* 0x02D75 */ u8 field_0x2d75[3]; // padding?
/* 0x02D78 */ void* field_0x2d78;
/* 0x02D7C */ daPy_frameCtrl_c* field_0x2d7c;
/* 0x02D80 */ int field_0x2d80;
+19 -11
View File
@@ -1,26 +1,34 @@
#ifndef M_DO_M_DO_AUDIO_H
#define M_DO_M_DO_AUDIO_H
#include "Z2AudioLib/Z2AudioMgr.h"
#include "dolphin/types.h"
// move/fix later
template <typename T>
class JASGlobalInstance {
public:
JASGlobalInstance(bool param_0) {
if (param_0) {
sInstance = this;
}
};
~JASGlobalInstance() {
if (sInstance == this) {
sInstance = NULL;
}
};
T* getInstance() { return sInstance; };
static T* sInstance;
};
extern bool struct_80450BB8; // sInitFlag
extern bool sResetFlag;
class mDoAud_zelAudio_c {
public:
void reset();
~mDoAud_zelAudio_c() {}
static void onInitFlag() { struct_80450BB8 = true; }
static bool isResetFlag() { return sResetFlag; }
static void onResetFlag() { sResetFlag = true; }
static void offResetFlag() { sResetFlag = false; }
Z2AudioMgr mAudioMgr;
};
extern JKRSolidHeap* g_mDoAud_audioHeap;
#endif /* M_DO_M_DO_AUDIO_H */