Skip to content

Commit

Permalink
VoiceManager
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Nov 5, 2024
1 parent 576e476 commit 54ec310
Show file tree
Hide file tree
Showing 8 changed files with 1,409 additions and 43 deletions.
2 changes: 2 additions & 0 deletions config/SOUE01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,8 @@ nw4r/snd/snd_Voice.cpp:

nw4r/snd/snd_VoiceManager.cpp:
.text start:0x80484040 end:0x804846F4
.sbss start:0x805766E0 end:0x805766E8
.bss start:0x80673A80 end:0x80673AA8

nw4r/snd/snd_Util.cpp:
.text start:0x80484700 end:0x80484BD4
Expand Down
4 changes: 2 additions & 2 deletions config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40962,7 +40962,7 @@ sMaxVoices__Q34nw4r3snd11SoundSystem = .sbss:0x805766BC; // type:object size:0x4
lbl_805766C8 = .sbss:0x805766C8; // type:object size:0x8 data:byte
lbl_805766D0 = .sbss:0x805766D0; // type:object size:0x8 data:4byte
@GUARD@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .sbss:0x805766D8; // type:object size:0x8 data:byte
lbl_805766E0 = .sbss:0x805766E0; // type:object size:0x8 data:byte
@GUARD@GetInstance__Q44nw4r3snd6detail12VoiceManagerFv@instance = .sbss:0x805766E0; // type:object size:0x1 data:byte
lbl_805766E8 = .sbss:0x805766E8; // type:object size:0x8 data:4byte
typeInfo__Q34nw4r3lyt4Pane = .sbss:0x805766F0; // type:object size:0x4 data:4byte
mspAllocator__Q34nw4r3lyt6Layout = .sbss:0x805766F8; // type:object size:0x4 data:4byte
Expand Down Expand Up @@ -49444,7 +49444,7 @@ lbl_80673A20 = .bss:0x80673A20; // type:object size:0x18
lbl_80673A38 = .bss:0x80673A38; // type:object size:0xC
@LOCAL@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .bss:0x80673A44; // type:object size:0x3C
lbl_80673A80 = .bss:0x80673A80; // type:object size:0xC
lbl_80673A8C = .bss:0x80673A8C; // type:object size:0x1C data:byte
@LOCAL@GetInstance__Q44nw4r3snd6detail12VoiceManagerFv@instance = .bss:0x80673A8C; // type:object size:0x1C data:byte
@LOCAL@SetSize__Q44nw4r3lyt6detail11TexCoordAryFUc@texCoords = .bss:0x80673AA8; // type:object size:0x20 scope:local data:float
sArchiveList__Q23EGG7Archive = .bss:0x80673AC8; // type:object size:0xC
sDvdList__Q23EGG7DvdFile = .bss:0x80673AD8; // type:object size:0xC
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ def nw4rLib(lib_name, objects, extra_cflags=[]):
Object(Matching, "nw4r/snd/snd_TaskManager.cpp"),
Object(Matching, "nw4r/snd/snd_TaskThread.cpp"),
Object(NonMatching, "nw4r/snd/snd_Voice.cpp"),
Object(NonMatching, "nw4r/snd/snd_VoiceManager.cpp"),
Object(Matching, "nw4r/snd/snd_VoiceManager.cpp"),
Object(Matching, "nw4r/snd/snd_Util.cpp"),
Object(NonMatching, "nw4r/snd/snd_WaveArchive.cpp"),
Object(NonMatching, "nw4r/snd/snd_WaveFile.cpp"),
Expand Down
4 changes: 2 additions & 2 deletions include/nw4r/snd/snd_AxVoice.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class AxVoice {

enum Format {
FORMAT_ADPCM = 0,
FORMAT_PCM16 = 10,
FORMAT_PCM8 = 25,
FORMAT_PCM16 = 1,
FORMAT_PCM8 = 2,
};

enum VoiceType {
Expand Down
71 changes: 34 additions & 37 deletions include/nw4r/snd/snd_Voice.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "nw4r/ut.h" // IWYU pragma: export
#include "rvl/WPAD.h" // IWYU pragma: export


namespace nw4r {
namespace snd {

Expand Down Expand Up @@ -117,8 +116,6 @@ class Voice : public DisposeCallback {
void SetFxSend(AuxBus bus, f32 send);

void SetRemoteOutVolume(int remote, f32 volume);
void SetRemoteSend(int remote, f32 send);
void SetRemoteFxSend(int remote, f32 send);

void SetPriority(int priority);
void UpdateVoicesPriority();
Expand Down Expand Up @@ -156,42 +153,42 @@ class Voice : public DisposeCallback {

private:
AxVoice *mAxVoice[CHANNEL_MAX][VOICES_MAX]; // at 0xC
SoundParam mVoiceOutParam[VOICES_MAX]; // at 0x2C
int mChannelCount; // at 0x9C
int mVoiceOutCount; // at 0xA0

VoiceCallback mCallback; // at 0xA4
void *mCallbackArg; // at 0xA8

bool mIsActive; // at 0xAC
bool mIsStarting; // at 0xAD
bool mIsStarted; // at 0xAE
bool mIsPause; // at 0xAF
bool mIsPausing; // at 0xB0

u8 mSyncFlag; // at 0xB1
u8 mRemoteFilter; // at 0xB2
u8 mBiquadType; // at 0xB3
int mPriority; // at 0xB4
f32 mPan; // at 0xB8
f32 mSurroundPan; // at 0xBC
f32 mLpfFreq; // at 0xC0
int mOutputLineFlag; // at 0xC4
f32 mMainOutVolume; // at 0xC8
f32 mMainSend; // at 0xCC
f32 mFxSend[AUX_BUS_NUM]; // at 0xD0
f32 mRemoteOutVolume[WPAD_MAX_CONTROLLERS]; // at 0xDC
f32 mRemoteSend[WPAD_MAX_CONTROLLERS]; // at 0xEC
f32 mRemoteFxSend[WPAD_MAX_CONTROLLERS]; // at 0xFC
f32 mPitch; // at 0x10C
f32 mVolume; // at 0x110
f32 mVeInitVolume; // at 0x114
f32 mVeTargetVolume; // at 0x118
PanMode mPanMode; // at 0x11C
PanCurve mPanCurve; // at 0x120
VoiceOutParam mVoiceOutParam[VOICES_MAX]; // at 0x2C
int mChannelCount; // at 0x8C
int mVoiceOutCount; // at 0x90

VoiceCallback mCallback; // at 0x94
void *mCallbackData; // at 0x98

bool mActiveFlag; // at 0x9C
bool mStartFlag; // at 0x9D
bool mStartedFlag; // at 0x9E
bool mPauseFlag; // at 0x9F
bool mPausingFlag; // at 0xA0

u8 mVoiceOutParamPitchDisableFlag; // at 0xA1
u16 mSyncFlag; // at 0xA2
u8 mRemoteFilter; // at 0xA4
u8 mBiquadType; // at 0xA5
int mPriority; // at 0xA8
f32 mPan; // at 0xAC
f32 mSurroundPan; // at 0xB0
f32 mLpfFreq; // at 0xB4
f32 mBiquadValue; // at 0xB8
int mOutputLineFlag; // at 0xBC
f32 mMainOutVolume; // at 0xC0
f32 mMainSend; // at 0xC4
f32 mFxSend[AUX_BUS_NUM]; // at 0xC8
f32 mRemoteOutVolume[WPAD_MAX_CONTROLLERS]; // at 0xD4
f32 mPitch; // at 0xE4
f32 mVolume; // at 0xE8
f32 mVeInitVolume; // at 0xEC
f32 mVeTargetVolume; // at 0xF0
PanMode mPanMode; // at 0xF4
PanCurve mPanCurve; // at 0xF8

public:
NW4R_UT_LIST_NODE_DECL(); // at 0x124
NW4R_UT_LIST_NODE_DECL(); // at 0xFC
};

NW4R_UT_LIST_TYPEDEF_DECL(Voice);
Expand Down
1 change: 0 additions & 1 deletion include/nw4r/snd/snd_VoiceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "nw4r/snd/snd_Voice.h"
#include "nw4r/types_nw4r.h"


namespace nw4r {
namespace snd {
namespace detail {
Expand Down
Loading

0 comments on commit 54ec310

Please sign in to comment.