From 62b35d862998fa84d2e9f6f9f5633788bce931b5 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 22:42:46 +0200 Subject: [PATCH] snd_SoundArchive OK --- config/SOUE01/splits.txt | 5 +++-- config/SOUE01/symbols.txt | 6 +++--- configure.py | 2 +- include/nw4r/snd/snd_SoundArchive.h | 2 ++ include/nw4r/snd/snd_SoundArchiveFile.h | 4 ++++ src/nw4r/snd/snd_SoundArchive.cpp | 9 +++++++++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index ec39f061..2cdd573e 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3046,10 +3046,11 @@ nw4r/snd/snd_Sound3DManager.cpp: .ctors start:0x804DB964 end:0x804DB968 nw4r/snd/snd_SoundActor.cpp: - .text start:0x80475F80 end:0x80476264 align:16 + .text start:0x80475F80 end:0x80476278 align:16 nw4r/snd/snd_SoundArchive.cpp: - .text start:0x80476270 end:0x8047697C align:16 + .text start:0x80476280 end:0x8047697C align:16 + .data start:0x8056E190 end:0x8056E1B0 nw4r/snd/snd_SoundArchiveFile.cpp: .text start:0x80476980 end:0x80477C90 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 586bc28d..9e1323e9 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25493,8 +25493,8 @@ GetPlayerCount__Q34nw4r3snd12SoundArchiveCFv = .text:0x80476340; // type:functio GetGroupCount__Q34nw4r3snd12SoundArchiveCFv = .text:0x80476350; // type:function size:0x8 GetSoundLabelString__Q34nw4r3snd12SoundArchiveCFUl = .text:0x80476360; // type:function size:0x8 ConvertLabelStringToSoundId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x80476370; // type:function size:0x10 -ConvertLabelStringToPlayerId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x80476380; // type:function size:0x10 -ConvertLabelStringToGroupId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x80476390; // type:function size:0x10 +ConvertLabelStringToGroupId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x80476380; // type:function size:0x10 +ConvertLabelStringToBankId__Q34nw4r3snd12SoundArchiveCFPCc = .text:0x80476390; // type:function size:0x10 GetSoundUserParam__Q34nw4r3snd12SoundArchiveCFUl = .text:0x804763A0; // type:function size:0x8 GetSoundType__Q34nw4r3snd12SoundArchiveCFUl = .text:0x804763B0; // type:function size:0x8 ReadSoundInfo__Q34nw4r3snd12SoundArchiveCFUlPQ44nw4r3snd12SoundArchive9SoundInfo = .text:0x804763C0; // type:function size:0x8 @@ -38613,7 +38613,7 @@ lbl_8056E0E8 = .data:0x8056E0E8; // type:object size:0x30 lbl_8056E118 = .data:0x8056E118; // type:object size:0x20 lbl_8056E138 = .data:0x8056E138; // type:object size:0x38 lbl_8056E170 = .data:0x8056E170; // type:object size:0x20 -lbl_8056E190 = .data:0x8056E190; // type:object size:0x20 +__vt__Q34nw4r3snd12SoundArchive = .data:0x8056E190; // type:object size:0x20 lbl_8056E1B0 = .data:0x8056E1B0; // type:object size:0x30 WSDCallback = .data:0x8056E1E0; // type:object size:0x10 SeqCallback = .data:0x8056E1F0; // type:object size:0x10 diff --git a/configure.py b/configure.py index 00633161..a41a2431 100644 --- a/configure.py +++ b/configure.py @@ -1058,7 +1058,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_Sound3DListener.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DManager.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundActor.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundArchive.cpp"), + Object(Matching, "nw4r/snd/snd_SoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchiveFile.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), diff --git a/include/nw4r/snd/snd_SoundArchive.h b/include/nw4r/snd/snd_SoundArchive.h index 76b63469..6ebf3a5a 100644 --- a/include/nw4r/snd/snd_SoundArchive.h +++ b/include/nw4r/snd/snd_SoundArchive.h @@ -180,6 +180,7 @@ namespace nw4r { namespace snd u32 ConvertLabelStringToSoundId(char const *label) const; u32 ConvertLabelStringToPlayerId(const char* pLabel) const; u32 ConvertLabelStringToGroupId(const char* pLabel) const; + u32 ConvertLabelStringToBankId(const char* pLabel) const; u32 GetSoundUserParam(u32 id) const; bool ReadSoundInfo(u32 soundId, SoundInfo *info) const; @@ -189,6 +190,7 @@ namespace nw4r { namespace snd bool ReadPlayerInfo(u32 playerId, PlayerInfo *info) const; bool ReadSoundArchivePlayerInfo(SoundArchivePlayerInfo *info) const; + bool detail_ReadSound3DParam(u32 soundId, nw4r::snd::SoundArchive::Sound3DParam*) const; bool ReadBankInfo(u32 bankId, BankInfo *info) const; diff --git a/include/nw4r/snd/snd_SoundArchiveFile.h b/include/nw4r/snd/snd_SoundArchiveFile.h index 3e05a24a..6fffb7f4 100644 --- a/include/nw4r/snd/snd_SoundArchiveFile.h +++ b/include/nw4r/snd/snd_SoundArchiveFile.h @@ -323,6 +323,7 @@ namespace nw4r { namespace snd { namespace detail bool ReadBankInfo(u32 bankId, SoundArchive::BankInfo *info) const; bool ReadPlayerInfo(u32 playerId, SoundArchive::PlayerInfo *info) const; + bool ReadSound3DParam(u32 soundId, nw4r::snd::SoundArchive::Sound3DParam* info) const; bool ReadGroupItemInfo(u32 groupId, u32 index, SoundArchive::GroupItemInfo *info) const; @@ -346,6 +347,9 @@ namespace nw4r { namespace snd { namespace detail u32 ConvertLabelStringToGroupId(const char* pLabel) const { return ConvertLabelStringToId(mStringTreeGroup, pLabel); } + u32 ConvertLabelStringToBankId(const char* pLabel) const { + return ConvertLabelStringToId(mStringTreeBank, pLabel); + } private: static bool IsValidFileHeader(void const *soundArchiveData); diff --git a/src/nw4r/snd/snd_SoundArchive.cpp b/src/nw4r/snd/snd_SoundArchive.cpp index e00a0f08..fd6a8fef 100644 --- a/src/nw4r/snd/snd_SoundArchive.cpp +++ b/src/nw4r/snd/snd_SoundArchive.cpp @@ -89,6 +89,10 @@ u32 SoundArchive::ConvertLabelStringToGroupId(const char* pLabel) const { return mFileReader->ConvertLabelStringToGroupId(pLabel); } +u32 SoundArchive::ConvertLabelStringToBankId(const char* pLabel) const { + return mFileReader->ConvertLabelStringToBankId(pLabel); +} + u32 SoundArchive::GetSoundUserParam(u32 id) const { return mFileReader->GetSoundUserParam(id); } @@ -131,6 +135,11 @@ bool SoundArchive::ReadSoundArchivePlayerInfo( return mFileReader->ReadSoundArchivePlayerInfo(info); } +bool SoundArchive::detail_ReadSound3DParam(u32 soundId, nw4r::snd::SoundArchive::Sound3DParam* info) const +{ + return mFileReader->ReadSound3DParam(soundId, info); +} + bool SoundArchive::ReadBankInfo(u32 bankId, BankInfo *info) const { return mFileReader->ReadBankInfo(bankId, info);