snd_SeqTrack OK

This commit is contained in:
robojumper
2025-05-26 01:49:31 +02:00
parent 913b135a0f
commit c62d985bde
8 changed files with 40 additions and 21 deletions
+3
View File
@@ -3019,6 +3019,9 @@ nw4r/snd/snd_SeqSoundHandle.cpp:
nw4r/snd/snd_SeqTrack.cpp:
.text start:0x804732B0 end:0x80474818 align:16
.rodata start:0x804F92E0 end:0x804F9308
.data start:0x8056E0D8 end:0x8056E0E8
.sdata2 start:0x8057F080 end:0x8057F0B0
nw4r/snd/snd_Sound3DActor.cpp:
.text start:0x80474820 end:0x80474BD8 align:16
+11 -11
View File
@@ -29157,7 +29157,7 @@ coefTable__Q44nw4r3snd6detail19BiquadFilterBpf2048 = .rodata:0x804F8C14; // type
DecibelSquareTable__Q44nw4r3snd6detail12EnvGenerator = .rodata:0x804F8FB8; // type:object size:0x100
@LOCAL@SetAttack__Q44nw4r3snd6detail12EnvGeneratorFi@attackTable = .rodata:0x804F90B8; // type:object size:0x200 scope:weak
@LOCAL@GetSinIdx__Q44nw4r3snd6detail3LfoFi@sinTable = .rodata:0x804F92B8; // type:object size:0x21 scope:weak
lbl_804F92E0 = .rodata:0x804F92E0; // type:object size:0x28 data:4byte
@2213 = .rodata:0x804F92E0; // type:object size:0x24 scope:local data:4byte
lbl_804F9308 = .rodata:0x804F9308; // type:object size:0x18 data:4byte
NoteTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9320; // type:object size:0x30
PitchTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9350; // type:object size:0x400
@@ -38608,7 +38608,7 @@ lbl_8056E018 = .data:0x8056E018; // type:object size:0xC data:4byte
lbl_8056E024 = .data:0x8056E024; // type:object size:0x64
lbl_8056E088 = .data:0x8056E088; // type:object size:0x38
lbl_8056E0C0 = .data:0x8056E0C0; // type:object size:0x18
lbl_8056E0D8 = .data:0x8056E0D8; // type:object size:0x10
__vt__Q44nw4r3snd6detail8SeqTrack = .data:0x8056E0D8; // type:object size:0x10
lbl_8056E0E8 = .data:0x8056E0E8; // type:object size:0x30
lbl_8056E118 = .data:0x8056E118; // type:object size:0x20
lbl_8056E138 = .data:0x8056E138; // type:object size:0x38
@@ -49708,15 +49708,15 @@ lbl_8057F068 = .sdata2:0x8057F068; // type:object size:0x4 align:4 data:float
lbl_8057F06C = .sdata2:0x8057F06C; // type:object size:0x4 align:4 data:float
lbl_8057F070 = .sdata2:0x8057F070; // type:object size:0x8 align:8 data:double
lbl_8057F078 = .sdata2:0x8057F078; // type:object size:0x4 align:4 data:float
lbl_8057F080 = .sdata2:0x8057F080; // type:object size:0x4 align:4 data:float
lbl_8057F084 = .sdata2:0x8057F084; // type:object size:0x4 align:4 data:float
lbl_8057F088 = .sdata2:0x8057F088; // type:object size:0x4 align:4 data:float
lbl_8057F08C = .sdata2:0x8057F08C; // type:object size:0x4 align:4 data:float
lbl_8057F090 = .sdata2:0x8057F090; // type:object size:0x4 align:4 data:float
lbl_8057F094 = .sdata2:0x8057F094; // type:object size:0x4 align:4 data:float
lbl_8057F098 = .sdata2:0x8057F098; // type:object size:0x4 align:4 data:float
lbl_8057F0A0 = .sdata2:0x8057F0A0; // type:object size:0x8 align:8 data:double
lbl_8057F0A8 = .sdata2:0x8057F0A8; // type:object size:0x8 align:8 data:double
@2980 = .sdata2:0x8057F080; // type:object size:0x4 scope:local align:4 data:float
@2981 = .sdata2:0x8057F084; // type:object size:0x4 scope:local align:4 data:float
@3311 = .sdata2:0x8057F088; // type:object size:0x4 scope:local align:4 data:float
@3312 = .sdata2:0x8057F08C; // type:object size:0x4 scope:local align:4 data:float
@3313 = .sdata2:0x8057F090; // type:object size:0x4 scope:local align:4 data:float
@3314 = .sdata2:0x8057F094; // type:object size:0x4 scope:local align:4 data:float
@3315 = .sdata2:0x8057F098; // type:object size:0x4 scope:local align:4 data:float
@3319 = .sdata2:0x8057F0A0; // type:object size:0x8 scope:local align:8 data:double
@3320 = .sdata2:0x8057F0A8; // type:object size:0x8 scope:local align:8 data:double
lbl_8057F0B0 = .sdata2:0x8057F0B0; // type:object size:0x4 align:4 data:float
lbl_8057F0B8 = .sdata2:0x8057F0B8; // type:object size:0x4 align:4 data:float
lbl_8057F0BC = .sdata2:0x8057F0BC; // type:object size:0x4 align:4 data:float
+1 -1
View File
@@ -1051,7 +1051,7 @@ config.libs = [
Object(NonMatching, "nw4r/snd/snd_SeqPlayer.cpp"),
Object(NonMatching, "nw4r/snd/snd_SeqSound.cpp"),
Object(NonMatching, "nw4r/snd/snd_SeqSoundHandle.cpp"),
Object(NonMatching, "nw4r/snd/snd_SeqTrack.cpp"),
Object(Matching, "nw4r/snd/snd_SeqTrack.cpp"),
Object(NonMatching, "nw4r/snd/snd_Sound3DActor.cpp"),
Object(NonMatching, "nw4r/snd/snd_Sound3DCalculator.cpp"),
Object(NonMatching, "nw4r/snd/snd_Sound3DEngine.cpp"),
+4 -4
View File
@@ -141,10 +141,10 @@ namespace nw4r { namespace snd { namespace detail
// typedefs
public:
typedef ut::LinkList<BasicSound, 0xe0> PriorityLinkList;
typedef ut::LinkList<BasicSound, 0xe8> SoundPlayerPlayLinkList;
typedef ut::LinkList<BasicSound, 0xf0> SoundPlayerPriorityLinkList;
typedef ut::LinkList<BasicSound, 0xf8> ExtSoundPlayerPlayLinkList;
typedef ut::LinkList<BasicSound, 0xf0> PriorityLinkList;
typedef ut::LinkList<BasicSound, 0xf8> SoundPlayerPlayLinkList;
typedef ut::LinkList<BasicSound, 0x100> SoundPlayerPriorityLinkList;
typedef ut::LinkList<BasicSound, 0x108> ExtSoundPlayerPlayLinkList;
// nested types
public:
+4
View File
@@ -115,6 +115,10 @@ namespace nw4r { namespace snd { namespace detail
{
mUserSurroundPan = surroundPan;
}
void SetRemoteOutVolume(int channel, f32 volume)
{
mRemoteOutVolume[channel] = volume;
}
void SetUserLpfFreq(f32 lpfFreq) { mUserLpfFreq = lpfFreq; }
void SetOutputLine(int lineFlag) { mOutputLineFlag = lineFlag; }
void SetMainOutVolume(f32 volume) { mMainOutVolume = volume; }
+2 -1
View File
@@ -93,9 +93,9 @@ namespace nw4r { namespace snd { namespace detail
MoveValue<u8, s16> volume; // size 0x06, offset 0x54
MoveValue<s8, s16> pan; // size 0x06, offset 0x5a
MoveValue<s8, s16> surroundPan; // size 0x06, offset 0x60
MoveValue<s8, s16> pitchBend; // size 0x01, offset 0x68
u8 volume2; // size 0x01, offset 0x66
u8 velocityRange; // size 0x01, offset 0x67
s8 pitchBend; // size 0x01, offset 0x68
u8 bendRange; // size 0x01, offset 0x69
s8 initPan; // size 0x01, offset 0x6a
s8 transpose; // size 0x01, offset 0x6b
@@ -141,6 +141,7 @@ namespace nw4r { namespace snd { namespace detail
void SetPlayerTrackNo(int playerTrackNo);
void SetVolume(f32);
void SetTrackVariable(int variable, s16 value);
void SetPitch(f32);
void SetPan(f32);
void SetSurroundPan(f32);
+1 -1
View File
@@ -410,7 +410,7 @@ void MmlParser::CommandProc(MmlSeqTrack *track, u32 command, s32 commandArg1,
break;
case MML_SET_PITCH_BEND:
trackParam.pitchBend = commandArg1;
trackParam.pitchBend.SetTarget(commandArg1, commandArg2);
break;
case MML_SET_BEND_RANGE:
+14 -3
View File
@@ -83,7 +83,7 @@ void SeqTrack::InitParam()
mParserTrackParam.surroundPan.InitValue(0);
mParserTrackParam.volume2 = 127;
mParserTrackParam.velocityRange = 127;
mParserTrackParam.pitchBend = 0;
mParserTrackParam.pitchBend.InitValue(0);
mParserTrackParam.bendRange = DEFAULT_BENDRANGE;
mParserTrackParam.initPan = 0;
mParserTrackParam.transpose = 0;
@@ -172,6 +172,7 @@ int SeqTrack::ParseNextTick(bool doNoteOn)
mParserTrackParam.volume.Update();
mParserTrackParam.pan.Update();
mParserTrackParam.surroundPan.Update();
mParserTrackParam.pitchBend.Update();
if (mParserTrackParam.noteFinishWait)
{
@@ -277,7 +278,7 @@ void SeqTrack::UpdateChannelParam()
volume *= mSeqPlayer->GetVolume();
f32 pitch =
mParserTrackParam.pitchBend / 128.0f * mParserTrackParam.bendRange;
mParserTrackParam.pitchBend.GetValue() / 128.0f * mParserTrackParam.bendRange;
f32 pitchRatio = 1.0f;
pitchRatio *= mSeqPlayer->GetPitch();
@@ -339,13 +340,17 @@ void SeqTrack::UpdateChannelParam()
channel->SetOutputLine(mSeqPlayer->GetOutputLine());
channel->SetMainOutVolume(mSeqPlayer->GetMainOutVolume());
channel->SetMainSend(mainSend);
for (int i = 0; i < AUX_BUS_NUM; i++)
{
AuxBus bus = static_cast<AuxBus>(i);
channel->SetFxSend(bus, fxSend[i]);
}
for (int i = 0; i < 4; i++) {
channel->SetRemoteOutVolume(i, mSeqPlayer->GetRemoteOutVolume(i));
}
for (int i = 0; i < mSeqPlayer->GetVoiceOutCount(); i++)
channel->SetVoiceOutParam(i, mSeqPlayer->GetVoiceOutParam(i));
@@ -500,8 +505,14 @@ void SeqTrack::SetModSpeed(f32 modSpeed)
mParserTrackParam.lfoParam.speed = modSpeed;
}
#if 0
// SeqTrack::GetTrackVariable? maybe both?
DECOMP_FORCE(NW4RAssertHeaderClampedLValue_String(varNo));
#endif
void SeqTrack::SetTrackVariable(int variable, s16 value) {
mTrackVariable[variable] = value;
}
s16 volatile *SeqTrack::GetVariablePtr(int varNo)
{