mirror of
https://github.com/zeldaret/ss
synced 2026-05-31 17:32:02 -04:00
Misc progress
This commit is contained in:
@@ -3002,6 +3002,9 @@ nw4r/snd/snd_SeqFile.cpp:
|
||||
|
||||
nw4r/snd/snd_SeqPlayer.cpp:
|
||||
.text start:0x80471020 end:0x804727F8 align:16
|
||||
.data start:0x8056E024 end:0x8056E088
|
||||
.sdata2 start:0x8057F068 end:0x8057F080
|
||||
.bss start:0x806596E8 end:0x80659708
|
||||
|
||||
nw4r/snd/snd_SeqSound.cpp:
|
||||
.text start:0x80472800 end:0x8047316C align:16
|
||||
|
||||
@@ -25155,8 +25155,7 @@ SetRemoteFilter__Q44nw4r3snd6detail10BasicSoundFi = .text:0x8046A0A0; // type:fu
|
||||
SetPanMode__Q44nw4r3snd6detail10BasicSoundFQ34nw4r3snd7PanMode = .text:0x8046A0E0; // type:function size:0x3C
|
||||
SetPanCurve__Q44nw4r3snd6detail10BasicSoundFQ34nw4r3snd8PanCurve = .text:0x8046A120; // type:function size:0x3C
|
||||
SetAmbientInfo__Q44nw4r3snd6detail10BasicSoundFRCQ54nw4r3snd6detail10BasicSound11AmbientInfo = .text:0x8046A160; // type:function size:0xC4
|
||||
GetAmbientPriority__Q44nw4r3snd6detail10BasicSoundFRCQ54nw4r3snd6detail10BasicSound11AmbientInfoUl = .text:0x8046A230; // type:function size:0x34
|
||||
fn_8046A264 = .text:0x8046A264; // type:function size:0x4
|
||||
GetAmbientPriority__Q44nw4r3snd6detail10BasicSoundFRCQ54nw4r3snd6detail10BasicSound11AmbientInfoUl = .text:0x8046A230; // type:function size:0x38
|
||||
IsAttachedGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A270; // type:function size:0x14
|
||||
IsAttachedTempGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A290; // type:function size:0x14
|
||||
DetachGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A2B0; // type:function size:0x8
|
||||
|
||||
@@ -308,6 +308,7 @@ namespace nw4r { namespace snd { namespace detail
|
||||
ExternalSoundPlayer *mExtSoundPlayer; // size 0x04, offset 0x18
|
||||
AmbientInfo mAmbientInfo; // size 0x14, offset 0x1c
|
||||
SoundParam mAmbientParam; // size 0x24, offset 0x30
|
||||
UNKWORD field_0x54;
|
||||
SoundActorParam mActorParam; // size 0x0c, offset 0x54
|
||||
MoveValue<f32, int> mFadeVolume; // size 0x10, offset 0x60
|
||||
MoveValue<f32, int> mPauseFadeVolume; // size 0x10, offset 0x70
|
||||
@@ -336,8 +337,7 @@ namespace nw4r { namespace snd { namespace detail
|
||||
f32 mMainOutVolume; // size 0x04, offset 0xc8
|
||||
f32 mMainSend; // size 0x04, offset 0xcc
|
||||
f32 mFxSend[AUX_BUS_NUM]; // size 0x0c, offset 0xd0
|
||||
// NOTE: Name is not from DWARF; derived from usage and other nearby names
|
||||
u32 mPauseNestCounter; // size 0x04, offset 0xdc
|
||||
f32 mRemoteOutVolume[4]; // size 0x10, offset 0xdc
|
||||
public:
|
||||
ut::LinkListNode mPriorityLink; // size 0x08, offset 0xe0
|
||||
ut::LinkListNode mSoundPlayerPlayLink; // size 0x08, offset 0xe8
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace nw4r { namespace snd { namespace detail
|
||||
ChannelCallbackStatus status,
|
||||
u32 userData);
|
||||
|
||||
typedef ut::LinkList<Channel, 0xc8> LinkList;
|
||||
typedef ut::LinkList<Channel, 0xd8> LinkList;
|
||||
|
||||
// methods
|
||||
public:
|
||||
@@ -208,6 +208,7 @@ namespace nw4r { namespace snd { namespace detail
|
||||
f32 mMainOutVolume; // size 0x04, offset 0x5c
|
||||
f32 mMainSend; // size 0x04, offset 0x60
|
||||
f32 mFxSend[AUX_BUS_NUM]; // size 0x0c, offset 0x64
|
||||
f32 mRemoteOutVolume[4];
|
||||
f32 mUserPitch; // size 0x04, offset 0x70
|
||||
f32 mSweepPitch; // size 0x04, offset 0x74
|
||||
s32 mSweepCounter; // size 0x04, offset 0x78
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace nw4r { namespace snd
|
||||
f32 GetFxSend(int index) const { return mFxSend[index]; }
|
||||
|
||||
void SetPlayableSoundCount(int count);
|
||||
f32 GetRemoteOutVolume(int remote) const;
|
||||
|
||||
int GetPlayingSoundCount() const { return mSoundList.GetSize(); }
|
||||
detail::BasicSound *GetLowestPrioritySound()
|
||||
|
||||
@@ -92,6 +92,7 @@ namespace nw4r { namespace snd { namespace detail
|
||||
void SetMainOutVolume(f32 volume);
|
||||
void SetMainSend(f32 send);
|
||||
void SetFxSend(AuxBus bus, f32 send);
|
||||
void SetRemoteOutVolume(int remote, f32 volume);
|
||||
void SetPitch(f32 pitch);
|
||||
void SetVolume(f32 volume);
|
||||
void SetVeVolume(f32 targetVolume, f32 initVolume);
|
||||
|
||||
@@ -921,10 +921,10 @@ void AxVoiceParamBlock::Sync()
|
||||
mVpb->pb.ve.currentDelta =
|
||||
-mPrevVeSetting.currentVolume / AX_SAMPLES_PER_FRAME;
|
||||
}
|
||||
else if (nextVolume > 32767)
|
||||
else if (nextVolume > 65535)
|
||||
{
|
||||
mVpb->pb.ve.currentDelta =
|
||||
(32767 - mPrevVeSetting.currentVolume) / AX_SAMPLES_PER_FRAME;
|
||||
(65535 - mPrevVeSetting.currentVolume) / AX_SAMPLES_PER_FRAME;
|
||||
}
|
||||
|
||||
if (mVpb->pb.ve.currentDelta == 0 && mPrevVeSetting.currentDelta == 0)
|
||||
|
||||
@@ -54,10 +54,11 @@ BasicSound::BasicSound(int priority, int ambientPriority) :
|
||||
mGeneralHandle (nullptr),
|
||||
mTempGeneralHandle (nullptr),
|
||||
mSoundPlayer (nullptr),
|
||||
field_0x54 (0),
|
||||
mSoundActor (nullptr),
|
||||
mExtSoundPlayer (nullptr),
|
||||
mId (INVALID_ID),
|
||||
mPauseNestCounter (0)
|
||||
mId (INVALID_ID)
|
||||
// mPauseNestCounter (0)
|
||||
{
|
||||
// specifically not the source variant
|
||||
NW4RAssertHeaderClampedLRValue_Line(53, priority, PRIORITY_MIN,
|
||||
@@ -108,6 +109,9 @@ void BasicSound::InitParam()
|
||||
for (int i = 0; i < AUX_BUS_NUM; i++)
|
||||
mFxSend[i] = 0.0f;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
mRemoteOutVolume[i] = 1.0f;
|
||||
|
||||
mAmbientParam.volume = 1.0f;
|
||||
mAmbientParam.pitch = 1.0f;
|
||||
mAmbientParam.pan = 0.0f;
|
||||
@@ -118,7 +122,7 @@ void BasicSound::InitParam()
|
||||
mAmbientParam.biquadFilterType = 0;
|
||||
mAmbientParam.priority = 0;
|
||||
|
||||
mPauseNestCounter = 0;
|
||||
// mPauseNestCounter = 0;
|
||||
}
|
||||
|
||||
void BasicSound::StartPrepared()
|
||||
@@ -155,7 +159,7 @@ void BasicSound::Pause(bool flag, int fadeFrames)
|
||||
|
||||
if (flag)
|
||||
{
|
||||
mPauseNestCounter++;
|
||||
// mPauseNestCounter++;
|
||||
|
||||
switch (mPauseState)
|
||||
{
|
||||
@@ -183,8 +187,8 @@ void BasicSound::Pause(bool flag, int fadeFrames)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mPauseNestCounter && --mPauseNestCounter)
|
||||
return;
|
||||
// if (mPauseNestCounter && --mPauseNestCounter)
|
||||
// return;
|
||||
|
||||
switch (mPauseState)
|
||||
{
|
||||
@@ -410,6 +414,13 @@ void BasicSound::UpdateParam()
|
||||
mainOutVolume *= mMainOutVolume;
|
||||
mainOutVolume *= GetSoundPlayer()->GetMainOutVolume();
|
||||
|
||||
f32 remoteOutVolume[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
remoteOutVolume[i] = 1.0f;
|
||||
remoteOutVolume[i] *= GetSoundPlayer()->GetRemoteOutVolume(i);
|
||||
remoteOutVolume[i] *= mRemoteOutVolume[i];
|
||||
}
|
||||
|
||||
f32 mainSend = 0.0f;
|
||||
mainSend += mMainSend;
|
||||
mainSend += GetSoundPlayer()->GetMainSend();
|
||||
@@ -434,6 +445,10 @@ void BasicSound::UpdateParam()
|
||||
basicPlayer.SetOutputLine(outputLineFlag);
|
||||
basicPlayer.SetMainOutVolume(mainOutVolume);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
basicPlayer.SetRemoteOutVolume(i, remoteOutVolume[i]);
|
||||
}
|
||||
|
||||
basicPlayer.SetMainSend(mainSend);
|
||||
|
||||
for (int i = 0; i < AUX_BUS_NUM; i++)
|
||||
@@ -569,15 +584,21 @@ void BasicSound::SetPlayerPriority(int priority)
|
||||
void BasicSound::SetInitialVolume(f32 volume)
|
||||
{
|
||||
NW4RAssert_Line(818, volume >= 0.0f);
|
||||
if (volume < 0.0f) {
|
||||
volume = 0.0f;
|
||||
}
|
||||
|
||||
mInitVolume = ut::Clamp(volume, 0.0f, 1.0f);
|
||||
mInitVolume = mInitVolume = volume;
|
||||
}
|
||||
|
||||
void BasicSound::SetVolume(f32 volume, int frames)
|
||||
{
|
||||
NW4RAssert_Line(833, volume >= 0.0f);
|
||||
if (volume < 0.0f) {
|
||||
volume = 0.0f;
|
||||
}
|
||||
|
||||
mExtMoveVolume.SetTarget(ut::Clamp(volume, 0.0f, 1.0f), frames);
|
||||
mExtMoveVolume.SetTarget(volume, frames);
|
||||
}
|
||||
|
||||
void BasicSound::SetPitch(f32 pitch)
|
||||
|
||||
@@ -150,6 +150,9 @@ void Channel::InitParam(Callback *callback, u32 callbackData)
|
||||
for (int i = 0; i < AUX_BUS_NUM; i++)
|
||||
mFxSend[i] = 0.0f;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
mRemoteOutVolume[i] = 1.0f;
|
||||
|
||||
mSilenceVolume.InitValue(SILENCE_VOLUME_MAX);
|
||||
|
||||
mSweepPitch = 0.0f;
|
||||
@@ -244,6 +247,12 @@ void Channel::Update(bool doPeriodicProc)
|
||||
|
||||
f32 mainSend = 0.0f;
|
||||
mainSend += mMainSend;
|
||||
|
||||
f32 remoteOutVolume[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
remoteOutVolume[i] = 1.0f;
|
||||
remoteOutVolume[i] *= mRemoteOutVolume[i];
|
||||
}
|
||||
|
||||
f32 fxSend[AUX_BUS_NUM];
|
||||
for (int i = 0; i < AUX_BUS_NUM; i++)
|
||||
@@ -285,6 +294,10 @@ void Channel::Update(bool doPeriodicProc)
|
||||
mVoice->SetMainOutVolume(mainOutVolume);
|
||||
mVoice->SetMainSend(mainSend);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mVoice->SetRemoteOutVolume(i, remoteOutVolume[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < AUX_BUS_NUM; i++)
|
||||
mVoice->SetFxSend(static_cast<AuxBus>(i), fxSend[i]);
|
||||
}
|
||||
|
||||
@@ -238,8 +238,10 @@ void SeqPlayer::Skip(OffsetType offsetType, int offset)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// SeqPlayer::SetTempoRatio ([R89JEL]:/bin/RVL/Debug/mainD.MAP:13781)
|
||||
DECOMP_FORCE(NW4RAssert_String(tempoRatio >= 0.0f));
|
||||
#endif
|
||||
|
||||
void SeqPlayer::SetTempoRatio(f32 tempo) {
|
||||
mTempoRatio = tempo;
|
||||
@@ -284,6 +286,7 @@ void SeqPlayer::CallSeqUserprocCallback(u16 procId, SeqTrack *track)
|
||||
trackParam.cmpFlag = param.cmpFlag;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// SeqPlayer::GetLocalVariable? maybe all of them?
|
||||
DECOMP_FORCE(NW4RAssertHeaderClampedLValue_String(varNo));
|
||||
|
||||
@@ -321,6 +324,7 @@ DECOMP_FORCE(&SeqTrack::SetModDepth);
|
||||
|
||||
// SeqPlayer::SetTrackModSpeed ([R89JEL]:/bin/RVL/Debug/mainD.MAP:13801)
|
||||
DECOMP_FORCE(&SeqTrack::SetModSpeed);
|
||||
#endif
|
||||
|
||||
void SeqPlayer::InvalidateData(void const *start, void const *end)
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ void *SoundThread::SoundThreadFunc(void *arg)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if 0
|
||||
/* SoundThread::RegisterSoundFrameCallback
|
||||
* ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14509)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user