diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index b5d17241..aa953c96 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25381,14 +25381,14 @@ ChannelCallback__Q44nw4r3snd6detail9SeqPlayerFPQ44nw4r3snd6detail7Channel = .tex @180@__dt__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x804727E0; // type:function size:0x8 scope:weak @192@__dt__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x804727F0; // type:function size:0x8 scope:weak __ct__Q44nw4r3snd6detail8SeqSoundFPQ44nw4r3snd6detail49SoundInstanceManagerii = .text:0x80472800; // type:function size:0x9C -__dt__Q54nw4r3snd6detail8SeqSound11SeqLoadTaskFv = .text:0x804728A0; // type:function size:0x58 +__dt__Q54nw4r3snd6detail8SeqSound11SeqLoadTaskFv = .text:0x804728A0; // type:function size:0x58 scope:weak InitParam__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80472900; // type:function size:0x34 Setup__Q44nw4r3snd6detail8SeqSoundFPQ44nw4r3snd6detail17SeqTrackAllocatorUlPQ44nw4r3snd6detail14NoteOnCallback = .text:0x80472940; // type:function size:0x7C Prepare__Q44nw4r3snd6detail8SeqSoundFPCvlQ54nw4r3snd6detail9SeqPlayer10OffsetTypei = .text:0x804729C0; // type:function size:0x68 Prepare__Q44nw4r3snd6detail8SeqSoundFPQ34nw4r2ut10FileStreamlQ54nw4r3snd6detail9SeqPlayer10OffsetTypei = .text:0x80472A30; // type:function size:0xF4 NotifyLoadAsyncEndSeqData__Q44nw4r3snd6detail8SeqSoundFbPCvPv = .text:0x80472B30; // type:function size:0x74 Shutdown__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80472BB0; // type:function size:0xDC -__dt__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80472C90; // type:function size:0x6C +__dt__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80472C90; // type:function size:0x6C scope:weak SetTempoRatio__Q44nw4r3snd6detail8SeqSoundFf = .text:0x80472D00; // type:function size:0x8 SetChannelPriority__Q44nw4r3snd6detail8SeqSoundFi = .text:0x80472D10; // type:function size:0x8 SetReleasePriorityFix__Q44nw4r3snd6detail8SeqSoundFb = .text:0x80472D20; // type:function size:0x8 @@ -25399,17 +25399,17 @@ SetTrackSilence__Q44nw4r3snd6detail8SeqSoundFUlbi = .text:0x80472E40; // type:fu SetTrackVolume__Q44nw4r3snd6detail8SeqSoundFUlf = .text:0x80472E50; // type:function size:0x8 ReadVariable__Q44nw4r3snd6detail8SeqSoundCFiPs = .text:0x80472E60; // type:function size:0x50 WriteVariable__Q44nw4r3snd6detail8SeqSoundFis = .text:0x80472EB0; // type:function size:0x2C -FUN_80472ee0 = .text:0x80472EE0; // type:function size:0x28 -WriteTrackVariable__Q44nw4r3snd6detail8SeqSoundFis = .text:0x80472F10; // type:function size:0x5C +WriteGlobalVariable__Q44nw4r3snd6detail8SeqSoundFis = .text:0x80472EE0; // type:function size:0x28 +WriteTrackVariable__Q44nw4r3snd6detail8SeqSoundFiis = .text:0x80472F10; // type:function size:0x5C GetTick__Q44nw4r3snd6detail8SeqSoundCFv = .text:0x80472F70; // type:function size:0x1C IsAttachedTempSpecialHandle__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80472F90; // type:function size:0x14 DetachTempSpecialHandle__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80472FB0; // type:function size:0x8 Execute__Q54nw4r3snd6detail8SeqSound11SeqLoadTaskFv = .text:0x80472FC0; // type:function size:0xF8 Cancel__Q54nw4r3snd6detail8SeqSound11SeqLoadTaskFv = .text:0x804730C0; // type:function size:0x24 OnCancel__Q54nw4r3snd6detail8SeqSound11SeqLoadTaskFv = .text:0x804730F0; // type:function size:0x2C -GetBasicPlayer__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80473120; // type:function size:0x8 -GetBasicPlayer__Q44nw4r3snd6detail8SeqSoundCFv = .text:0x80473130; // type:function size:0x8 -IsPrepared__Q44nw4r3snd6detail8SeqSoundCFv = .text:0x80473140; // type:function size:0x8 +GetBasicPlayer__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80473120; // type:function size:0x8 scope:weak +GetBasicPlayer__Q44nw4r3snd6detail8SeqSoundCFv = .text:0x80473130; // type:function size:0x8 scope:weak +IsPrepared__Q44nw4r3snd6detail8SeqSoundCFv = .text:0x80473140; // type:function size:0x8 scope:weak GetRuntimeTypeInfo__Q44nw4r3snd6detail8SeqSoundCFv = .text:0x80473150; // type:function size:0x8 scope:weak __sinit_\snd_SeqSound_cpp = .text:0x80473160; // type:function size:0xC scope:local __ct__Q34nw4r3snd14SeqSoundHandleFPQ34nw4r3snd11SoundHandle = .text:0x80473170; // type:function size:0xF4 @@ -38606,8 +38606,8 @@ __vt__Q44nw4r3snd6detail10PlayerHeap = .data:0x8056DFF0; // type:object size:0x1 @4096 = .data:0x8056E00C; // type:object size:0xC scope:local data:4byte @4111 = .data:0x8056E018; // type:object size:0xC scope:local data:4byte __vt__Q44nw4r3snd6detail9SeqPlayer = .data:0x8056E024; // type:object size:0x64 -lbl_8056E088 = .data:0x8056E088; // type:object size:0x38 -lbl_8056E0C0 = .data:0x8056E0C0; // type:object size:0x18 +__vt__Q44nw4r3snd6detail8SeqSound = .data:0x8056E088; // type:object size:0x38 +__vt__Q54nw4r3snd6detail8SeqSound11SeqLoadTask = .data:0x8056E0C0; // type:object size:0x18 __vt__Q44nw4r3snd6detail8SeqTrack = .data:0x8056E0D8; // type:object size:0x10 lbl_8056E0E8 = .data:0x8056E0E8; // type:object size:0x30 lbl_8056E118 = .data:0x8056E118; // type:object size:0x20 @@ -42430,7 +42430,7 @@ mPrintVarEnabledFlag__Q44nw4r3snd6detail9MmlParser = .sbss:0x80576690; // type:o lbl_80576698 = .sbss:0x80576698; // type:object size:0x4 data:4byte lbl_8057669C = .sbss:0x8057669C; // type:object size:0x1 data:byte @GUARD@GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv@instance = .sbss:0x805766A0; // type:object size:0x1 scope:weak data:byte -lbl_805766A8 = .sbss:0x805766A8; // type:object size:0x8 data:4byte +typeInfo__Q44nw4r3snd6detail8SeqSound = .sbss:0x805766A8; // type:object size:0x4 data:4byte @GUARD@detail_SortPriorityList__Q34nw4r3snd11SoundPlayerFv@tmplist = .sbss:0x805766B0; // type:object size:0x1 scope:weak data:byte sInitialized__Q34nw4r3snd29@unnamed@snd_SoundSystem_cpp@ = .sbss:0x805766B8; // type:object size:0x1 scope:local data:byte sMaxVoices__Q34nw4r3snd11SoundSystem = .sbss:0x805766BC; // type:object size:0x4 data:4byte diff --git a/configure.py b/configure.py index 3157afb0..1005d8ef 100644 --- a/configure.py +++ b/configure.py @@ -1049,7 +1049,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), Object(Matching, "nw4r/snd/snd_SeqFile.cpp"), Object(Matching, "nw4r/snd/snd_SeqPlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_SeqSound.cpp"), + Object(Matching, "nw4r/snd/snd_SeqSound.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SeqTrack.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DActor.cpp"), diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index 49d9b3a8..84a4d5e4 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -253,6 +253,7 @@ namespace nw4r { namespace snd { namespace detail void SetAutoStopCounter(int count); void FadeIn(int fadeFrames); + bool GetStartedFlag() const { return mStartedFlag; } u32 GetId() const { return mId; } PlayerHeap *GetPlayerHeap() { return mPlayerHeap; } SoundPlayer *GetSoundPlayer() { return mSoundPlayer; } diff --git a/include/nw4r/snd/snd_SeqPlayer.h b/include/nw4r/snd/snd_SeqPlayer.h index cb4c1a52..54b8e0ae 100644 --- a/include/nw4r/snd/snd_SeqPlayer.h +++ b/include/nw4r/snd/snd_SeqPlayer.h @@ -149,6 +149,10 @@ namespace nw4r { namespace snd { namespace detail return mParserParam.timebase * mParserParam.tempo * mTempoRatio; } + u32 GetTickCounter() const { + return mTickCounter; + } + void SetSeqData(void const *seqBase, s32 seqOffset); void CallSeqUserprocCallback(u16 procId, SeqTrack *track); diff --git a/include/nw4r/snd/snd_SeqSound.h b/include/nw4r/snd/snd_SeqSound.h index d700b34f..7079f9bc 100644 --- a/include/nw4r/snd/snd_SeqSound.h +++ b/include/nw4r/snd/snd_SeqSound.h @@ -121,6 +121,15 @@ namespace nw4r { namespace snd { namespace detail static void NotifyLoadAsyncEndSeqData(bool result, void const *seqBase, void *userData); + void SetTrackMute(u32 trackFlags, SeqMute mute); + void SetTrackSilence(u32 trackFlags, bool silence, int fadeFrames); + void SetTrackVolume(u32 trackFlags, f32 volume); + bool ReadVariable(int varNo, s16 *value) const; + bool WriteVariable(int varNo, s16 value); + static bool WriteGlobalVariable(int varNo, s16 value); + bool WriteTrackVariable(int trackNo, int varNo, s16 value); + u32 GetTick() const; + static DebugSoundType GetSoundType() { return DEBUG_SOUND_TYPE_SEQSOUND; diff --git a/src/nw4r/snd/snd_SeqSound.cpp b/src/nw4r/snd/snd_SeqSound.cpp index 9b68e1f5..ca752f8b 100644 --- a/src/nw4r/snd/snd_SeqSound.cpp +++ b/src/nw4r/snd/snd_SeqSound.cpp @@ -17,6 +17,7 @@ #include "nw4r/snd/snd_SeqFile.h" #include "nw4r/snd/snd_SeqPlayer.h" #include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SeqTrack.h" #include "nw4r/snd/snd_SoundInstanceManager.h" #include "nw4r/snd/snd_TaskManager.h" @@ -165,9 +166,10 @@ void SeqSound::Shutdown() BasicSound::Shutdown(); mManager->Free(this); } - +#if 0 // SeqSound::SetTempoRatio ([R89JEL]:/bin/RVL/Debug/mainD.MAP:13849) DECOMP_FORCE(NW4RAssert_String(tempoRatio >= 0.0f)); +#endif void SeqSound::SetTempoRatio(f32 tempo) { mSeqPlayer.SetTempoRatio(tempo); @@ -197,6 +199,60 @@ void SeqSound::OnUpdatePlayerPriority() mManager->UpdatePriority(this, CalcCurrentPlayerPriority()); } +void SeqSound::SetTrackMute(u32 trackFlags, SeqMute mute) +{ + mSeqPlayer.SetTrackMute(trackFlags, mute); +} + +void SeqSound::SetTrackSilence(u32 trackFlags, bool silence, int fadeFrames) +{ + mSeqPlayer.SetTrackSilence(trackFlags, silence, fadeFrames); +} + +void SeqSound::SetTrackVolume(u32 trackFlags, f32 volume) +{ + mSeqPlayer.SetTrackVolume(trackFlags, volume); +} + +bool SeqSound::ReadVariable(int varNo, s16 *value) const +{ + if (!GetStartedFlag()) { + *value = -1; + } else { + *value = mSeqPlayer.GetLocalVariable(varNo); + } + return true; +} + +bool SeqSound::WriteVariable(int varNo, s16 value) +{ + mSeqPlayer.SetLocalVariable(varNo, value); + return true; +} + +bool SeqSound::WriteGlobalVariable(int varNo, s16 value) +{ + SeqPlayer::SetGlobalVariable(varNo, value); + return true; +} + +bool SeqSound::WriteTrackVariable(int trackNo, int varNo, s16 value) +{ + SeqTrack *track = mSeqPlayer.GetPlayerTrack(trackNo); + if (track == NULL) + return false; + + track->SetTrackVariable(varNo, value); + return true; +} + +u32 SeqSound::GetTick() const +{ + return !GetStartedFlag() ? 0 : mSeqPlayer.GetTickCounter(); +} + + +#if 0 // SeqSound::SetTrackVolume ([R89JEL]:/bin/RVL/Debug/mainD.MAP:13857) DECOMP_FORCE(NW4RAssert_String(volume >= 0.0f)); @@ -211,7 +267,7 @@ DECOMP_FORCE(NW4RAssertHeaderClampedLValue_String(varNo)); // SeqSound::ReadTrackVariable? maybe both of them? DECOMP_FORCE(NW4RAssertHeaderClampedLValue_String(trackNo)); - +#endif bool SeqSound::IsAttachedTempSpecialHandle() { return mTempSpecialHandle != nullptr;