From d016bf80054ee09370809fc88f1e103532e5b03e Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 21:57:46 +0200 Subject: [PATCH 01/91] snd_BasicPlayer OK --- .../rels/d_t_gate_to_groundNP/symbols.txt | 2 +- config/SOUE01/splits.txt | 5 ++ config/SOUE01/symbols.txt | 76 +++++++++---------- configure.py | 4 +- include/nw4r/snd/snd_AxManager.h | 13 ++-- include/nw4r/snd/snd_BasicPlayer.h | 5 +- src/nw4r/snd/snd_AxManager.cpp | 16 +++- src/nw4r/snd/snd_BasicPlayer.cpp | 13 ++++ 8 files changed, 84 insertions(+), 50 deletions(-) diff --git a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt index 00eb2edf..49256b1d 100644 --- a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt +++ b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt @@ -10,7 +10,7 @@ draw__17dTgGateToGround_cFv = .text:0x000002F0; // type:function size:0x8 __dt__17dTgGateToGround_cFv = .text:0x00000300; // type:function size:0x70 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -@20562 = .rodata:0x00000000; // type:object size:0x4 data:float scope:local +@20562 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float g_profile_GATE2GND_TAG = .data:0x00000000; // type:object size:0x10 @20583 = .data:0x00000010; // type:object size:0xC scope:local __vt__17dTgGateToGround_c = .data:0x0000001C; // type:object size:0x74 diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index f07e4a94..e6a42f8c 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2895,6 +2895,9 @@ nw4r/snd/snd_AnimSound.cpp: nw4r/snd/snd_AxManager.cpp: .text start:0x804630E0 end:0x80464880 align:16 .ctors start:0x804DB958 end:0x804DB95C + .sbss start:0x80576650 end:0x80576668 + .sdata2 start:0x8057EF18 end:0x8057EF30 + .bss start:0x80658F80 end:0x80659390 nw4r/snd/snd_AxVoice.cpp: .text start:0x80464880 end:0x80467634 align:16 @@ -2913,6 +2916,8 @@ nw4r/snd/snd_BankFile.cpp: nw4r/snd/snd_BasicPlayer.cpp: .text start:0x80468910 end:0x80468B50 align:16 + .data start:0x8056DB38 end:0x8056DB60 + .sdata2 start:0x8057EF80 end:0x8057EF88 nw4r/snd/snd_BasicSound.cpp: .text start:0x80468B50 end:0x8046A36C align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index c438e780..cfb5a8f4 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -21769,7 +21769,7 @@ fn_8039EDC0 = .text:0x8039EDC0; // type:function size:0x28C AXSetVoiceState = .text:0x8039F050; // type:function size:0x70 AXSetVoiceAddr = .text:0x8039F0C0; // type:function size:0xE8 AXGetLpfCoefs = .text:0x8039F1B0; // type:function size:0xBC -fn_8039F270 = .text:0x8039F270; // type:function size:0x8 +AXSetMaxDspCycles = .text:0x8039F270; // type:function size:0x8 AXGetMaxVoices = .text:0x8039F280; // type:function size:0x8 fn_8039F290 = .text:0x8039F290; // type:function size:0x40 fn_8039F2D0 = .text:0x8039F2D0; // type:function size:0x64 @@ -25031,10 +25031,10 @@ nw4r__snd__detail__AnimSoundFileReader__GetEventCount = .text:0x80462FB0; // typ nw4r__snd__detail__AnimSoundFileReader__GetEventRef = .text:0x80463000; // type:function size:0x58 nw4r__snd__detail__AnimSoundFileReader__GetEvent = .text:0x80463060; // type:function size:0x74 __ct__Q44nw4r3snd6detail9AxManagerFv = .text:0x804630E0; // type:function size:0x218 -__ct__Q34nw4r2ut30LinkListFv = .text:0x80463300; // type:function size:0x18 -__dt__Q34nw4r2ut30LinkListFv = .text:0x80463320; // type:function size:0x58 +__ct__Q34nw4r2ut30LinkListFv = .text:0x80463300; // type:function size:0x18 scope:weak +__dt__Q34nw4r2ut30LinkListFv = .text:0x80463320; // type:function size:0x58 scope:weak GetInstance__Q44nw4r3snd6detail9AxManagerFv = .text:0x80463380; // type:function size:0x64 -__dt__Q44nw4r3snd6detail9AxManagerFv = .text:0x804633F0; // type:function size:0x78 +__dt__Q44nw4r3snd6detail9AxManagerFv = .text:0x804633F0; // type:function size:0x78 scope:weak Init__Q44nw4r3snd6detail9AxManagerFv = .text:0x80463470; // type:function size:0x128 GetOutputVolume__Q44nw4r3snd6detail9AxManagerCFv = .text:0x804635A0; // type:function size:0x6C Update__Q44nw4r3snd6detail9AxManagerFv = .text:0x80463610; // type:function size:0x3CC @@ -25118,7 +25118,7 @@ SetBiquadFilter__Q44nw4r3snd6detail11BasicPlayerFif = .text:0x80468AD0; // type: SetRemoteFilter__Q44nw4r3snd6detail11BasicPlayerFi = .text:0x80468AE0; // type:function size:0x8 SetRemoteOutVolume__Q44nw4r3snd6detail11BasicPlayerFif = .text:0x80468AF0; // type:function size:0x10 GetRemoteOutVolume__Q44nw4r3snd6detail11BasicPlayerCFi = .text:0x80468B00; // type:function size:0x10 -__dt__Q44nw4r3snd6detail11BasicPlayerFv = .text:0x80468B10; // type:function size:0x40 +__dt__Q44nw4r3snd6detail11BasicPlayerFv = .text:0x80468B10; // type:function size:0x40 scope:weak __ct__Q44nw4r3snd6detail10BasicSoundFii = .text:0x80468B50; // type:function size:0xE0 InitParam__Q44nw4r3snd6detail10BasicSoundFv = .text:0x80468C30; // type:function size:0x154 StartPrepared__Q44nw4r3snd6detail10BasicSoundFv = .text:0x80468D90; // type:function size:0x18 @@ -38584,13 +38584,13 @@ __vt__Q34nw4r3g3d12ScnMdlSimple = .data:0x8056DA28; // type:object size:0x48 __vt__Q34nw4r3g3d6ScnMdl = .data:0x8056DA70; // type:object size:0x48 @10666 = .data:0x8056DAB8; // type:object size:0x46 scope:local data:string __vt__Q34nw4r3g3d7ScnProc = .data:0x8056DB00; // type:object size:0x34 -lbl_8056DB38 = .data:0x8056DB38; // type:object size:0x28 +__vt__Q44nw4r3snd6detail11BasicPlayer = .data:0x8056DB38; // type:object size:0x24 scope:weak lbl_8056DB60 = .data:0x8056DB60; // type:object size:0x38 -lbl_8056DB98 = .data:0x8056DB98; // type:object size:0x10 -lbl_8056DBA8 = .data:0x8056DBA8; // type:object size:0x10 -lbl_8056DBB8 = .data:0x8056DBB8; // type:object size:0x10 -lbl_8056DBC8 = .data:0x8056DBC8; // type:object size:0x10 -lbl_8056DBD8 = .data:0x8056DBD8; // type:object size:0x10 +__vt__Q44nw4r3snd6detail19BiquadFilterBpf2048 = .data:0x8056DB98; // type:object size:0x10 +__vt__Q44nw4r3snd6detail19BiquadFilterBpf1024 = .data:0x8056DBA8; // type:object size:0x10 +__vt__Q44nw4r3snd6detail18BiquadFilterBpf512 = .data:0x8056DBB8; // type:object size:0x10 +__vt__Q44nw4r3snd6detail15BiquadFilterHpf = .data:0x8056DBC8; // type:object size:0x10 +__vt__Q44nw4r3snd6detail15BiquadFilterLpf = .data:0x8056DBD8; // type:object size:0x10 lbl_8056DBE8 = .data:0x8056DBE8; // type:object size:0x68 lbl_8056DC50 = .data:0x8056DC50; // type:object size:0x20 lbl_8056DC70 = .data:0x8056DC70; // type:object size:0x28 @@ -40617,7 +40617,7 @@ lbl_8057406C = .sdata:0x8057406C; // type:object size:0x4 data:4byte lbl_80574070 = .sdata:0x80574070; // type:object size:0x8 lbl_80574078 = .sdata:0x80574078; // type:object size:0x8 lbl_80574080 = .sdata:0x80574080; // type:object size:0x8 -lbl_80574088 = .sdata:0x80574088; // type:object size:0x4 scope:local data:4byte +@14637 = .sdata:0x80574088; // type:object size:0x4 scope:local data:4byte lbl_80574090 = .sdata:0x80574090; // type:object size:0x8 lbl_80574098 = .sdata:0x80574098; // type:object size:0x4 lbl_8057409C = .sdata:0x8057409C; // type:object size:0x4 @@ -42415,13 +42415,13 @@ sTev__Q44nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@ = .sbss:0x80576634; // type: @GUARD@GetViewNrmMtxPtr__Q54nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@19PosNrmMtxArrayStateCFUl@m = .sbss:0x80576638; // type:object size:0x1 scope:weak data:byte sMisc__Q44nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@ = .sbss:0x80576640; // type:object size:0x8 scope:local data:4byte gpCullingFrustum__Q24nw4r3g3d = .sbss:0x80576648; // type:object size:0x4 data:4byte -sBiquadFilterLpf = .sbss:0x80576650; // type:object size:0x4 data:4byte -sBiquadFilterHpf = .sbss:0x80576654; // type:object size:0x4 data:4byte -sBiquadFilterBpf512 = .sbss:0x80576658; // type:object size:0x4 data:4byte -sBiquadFilterBpf1024 = .sbss:0x8057665C; // type:object size:0x4 data:4byte -sBiquadFilterBpf2048 = .sbss:0x80576660; // type:object size:0x4 data:4byte -lbl_80576664 = .sbss:0x80576664; // type:object size:0x1 data:byte -lbl_80576665 = .sbss:0x80576665; // type:object size:0x1 data:byte +sBiquadFilterLpf__Q44nw4r3snd6detail9AxManager = .sbss:0x80576650; // type:object size:0x4 data:4byte +sBiquadFilterHpf__Q44nw4r3snd6detail9AxManager = .sbss:0x80576654; // type:object size:0x4 data:4byte +sBiquadFilterBpf512__Q44nw4r3snd6detail9AxManager = .sbss:0x80576658; // type:object size:0x4 data:4byte +sBiquadFilterBpf1024__Q44nw4r3snd6detail9AxManager = .sbss:0x8057665C; // type:object size:0x4 data:4byte +sBiquadFilterBpf2048__Q44nw4r3snd6detail9AxManager = .sbss:0x80576660; // type:object size:0x4 data:4byte +@GUARD@GetInstance__Q44nw4r3snd6detail9AxManagerFv@instance = .sbss:0x80576664; // type:object size:0x1 scope:weak data:byte +@LOCAL@AiDmaCallbackFunc__Q44nw4r3snd6detail9AxManagerFv@finishedFlag = .sbss:0x80576665; // type:object size:0x1 scope:weak data:byte lbl_80576668 = .sbss:0x80576668; // type:object size:0x8 data:byte lbl_80576670 = .sbss:0x80576670; // type:object size:0x4 data:4byte lbl_80576674 = .sbss:0x80576674; // type:object size:0x4 data:4byte @@ -48327,14 +48327,14 @@ lbl_8057D284 = .sdata2:0x8057D284; // type:object size:0x4 align:4 data:float lbl_8057D288 = .sdata2:0x8057D288; // type:object size:0x4 align:4 data:float lbl_8057D28C = .sdata2:0x8057D28C; // type:object size:0x4 align:4 data:float lbl_8057D290 = .sdata2:0x8057D290; // type:object size:0x4 align:4 data:float -lbl_8057D298 = .sdata2:0x8057D298; // type:object size:0x4 scope:local align:4 data:float -lbl_8057D29C = .sdata2:0x8057D29C; // type:object size:0x4 scope:local align:4 data:float -lbl_8057D2A0 = .sdata2:0x8057D2A0; // type:object size:0x4 scope:local align:4 data:float -lbl_8057D2A4 = .sdata2:0x8057D2A4; // type:object size:0x4 scope:local align:4 data:float -lbl_8057D2A8 = .sdata2:0x8057D2A8; // type:object size:0x4 scope:local align:4 data:float -lbl_8057D2AC = .sdata2:0x8057D2AC; // type:object size:0x4 scope:local align:4 data:float -lbl_8057D2B0 = .sdata2:0x8057D2B0; // type:object size:0x4 scope:local align:4 data:float -lbl_8057D2B4 = .sdata2:0x8057D2B4; // type:object size:0x4 scope:local align:4 data:float +@15358 = .sdata2:0x8057D298; // type:object size:0x4 scope:local align:4 data:float +@15812 = .sdata2:0x8057D29C; // type:object size:0x4 scope:local align:4 data:float +@15813 = .sdata2:0x8057D2A0; // type:object size:0x4 scope:local align:4 data:float +@15814 = .sdata2:0x8057D2A4; // type:object size:0x4 scope:local align:4 data:float +@15815 = .sdata2:0x8057D2A8; // type:object size:0x4 scope:local align:4 data:float +@15816 = .sdata2:0x8057D2AC; // type:object size:0x4 scope:local align:4 data:float +@15817 = .sdata2:0x8057D2B0; // type:object size:0x4 scope:local align:4 data:float +@15818 = .sdata2:0x8057D2B4; // type:object size:0x4 scope:local align:4 data:float lbl_8057D2B8 = .sdata2:0x8057D2B8; // type:object size:0x4 align:4 data:float lbl_8057D2C0 = .sdata2:0x8057D2C0; // type:object size:0x4 align:4 data:float lbl_8057D2C4 = .sdata2:0x8057D2C4; // type:object size:0x4 align:4 data:float @@ -49643,11 +49643,11 @@ lbl_8057EF00 = .sdata2:0x8057EF00; // type:object size:0x8 align:8 data:double lbl_8057EF08 = .sdata2:0x8057EF08; // type:object size:0x8 align:8 data:double lbl_8057EF10 = .sdata2:0x8057EF10; // type:object size:0x4 align:4 data:float lbl_8057EF14 = .sdata2:0x8057EF14; // type:object size:0x4 align:4 data:float -lbl_8057EF18 = .sdata2:0x8057EF18; // type:object size:0x4 align:4 data:float -lbl_8057EF1C = .sdata2:0x8057EF1C; // type:object size:0x4 align:4 data:float -lbl_8057EF20 = .sdata2:0x8057EF20; // type:object size:0x8 align:8 data:double -lbl_8057EF28 = .sdata2:0x8057EF28; // type:object size:0x4 align:4 data:float -lbl_8057EF2C = .sdata2:0x8057EF2C; // type:object size:0x4 align:4 data:float +@2457 = .sdata2:0x8057EF18; // type:object size:0x4 scope:local align:4 data:float +@2458 = .sdata2:0x8057EF1C; // type:object size:0x4 scope:local align:4 data:float +@2523 = .sdata2:0x8057EF20; // type:object size:0x8 scope:local align:8 data:double +@2626 = .sdata2:0x8057EF28; // type:object size:0x4 scope:local align:4 data:float +@3157 = .sdata2:0x8057EF2C; // type:object size:0x4 scope:local align:4 data:float lbl_8057EF30 = .sdata2:0x8057EF30; // type:object size:0x4 align:4 data:float lbl_8057EF34 = .sdata2:0x8057EF34; // type:object size:0x4 align:4 data:float lbl_8057EF38 = .sdata2:0x8057EF38; // type:object size:0x4 align:4 data:float @@ -49662,8 +49662,8 @@ lbl_8057EF60 = .sdata2:0x8057EF60; // type:object size:0x4 align:4 data:float lbl_8057EF68 = .sdata2:0x8057EF68; // type:object size:0x8 align:8 data:double lbl_8057EF70 = .sdata2:0x8057EF70; // type:object size:0x8 align:8 data:double lbl_8057EF78 = .sdata2:0x8057EF78; // type:object size:0x4 align:4 data:float -lbl_8057EF80 = .sdata2:0x8057EF80; // type:object size:0x4 align:4 data:float -lbl_8057EF84 = .sdata2:0x8057EF84; // type:object size:0x4 align:4 data:float +@608 = .sdata2:0x8057EF80; // type:object size:0x4 scope:local align:4 data:float +@609 = .sdata2:0x8057EF84; // type:object size:0x4 scope:local align:4 data:float lbl_8057EF88 = .sdata2:0x8057EF88; // type:object size:0x4 align:4 data:float lbl_8057EF8C = .sdata2:0x8057EF8C; // type:object size:0x4 align:4 data:float lbl_8057EF90 = .sdata2:0x8057EF90; // type:object size:0x8 align:8 data:double @@ -51930,10 +51930,10 @@ sRenderMode__Q44nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@ = .bss:0x80640E48; // IndMtxOpDefault__Q44nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@ = .bss:0x80640E88; // type:object size:0x98 scope:local data:4byte @LOCAL@GetViewNrmMtxPtr__Q54nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@19PosNrmMtxArrayStateCFUl@m = .bss:0x80640F20; // type:object size:0x24 scope:weak sTemp__Q54nw4r3g3d6detail7workmem25@unnamed@g3d_workmem_cpp@ = .bss:0x80640F80; // type:object size:0x18000 scope:local -lbl_80658F80 = .bss:0x80658F80; // type:object size:0x100 -lbl_80659080 = .bss:0x80659080; // type:object size:0x200 -lbl_80659280 = .bss:0x80659280; // type:object size:0xC -lbl_8065928C = .bss:0x8065928C; // type:object size:0x104 data:4byte +sZeroBuffer__Q44nw4r3snd6detail9AxManager = .bss:0x80658F80; // type:object size:0x100 +sBiquadFilterCallbackTable__Q44nw4r3snd6detail9AxManager = .bss:0x80659080; // type:object size:0x200 +@1190 = .bss:0x80659280; // type:object size:0xC scope:local +@LOCAL@GetInstance__Q44nw4r3snd6detail9AxManagerFv@instance = .bss:0x8065928C; // type:object size:0x104 scope:weak data:4byte lbl_80659390 = .bss:0x80659390; // type:object size:0xC lbl_8065939C = .bss:0x8065939C; // type:object size:0x2C data:4byte lbl_806593C8 = .bss:0x806593C8; // type:object size:0x10 diff --git a/configure.py b/configure.py index 5f129583..cba8e03c 100644 --- a/configure.py +++ b/configure.py @@ -1013,13 +1013,13 @@ config.libs = [ "snd", [ Object(NonMatching, "nw4r/snd/snd_AnimSound.cpp"), - Object(NonMatching, "nw4r/snd/snd_AxManager.cpp"), + Object(Matching, "nw4r/snd/snd_AxManager.cpp"), Object(NonMatching, "nw4r/snd/snd_AxVoice.cpp"), Object(NonMatching, "nw4r/snd/snd_AxVoiceManager.cpp"), Object(NonMatching, "nw4r/snd/snd_AxfxImpl.cpp"), Object(NonMatching, "nw4r/snd/snd_Bank.cpp"), Object(NonMatching, "nw4r/snd/snd_BankFile.cpp"), - Object(NonMatching, "nw4r/snd/snd_BasicPlayer.cpp"), + Object(Matching, "nw4r/snd/snd_BasicPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), Object(NonMatching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), Object(NonMatching, "nw4r/snd/snd_Channel.cpp"), diff --git a/include/nw4r/snd/snd_AxManager.h b/include/nw4r/snd/snd_AxManager.h index e68069a0..01df41f9 100644 --- a/include/nw4r/snd/snd_AxManager.h +++ b/include/nw4r/snd/snd_AxManager.h @@ -117,11 +117,11 @@ namespace nw4r { namespace snd { namespace detail // static members private: - static u8 const AUX_CALLBACK_WAIT_FRAME; + static u8 const AUX_CALLBACK_WAIT_FRAME = 6; static u16 const AUX_RETURN_VOLUME_MAX = AX_MAX_VOLUME; - static int const FX_SAMPLE_RATE; - static SampleFormat const FX_SAMPLE_FORMAT; - static int const FX_BUFFER_SIZE; + static int const FX_SAMPLE_RATE = 32000; + static SampleFormat const FX_SAMPLE_FORMAT = SAMPLE_FORMAT_PCM_S32; + static int const FX_BUFFER_SIZE = 0x180; static int const ZERO_BUFFER_SIZE = 256; static int const SAMPLES_PAR_AUDIO_FRAME; static int const AUDIO_FRAME_INTERVAL; @@ -147,7 +147,7 @@ namespace nw4r { namespace snd { namespace detail MoveValue mMainOutVolume; // size 0x10, offset 0x2c MoveValue mVolumeForReset; // size 0x10, offset 0x3c AIDMACallback mOldAidCallback; // size 0x04, offset 0x4c - s32 mResetReadyCounter; // size 0x04, offset 0x50 + volatile s32 mResetReadyCounter; // size 0x04, offset 0x50 MoveValue mAuxFadeVolume[AUX_BUS_NUM]; // size 0x30, offset 0x54 MoveValue mAuxUserVolume[AUX_BUS_NUM]; // size 0x30, offset 0x84 FxBase::LinkList mFxList[AUX_BUS_NUM]; // size 0x24, offset 0xb4 @@ -156,7 +156,8 @@ namespace nw4r { namespace snd { namespace detail u8 mAuxCallbackWaitCounter[AUX_BUS_NUM]; // size 0x03, offset 0xf0 /* 1 byte padding */ u32 mEffectProcessTick[AUX_BUS_NUM]; // size 0x0c, offset 0xf4 - }; // size 0x100 + u32 field_0x100; + }; // size 0x104 }}} // namespace nw4r::snd::detail #endif // NW4R_SND_AX_MANAGER_H diff --git a/include/nw4r/snd/snd_BasicPlayer.h b/include/nw4r/snd/snd_BasicPlayer.h index ccd5d31e..a25f95fb 100644 --- a/include/nw4r/snd/snd_BasicPlayer.h +++ b/include/nw4r/snd/snd_BasicPlayer.h @@ -44,7 +44,8 @@ namespace nw4r { namespace snd { namespace detail PanMode panMode; // size 0x04, offset 0x28 PanCurve panCurve; // size 0x04, offset 0x2c f32 fxSend[AUX_BUS_NUM]; // size 0x0c, offset 0x30 - VoiceOutParam voiceOutParam[4]; // size 0x60, offset 0x3c + f32 remoteOutVolume[4]; // size 0x04, offset 0x3c + VoiceOutParam voiceOutParam[4]; // size 0x60, offset 0x5c }; // size 0x9c }}} // namespace nw4r::snd::detail @@ -75,6 +76,8 @@ namespace nw4r { namespace snd { namespace detail // methods void InitParam(); + void SetRemoteOutVolume(int remote, f32 volume); + f32 GetRemoteOutVolume(int remote) const; f32 GetVolume() const { return mPlayerParamSet.volume; } f32 GetPitch() const { return mPlayerParamSet.pitch; } diff --git a/src/nw4r/snd/snd_AxManager.cpp b/src/nw4r/snd/snd_AxManager.cpp index 1cb2c4b1..971f5e4b 100644 --- a/src/nw4r/snd/snd_AxManager.cpp +++ b/src/nw4r/snd/snd_AxManager.cpp @@ -68,7 +68,8 @@ AxManager::AxManager() : mInitialized (false), mUpdateVoicePrioFlag (true), mOldAidCallback (nullptr), - mResetReadyCounter (-1) + mResetReadyCounter (-1), + field_0x100(5) { mMainOutVolume.InitValue(1.0f); mMasterVolume.InitValue(1.0f); @@ -307,7 +308,10 @@ OutputMode AxManager::GetOutputMode() } void AxManager::SetMasterVolume(f32 volume, int frame) { - mMasterVolume.SetTarget(ut::Clamp(volume, 0.0f, 1.0f), (frame + 2) / 3); + if (volume < 0.0f) { + volume = 0.0f; + } + mMasterVolume.SetTarget(volume, (frame + 2) / 3); if (frame == 0) { VoiceManager::GetInstance().UpdateAllVoicesSync(Voice::SYNC_AX_VE); @@ -395,6 +399,9 @@ bool AxManager::AppendEffect(AuxBus bus, FxBase* pFx) { void AxManager::ClearEffect(AuxBus bus, int frame) { if (frame == 0) { ShutdownEffect(bus); + if (!mAuxFadeVolume[bus].IsFinished()) { + mAuxFadeVolume[bus].SetTarget(0.0f, 0); + } return; } @@ -447,6 +454,8 @@ void AxManager::AuxCallbackFunc(void* pChans, void* pContext) { void** ppChans = static_cast(pChans); AuxBus bus = static_cast(reinterpret_cast(pContext)); + int tick = OSGetTick(); + if (GetInstance().GetOutputMode() == OUTPUT_MODE_DPL2) { num = AX_DPL2_MAX; @@ -468,10 +477,12 @@ void AxManager::AuxCallbackFunc(void* pChans, void* pContext) { for (int i = 0; i < num; i++) { std::memset(buffer[i], 0, FX_BUFFER_SIZE); } + GetInstance().mEffectProcessTick[bus] = OSGetTick() - tick; } else if (GetInstance().GetEffectList(bus).IsEmpty()) { for (int i = 0; i < num; i++) { std::memset(buffer[i], 0, FX_BUFFER_SIZE); } + GetInstance().mEffectProcessTick[bus] = OSGetTick() - tick; } else { for (FxBase::LinkList::Iterator it = GetInstance().GetEffectList(bus).GetBeginIter(); @@ -480,6 +491,7 @@ void AxManager::AuxCallbackFunc(void* pChans, void* pContext) { it->UpdateBuffer(num, buffer, FX_BUFFER_SIZE, FX_SAMPLE_FORMAT, FX_SAMPLE_RATE, GetInstance().GetOutputMode()); } + GetInstance().mEffectProcessTick[bus] = OSGetTick() - tick; } } diff --git a/src/nw4r/snd/snd_BasicPlayer.cpp b/src/nw4r/snd/snd_BasicPlayer.cpp index e5695e31..4045f4b8 100644 --- a/src/nw4r/snd/snd_BasicPlayer.cpp +++ b/src/nw4r/snd/snd_BasicPlayer.cpp @@ -41,6 +41,9 @@ void PlayerParamSet::Init() for (int i = 0; i < AUX_BUS_NUM; i++) fxSend[i] = 0.0f; + for (int i = 0; i < 4; i++) + remoteOutVolume[i] = 1.0f; + for (int i = 0; i < (int)ARRAY_LENGTH(voiceOutParam); i++) { VoiceOutParam *param = &voiceOutParam[i]; @@ -99,4 +102,14 @@ void BasicPlayer::SetRemoteFilter(int filter) mPlayerParamSet.remoteFilter = filter; } +void BasicPlayer::SetRemoteOutVolume(int remote, f32 volume) +{ + mPlayerParamSet.remoteOutVolume[remote] = volume; +} + +f32 BasicPlayer::GetRemoteOutVolume(int remote) const +{ + return mPlayerParamSet.remoteOutVolume[remote]; +} + }}} // namespace nw4r::snd::detail From cba330a33771d1aa677e51d3acc017eafcb0590a Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:13:27 +0200 Subject: [PATCH 02/91] snd_BiquadFilterPreset OK --- config/SOUE01/splits.txt | 3 +++ config/SOUE01/symbols.txt | 24 ++++++++++++------------ configure.py | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index e6a42f8c..b1a17f9c 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2925,6 +2925,9 @@ nw4r/snd/snd_BasicSound.cpp: nw4r/snd/snd_BiquadFilterPreset.cpp: .text start:0x8046A370 end:0x8046A7B0 align:16 + .rodata start:0x804F7B80 end:0x804F8FB8 + .data start:0x8056DB98 end:0x8056DBE8 + .sdata2 start:0x8057EF98 end:0x8057EFA8 nw4r/snd/snd_Channel.cpp: .text start:0x8046A7B0 end:0x8046B7C8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index cfb5a8f4..d9f4cf61 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25170,11 +25170,11 @@ GetCoef__Q44nw4r3snd6detail15BiquadFilterHpfCFifPQ44nw4r3snd20BiquadFilterCallba GetCoef__Q44nw4r3snd6detail18BiquadFilterBpf512CFifPQ44nw4r3snd20BiquadFilterCallback10BiquadCoef = .text:0x8046A490; // type:function size:0x94 GetCoef__Q44nw4r3snd6detail19BiquadFilterBpf1024CFifPQ44nw4r3snd20BiquadFilterCallback10BiquadCoef = .text:0x8046A530; // type:function size:0x94 GetCoef__Q44nw4r3snd6detail19BiquadFilterBpf2048CFifPQ44nw4r3snd20BiquadFilterCallback10BiquadCoef = .text:0x8046A5D0; // type:function size:0x94 -__dt__Q44nw4r3snd6detail15BiquadFilterLpfFv = .text:0x8046A670; // type:function size:0x40 -__dt__Q44nw4r3snd6detail15BiquadFilterHpfFv = .text:0x8046A6B0; // type:function size:0x40 -__dt__Q44nw4r3snd6detail18BiquadFilterBpf512Fv = .text:0x8046A6F0; // type:function size:0x40 -__dt__Q44nw4r3snd6detail19BiquadFilterBpf1024Fv = .text:0x8046A730; // type:function size:0x40 -__dt__Q44nw4r3snd6detail19BiquadFilterBpf2048Fv = .text:0x8046A770; // type:function size:0x40 +__dt__Q44nw4r3snd6detail15BiquadFilterLpfFv = .text:0x8046A670; // type:function size:0x40 scope:weak +__dt__Q44nw4r3snd6detail15BiquadFilterHpfFv = .text:0x8046A6B0; // type:function size:0x40 scope:weak +__dt__Q44nw4r3snd6detail18BiquadFilterBpf512Fv = .text:0x8046A6F0; // type:function size:0x40 scope:weak +__dt__Q44nw4r3snd6detail19BiquadFilterBpf1024Fv = .text:0x8046A730; // type:function size:0x40 scope:weak +__dt__Q44nw4r3snd6detail19BiquadFilterBpf2048Fv = .text:0x8046A770; // type:function size:0x40 scope:weak GetInstance__Q44nw4r3snd6detail14ChannelManagerFv = .text:0x8046A7B0; // type:function size:0x74 __dt__Q44nw4r3snd6detail14ChannelManagerFv = .text:0x8046A830; // type:function size:0x60 GetRequiredMemSize__Q44nw4r3snd6detail14ChannelManagerFi = .text:0x8046A890; // type:function size:0xC @@ -29151,11 +29151,11 @@ TYPE_NAME__Q34nw4r3g3d12ScnMdlSimple = .rodata:0x804F7B30; // type:object size:0 TYPE_NAME__Q34nw4r3g3d6ScnMdl = .rodata:0x804F7B48; // type:object size:0xC TYPE_NAME__Q34nw4r3g3d14ScnMdl1Mat1Shp = .rodata:0x804F7B58; // type:object size:0x18 TYPE_NAME__Q34nw4r3g3d7ScnProc = .rodata:0x804F7B70; // type:object size:0x10 -lbl_804F7B80 = .rodata:0x804F7B80; // type:object size:0x460 -lbl_804F7FE0 = .rodata:0x804F7FE0; // type:object size:0x3CC -lbl_804F83AC = .rodata:0x804F83AC; // type:object size:0x4C4 -lbl_804F8870 = .rodata:0x804F8870; // type:object size:0x3A4 -lbl_804F8C14 = .rodata:0x804F8C14; // type:object size:0x3A4 +coefTable__Q44nw4r3snd6detail15BiquadFilterLpf = .rodata:0x804F7B80; // type:object size:0x460 +coefTable__Q44nw4r3snd6detail15BiquadFilterHpf = .rodata:0x804F7FE0; // type:object size:0x3CA +coefTable__Q44nw4r3snd6detail18BiquadFilterBpf512 = .rodata:0x804F83AC; // type:object size:0x4C4 +coefTable__Q44nw4r3snd6detail19BiquadFilterBpf1024 = .rodata:0x804F8870; // type:object size:0x3A2 +coefTable__Q44nw4r3snd6detail19BiquadFilterBpf2048 = .rodata:0x804F8C14; // type:object size:0x3A2 lbl_804F8FB8 = .rodata:0x804F8FB8; // type:object size:0x100 lbl_804F90B8 = .rodata:0x804F90B8; // type:object size:0x200 lbl_804F92B8 = .rodata:0x804F92B8; // type:object size:0x28 @@ -49667,8 +49667,8 @@ lbl_8057EF78 = .sdata2:0x8057EF78; // type:object size:0x4 align:4 data:float lbl_8057EF88 = .sdata2:0x8057EF88; // type:object size:0x4 align:4 data:float lbl_8057EF8C = .sdata2:0x8057EF8C; // type:object size:0x4 align:4 data:float lbl_8057EF90 = .sdata2:0x8057EF90; // type:object size:0x8 align:8 data:double -lbl_8057EF98 = .sdata2:0x8057EF98; // type:object size:0x8 align:8 data:double -lbl_8057EFA0 = .sdata2:0x8057EFA0; // type:object size:0x4 align:4 data:float +@212 = .sdata2:0x8057EF98; // type:object size:0x8 scope:local align:8 data:double +@247 = .sdata2:0x8057EFA0; // type:object size:0x4 scope:local align:4 data:float lbl_8057EFA8 = .sdata2:0x8057EFA8; // type:object size:0x4 align:4 data:float lbl_8057EFAC = .sdata2:0x8057EFAC; // type:object size:0x4 align:4 data:float lbl_8057EFB0 = .sdata2:0x8057EFB0; // type:object size:0x4 align:4 data:float diff --git a/configure.py b/configure.py index cba8e03c..c7ae35d8 100644 --- a/configure.py +++ b/configure.py @@ -1021,7 +1021,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_BankFile.cpp"), Object(Matching, "nw4r/snd/snd_BasicPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), - Object(NonMatching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), + Object(Matching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), Object(NonMatching, "nw4r/snd/snd_Channel.cpp"), Object(NonMatching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), Object(NonMatching, "nw4r/snd/snd_debug.cpp"), From e16b0e7289842cc8ebb98829d58fa72f46b815f2 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:18:40 +0200 Subject: [PATCH 03/91] snd_DisposeCallbackManager OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 8 ++++---- configure.py | 2 +- src/nw4r/snd/snd_DisposeCallbackManager.cpp | 5 ++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index b1a17f9c..5bbbc519 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2934,6 +2934,8 @@ nw4r/snd/snd_Channel.cpp: nw4r/snd/snd_DisposeCallbackManager.cpp: .text start:0x8046B7D0 end:0x8046BB5C align:16 + .sbss start:0x80576688 end:0x80576690 + .bss start:0x806593F8 end:0x80659410 nw4r/snd/snd_DvdSoundArchive.cpp: .text start:0x8046BB60 end:0x8046C1C8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index d9f4cf61..dad564e0 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25193,7 +25193,7 @@ VoiceCallbackFunc__Q44nw4r3snd6detail7ChannelFPQ44nw4r3snd6detail5VoiceQ54nw4r3s AllocChannel__Q44nw4r3snd6detail7ChannelFiiiPFPQ44nw4r3snd6detail7ChannelQ54nw4r3snd6detail7Channel21ChannelCallbackStatusUl_vUl = .text:0x8046B5C0; // type:function size:0x1EC FreeChannel__Q44nw4r3snd6detail7ChannelFPQ44nw4r3snd6detail7Channel = .text:0x8046B7B0; // type:function size:0x18 GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv = .text:0x8046B7D0; // type:function size:0x8C -__dt__Q44nw4r3snd6detail22DisposeCallbackManagerFv = .text:0x8046B860; // type:function size:0x5C +__dt__Q44nw4r3snd6detail22DisposeCallbackManagerFv = .text:0x8046B860; // type:function size:0x5C scope:weak RegisterDisposeCallback__Q44nw4r3snd6detail22DisposeCallbackManagerFPQ44nw4r3snd6detail15DisposeCallback = .text:0x8046B8C0; // type:function size:0x30 UnregisterDisposeCallback__Q44nw4r3snd6detail22DisposeCallbackManagerFPQ44nw4r3snd6detail15DisposeCallback = .text:0x8046B8F0; // type:function size:0x4 Dispose__Q44nw4r3snd6detail22DisposeCallbackManagerFPvUlPv = .text:0x8046B900; // type:function size:0x12C @@ -42427,7 +42427,7 @@ lbl_80576670 = .sbss:0x80576670; // type:object size:0x4 data:4byte lbl_80576674 = .sbss:0x80576674; // type:object size:0x4 data:4byte lbl_80576678 = .sbss:0x80576678; // type:object size:0x8 data:4byte lbl_80576680 = .sbss:0x80576680; // type:object size:0x8 data:byte -lbl_80576688 = .sbss:0x80576688; // type:object size:0x8 data:byte +@GUARD@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .sbss:0x80576688; // type:object size:0x1 scope:weak data:byte lbl_80576690 = .sbss:0x80576690; // type:object size:0x8 data:byte lbl_80576698 = .sbss:0x80576698; // type:object size:0x4 data:4byte lbl_8057669C = .sbss:0x8057669C; // type:object size:0x1 data:byte @@ -51938,8 +51938,8 @@ lbl_80659390 = .bss:0x80659390; // type:object size:0xC lbl_8065939C = .bss:0x8065939C; // type:object size:0x2C data:4byte lbl_806593C8 = .bss:0x806593C8; // type:object size:0x10 lbl_806593D8 = .bss:0x806593D8; // type:object size:0x20 data:4byte -lbl_806593F8 = .bss:0x806593F8; // type:object size:0xC -lbl_80659404 = .bss:0x80659404; // type:object size:0xC data:4byte +@781 = .bss:0x806593F8; // type:object size:0xC scope:local +@LOCAL@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .bss:0x80659404; // type:object size:0xC scope:weak data:4byte lbl_80659410 = .bss:0x80659410; // type:object size:0x2D8 data:byte lbl_806596E8 = .bss:0x806596E8; // type:object size:0x20 data:2byte lbl_80659708 = .bss:0x80659708; // type:object size:0x18 diff --git a/configure.py b/configure.py index c7ae35d8..571e3191 100644 --- a/configure.py +++ b/configure.py @@ -1023,7 +1023,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), Object(Matching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), Object(NonMatching, "nw4r/snd/snd_Channel.cpp"), - Object(NonMatching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), + Object(Matching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), Object(NonMatching, "nw4r/snd/snd_debug.cpp"), Object(NonMatching, "nw4r/snd/snd_DvdSoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_EnvGenerator.cpp"), diff --git a/src/nw4r/snd/snd_DisposeCallbackManager.cpp b/src/nw4r/snd/snd_DisposeCallbackManager.cpp index 060bc6fc..d10c2a5b 100644 --- a/src/nw4r/snd/snd_DisposeCallbackManager.cpp +++ b/src/nw4r/snd/snd_DisposeCallbackManager.cpp @@ -55,8 +55,7 @@ void DisposeCallbackManager::Dispose(void *mem, u32 size, void *arg ATTR_UNUSED) { decltype(itr) curItr = itr++; - // the post-increment is in ketteiban - curItr++->InvalidateData(start, end); + curItr->InvalidateData(start, end); } } @@ -73,7 +72,7 @@ void DisposeCallbackManager::DisposeWave(void *mem, u32 size, { decltype(itr) curItr = itr++; - curItr++->InvalidateWaveData(start, end); + curItr->InvalidateWaveData(start, end); } } From 5a7083ddba2e2a17170339a03c663c93ef912ef6 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:26:16 +0200 Subject: [PATCH 04/91] snd_DvdSoundArchive OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 14 +++++++------- configure.py | 2 +- src/nw4r/snd/snd_DvdSoundArchive.cpp | 20 +++++++++----------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 5bbbc519..61a4d279 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2939,6 +2939,7 @@ nw4r/snd/snd_DisposeCallbackManager.cpp: nw4r/snd/snd_DvdSoundArchive.cpp: .text start:0x8046BB60 end:0x8046C1C8 align:16 + .data start:0x8056DBE8 end:0x8056DC70 nw4r/snd/snd_EnvGenerator.cpp: .text start:0x8046C1D0 end:0x8046C5A0 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index dad564e0..a23267f9 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25209,11 +25209,11 @@ LoadHeader__Q34nw4r3snd15DvdSoundArchiveFPvUl = .text:0x8046BF60; // type:functi LoadLabelStringData__Q34nw4r3snd15DvdSoundArchiveFPvUl = .text:0x8046BFF0; // type:function size:0x88 Read__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamFPvUl = .text:0x8046C080; // type:function size:0x2C Seek__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamFlUl = .text:0x8046C0B0; // type:function size:0x80 -GetSize__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamCFv = .text:0x8046C130; // type:function size:0x8 -Tell__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamCFv = .text:0x8046C140; // type:function size:0x10 -detail_GetWaveDataFileAddress__Q34nw4r3snd15DvdSoundArchiveCFUl = .text:0x8046C150; // type:function size:0x8 -detail_GetFileAddress__Q34nw4r3snd15DvdSoundArchiveCFUl = .text:0x8046C160; // type:function size:0x8 -__dt__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamFv = .text:0x8046C170; // type:function size:0x58 +GetSize__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamCFv = .text:0x8046C130; // type:function size:0x8 scope:weak +Tell__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamCFv = .text:0x8046C140; // type:function size:0x10 scope:weak +detail_GetWaveDataFileAddress__Q34nw4r3snd15DvdSoundArchiveCFUl = .text:0x8046C150; // type:function size:0x8 scope:weak +detail_GetFileAddress__Q34nw4r3snd15DvdSoundArchiveCFUl = .text:0x8046C160; // type:function size:0x8 scope:weak +__dt__Q44nw4r3snd15DvdSoundArchive13DvdFileStreamFv = .text:0x8046C170; // type:function size:0x58 scope:weak __ct__Q44nw4r3snd6detail12EnvGeneratorFv = .text:0x8046C1D0; // type:function size:0x44 Init__Q44nw4r3snd6detail12EnvGeneratorFf = .text:0x8046C220; // type:function size:0x40 Reset__Q44nw4r3snd6detail12EnvGeneratorFf = .text:0x8046C260; // type:function size:0x18 @@ -38591,8 +38591,8 @@ __vt__Q44nw4r3snd6detail19BiquadFilterBpf1024 = .data:0x8056DBA8; // type:object __vt__Q44nw4r3snd6detail18BiquadFilterBpf512 = .data:0x8056DBB8; // type:object size:0x10 __vt__Q44nw4r3snd6detail15BiquadFilterHpf = .data:0x8056DBC8; // type:object size:0x10 __vt__Q44nw4r3snd6detail15BiquadFilterLpf = .data:0x8056DBD8; // type:object size:0x10 -lbl_8056DBE8 = .data:0x8056DBE8; // type:object size:0x68 -lbl_8056DC50 = .data:0x8056DC50; // type:object size:0x20 +__vt__Q44nw4r3snd15DvdSoundArchive13DvdFileStream = .data:0x8056DBE8; // type:object size:0x64 +__vt__Q34nw4r3snd15DvdSoundArchive = .data:0x8056DC50; // type:object size:0x20 lbl_8056DC70 = .data:0x8056DC70; // type:object size:0x28 lbl_8056DC98 = .data:0x8056DC98; // type:object size:0x60 lbl_8056DCF8 = .data:0x8056DCF8; // type:object size:0x20 diff --git a/configure.py b/configure.py index 571e3191..2f9bb007 100644 --- a/configure.py +++ b/configure.py @@ -1025,7 +1025,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_Channel.cpp"), Object(Matching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), Object(NonMatching, "nw4r/snd/snd_debug.cpp"), - Object(NonMatching, "nw4r/snd/snd_DvdSoundArchive.cpp"), + Object(Matching, "nw4r/snd/snd_DvdSoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_EnvGenerator.cpp"), Object(NonMatching, "nw4r/snd/snd_ExternalSoundPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_FrameHeap.cpp"), diff --git a/src/nw4r/snd/snd_DvdSoundArchive.cpp b/src/nw4r/snd/snd_DvdSoundArchive.cpp index 43a69d2e..ff98e4e4 100644 --- a/src/nw4r/snd/snd_DvdSoundArchive.cpp +++ b/src/nw4r/snd/snd_DvdSoundArchive.cpp @@ -56,8 +56,10 @@ bool DvdSoundArchive::Open(const char* pPath) { char extRoot[FILE_PATH_MAX]; for (int i = std::strlen(pPath) - 1; i >= 0; i--) { - if (pPath[i] == '/' || pPath[i] == '\\') { - // @bug Long path can overflow extRoot buffer + if ((pPath[i] == '/' || pPath[i] == '\\')) { + if (i >= FILE_PATH_MAX + 1) { + return false; + } std::strncpy(extRoot, pPath, i); extRoot[i] = '\0'; @@ -70,8 +72,10 @@ bool DvdSoundArchive::Open(const char* pPath) { } void DvdSoundArchive::Close() { - DVDClose(&mFileInfo); - mOpen = false; + if (mOpen) { + DVDClose(&mFileInfo); + mOpen = false; + } Shutdown(); } @@ -115,7 +119,7 @@ bool DvdSoundArchive::LoadFileHeader() { u8 headerArea[detail::SoundArchiveFile::HEADER_AREA_SIZE]; static const u32 headerAlignSize = - ut::RoundUp(sizeof(detail::SoundArchiveFile::Header), 32); + ROUND_UP(sizeof(detail::SoundArchiveFile::Header), 32); void* pFile = ut::RoundUp(headerArea, 32); @@ -173,9 +177,6 @@ bool DvdSoundArchive::LoadLabelStringData(void* pBuffer, u32 size) { DvdSoundArchive::DvdFileStream::DvdFileStream(const DVDFileInfo* pFileInfo, u32 offset, u32 size) : DvdLockedFileStream(pFileInfo, false), mOffset(offset), mSize(size) { - if (mSize == 0) { - mSize = ut::DvdFileStream::GetSize(); - } ut::DvdFileStream::Seek(mOffset, SEEKORG_BEG); } @@ -183,9 +184,6 @@ DvdSoundArchive::DvdFileStream::DvdFileStream(const DVDFileInfo* pFileInfo, DvdSoundArchive::DvdFileStream::DvdFileStream(s32 entrynum, u32 offset, u32 size) : DvdLockedFileStream(entrynum), mOffset(offset), mSize(size) { - if (mSize == 0) { - mSize = ut::DvdFileStream::GetSize(); - } ut::DvdFileStream::Seek(mOffset, SEEKORG_BEG); } From 7038a266f43549423c6627bdb5e9d1bfacf08560 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:29:50 +0200 Subject: [PATCH 05/91] snd_EnvGenerator OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 24 ++++++++++++------------ configure.py | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 61a4d279..11eb4f0a 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2943,6 +2943,8 @@ nw4r/snd/snd_DvdSoundArchive.cpp: nw4r/snd/snd_EnvGenerator.cpp: .text start:0x8046C1D0 end:0x8046C5A0 align:16 + .rodata start:0x804F8FB8 end:0x804F92B8 + .sdata2 start:0x8057EFD0 end:0x8057F000 nw4r/snd/snd_ExternalSoundPlayer.cpp: .text start:0x8046C5A0 end:0x8046CB18 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index a23267f9..93c1695a 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -29156,8 +29156,8 @@ coefTable__Q44nw4r3snd6detail15BiquadFilterHpf = .rodata:0x804F7FE0; // type:obj coefTable__Q44nw4r3snd6detail18BiquadFilterBpf512 = .rodata:0x804F83AC; // type:object size:0x4C4 coefTable__Q44nw4r3snd6detail19BiquadFilterBpf1024 = .rodata:0x804F8870; // type:object size:0x3A2 coefTable__Q44nw4r3snd6detail19BiquadFilterBpf2048 = .rodata:0x804F8C14; // type:object size:0x3A2 -lbl_804F8FB8 = .rodata:0x804F8FB8; // type:object size:0x100 -lbl_804F90B8 = .rodata:0x804F90B8; // type:object size:0x200 +DecibelSquareTable__Q44nw4r3snd6detail12EnvGenerator = .rodata:0x804F8FB8; // type:object size:0x100 +@LOCAL@SetAttack__Q44nw4r3snd6detail12EnvGeneratorFi@attackTable = .rodata:0x804F90B8; // type:object size:0x200 scope:weak lbl_804F92B8 = .rodata:0x804F92B8; // type:object size:0x28 lbl_804F92E0 = .rodata:0x804F92E0; // type:object size:0x28 data:4byte lbl_804F9308 = .rodata:0x804F9308; // type:object size:0x18 data:4byte @@ -49676,16 +49676,16 @@ lbl_8057EFB4 = .sdata2:0x8057EFB4; // type:object size:0x4 align:4 data:float lbl_8057EFB8 = .sdata2:0x8057EFB8; // type:object size:0x4 align:4 data:float lbl_8057EFC0 = .sdata2:0x8057EFC0; // type:object size:0x8 align:8 data:double lbl_8057EFC8 = .sdata2:0x8057EFC8; // type:object size:0x8 align:8 data:double -lbl_8057EFD0 = .sdata2:0x8057EFD0; // type:object size:0x4 align:4 data:float -lbl_8057EFD4 = .sdata2:0x8057EFD4; // type:object size:0x4 align:4 data:float -lbl_8057EFD8 = .sdata2:0x8057EFD8; // type:object size:0x4 align:4 data:float -lbl_8057EFDC = .sdata2:0x8057EFDC; // type:object size:0x4 align:4 data:float -lbl_8057EFE0 = .sdata2:0x8057EFE0; // type:object size:0x4 align:4 data:float -lbl_8057EFE8 = .sdata2:0x8057EFE8; // type:object size:0x8 align:8 data:double -lbl_8057EFF0 = .sdata2:0x8057EFF0; // type:object size:0x4 align:4 data:float -lbl_8057EFF4 = .sdata2:0x8057EFF4; // type:object size:0x4 align:4 data:float -lbl_8057EFF8 = .sdata2:0x8057EFF8; // type:object size:0x4 align:4 data:float -lbl_8057EFFC = .sdata2:0x8057EFFC; // type:object size:0x4 align:4 data:float +VOLUME_INIT__Q44nw4r3snd6detail12EnvGenerator = .sdata2:0x8057EFD0; // type:object size:0x4 align:4 data:float +@180 = .sdata2:0x8057EFD4; // type:object size:0x4 scope:local align:4 data:float +@181 = .sdata2:0x8057EFD8; // type:object size:0x4 scope:local align:4 data:float +@189 = .sdata2:0x8057EFDC; // type:object size:0x4 scope:local align:4 data:float +@210 = .sdata2:0x8057EFE0; // type:object size:0x4 scope:local align:4 data:float +@213 = .sdata2:0x8057EFE8; // type:object size:0x8 scope:local align:8 data:double +@224 = .sdata2:0x8057EFF0; // type:object size:0x4 scope:local align:4 data:float +@225 = .sdata2:0x8057EFF4; // type:object size:0x4 scope:local align:4 data:float +@226 = .sdata2:0x8057EFF8; // type:object size:0x4 scope:local align:4 data:float +@227 = .sdata2:0x8057EFFC; // type:object size:0x4 scope:local align:4 data:float lbl_8057F000 = .sdata2:0x8057F000; // type:object size:0x4 align:4 data:float lbl_8057F004 = .sdata2:0x8057F004; // type:object size:0x4 align:4 data:float lbl_8057F008 = .sdata2:0x8057F008; // type:object size:0x4 align:4 data:float diff --git a/configure.py b/configure.py index 2f9bb007..e4c39068 100644 --- a/configure.py +++ b/configure.py @@ -1026,7 +1026,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), Object(NonMatching, "nw4r/snd/snd_debug.cpp"), Object(Matching, "nw4r/snd/snd_DvdSoundArchive.cpp"), - Object(NonMatching, "nw4r/snd/snd_EnvGenerator.cpp"), + Object(Matching, "nw4r/snd/snd_EnvGenerator.cpp"), Object(NonMatching, "nw4r/snd/snd_ExternalSoundPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_FrameHeap.cpp"), Object(NonMatching, "nw4r/snd/snd_FxBase.cpp"), From 6272daffa4f0aaffebd8a28abc85d7201b4faca5 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:41:53 +0200 Subject: [PATCH 06/91] snd_FrameHeap OK --- configure.py | 2 +- include/nw4r/snd/snd_FrameHeap.h | 17 +++++++---------- src/nw4r/snd/snd_FrameHeap.cpp | 9 +++++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/configure.py b/configure.py index e4c39068..c0e8045f 100644 --- a/configure.py +++ b/configure.py @@ -1028,7 +1028,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_DvdSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_EnvGenerator.cpp"), Object(NonMatching, "nw4r/snd/snd_ExternalSoundPlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_FrameHeap.cpp"), + Object(Matching, "nw4r/snd/snd_FrameHeap.cpp"), Object(NonMatching, "nw4r/snd/snd_FxBase.cpp"), Object(NonMatching, "nw4r/snd/snd_FxChorus.cpp"), Object(NonMatching, "nw4r/snd/snd_FxDelay.cpp"), diff --git a/include/nw4r/snd/snd_FrameHeap.h b/include/nw4r/snd/snd_FrameHeap.h index 3fe9d628..86b4b3ed 100644 --- a/include/nw4r/snd/snd_FrameHeap.h +++ b/include/nw4r/snd/snd_FrameHeap.h @@ -34,22 +34,19 @@ public: private: struct Block { NW4R_UT_LIST_NODE_DECL(); // at 0x0 - u32 mSize; // at 0x8 - FreeCallback mCallback; // at 0xc - void *mCallbackArg; // at 0x10 + void *mpBuffer; // at 0x8 + u32 mSize; // at 0xC + FreeCallback mCallback; // at 0x10 + void *mCallbackArg; // at 0x14 - Block(u32 size, FreeCallback pCallback, void *pCallbackArg) - : mSize(size), mCallback(pCallback), mCallbackArg(pCallbackArg) {} + Block(void *pBuffer2, u32 size, FreeCallback pCallback, void *pCallbackArg) + : mSize(size), mCallback(pCallback), mCallbackArg(pCallbackArg), mpBuffer(pBuffer2) {} ~Block() { if (mCallback != NULL) { - mCallback(GetBufferAddr(), mSize, mCallbackArg); + mCallback(mpBuffer, mSize, mCallbackArg); } } - - void *GetBufferAddr() { - return ut::AddOffsetToPtr(this, BLOCK_BUFFER_SIZE); - } }; NW4R_UT_LIST_TYPEDEF_DECL(Block); diff --git a/src/nw4r/snd/snd_FrameHeap.cpp b/src/nw4r/snd/snd_FrameHeap.cpp index 5c67fdad..31202906 100644 --- a/src/nw4r/snd/snd_FrameHeap.cpp +++ b/src/nw4r/snd/snd_FrameHeap.cpp @@ -63,10 +63,11 @@ void* FrameHeap::Alloc(u32 size, FreeCallback pCallback, void* pCallbackArg) { return NULL; } - Block* pBlock = new (pBuffer) Block(size, pCallback, pCallbackArg); + void *pBuffer2 = ut::AddOffsetToPtr(pBuffer, BLOCK_BUFFER_SIZE); + Block* pBlock = new (pBuffer) Block(pBuffer2, size, pCallback, pCallbackArg); mSectionList.GetBack().AppendBlock(pBlock); - return pBlock->GetBufferAddr(); + return pBuffer2; } int FrameHeap::SaveState() { @@ -106,11 +107,11 @@ int FrameHeap::GetCurrentLevel() const { u32 FrameHeap::GetFreeSize() const { u32 freeSize = MEMGetAllocatableSizeForFrmHeapEx(mHandle, HEAP_ALIGN); - if (freeSize < BLOCK_BUFFER_SIZE) { + if (freeSize < sizeof(Block)) { return 0; } - return ut::RoundDown(freeSize - BLOCK_BUFFER_SIZE, HEAP_ALIGN); + return ut::RoundDown(freeSize - sizeof(Block), HEAP_ALIGN); } bool FrameHeap::NewSection() { From f849d66b2c0dd541587e80d516babc5a8ece3a7b Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:42:32 +0200 Subject: [PATCH 07/91] snd_InstancePool OK --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index c0e8045f..2d7db55f 100644 --- a/configure.py +++ b/configure.py @@ -1036,7 +1036,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_FxReverbHiDpl2.cpp"), Object(NonMatching, "nw4r/snd/snd_FxReverbStd.cpp"), Object(NonMatching, "nw4r/snd/snd_FxReverbStdDpl2.cpp"), - Object(NonMatching, "nw4r/snd/snd_InstancePool.cpp"), + Object(Matching, "nw4r/snd/snd_InstancePool.cpp"), Object(NonMatching, "nw4r/snd/snd_Lfo.cpp"), Object(NonMatching, "nw4r/snd/snd_MemorySoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), From 8ed188fb25d36e2da0a38634f954c0cba447e533 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:44:44 +0200 Subject: [PATCH 08/91] snd_Lfo OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 18 +++++++++--------- configure.py | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 11eb4f0a..228a46de 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2960,6 +2960,8 @@ nw4r/snd/snd_InstancePool.cpp: nw4r/snd/snd_Lfo.cpp: .text start:0x8046DD00 end:0x8046DF08 align:16 + .rodata start:0x804F92B8 end:0x804F92E0 + .sdata2 start:0x8057F018 end:0x8057F048 nw4r/snd/snd_MemorySoundArchive.cpp: .text start:0x8046DF10 end:0x8046E3B0 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 93c1695a..023b855d 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -29158,7 +29158,7 @@ coefTable__Q44nw4r3snd6detail19BiquadFilterBpf1024 = .rodata:0x804F8870; // type coefTable__Q44nw4r3snd6detail19BiquadFilterBpf2048 = .rodata:0x804F8C14; // type:object size:0x3A2 DecibelSquareTable__Q44nw4r3snd6detail12EnvGenerator = .rodata:0x804F8FB8; // type:object size:0x100 @LOCAL@SetAttack__Q44nw4r3snd6detail12EnvGeneratorFi@attackTable = .rodata:0x804F90B8; // type:object size:0x200 scope:weak -lbl_804F92B8 = .rodata:0x804F92B8; // type:object size:0x28 +@LOCAL@GetSinIdx__Q44nw4r3snd6detail3LfoFi@sinTable = .rodata:0x804F92B8; // type:object size:0x21 scope:weak lbl_804F92E0 = .rodata:0x804F92E0; // type:object size:0x28 data:4byte lbl_804F9308 = .rodata:0x804F9308; // type:object size:0x18 data:4byte lbl_804F9320 = .rodata:0x804F9320; // type:object size:0x30 @@ -49692,14 +49692,14 @@ lbl_8057F008 = .sdata2:0x8057F008; // type:object size:0x4 align:4 data:float lbl_8057F00C = .sdata2:0x8057F00C; // type:object size:0x4 align:4 data:float lbl_8057F010 = .sdata2:0x8057F010; // type:object size:0x4 align:4 data:float lbl_8057F014 = .sdata2:0x8057F014; // type:object size:0x4 align:4 data:float -lbl_8057F018 = .sdata2:0x8057F018; // type:object size:0x4 align:4 data:float -lbl_8057F01C = .sdata2:0x8057F01C; // type:object size:0x4 align:4 data:float -lbl_8057F020 = .sdata2:0x8057F020; // type:object size:0x4 align:4 data:float -lbl_8057F028 = .sdata2:0x8057F028; // type:object size:0x8 align:8 data:double -lbl_8057F030 = .sdata2:0x8057F030; // type:object size:0x4 align:4 data:float -lbl_8057F034 = .sdata2:0x8057F034; // type:object size:0x4 align:4 data:float -lbl_8057F038 = .sdata2:0x8057F038; // type:object size:0x4 align:4 data:float -lbl_8057F040 = .sdata2:0x8057F040; // type:object size:0x8 align:8 data:double +@94 = .sdata2:0x8057F018; // type:object size:0x4 scope:local align:4 data:float +@95 = .sdata2:0x8057F01C; // type:object size:0x4 scope:local align:4 data:float +@110 = .sdata2:0x8057F020; // type:object size:0x4 scope:local align:4 data:float +@113 = .sdata2:0x8057F028; // type:object size:0x8 scope:local align:8 data:double +@123 = .sdata2:0x8057F030; // type:object size:0x4 scope:local align:4 data:float +@124 = .sdata2:0x8057F034; // type:object size:0x4 scope:local align:4 data:float +@125 = .sdata2:0x8057F038; // type:object size:0x4 scope:local align:4 data:float +@129 = .sdata2:0x8057F040; // type:object size:0x8 scope:local align:8 data:double lbl_8057F048 = .sdata2:0x8057F048; // type:object size:0x4 align:4 data:float lbl_8057F04C = .sdata2:0x8057F04C; // type:object size:0x4 align:4 data:float lbl_8057F050 = .sdata2:0x8057F050; // type:object size:0x4 align:4 data:float diff --git a/configure.py b/configure.py index 2d7db55f..45fd316a 100644 --- a/configure.py +++ b/configure.py @@ -1037,7 +1037,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_FxReverbStd.cpp"), Object(NonMatching, "nw4r/snd/snd_FxReverbStdDpl2.cpp"), Object(Matching, "nw4r/snd/snd_InstancePool.cpp"), - Object(NonMatching, "nw4r/snd/snd_Lfo.cpp"), + Object(Matching, "nw4r/snd/snd_Lfo.cpp"), Object(NonMatching, "nw4r/snd/snd_MemorySoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlParser.cpp"), From a4c0a6bbd99415a0bfb8b3faa90f63b014226d8c Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:49:45 +0200 Subject: [PATCH 09/91] snd_MemorySoundArchive OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 23 +++++++++++------------ configure.py | 7 ++++--- src/nw4r/snd/snd_MemorySoundArchive.cpp | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 228a46de..328dbb5d 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2965,6 +2965,7 @@ nw4r/snd/snd_Lfo.cpp: nw4r/snd/snd_MemorySoundArchive.cpp: .text start:0x8046DF10 end:0x8046E3B0 align:16 + .data start:0x8056DC98 end:0x8056DD18 nw4r/snd/snd_MidiSeqPlayer.cpp: .text start:0x8046E3B0 end:0x8046E458 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 023b855d..5746ec6b 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25271,16 +25271,15 @@ OpenExtStream__Q34nw4r3snd18MemorySoundArchiveCFPviPCcUlUl = .text:0x8046E210; / detail_GetRequiredStreamBufferSize__Q34nw4r3snd18MemorySoundArchiveCFv = .text:0x8046E220; // type:function size:0x8 Close__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamFv = .text:0x8046E230; // type:function size:0x14 Read__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamFPvUl = .text:0x8046E250; // type:function size:0x58 -Seek__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamFlUl = .text:0x8046E2B0; // type:function size:0x44 -fn_8046E2F4 = .text:0x8046E2F4; // type:function size:0x4 -GetSize__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E300; // type:function size:0x8 -Tell__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E310; // type:function size:0x8 -CanWrite__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E320; // type:function size:0x8 -CanRead__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E330; // type:function size:0x8 -CanAsync__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E340; // type:function size:0x8 -CanCancel__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E350; // type:function size:0x8 -CanSeek__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E360; // type:function size:0x8 -__dt__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamFv = .text:0x8046E370; // type:function size:0x40 +Seek__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamFlUl = .text:0x8046E2B0; // type:function size:0x48 +GetSize__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E300; // type:function size:0x8 scope:weak +Tell__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E310; // type:function size:0x8 scope:weak +CanWrite__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E320; // type:function size:0x8 scope:weak +CanRead__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E330; // type:function size:0x8 scope:weak +CanAsync__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E340; // type:function size:0x8 scope:weak +CanCancel__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E350; // type:function size:0x8 scope:weak +CanSeek__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E360; // type:function size:0x8 scope:weak +__dt__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamFv = .text:0x8046E370; // type:function size:0x40 scope:weak OnUpdateFrameSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E3B0; // type:function size:0x4 OnShutdownSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E3C0; // type:function size:0x10 InvalidateWaveData__Q44nw4r3snd6detail9SeqPlayerFPCvPCv = .text:0x8046E3D0; // type:function size:0x4 @@ -38594,8 +38593,8 @@ __vt__Q44nw4r3snd6detail15BiquadFilterLpf = .data:0x8056DBD8; // type:object siz __vt__Q44nw4r3snd15DvdSoundArchive13DvdFileStream = .data:0x8056DBE8; // type:object size:0x64 __vt__Q34nw4r3snd15DvdSoundArchive = .data:0x8056DC50; // type:object size:0x20 lbl_8056DC70 = .data:0x8056DC70; // type:object size:0x28 -lbl_8056DC98 = .data:0x8056DC98; // type:object size:0x60 -lbl_8056DCF8 = .data:0x8056DCF8; // type:object size:0x20 +__vt__Q44nw4r3snd18MemorySoundArchive16MemoryFileStream = .data:0x8056DC98; // type:object size:0x5C +__vt__Q34nw4r3snd18MemorySoundArchive = .data:0x8056DCF8; // type:object size:0x20 lbl_8056DD18 = .data:0x8056DD18; // type:object size:0x28 jumptable_8056DD40 = .data:0x8056DD40; // type:object size:0x1F4 scope:local lbl_8056DF38 = .data:0x8056DF38; // type:object size:0x10 diff --git a/configure.py b/configure.py index 45fd316a..18f06a95 100644 --- a/configure.py +++ b/configure.py @@ -313,10 +313,10 @@ def EGGLib(lib_name, objects): } -def nw4rLib(lib_name, objects, extra_cflags=[]): +def nw4rLib(lib_name, objects, extra_cflags=[], mw_version=None): return { "lib": lib_name, - "mw_version": "Wii/1.3", # most seem to be around 1.2, snd is 1.6 + "mw_version": mw_version or "Wii/1.3", # most seem to be around 1.2, snd is 1.6 "cflags": cflags_nw4r + extra_cflags, "progress_category": "nw4r", "host": False, @@ -1038,7 +1038,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_FxReverbStdDpl2.cpp"), Object(Matching, "nw4r/snd/snd_InstancePool.cpp"), Object(Matching, "nw4r/snd/snd_Lfo.cpp"), - Object(NonMatching, "nw4r/snd/snd_MemorySoundArchive.cpp"), + Object(Matching, "nw4r/snd/snd_MemorySoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlParser.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlSeqTrack.cpp"), @@ -1087,6 +1087,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_WsdPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_adpcm.cpp"), ], + mw_version="Wii/1.6", ), nw4rLib( "lyt", diff --git a/src/nw4r/snd/snd_MemorySoundArchive.cpp b/src/nw4r/snd/snd_MemorySoundArchive.cpp index 5faa944c..45dbe9ab 100644 --- a/src/nw4r/snd/snd_MemorySoundArchive.cpp +++ b/src/nw4r/snd/snd_MemorySoundArchive.cpp @@ -176,7 +176,7 @@ void MemorySoundArchive::MemoryFileStream::Seek(s32 offset, u32 origin) default: NW4RPanicMessage_Line(234, "Unsupported Seek origin"); - break; + return; } } From 306f620a9f8d5a54bb4d2a54e06e5aec1d6403e7 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:51:08 +0200 Subject: [PATCH 10/91] snd_MidiSeqPlayer OK --- config/SOUE01/symbols.txt | 22 +++++++++++----------- configure.py | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 5746ec6b..c08478ef 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25280,17 +25280,17 @@ CanAsync__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E34 CanCancel__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E350; // type:function size:0x8 scope:weak CanSeek__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamCFv = .text:0x8046E360; // type:function size:0x8 scope:weak __dt__Q44nw4r3snd18MemorySoundArchive16MemoryFileStreamFv = .text:0x8046E370; // type:function size:0x40 scope:weak -OnUpdateFrameSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E3B0; // type:function size:0x4 -OnShutdownSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E3C0; // type:function size:0x10 -InvalidateWaveData__Q44nw4r3snd6detail9SeqPlayerFPCvPCv = .text:0x8046E3D0; // type:function size:0x4 -OnUpdateVoiceSoundThread__Q54nw4r3snd6detail11SoundThread14PlayerCallbackFv = .text:0x8046E3E0; // type:function size:0x4 -IsPause__Q44nw4r3snd6detail9SeqPlayerCFv = .text:0x8046E3F0; // type:function size:0x8 -IsStarted__Q44nw4r3snd6detail9SeqPlayerCFv = .text:0x8046E400; // type:function size:0x8 -IsActive__Q44nw4r3snd6detail9SeqPlayerCFv = .text:0x8046E410; // type:function size:0x8 -@180@InvalidateWaveData__Q44nw4r3snd6detail9SeqPlayerFPCvPCv = .text:0x8046E420; // type:function size:0x8 -@180@InvalidateData__Q44nw4r3snd6detail9SeqPlayerFPCvPCv = .text:0x8046E430; // type:function size:0x8 -@192@OnShutdownSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E440; // type:function size:0x8 -@192@OnUpdateFrameSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E450; // type:function size:0x8 +OnUpdateFrameSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E3B0; // type:function size:0x4 scope:weak +OnShutdownSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E3C0; // type:function size:0x10 scope:weak +InvalidateWaveData__Q44nw4r3snd6detail9SeqPlayerFPCvPCv = .text:0x8046E3D0; // type:function size:0x4 scope:weak +OnUpdateVoiceSoundThread__Q54nw4r3snd6detail11SoundThread14PlayerCallbackFv = .text:0x8046E3E0; // type:function size:0x4 scope:weak +IsPause__Q44nw4r3snd6detail9SeqPlayerCFv = .text:0x8046E3F0; // type:function size:0x8 scope:weak +IsStarted__Q44nw4r3snd6detail9SeqPlayerCFv = .text:0x8046E400; // type:function size:0x8 scope:weak +IsActive__Q44nw4r3snd6detail9SeqPlayerCFv = .text:0x8046E410; // type:function size:0x8 scope:weak +@180@InvalidateWaveData__Q44nw4r3snd6detail9SeqPlayerFPCvPCv = .text:0x8046E420; // type:function size:0x8 scope:weak +@180@InvalidateData__Q44nw4r3snd6detail9SeqPlayerFPCvPCv = .text:0x8046E430; // type:function size:0x8 scope:weak +@192@OnShutdownSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E440; // type:function size:0x8 scope:weak +@192@OnUpdateFrameSoundThread__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x8046E450; // type:function size:0x8 scope:weak Parse__Q44nw4r3snd6detail9MmlParserCFPQ44nw4r3snd6detail11MmlSeqTrackb = .text:0x8046E460; // type:function size:0x68C CommandProc__Q44nw4r3snd6detail9MmlParserCFPQ44nw4r3snd6detail11MmlSeqTrackUlll = .text:0x8046EAF0; // type:function size:0x97C NoteOnCommandProc__Q44nw4r3snd6detail9MmlParserCFPQ44nw4r3snd6detail11MmlSeqTrackiilb = .text:0x8046F470; // type:function size:0x18 diff --git a/configure.py b/configure.py index 18f06a95..90819320 100644 --- a/configure.py +++ b/configure.py @@ -1039,7 +1039,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_InstancePool.cpp"), Object(Matching, "nw4r/snd/snd_Lfo.cpp"), Object(Matching, "nw4r/snd/snd_MemorySoundArchive.cpp"), - Object(NonMatching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), + Object(Matching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlParser.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlSeqTrack.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), From 0635ce50fce4e5407945859bc41888cc8fba9623 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:57:30 +0200 Subject: [PATCH 11/91] snd_PlayerHeap OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 2 +- configure.py | 2 +- src/nw4r/snd/snd_MmlParser.cpp | 2 +- src/nw4r/snd/snd_NandSoundArchive.cpp | 6 ------ 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 328dbb5d..3c007224 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2984,6 +2984,7 @@ nw4r/snd/snd_NandSoundArchive.cpp: nw4r/snd/snd_PlayerHeap.cpp: .text start:0x804700C0 end:0x804702DC align:16 + .data start:0x8056DFF0 end:0x8056E000 nw4r/snd/snd_RemoteSpeaker.cpp: .text start:0x804702E0 end:0x80470C90 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index c08478ef..efdbde41 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -38602,7 +38602,7 @@ lbl_8056DF48 = .data:0x8056DF48; // type:object size:0x10 lbl_8056DF58 = .data:0x8056DF58; // type:object size:0x18 lbl_8056DF70 = .data:0x8056DF70; // type:object size:0x60 lbl_8056DFD0 = .data:0x8056DFD0; // type:object size:0x20 -lbl_8056DFF0 = .data:0x8056DFF0; // type:object size:0x10 +__vt__Q44nw4r3snd6detail10PlayerHeap = .data:0x8056DFF0; // type:object size:0x10 lbl_8056E000 = .data:0x8056E000; // type:object size:0xC data:4byte lbl_8056E00C = .data:0x8056E00C; // type:object size:0xC data:4byte lbl_8056E018 = .data:0x8056E018; // type:object size:0xC data:4byte diff --git a/configure.py b/configure.py index 90819320..3e6bd835 100644 --- a/configure.py +++ b/configure.py @@ -1044,7 +1044,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_MmlSeqTrack.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), - Object(NonMatching, "nw4r/snd/snd_PlayerHeap.cpp"), + Object(Matching, "nw4r/snd/snd_PlayerHeap.cpp"), Object(NonMatching, "nw4r/snd/snd_RemoteSpeaker.cpp"), Object(NonMatching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqFile.cpp"), diff --git a/src/nw4r/snd/snd_MmlParser.cpp b/src/nw4r/snd/snd_MmlParser.cpp index d481920f..56fe73b2 100644 --- a/src/nw4r/snd/snd_MmlParser.cpp +++ b/src/nw4r/snd/snd_MmlParser.cpp @@ -159,7 +159,7 @@ MmlSeqTrack::ParseResult MmlParser::Parse(MmlSeqTrack *track, s32 commandArg1 = 0; s32 commandArg2 = 0; - switch (static_cast(cmd & MML_CMD_SET_MASK)) + switch (cmd & MML_CMD_SET_MASK) { case 0x80: { diff --git a/src/nw4r/snd/snd_NandSoundArchive.cpp b/src/nw4r/snd/snd_NandSoundArchive.cpp index e37db9d9..2e104f72 100644 --- a/src/nw4r/snd/snd_NandSoundArchive.cpp +++ b/src/nw4r/snd/snd_NandSoundArchive.cpp @@ -193,9 +193,6 @@ NandSoundArchive::NandFileStream::NandFileStream(const NANDFileInfo* pFileInfo, mSize(size) { if (IsAvailable()) { - if (mSize == 0) { - mSize = ut::NandFileStream::GetSize(); - } ut::NandFileStream::Seek(mOffset, SEEKORG_BEG); } @@ -208,9 +205,6 @@ NandSoundArchive::NandFileStream::NandFileStream(const char* pPath, u32 offset, mSize(size) { if (IsAvailable()) { - if (mSize == 0) { - mSize = ut::NandFileStream::GetSize(); - } ut::NandFileStream::Seek(mOffset, SEEKORG_BEG); } From e35df56bcdfc7875aa2e3adfcc16bab93435e9ae Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 22:59:22 +0200 Subject: [PATCH 12/91] snd_RemoteSpeaker OK --- configure.py | 2 +- src/nw4r/snd/snd_RemoteSpeaker.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index 3e6bd835..166276f1 100644 --- a/configure.py +++ b/configure.py @@ -1045,7 +1045,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_PlayerHeap.cpp"), - Object(NonMatching, "nw4r/snd/snd_RemoteSpeaker.cpp"), + Object(Matching, "nw4r/snd/snd_RemoteSpeaker.cpp"), Object(NonMatching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqFile.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqPlayer.cpp"), diff --git a/src/nw4r/snd/snd_RemoteSpeaker.cpp b/src/nw4r/snd/snd_RemoteSpeaker.cpp index 9f97bd70..74a7357d 100644 --- a/src/nw4r/snd/snd_RemoteSpeaker.cpp +++ b/src/nw4r/snd/snd_RemoteSpeaker.cpp @@ -58,8 +58,8 @@ bool RemoteSpeaker::Setup(WPADCallback pCallback) { mValidCallbackFlag = false; } - mWpadCallback = pCallback; mUserCommand = COMMAND_SPEAKER_ON; + mWpadCallback = pCallback; mInitFlag = true; return true; @@ -357,7 +357,7 @@ void RemoteSpeaker::ContinueAlarmHandler(OSAlarm* pAlarm, OSContext* pCtx) { RemoteSpeaker* p = static_cast(OSGetAlarmUserData(pAlarm)); // p->mForceResumeFlag = true; - p->mContinueFlag = false; + // p->mContinueFlag = false; } void RemoteSpeaker::IntervalAlarmHandler(OSAlarm* pAlarm, OSContext* pCtx) { From b92b53f1e125b9dfebc66790a1b678cd784312fa Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:01:41 +0200 Subject: [PATCH 13/91] snd_RemoteSpeakerManager OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 10 +++++----- configure.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 3c007224..e94192e9 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2991,6 +2991,8 @@ nw4r/snd/snd_RemoteSpeaker.cpp: nw4r/snd/snd_RemoteSpeakerManager.cpp: .text start:0x80470C90 end:0x80470ED8 align:16 + .sbss start:0x805766A0 end:0x805766A8 + .bss start:0x80659410 end:0x806596E8 nw4r/snd/snd_SeqFile.cpp: .text start:0x80470EE0 end:0x80471018 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index efdbde41..2c386f32 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -21750,9 +21750,9 @@ fn_8039DBF0 = .text:0x8039DBF0; // type:function size:0x4 fn_8039DC00 = .text:0x8039DC00; // type:function size:0xEC fn_8039DCF0 = .text:0x8039DCF0; // type:function size:0x1F8 AXRegisterCallback = .text:0x8039DEF0; // type:function size:0x44 -fn_8039DF40 = .text:0x8039DF40; // type:function size:0x2C -fn_8039DF70 = .text:0x8039DF70; // type:function size:0xC4 -fn_8039E040 = .text:0x8039E040; // type:function size:0x58 +AXRmtGetSamplesLeft = .text:0x8039DF40; // type:function size:0x2C +AXRmtGetSamples = .text:0x8039DF70; // type:function size:0xC4 +AXRmtAdvancePtr = .text:0x8039E040; // type:function size:0x58 fn_8039E0A0 = .text:0x8039E0A0; // type:function size:0xC fn_8039E0B0 = .text:0x8039E0B0; // type:function size:0x6C fn_8039E120 = .text:0x8039E120; // type:function size:0x6C @@ -42430,7 +42430,7 @@ lbl_80576680 = .sbss:0x80576680; // type:object size:0x8 data:byte lbl_80576690 = .sbss:0x80576690; // type:object size:0x8 data:byte lbl_80576698 = .sbss:0x80576698; // type:object size:0x4 data:4byte lbl_8057669C = .sbss:0x8057669C; // type:object size:0x1 data:byte -lbl_805766A0 = .sbss:0x805766A0; // type:object size:0x8 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 lbl_805766B0 = .sbss:0x805766B0; // type:object size:0x8 data:byte isSoundSystemInit = .sbss:0x805766B8; // type:object size:0x1 data:byte @@ -51939,7 +51939,7 @@ lbl_806593C8 = .bss:0x806593C8; // type:object size:0x10 lbl_806593D8 = .bss:0x806593D8; // type:object size:0x20 data:4byte @781 = .bss:0x806593F8; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .bss:0x80659404; // type:object size:0xC scope:weak data:4byte -lbl_80659410 = .bss:0x80659410; // type:object size:0x2D8 data:byte +@LOCAL@GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv@instance = .bss:0x80659410; // type:object size:0x2D8 scope:weak data:byte lbl_806596E8 = .bss:0x806596E8; // type:object size:0x20 data:2byte lbl_80659708 = .bss:0x80659708; // type:object size:0x18 lbl_80659720 = .bss:0x80659720; // type:object size:0x10 diff --git a/configure.py b/configure.py index 166276f1..ed5324f2 100644 --- a/configure.py +++ b/configure.py @@ -1046,7 +1046,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_PlayerHeap.cpp"), Object(Matching, "nw4r/snd/snd_RemoteSpeaker.cpp"), - Object(NonMatching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), + Object(Matching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqFile.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqSound.cpp"), From db200eda22bd9645a0725897290a47237338fbce Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:02:35 +0200 Subject: [PATCH 14/91] snd_SeqFile OK --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index ed5324f2..693a0f7d 100644 --- a/configure.py +++ b/configure.py @@ -1047,7 +1047,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_PlayerHeap.cpp"), Object(Matching, "nw4r/snd/snd_RemoteSpeaker.cpp"), Object(Matching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), - Object(NonMatching, "nw4r/snd/snd_SeqFile.cpp"), + Object(Matching, "nw4r/snd/snd_SeqFile.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqSound.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqSoundHandle.cpp"), From 6d6b7a41ca10694376e73d103a0ec2f2bc00e7e2 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:10:54 +0200 Subject: [PATCH 15/91] snd_AxVoiceManager OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 8 ++++---- configure.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index e94192e9..a6ac17a4 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2904,6 +2904,8 @@ nw4r/snd/snd_AxVoice.cpp: nw4r/snd/snd_AxVoiceManager.cpp: .text start:0x80467640 end:0x80467DC8 align:16 + .sbss start:0x80576668 end:0x80576670 + .bss start:0x80659390 end:0x806593C8 nw4r/snd/snd_AxfxImpl.cpp: .text start:0x80467DD0 end:0x80467FC8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 2c386f32..a44a13fb 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25088,7 +25088,7 @@ SetVoiceSrcType__Q44nw4r3snd6detail17AxVoiceParamBlockFUl = .text:0x804671E0; // SetVoiceRmtMix__Q44nw4r3snd6detail17AxVoiceParamBlockFRC11_AXPBRMTMIX = .text:0x804672C0; // type:function size:0x1EC SetVoiceRmtIIRCoefs__Q44nw4r3snd6detail17AxVoiceParamBlockFUse = .text:0x804674B0; // type:function size:0x184 GetInstance__Q44nw4r3snd6detail14AxVoiceManagerFv = .text:0x80467640; // type:function size:0x8C -__dt__Q44nw4r3snd6detail14AxVoiceManagerFv = .text:0x804676D0; // type:function size:0x84 +__dt__Q44nw4r3snd6detail14AxVoiceManagerFv = .text:0x804676D0; // type:function size:0x84 scope:weak GetRequiredMemSize__Q44nw4r3snd6detail14AxVoiceManagerFi = .text:0x80467760; // type:function size:0xC Setup__Q44nw4r3snd6detail14AxVoiceManagerFPvUl = .text:0x80467770; // type:function size:0xBC AcquireAxVoice__Q44nw4r3snd6detail14AxVoiceManagerFUlPFPQ44nw4r3snd6detail7AxVoiceQ54nw4r3snd6detail7AxVoice21AxVoiceCallbackStatusPv_vPv = .text:0x80467830; // type:function size:0x2B8 @@ -42421,7 +42421,7 @@ sBiquadFilterBpf1024__Q44nw4r3snd6detail9AxManager = .sbss:0x8057665C; // type:o sBiquadFilterBpf2048__Q44nw4r3snd6detail9AxManager = .sbss:0x80576660; // type:object size:0x4 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail9AxManagerFv@instance = .sbss:0x80576664; // type:object size:0x1 scope:weak data:byte @LOCAL@AiDmaCallbackFunc__Q44nw4r3snd6detail9AxManagerFv@finishedFlag = .sbss:0x80576665; // type:object size:0x1 scope:weak data:byte -lbl_80576668 = .sbss:0x80576668; // type:object size:0x8 data:byte +@GUARD@GetInstance__Q44nw4r3snd6detail14AxVoiceManagerFv@instance = .sbss:0x80576668; // type:object size:0x1 scope:weak data:byte lbl_80576670 = .sbss:0x80576670; // type:object size:0x4 data:4byte lbl_80576674 = .sbss:0x80576674; // type:object size:0x4 data:4byte lbl_80576678 = .sbss:0x80576678; // type:object size:0x8 data:4byte @@ -51933,8 +51933,8 @@ sZeroBuffer__Q44nw4r3snd6detail9AxManager = .bss:0x80658F80; // type:object size sBiquadFilterCallbackTable__Q44nw4r3snd6detail9AxManager = .bss:0x80659080; // type:object size:0x200 @1190 = .bss:0x80659280; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail9AxManagerFv@instance = .bss:0x8065928C; // type:object size:0x104 scope:weak data:4byte -lbl_80659390 = .bss:0x80659390; // type:object size:0xC -lbl_8065939C = .bss:0x8065939C; // type:object size:0x2C data:4byte +@986 = .bss:0x80659390; // type:object size:0xC scope:local +@LOCAL@GetInstance__Q44nw4r3snd6detail14AxVoiceManagerFv@instance = .bss:0x8065939C; // type:object size:0x2C scope:weak data:4byte lbl_806593C8 = .bss:0x806593C8; // type:object size:0x10 lbl_806593D8 = .bss:0x806593D8; // type:object size:0x20 data:4byte @781 = .bss:0x806593F8; // type:object size:0xC scope:local diff --git a/configure.py b/configure.py index 693a0f7d..7003dbba 100644 --- a/configure.py +++ b/configure.py @@ -1015,7 +1015,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_AnimSound.cpp"), Object(Matching, "nw4r/snd/snd_AxManager.cpp"), Object(NonMatching, "nw4r/snd/snd_AxVoice.cpp"), - Object(NonMatching, "nw4r/snd/snd_AxVoiceManager.cpp"), + Object(Matching, "nw4r/snd/snd_AxVoiceManager.cpp"), Object(NonMatching, "nw4r/snd/snd_AxfxImpl.cpp"), Object(NonMatching, "nw4r/snd/snd_Bank.cpp"), Object(NonMatching, "nw4r/snd/snd_BankFile.cpp"), From 9302e6b1a9d5a9b21f9199d50d2724e0ac078fe6 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:14:24 +0200 Subject: [PATCH 16/91] snd_BankFile OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 2 +- configure.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index a6ac17a4..c8b9c60e 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2915,6 +2915,7 @@ nw4r/snd/snd_Bank.cpp: nw4r/snd/snd_BankFile.cpp: .text start:0x80468250 end:0x8046890C align:16 + .sdata2 start:0x8057EF78 end:0x8057EF80 nw4r/snd/snd_BasicPlayer.cpp: .text start:0x80468910 end:0x80468B50 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index a44a13fb..57386b7f 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -49660,7 +49660,7 @@ lbl_8057EF5C = .sdata2:0x8057EF5C; // type:object size:0x4 align:4 data:float lbl_8057EF60 = .sdata2:0x8057EF60; // type:object size:0x4 align:4 data:float lbl_8057EF68 = .sdata2:0x8057EF68; // type:object size:0x8 align:8 data:double lbl_8057EF70 = .sdata2:0x8057EF70; // type:object size:0x8 align:8 data:double -lbl_8057EF78 = .sdata2:0x8057EF78; // type:object size:0x4 align:4 data:float +@1860 = .sdata2:0x8057EF78; // type:object size:0x4 scope:local align:4 data:float @608 = .sdata2:0x8057EF80; // type:object size:0x4 scope:local align:4 data:float @609 = .sdata2:0x8057EF84; // type:object size:0x4 scope:local align:4 data:float lbl_8057EF88 = .sdata2:0x8057EF88; // type:object size:0x4 align:4 data:float diff --git a/configure.py b/configure.py index 7003dbba..3a92ac30 100644 --- a/configure.py +++ b/configure.py @@ -1018,7 +1018,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_AxVoiceManager.cpp"), Object(NonMatching, "nw4r/snd/snd_AxfxImpl.cpp"), Object(NonMatching, "nw4r/snd/snd_Bank.cpp"), - Object(NonMatching, "nw4r/snd/snd_BankFile.cpp"), + Object(Matching, "nw4r/snd/snd_BankFile.cpp"), Object(Matching, "nw4r/snd/snd_BasicPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), Object(Matching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), From 73ad19fb796814ff0bdbb098ab37f365858c3fee Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:15:21 +0200 Subject: [PATCH 17/91] snd_adpcm OK --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 3a92ac30..d64db591 100644 --- a/configure.py +++ b/configure.py @@ -1085,7 +1085,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_WaveSoundHandle.cpp"), Object(NonMatching, "nw4r/snd/snd_WsdFile.cpp"), Object(NonMatching, "nw4r/snd/snd_WsdPlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_adpcm.cpp"), + Object(Matching, "nw4r/snd/snd_adpcm.cpp"), ], mw_version="Wii/1.6", ), From 6ff9dd199a75770fcbb6ce76ca7332ce9dd2d9d3 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:17:24 +0200 Subject: [PATCH 18/91] snd_WsdFile OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 2 +- configure.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index c8b9c60e..d2b02709 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3109,6 +3109,7 @@ nw4r/snd/snd_WaveSoundHandle.cpp: nw4r/snd/snd_WsdFile.cpp: .text start:0x80485460 end:0x80485824 align:16 + .sdata2 start:0x8057F1F0 end:0x8057F1F8 nw4r/snd/snd_WsdPlayer.cpp: .text start:0x80485830 end:0x804869D8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 57386b7f..71700049 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -49784,7 +49784,7 @@ lbl_8057F1E0 = .sdata2:0x8057F1E0; // type:object size:0x4 align:4 data:float lbl_8057F1E4 = .sdata2:0x8057F1E4; // type:object size:0x4 align:4 data:float lbl_8057F1E8 = .sdata2:0x8057F1E8; // type:object size:0x4 align:4 data:float lbl_8057F1EC = .sdata2:0x8057F1EC; // type:object size:0x4 align:4 data:float -lbl_8057F1F0 = .sdata2:0x8057F1F0; // type:object size:0x4 align:4 data:float +@1628 = .sdata2:0x8057F1F0; // type:object size:0x4 scope:local align:4 data:float lbl_8057F1F8 = .sdata2:0x8057F1F8; // type:object size:0x4 align:4 data:float lbl_8057F1FC = .sdata2:0x8057F1FC; // type:object size:0x4 align:4 data:float lbl_8057F200 = .sdata2:0x8057F200; // type:object size:0x4 align:4 data:float diff --git a/configure.py b/configure.py index d64db591..8837c519 100644 --- a/configure.py +++ b/configure.py @@ -1083,7 +1083,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_WaveFile.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveSound.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveSoundHandle.cpp"), - Object(NonMatching, "nw4r/snd/snd_WsdFile.cpp"), + Object(Matching, "nw4r/snd/snd_WsdFile.cpp"), Object(NonMatching, "nw4r/snd/snd_WsdPlayer.cpp"), Object(Matching, "nw4r/snd/snd_adpcm.cpp"), ], From 7e4cfe3d6eb343ab76a6a3ca4dff5845df26784b Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:25:22 +0200 Subject: [PATCH 19/91] snd_SoundHandle OK --- configure.py | 2 +- src/nw4r/snd/snd_SoundHandle.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 8837c519..acab0506 100644 --- a/configure.py +++ b/configure.py @@ -1062,7 +1062,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_SoundArchiveFile.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundHandle.cpp"), + Object(Matching, "nw4r/snd/snd_SoundHandle.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundHeap.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), diff --git a/src/nw4r/snd/snd_SoundHandle.cpp b/src/nw4r/snd/snd_SoundHandle.cpp index bc785840..7998d007 100644 --- a/src/nw4r/snd/snd_SoundHandle.cpp +++ b/src/nw4r/snd/snd_SoundHandle.cpp @@ -28,9 +28,11 @@ void SoundHandle::detail_AttachSoundAsTempHandle(detail::BasicSound* pSound) { mSound->DetachTempGeneralHandle(); } + /* if (mSound->IsAttachedTempSpecialHandle()) { mSound->DetachTempSpecialHandle(); } + */ mSound->mTempGeneralHandle = this; } From ae4f7748659e1e8f4174b5270f1bd40bd3388f75 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:26:52 +0200 Subject: [PATCH 20/91] snd_SoundHeap OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 2 +- configure.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index d2b02709..8824e7c1 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3049,6 +3049,7 @@ nw4r/snd/snd_SoundHandle.cpp: nw4r/snd/snd_SoundHeap.cpp: .text start:0x8047B110 end:0x8047B418 align:16 + .data start:0x8056E200 end:0x8056E210 nw4r/snd/snd_SoundPlayer.cpp: .text start:0x8047B420 end:0x8047C050 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 71700049..55c1006b 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -38618,7 +38618,7 @@ lbl_8056E190 = .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 -lbl_8056E200 = .data:0x8056E200; // type:object size:0x10 +__vt__Q34nw4r3snd9SoundHeap = .data:0x8056E200; // type:object size:0x10 lbl_8056E210 = .data:0x8056E210; // type:object size:0x48 lbl_8056E258 = .data:0x8056E258; // type:object size:0x48 lbl_8056E2A0 = .data:0x8056E2A0; // type:object size:0x18 diff --git a/configure.py b/configure.py index acab0506..34ff8077 100644 --- a/configure.py +++ b/configure.py @@ -1063,7 +1063,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), Object(Matching, "nw4r/snd/snd_SoundHandle.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundHeap.cpp"), + Object(Matching, "nw4r/snd/snd_SoundHeap.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundSystem.cpp"), From eb07606e36cb0f0278a52f7dce5f64d63012a073 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:29:40 +0200 Subject: [PATCH 21/91] snd_Task OK --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 34ff8077..8b097dc1 100644 --- a/configure.py +++ b/configure.py @@ -1073,7 +1073,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_StrmPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSound.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), - Object(NonMatching, "nw4r/snd/snd_Task.cpp"), + Object(Matching, "nw4r/snd/snd_Task.cpp"), Object(NonMatching, "nw4r/snd/snd_TaskManager.cpp"), Object(NonMatching, "nw4r/snd/snd_TaskThread.cpp"), Object(NonMatching, "nw4r/snd/snd_Voice.cpp"), From 83f3bc5b6ba14b06233907c6e667441c97030a3f Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:32:45 +0200 Subject: [PATCH 22/91] snd_TaskManager OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 12 ++++++------ configure.py | 2 +- src/nw4r/snd/snd_TaskManager.cpp | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 8824e7c1..ad33feff 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3085,6 +3085,8 @@ nw4r/snd/snd_Task.cpp: nw4r/snd/snd_TaskManager.cpp: .text start:0x80480F10 end:0x804815D0 align:16 + .sbss start:0x805766D8 end:0x805766E0 + .bss start:0x80673A38 end:0x80673A80 nw4r/snd/snd_TaskThread.cpp: .text start:0x804815D0 end:0x80481798 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 55c1006b..e851c897 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25717,9 +25717,9 @@ __ct__Q34nw4r3snd15StrmSoundHandleFPQ34nw4r3snd11SoundHandle = .text:0x80480D90; DetachSound__Q34nw4r3snd15StrmSoundHandleFv = .text:0x80480E90; // type:function size:0x38 __dt__Q44nw4r3snd6detail4TaskFv = .text:0x80480ED0; // type:function size:0x40 GetInstance__Q44nw4r3snd6detail11TaskManagerFv = .text:0x80480F10; // type:function size:0x9C -__dt__Q44nw4r3snd6detail11TaskManagerFv = .text:0x80480FB0; // type:function size:0x64 -__dt__Q34nw4r2ut35LinkListFv = .text:0x80481020; // type:function size:0x58 -__ct__Q34nw4r2ut35LinkListFv = .text:0x80481080; // type:function size:0x18 +__dt__Q44nw4r3snd6detail11TaskManagerFv = .text:0x80480FB0; // type:function size:0x64 scope:weak +__dt__Q34nw4r2ut35LinkListFv = .text:0x80481020; // type:function size:0x58 scope:weak +__ct__Q34nw4r2ut35LinkListFv = .text:0x80481080; // type:function size:0x18 scope:weak AppendTask__Q44nw4r3snd6detail11TaskManagerFPQ44nw4r3snd6detail4TaskQ54nw4r3snd6detail11TaskManager12TaskPriority = .text:0x804810A0; // type:function size:0x7C PopTask__Q44nw4r3snd6detail11TaskManagerFv = .text:0x80481120; // type:function size:0x15C GetNextTask__Q44nw4r3snd6detail11TaskManagerFv = .text:0x80481280; // type:function size:0x10C @@ -42438,7 +42438,7 @@ lbl_805766BC = .sbss:0x805766BC; // type:object size:0x4 data:4byte lbl_805766C0 = .sbss:0x805766C0; // type:object size:0x8 data:byte lbl_805766C8 = .sbss:0x805766C8; // type:object size:0x8 data:byte lbl_805766D0 = .sbss:0x805766D0; // type:object size:0x8 data:4byte -lbl_805766D8 = .sbss:0x805766D8; // type:object size:0x8 data:byte +@GUARD@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .sbss:0x805766D8; // type:object size:0x1 scope:weak data:byte lbl_805766E0 = .sbss:0x805766E0; // type:object size:0x8 data:byte lbl_805766E8 = .sbss:0x805766E8; // type:object size:0x8 data:4byte typeInfo__Q34nw4r3lyt4Pane = .sbss:0x805766F0; // type:object size:0x4 data:4byte @@ -51951,8 +51951,8 @@ lbl_8066F660 = .bss:0x8066F660; // type:object size:0x10 lbl_8066F670 = .bss:0x8066F670; // type:object size:0x3B0 lbl_8066FA20 = .bss:0x8066FA20; // type:object size:0x4000 lbl_80673A20 = .bss:0x80673A20; // type:object size:0x18 -lbl_80673A38 = .bss:0x80673A38; // type:object size:0xC -lbl_80673A44 = .bss:0x80673A44; // type:object size:0x3C +@886 = .bss:0x80673A38; // type:object size:0xC scope:local +@LOCAL@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .bss:0x80673A44; // type:object size:0x3C scope:weak lbl_80673A80 = .bss:0x80673A80; // type:object size:0xC lbl_80673A8C = .bss:0x80673A8C; // type:object size:0x1C data:byte @LOCAL@SetSize__Q44nw4r3lyt6detail11TexCoordAryFUc@texCoords = .bss:0x80673AA8; // type:object size:0x20 scope:weak align:4 data:float diff --git a/configure.py b/configure.py index 8b097dc1..f9306c4d 100644 --- a/configure.py +++ b/configure.py @@ -1074,7 +1074,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_StrmSound.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_Task.cpp"), - Object(NonMatching, "nw4r/snd/snd_TaskManager.cpp"), + Object(Matching, "nw4r/snd/snd_TaskManager.cpp"), Object(NonMatching, "nw4r/snd/snd_TaskThread.cpp"), Object(NonMatching, "nw4r/snd/snd_Voice.cpp"), Object(NonMatching, "nw4r/snd/snd_VoiceManager.cpp"), diff --git a/src/nw4r/snd/snd_TaskManager.cpp b/src/nw4r/snd/snd_TaskManager.cpp index cebd4dfb..6edd03c3 100644 --- a/src/nw4r/snd/snd_TaskManager.cpp +++ b/src/nw4r/snd/snd_TaskManager.cpp @@ -57,7 +57,7 @@ void TaskManager::AppendTask(Task *task, TaskPriority priority) } // TaskManager::FindTask, probably -DECOMP_FORCE_CLASS_METHOD(Task::LinkList::Iterator, operator *()); +// DECOMP_FORCE_CLASS_METHOD(Task::LinkList::Iterator, operator *()); Task *TaskManager::GetNextTask(TaskPriority priority, bool doRemove) { From 8ca7ba733b8bae83dd67c9939614d778e7282fcf Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:33:33 +0200 Subject: [PATCH 23/91] snd_TaskThread OK --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index f9306c4d..df8d5b58 100644 --- a/configure.py +++ b/configure.py @@ -1075,7 +1075,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_Task.cpp"), Object(Matching, "nw4r/snd/snd_TaskManager.cpp"), - Object(NonMatching, "nw4r/snd/snd_TaskThread.cpp"), + Object(Matching, "nw4r/snd/snd_TaskThread.cpp"), Object(NonMatching, "nw4r/snd/snd_Voice.cpp"), Object(NonMatching, "nw4r/snd/snd_VoiceManager.cpp"), Object(NonMatching, "nw4r/snd/snd_Util.cpp"), From e75b8ecb55f5396ffe2179c59afd1ca0b7165fa0 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 25 May 2025 23:44:02 +0200 Subject: [PATCH 24/91] snd_Util OK --- config/SOUE01/splits.txt | 4 ++++ config/SOUE01/symbols.txt | 44 +++++++++++++++++++-------------------- configure.py | 2 +- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index ad33feff..79f7fd9e 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3099,6 +3099,10 @@ nw4r/snd/snd_VoiceManager.cpp: nw4r/snd/snd_Util.cpp: .text start:0x80484700 end:0x80484BD4 align:16 + .rodata start:0x804F9320 end:0x804FB7A0 + .data start:0x8056E340 end:0x8056E350 + .sdata start:0x80574EA8 end:0x80574EB0 + .sdata2 start:0x8057F1C0 end:0x8057F1F0 nw4r/snd/snd_WaveFile.cpp: .text start:0x80484BE0 end:0x80484F54 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index e851c897..bfde946f 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -29160,14 +29160,14 @@ DecibelSquareTable__Q44nw4r3snd6detail12EnvGenerator = .rodata:0x804F8FB8; // ty @LOCAL@GetSinIdx__Q44nw4r3snd6detail3LfoFi@sinTable = .rodata:0x804F92B8; // type:object size:0x21 scope:weak lbl_804F92E0 = .rodata:0x804F92E0; // type:object size:0x28 data:4byte lbl_804F9308 = .rodata:0x804F9308; // type:object size:0x18 data:4byte -lbl_804F9320 = .rodata:0x804F9320; // type:object size:0x30 -lbl_804F9350 = .rodata:0x804F9350; // type:object size:0x400 -lbl_804F9750 = .rodata:0x804F9750; // type:object size:0xF14 -lbl_804FA664 = .rodata:0x804FA664; // type:object size:0x404 -lbl_804FAA68 = .rodata:0x804FAA68; // type:object size:0x404 -lbl_804FAE6C = .rodata:0x804FAE6C; // type:object size:0x404 -lbl_804FB270 = .rodata:0x804FB270; // type:object size:0x500 -lbl_804FB770 = .rodata:0x804FB770; // type:object size:0x30 +NoteTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9320; // type:object size:0x30 +PitchTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9350; // type:object size:0x400 +Decibel2RatioTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9750; // type:object size:0xF14 +Pan2RatioTableSqrt__Q44nw4r3snd6detail4Util = .rodata:0x804FA664; // type:object size:0x404 +Pan2RatioTableSinCos__Q44nw4r3snd6detail4Util = .rodata:0x804FAA68; // type:object size:0x404 +Pan2RatioTableLinear__Q44nw4r3snd6detail4Util = .rodata:0x804FAE6C; // type:object size:0x404 +RemoteFilterCoefTable__Q44nw4r3snd6detail4Util = .rodata:0x804FB270; // type:object size:0x500 +CalcLpfFreqTable__Q44nw4r3snd6detail4Util = .rodata:0x804FB770; // type:object size:0x30 gRMO_Pal60_640x456Prog_16x9__22@unnamed@eggVideo_cpp@ = .rodata:0x804FB7A0; // type:object size:0x3C scope:local gRMO_Pal60_640x456IntDf_16x9__22@unnamed@eggVideo_cpp@ = .rodata:0x804FB7DC; // type:object size:0x3C scope:local gRMO_Pal50_640x456IntDf_16x9__22@unnamed@eggVideo_cpp@ = .rodata:0x804FB818; // type:object size:0x3C scope:local @@ -38626,7 +38626,7 @@ lbl_8056E2B8 = .data:0x8056E2B8; // type:object size:0x18 lbl_8056E2D0 = .data:0x8056E2D0; // type:object size:0x38 jumptable_8056E308 = .data:0x8056E308; // type:object size:0x24 scope:local lbl_8056E32C = .data:0x8056E32C; // type:object size:0x14 -lbl_8056E340 = .data:0x8056E340; // type:object size:0x10 +PanTableTable__Q44nw4r3snd6detail4Util = .data:0x8056E340; // type:object size:0xC lbl_8056E350 = .data:0x8056E350; // type:object size:0x38 lbl_8056E388 = .data:0x8056E388; // type:object size:0x60 @324 = .data:0x8056E3E8; // type:object size:0x46 scope:local data:string @@ -41149,7 +41149,7 @@ lbl_80574E90 = .sdata:0x80574E90; // type:object size:0x4 lbl_80574E94 = .sdata:0x80574E94; // type:object size:0x4 lbl_80574E98 = .sdata:0x80574E98; // type:object size:0x8 lbl_80574EA0 = .sdata:0x80574EA0; // type:object size:0x8 data:4byte -lbl_80574EA8 = .sdata:0x80574EA8; // type:object size:0x8 data:4byte +@LOCAL@CalcRandom__Q44nw4r3snd6detail4UtilFv@u = .sdata:0x80574EA8; // type:object size:0x4 scope:weak data:4byte NW4R_LYT_Version___22@unnamed@lyt_init_cpp@ = .sdata:0x80574EB0; // type:object size:0x4 scope:local data:4byte @6623 = .sdata:0x80574EB8; // type:object size:0x4 scope:local data:string @1484 = .sdata:0x80574EC0; // type:object size:0x2 scope:local data:string @@ -49772,18 +49772,18 @@ lbl_8057F1AC = .sdata2:0x8057F1AC; // type:object size:0x4 align:4 data:float lbl_8057F1B0 = .sdata2:0x8057F1B0; // type:object size:0x4 align:4 data:float lbl_8057F1B4 = .sdata2:0x8057F1B4; // type:object size:0x4 align:4 data:float lbl_8057F1B8 = .sdata2:0x8057F1B8; // type:object size:0x4 align:4 data:float -lbl_8057F1C0 = .sdata2:0x8057F1C0; // type:object size:0x4 align:4 data:float -lbl_8057F1C4 = .sdata2:0x8057F1C4; // type:object size:0x4 align:4 data:float -lbl_8057F1C8 = .sdata2:0x8057F1C8; // type:object size:0x4 align:4 data:float -lbl_8057F1CC = .sdata2:0x8057F1CC; // type:object size:0x4 align:4 data:float -lbl_8057F1D0 = .sdata2:0x8057F1D0; // type:object size:0x4 align:4 data:float -lbl_8057F1D4 = .sdata2:0x8057F1D4; // type:object size:0x4 align:4 data:float -lbl_8057F1D8 = .sdata2:0x8057F1D8; // type:object size:0x4 align:4 data:float -lbl_8057F1DC = .sdata2:0x8057F1DC; // type:object size:0x4 align:4 data:float -lbl_8057F1E0 = .sdata2:0x8057F1E0; // type:object size:0x4 align:4 data:float -lbl_8057F1E4 = .sdata2:0x8057F1E4; // type:object size:0x4 align:4 data:float -lbl_8057F1E8 = .sdata2:0x8057F1E8; // type:object size:0x4 align:4 data:float -lbl_8057F1EC = .sdata2:0x8057F1EC; // type:object size:0x4 align:4 data:float +@312 = .sdata2:0x8057F1C0; // type:object size:0x4 scope:local align:4 data:float +@313 = .sdata2:0x8057F1C4; // type:object size:0x4 scope:local align:4 data:float +@314 = .sdata2:0x8057F1C8; // type:object size:0x4 scope:local align:4 data:float +@326 = .sdata2:0x8057F1CC; // type:object size:0x4 scope:local align:4 data:float +@327 = .sdata2:0x8057F1D0; // type:object size:0x4 scope:local align:4 data:float +@328 = .sdata2:0x8057F1D4; // type:object size:0x4 scope:local align:4 data:float +@366 = .sdata2:0x8057F1D8; // type:object size:0x4 scope:local align:4 data:float +@367 = .sdata2:0x8057F1DC; // type:object size:0x4 scope:local align:4 data:float +@368 = .sdata2:0x8057F1E0; // type:object size:0x4 scope:local align:4 data:float +@409 = .sdata2:0x8057F1E4; // type:object size:0x4 scope:local align:4 data:float +@410 = .sdata2:0x8057F1E8; // type:object size:0x4 scope:local align:4 data:float +@411 = .sdata2:0x8057F1EC; // type:object size:0x4 scope:local align:4 data:float @1628 = .sdata2:0x8057F1F0; // type:object size:0x4 scope:local align:4 data:float lbl_8057F1F8 = .sdata2:0x8057F1F8; // type:object size:0x4 align:4 data:float lbl_8057F1FC = .sdata2:0x8057F1FC; // type:object size:0x4 align:4 data:float diff --git a/configure.py b/configure.py index df8d5b58..2554881c 100644 --- a/configure.py +++ b/configure.py @@ -1078,7 +1078,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_TaskThread.cpp"), Object(NonMatching, "nw4r/snd/snd_Voice.cpp"), Object(NonMatching, "nw4r/snd/snd_VoiceManager.cpp"), - Object(NonMatching, "nw4r/snd/snd_Util.cpp"), + Object(Matching, "nw4r/snd/snd_Util.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveFile.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveSound.cpp"), From 2ce5dc4bd911efaeb2c7cf94137d84e4314c34cb Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 00:32:45 +0200 Subject: [PATCH 25/91] snd_StrmFile OK --- configure.py | 2 +- include/nw4r/snd/snd_StrmPlayer.h | 2 +- include/nw4r/ut/ut_RuntimeTypeInfo.h | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure.py b/configure.py index 2554881c..8ce07d5c 100644 --- a/configure.py +++ b/configure.py @@ -1069,7 +1069,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_SoundSystem.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundThread.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmChannel.cpp"), - Object(NonMatching, "nw4r/snd/snd_StrmFile.cpp"), + Object(Matching, "nw4r/snd/snd_StrmFile.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSound.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), diff --git a/include/nw4r/snd/snd_StrmPlayer.h b/include/nw4r/snd/snd_StrmPlayer.h index 96742e28..aee8101e 100644 --- a/include/nw4r/snd/snd_StrmPlayer.h +++ b/include/nw4r/snd/snd_StrmPlayer.h @@ -222,7 +222,7 @@ namespace nw4r { namespace snd { namespace detail /* base SoundThread::PlayerCallback */ // size 0x00c, offset 0x0a4 StrmFileReader::StrmInfo mStrmInfo; // size 0x040, offset 0x0b0 bool mSetupFlag; // size 0x001, offset 0x0f0 - bool volatile mActiveFlag; // size 0x001, offset 0x0f1 + bool mActiveFlag; // size 0x001, offset 0x0f1 bool mStartedFlag; // size 0x001, offset 0x0f2 bool mPreparedFlag; // size 0x001, offset 0x0f3 bool mTaskErrorFlag; // size 0x001, offset 0x0f4 diff --git a/include/nw4r/ut/ut_RuntimeTypeInfo.h b/include/nw4r/ut/ut_RuntimeTypeInfo.h index 12bf7cc4..289ed170 100644 --- a/include/nw4r/ut/ut_RuntimeTypeInfo.h +++ b/include/nw4r/ut/ut_RuntimeTypeInfo.h @@ -47,8 +47,12 @@ inline TDerived DynamicCast(TBase *ptr) { // Derived type info const detail::RuntimeTypeInfo *derivedTypeInfo = detail::GetTypeInfoFromPtr_(static_cast(NULL)); // Downcast if possible - if (ptr && ptr->GetRuntimeTypeInfo()->IsDerivedFrom(derivedTypeInfo)) { - return static_cast(ptr); + // NB Wii/1.6 used in SND seems to be very sensitive to the way this + // is structured while Wii/1.5 and below don't seem to care at all + if (ptr) { + if (ptr->GetRuntimeTypeInfo()->IsDerivedFrom(derivedTypeInfo)) { + return static_cast(ptr); + } } return NULL; From 83a7f21b96da09bfa8487a51230e91e606315f7b Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 00:33:25 +0200 Subject: [PATCH 26/91] snd_StrmChannel OK --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 8ce07d5c..445359da 100644 --- a/configure.py +++ b/configure.py @@ -1068,7 +1068,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundSystem.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundThread.cpp"), - Object(NonMatching, "nw4r/snd/snd_StrmChannel.cpp"), + Object(Matching, "nw4r/snd/snd_StrmChannel.cpp"), Object(Matching, "nw4r/snd/snd_StrmFile.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSound.cpp"), From a9da90bbb2c8dddbaffec4c82e03b92eb97f2690 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 00:42:57 +0200 Subject: [PATCH 27/91] snd_SoundThread OK --- config/SOUE01/splits.txt | 2 + config/SOUE01/symbols.txt | 10 ++-- configure.py | 2 +- include/nw4r/snd/snd_SoundThread.h | 2 + src/nw4r/snd/snd_SoundThread.cpp | 88 +++++++++++++++++------------- 5 files changed, 59 insertions(+), 45 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 79f7fd9e..51606d7b 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3063,6 +3063,8 @@ nw4r/snd/snd_SoundSystem.cpp: nw4r/snd/snd_SoundThread.cpp: .text start:0x8047C710 end:0x8047CD10 align:16 + .sbss start:0x805766C0 end:0x805766C8 + .bss start:0x8066F660 end:0x8066FA20 nw4r/snd/snd_StrmChannel.cpp: .text start:0x8047CD10 end:0x8047CF50 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index bfde946f..8265b693 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25629,7 +25629,7 @@ IsInitializedSoundSystem__Q34nw4r3snd11SoundSystemFv = .text:0x8047C630; // type WaitForResetReady__Q34nw4r3snd11SoundSystemFv = .text:0x8047C640; // type:function size:0x74 __sinit_\snd_SoundSystem_cpp = .text:0x8047C6C0; // type:function size:0x48 scope:local GetInstance__Q44nw4r3snd6detail11SoundThreadFv = .text:0x8047C710; // type:function size:0xB8 -__dt__Q44nw4r3snd6detail11SoundThreadFv = .text:0x8047C7D0; // type:function size:0x70 +__dt__Q44nw4r3snd6detail11SoundThreadFv = .text:0x8047C7D0; // type:function size:0x70 scope:weak Create__Q44nw4r3snd6detail11SoundThreadFlPvUl = .text:0x8047C840; // type:function size:0x12C AxCallbackFunc__Q44nw4r3snd6detail11SoundThreadFv = .text:0x8047C970; // type:function size:0x10C SoundThreadFunc__Q44nw4r3snd6detail11SoundThreadFPv = .text:0x8047CA80; // type:function size:0xB8 @@ -42435,7 +42435,7 @@ lbl_805766A8 = .sbss:0x805766A8; // type:object size:0x8 data:4byte lbl_805766B0 = .sbss:0x805766B0; // type:object size:0x8 data:byte isSoundSystemInit = .sbss:0x805766B8; // type:object size:0x1 data:byte lbl_805766BC = .sbss:0x805766BC; // type:object size:0x4 data:4byte -lbl_805766C0 = .sbss:0x805766C0; // type:object size:0x8 data:byte +@GUARD@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .sbss:0x805766C0; // type:object size:0x1 scope:weak data:byte 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:0x1 scope:weak data:byte @@ -51947,9 +51947,9 @@ lbl_80659730 = .bss:0x80659730; // type:object size:0x610 data:4byte lbl_80659D40 = .bss:0x80659D40; // type:object size:0x10 lbl_80659D50 = .bss:0x80659D50; // type:object size:0x330 lbl_8065A080 = .bss:0x8065A080; // type:object size:0x155E0 -lbl_8066F660 = .bss:0x8066F660; // type:object size:0x10 -lbl_8066F670 = .bss:0x8066F670; // type:object size:0x3B0 -lbl_8066FA20 = .bss:0x8066FA20; // type:object size:0x4000 +@1941 = .bss:0x8066F660; // type:object size:0xC scope:local +@LOCAL@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .bss:0x8066F670; // type:object size:0x398 scope:weak +lbl_8066FA20 = .bss:0x8066FA20; // type:object size:0x4000 align:32 lbl_80673A20 = .bss:0x80673A20; // type:object size:0x18 @886 = .bss:0x80673A38; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .bss:0x80673A44; // type:object size:0x3C scope:weak diff --git a/configure.py b/configure.py index 445359da..aecb61a3 100644 --- a/configure.py +++ b/configure.py @@ -1067,7 +1067,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_SoundPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundSystem.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundThread.cpp"), + Object(Matching, "nw4r/snd/snd_SoundThread.cpp"), Object(Matching, "nw4r/snd/snd_StrmChannel.cpp"), Object(Matching, "nw4r/snd/snd_StrmFile.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmPlayer.cpp"), diff --git a/include/nw4r/snd/snd_SoundThread.h b/include/nw4r/snd/snd_SoundThread.h index 42d4a10f..7d250496 100644 --- a/include/nw4r/snd/snd_SoundThread.h +++ b/include/nw4r/snd/snd_SoundThread.h @@ -101,6 +101,7 @@ namespace nw4r { namespace snd { namespace detail static void *SoundThreadFunc(void *arg); void SoundThreadProc(); + void FrameProcess(); // static members private: @@ -121,6 +122,7 @@ namespace nw4r { namespace snd { namespace detail PlayerCallback::LinkList mPlayerCallbackList; // size 0x00c, offset 0x384 u32 mProcessTick; // size 0x004, offset 0x390 bool mCreateFlag; // size 0x001, offset 0x394 + bool field_0x395; // size 0x001, offset 0x395 /* 3 bytes padding */ }; // size 0x398 }}} // namespace nw4r::snd::detail diff --git a/src/nw4r/snd/snd_SoundThread.cpp b/src/nw4r/snd/snd_SoundThread.cpp index 2a8ca309..153d3492 100644 --- a/src/nw4r/snd/snd_SoundThread.cpp +++ b/src/nw4r/snd/snd_SoundThread.cpp @@ -35,7 +35,8 @@ namespace nw4r { namespace snd { namespace detail { SoundThread::SoundThread() : mStackEnd (nullptr), - mCreateFlag (false) + mCreateFlag (false), + field_0x395 (false) { OSInitMessageQueue(&mMsgQueue, mMsgBuffer, THREAD_MESSAGE_BUFSIZE); OSInitThreadQueue(&mThreadQueue); @@ -96,8 +97,10 @@ void SoundThread::AxCallbackFunc() void SoundThread::AxCallbackProc() { - BOOL result ATTR_UNUSED = - OSSendMessageAny(&mMsgQueue, MESSAGE_AX_CALLBACK, OS_MESSAGE_NO_FLAGS); + if (!field_0x395) { + BOOL result ATTR_UNUSED = + OSSendMessageAny(&mMsgQueue, MESSAGE_AX_CALLBACK, OS_MESSAGE_NO_FLAGS); + } NW4R_RANGE_FOR_NO_AUTO_INC(itr, mPlayerCallbackList) { @@ -123,6 +126,7 @@ void *SoundThread::SoundThreadFunc(void *arg) return nullptr; } +#ifdef DEBUG /* SoundThread::RegisterSoundFrameCallback * ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14509) */ @@ -134,6 +138,7 @@ DECOMP_FORCE_CLASS_METHOD(SoundThread::SoundFrameCallback::LinkList, */ DECOMP_FORCE_CLASS_METHOD(SoundThread::SoundFrameCallback::LinkList, Erase(nullptr)); +#endif void SoundThread::RegisterPlayerCallback(PlayerCallback *callback) { @@ -159,42 +164,7 @@ void SoundThread::SoundThreadProc() if (reinterpret_cast(message) == MESSAGE_AX_CALLBACK) { - ut::detail::AutoLock lock(mMutex); - - NW4R_RANGE_FOR_NO_AUTO_INC(itr, mSoundFrameCallbackList) - { - decltype(itr) curItr = itr++; - - curItr->at_0x0c(); - } - - OSTick tick = OSGetTick(); - - { - // Sound frame - AxVoiceManager::GetInstance().FreeAllReservedAxVoice(); - AxManager::GetInstance().Update(); - - NW4R_RANGE_FOR_NO_AUTO_INC(itr, mPlayerCallbackList) - { - decltype(itr) curItr = itr++; - - curItr->OnUpdateFrameSoundThread(); - } - - ChannelManager::GetInstance().UpdateAllChannel(); - (void)Util::CalcRandom(); // ? - VoiceManager::GetInstance().UpdateAllVoices(); - } - - mProcessTick = OSGetTick() - tick; - - NW4R_RANGE_FOR_NO_AUTO_INC(itr, mSoundFrameCallbackList) - { - decltype(itr) curItr = itr++; - - curItr->at_0x10(); - } + FrameProcess(); } else if (reinterpret_cast(message) == MESSAGE_SHUTDOWN) { @@ -212,4 +182,44 @@ void SoundThread::SoundThreadProc() } } +void SoundThread::FrameProcess() +{ + ut::detail::AutoLock lock(mMutex); + + NW4R_RANGE_FOR_NO_AUTO_INC(itr, mSoundFrameCallbackList) + { + decltype(itr) curItr = itr++; + + curItr->at_0x0c(); + } + + OSTick tick = OSGetTick(); + + { + // Sound frame + AxVoiceManager::GetInstance().FreeAllReservedAxVoice(); + AxManager::GetInstance().Update(); + + NW4R_RANGE_FOR_NO_AUTO_INC(itr, mPlayerCallbackList) + { + decltype(itr) curItr = itr++; + + curItr->OnUpdateFrameSoundThread(); + } + + ChannelManager::GetInstance().UpdateAllChannel(); + (void)Util::CalcRandom(); // ? + VoiceManager::GetInstance().UpdateAllVoices(); + } + + mProcessTick = OSGetTick() - tick; + + NW4R_RANGE_FOR_NO_AUTO_INC(itr, mSoundFrameCallbackList) + { + decltype(itr) curItr = itr++; + + curItr->at_0x10(); + } +} + }}} // namespace nw4r::snd::detail From e10ce717296af0540745da9e9f0cc2e86f920e7c Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 01:24:28 +0200 Subject: [PATCH 28/91] Misc progress --- config/SOUE01/splits.txt | 3 +++ config/SOUE01/symbols.txt | 3 +-- include/nw4r/snd/snd_BasicSound.h | 4 ++-- include/nw4r/snd/snd_Channel.h | 3 ++- include/nw4r/snd/snd_SoundPlayer.h | 1 + include/nw4r/snd/snd_Voice.h | 1 + src/nw4r/snd/snd_AxVoice.cpp | 4 ++-- src/nw4r/snd/snd_BasicSound.cpp | 37 +++++++++++++++++++++++------- src/nw4r/snd/snd_Channel.cpp | 13 +++++++++++ src/nw4r/snd/snd_SeqPlayer.cpp | 4 ++++ src/nw4r/snd/snd_SoundThread.cpp | 2 +- 11 files changed, 59 insertions(+), 16 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 51606d7b..015756ec 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -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 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 8265b693..794bff2d 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -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 diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index eca939cd..e57e704a 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -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 mFadeVolume; // size 0x10, offset 0x60 MoveValue 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 diff --git a/include/nw4r/snd/snd_Channel.h b/include/nw4r/snd/snd_Channel.h index 636d3a7c..9f75f540 100644 --- a/include/nw4r/snd/snd_Channel.h +++ b/include/nw4r/snd/snd_Channel.h @@ -63,7 +63,7 @@ namespace nw4r { namespace snd { namespace detail ChannelCallbackStatus status, u32 userData); - typedef ut::LinkList LinkList; + typedef ut::LinkList 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 diff --git a/include/nw4r/snd/snd_SoundPlayer.h b/include/nw4r/snd/snd_SoundPlayer.h index 33dd9fa3..45da6493 100644 --- a/include/nw4r/snd/snd_SoundPlayer.h +++ b/include/nw4r/snd/snd_SoundPlayer.h @@ -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() diff --git a/include/nw4r/snd/snd_Voice.h b/include/nw4r/snd/snd_Voice.h index 32e6a690..0aee71a3 100644 --- a/include/nw4r/snd/snd_Voice.h +++ b/include/nw4r/snd/snd_Voice.h @@ -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); diff --git a/src/nw4r/snd/snd_AxVoice.cpp b/src/nw4r/snd/snd_AxVoice.cpp index be050bd3..57e8adc4 100644 --- a/src/nw4r/snd/snd_AxVoice.cpp +++ b/src/nw4r/snd/snd_AxVoice.cpp @@ -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) diff --git a/src/nw4r/snd/snd_BasicSound.cpp b/src/nw4r/snd/snd_BasicSound.cpp index 0aacd888..96014df5 100644 --- a/src/nw4r/snd/snd_BasicSound.cpp +++ b/src/nw4r/snd/snd_BasicSound.cpp @@ -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) diff --git a/src/nw4r/snd/snd_Channel.cpp b/src/nw4r/snd/snd_Channel.cpp index c55d4321..98b85285 100644 --- a/src/nw4r/snd/snd_Channel.cpp +++ b/src/nw4r/snd/snd_Channel.cpp @@ -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(i), fxSend[i]); } diff --git a/src/nw4r/snd/snd_SeqPlayer.cpp b/src/nw4r/snd/snd_SeqPlayer.cpp index 10264746..481c9e6b 100644 --- a/src/nw4r/snd/snd_SeqPlayer.cpp +++ b/src/nw4r/snd/snd_SeqPlayer.cpp @@ -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) { diff --git a/src/nw4r/snd/snd_SoundThread.cpp b/src/nw4r/snd/snd_SoundThread.cpp index 153d3492..571458af 100644 --- a/src/nw4r/snd/snd_SoundThread.cpp +++ b/src/nw4r/snd/snd_SoundThread.cpp @@ -126,7 +126,7 @@ void *SoundThread::SoundThreadFunc(void *arg) return nullptr; } -#ifdef DEBUG +#if 0 /* SoundThread::RegisterSoundFrameCallback * ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14509) */ From 05c763814bdfe3a79d79e1f732c66b978772692b Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 01:26:21 +0200 Subject: [PATCH 29/91] snd_Bank OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 10 +++++----- configure.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 015756ec..182b3322 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2912,6 +2912,7 @@ nw4r/snd/snd_AxfxImpl.cpp: nw4r/snd/snd_Bank.cpp: .text start:0x80467FD0 end:0x80468248 align:16 + .sdata2 start:0x8057EF58 end:0x8057EF78 nw4r/snd/snd_BankFile.cpp: .text start:0x80468250 end:0x8046890C align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 794bff2d..79ae31b9 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -49654,11 +49654,11 @@ lbl_8057EF48 = .sdata2:0x8057EF48; // type:object size:0x4 align:4 data:float lbl_8057EF4C = .sdata2:0x8057EF4C; // type:object size:0x4 align:4 data:float lbl_8057EF50 = .sdata2:0x8057EF50; // type:object size:0x4 align:4 data:float lbl_8057EF54 = .sdata2:0x8057EF54; // type:object size:0x4 align:4 data:float -lbl_8057EF58 = .sdata2:0x8057EF58; // type:object size:0x4 align:4 data:float -lbl_8057EF5C = .sdata2:0x8057EF5C; // type:object size:0x4 align:4 data:float -lbl_8057EF60 = .sdata2:0x8057EF60; // type:object size:0x4 align:4 data:float -lbl_8057EF68 = .sdata2:0x8057EF68; // type:object size:0x8 align:8 data:double -lbl_8057EF70 = .sdata2:0x8057EF70; // type:object size:0x8 align:8 data:double +@1517 = .sdata2:0x8057EF58; // type:object size:0x4 scope:local align:4 data:float +@1518 = .sdata2:0x8057EF5C; // type:object size:0x4 scope:local align:4 data:float +@1519 = .sdata2:0x8057EF60; // type:object size:0x4 scope:local align:4 data:float +@1524 = .sdata2:0x8057EF68; // type:object size:0x8 scope:local align:8 data:double +@1525 = .sdata2:0x8057EF70; // type:object size:0x8 scope:local align:8 data:double @1860 = .sdata2:0x8057EF78; // type:object size:0x4 scope:local align:4 data:float @608 = .sdata2:0x8057EF80; // type:object size:0x4 scope:local align:4 data:float @609 = .sdata2:0x8057EF84; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index aecb61a3..6ff68488 100644 --- a/configure.py +++ b/configure.py @@ -1017,7 +1017,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_AxVoice.cpp"), Object(Matching, "nw4r/snd/snd_AxVoiceManager.cpp"), Object(NonMatching, "nw4r/snd/snd_AxfxImpl.cpp"), - Object(NonMatching, "nw4r/snd/snd_Bank.cpp"), + Object(Matching, "nw4r/snd/snd_Bank.cpp"), Object(Matching, "nw4r/snd/snd_BankFile.cpp"), Object(Matching, "nw4r/snd/snd_BasicPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), From 913b135a0fa7282848f94dd590e736c47d662fce Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 01:31:35 +0200 Subject: [PATCH 30/91] snd_Channel OK --- config/SOUE01/splits.txt | 3 +++ config/SOUE01/symbols.txt | 22 +++++++++++----------- configure.py | 2 +- src/nw4r/snd/snd_Channel.cpp | 18 +++++++++--------- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 182b3322..b437fc7e 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2935,6 +2935,9 @@ nw4r/snd/snd_BiquadFilterPreset.cpp: nw4r/snd/snd_Channel.cpp: .text start:0x8046A7B0 end:0x8046B7C8 align:16 + .sbss start:0x80576680 end:0x80576688 + .sdata2 start:0x8057EFA8 end:0x8057EFD0 + .bss start:0x806593C8 end:0x806593F8 nw4r/snd/snd_DisposeCallbackManager.cpp: .text start:0x8046B7D0 end:0x8046BB5C align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 79ae31b9..84341ec8 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25175,7 +25175,7 @@ __dt__Q44nw4r3snd6detail18BiquadFilterBpf512Fv = .text:0x8046A6F0; // type:funct __dt__Q44nw4r3snd6detail19BiquadFilterBpf1024Fv = .text:0x8046A730; // type:function size:0x40 scope:weak __dt__Q44nw4r3snd6detail19BiquadFilterBpf2048Fv = .text:0x8046A770; // type:function size:0x40 scope:weak GetInstance__Q44nw4r3snd6detail14ChannelManagerFv = .text:0x8046A7B0; // type:function size:0x74 -__dt__Q44nw4r3snd6detail14ChannelManagerFv = .text:0x8046A830; // type:function size:0x60 +__dt__Q44nw4r3snd6detail14ChannelManagerFv = .text:0x8046A830; // type:function size:0x60 scope:weak GetRequiredMemSize__Q44nw4r3snd6detail14ChannelManagerFi = .text:0x8046A890; // type:function size:0xC Setup__Q44nw4r3snd6detail14ChannelManagerFPvUl = .text:0x8046A8A0; // type:function size:0x94 UpdateAllChannel__Q44nw4r3snd6detail14ChannelManagerFv = .text:0x8046A940; // type:function size:0x54 @@ -42424,7 +42424,7 @@ sBiquadFilterBpf2048__Q44nw4r3snd6detail9AxManager = .sbss:0x80576660; // type:o lbl_80576670 = .sbss:0x80576670; // type:object size:0x4 data:4byte lbl_80576674 = .sbss:0x80576674; // type:object size:0x4 data:4byte lbl_80576678 = .sbss:0x80576678; // type:object size:0x8 data:4byte -lbl_80576680 = .sbss:0x80576680; // type:object size:0x8 data:byte +@GUARD@GetInstance__Q44nw4r3snd6detail14ChannelManagerFv@instance = .sbss:0x80576680; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .sbss:0x80576688; // type:object size:0x1 scope:weak data:byte lbl_80576690 = .sbss:0x80576690; // type:object size:0x8 data:byte lbl_80576698 = .sbss:0x80576698; // type:object size:0x4 data:4byte @@ -49667,13 +49667,13 @@ lbl_8057EF8C = .sdata2:0x8057EF8C; // type:object size:0x4 align:4 data:float lbl_8057EF90 = .sdata2:0x8057EF90; // type:object size:0x8 align:8 data:double @212 = .sdata2:0x8057EF98; // type:object size:0x8 scope:local align:8 data:double @247 = .sdata2:0x8057EFA0; // type:object size:0x4 scope:local align:4 data:float -lbl_8057EFA8 = .sdata2:0x8057EFA8; // type:object size:0x4 align:4 data:float -lbl_8057EFAC = .sdata2:0x8057EFAC; // type:object size:0x4 align:4 data:float -lbl_8057EFB0 = .sdata2:0x8057EFB0; // type:object size:0x4 align:4 data:float -lbl_8057EFB4 = .sdata2:0x8057EFB4; // type:object size:0x4 align:4 data:float -lbl_8057EFB8 = .sdata2:0x8057EFB8; // type:object size:0x4 align:4 data:float -lbl_8057EFC0 = .sdata2:0x8057EFC0; // type:object size:0x8 align:8 data:double -lbl_8057EFC8 = .sdata2:0x8057EFC8; // type:object size:0x8 align:8 data:double +@2816 = .sdata2:0x8057EFA8; // type:object size:0x4 scope:local align:4 data:float +@2937 = .sdata2:0x8057EFAC; // type:object size:0x4 scope:local align:4 data:float +@3086 = .sdata2:0x8057EFB0; // type:object size:0x4 scope:local align:4 data:float +@3087 = .sdata2:0x8057EFB4; // type:object size:0x4 scope:local align:4 data:float +@3088 = .sdata2:0x8057EFB8; // type:object size:0x4 scope:local align:4 data:float +@3092 = .sdata2:0x8057EFC0; // type:object size:0x8 scope:local align:8 data:double +@3093 = .sdata2:0x8057EFC8; // type:object size:0x8 scope:local align:8 data:double VOLUME_INIT__Q44nw4r3snd6detail12EnvGenerator = .sdata2:0x8057EFD0; // type:object size:0x4 align:4 data:float @180 = .sdata2:0x8057EFD4; // type:object size:0x4 scope:local align:4 data:float @181 = .sdata2:0x8057EFD8; // type:object size:0x4 scope:local align:4 data:float @@ -51934,8 +51934,8 @@ sBiquadFilterCallbackTable__Q44nw4r3snd6detail9AxManager = .bss:0x80659080; // t @LOCAL@GetInstance__Q44nw4r3snd6detail9AxManagerFv@instance = .bss:0x8065928C; // type:object size:0x104 scope:weak data:4byte @986 = .bss:0x80659390; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail14AxVoiceManagerFv@instance = .bss:0x8065939C; // type:object size:0x2C scope:weak data:4byte -lbl_806593C8 = .bss:0x806593C8; // type:object size:0x10 -lbl_806593D8 = .bss:0x806593D8; // type:object size:0x20 data:4byte +@1671 = .bss:0x806593C8; // type:object size:0xC scope:local +@LOCAL@GetInstance__Q44nw4r3snd6detail14ChannelManagerFv@instance = .bss:0x806593D8; // type:object size:0x20 scope:weak data:4byte @781 = .bss:0x806593F8; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .bss:0x80659404; // type:object size:0xC scope:weak data:4byte @LOCAL@GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv@instance = .bss:0x80659410; // type:object size:0x2D8 scope:weak data:byte diff --git a/configure.py b/configure.py index 6ff68488..91af6243 100644 --- a/configure.py +++ b/configure.py @@ -1022,7 +1022,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_BasicPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), Object(Matching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), - Object(NonMatching, "nw4r/snd/snd_Channel.cpp"), + Object(Matching, "nw4r/snd/snd_Channel.cpp"), Object(Matching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), Object(NonMatching, "nw4r/snd/snd_debug.cpp"), Object(Matching, "nw4r/snd/snd_DvdSoundArchive.cpp"), diff --git a/src/nw4r/snd/snd_Channel.cpp b/src/nw4r/snd/snd_Channel.cpp index 98b85285..3d3456d8 100644 --- a/src/nw4r/snd/snd_Channel.cpp +++ b/src/nw4r/snd/snd_Channel.cpp @@ -247,12 +247,6 @@ 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++) @@ -261,6 +255,12 @@ void Channel::Update(bool doPeriodicProc) fxSend[i] += mFxSend[i]; } + f32 remoteOutVolume[4]; + for (int i = 0; i < 4; i++) { + remoteOutVolume[i] = 1.0f; + remoteOutVolume[i] *= mRemoteOutVolume[i]; + } + if (doPeriodicProc) { if (mAutoSweep) @@ -294,12 +294,12 @@ void Channel::Update(bool doPeriodicProc) mVoice->SetMainOutVolume(mainOutVolume); mVoice->SetMainSend(mainSend); + for (int i = 0; i < AUX_BUS_NUM; i++) + mVoice->SetFxSend(static_cast(i), fxSend[i]); + 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(i), fxSend[i]); } } From c62d985bde15e5304e6b050082ed04ac1b16c5c7 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 01:49:31 +0200 Subject: [PATCH 31/91] snd_SeqTrack OK --- config/SOUE01/splits.txt | 3 +++ config/SOUE01/symbols.txt | 22 +++++++++++----------- configure.py | 2 +- include/nw4r/snd/snd_BasicSound.h | 8 ++++---- include/nw4r/snd/snd_Channel.h | 4 ++++ include/nw4r/snd/snd_SeqTrack.h | 3 ++- src/nw4r/snd/snd_MmlParser.cpp | 2 +- src/nw4r/snd/snd_SeqTrack.cpp | 17 ++++++++++++++--- 8 files changed, 40 insertions(+), 21 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index b437fc7e..b32a4628 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -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 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 84341ec8..af37808a 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -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 diff --git a/configure.py b/configure.py index 91af6243..b4c83b6f 100644 --- a/configure.py +++ b/configure.py @@ -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"), diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index e57e704a..c1fe052f 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -141,10 +141,10 @@ namespace nw4r { namespace snd { namespace detail // typedefs public: - typedef ut::LinkList PriorityLinkList; - typedef ut::LinkList SoundPlayerPlayLinkList; - typedef ut::LinkList SoundPlayerPriorityLinkList; - typedef ut::LinkList ExtSoundPlayerPlayLinkList; + typedef ut::LinkList PriorityLinkList; + typedef ut::LinkList SoundPlayerPlayLinkList; + typedef ut::LinkList SoundPlayerPriorityLinkList; + typedef ut::LinkList ExtSoundPlayerPlayLinkList; // nested types public: diff --git a/include/nw4r/snd/snd_Channel.h b/include/nw4r/snd/snd_Channel.h index 9f75f540..20a34077 100644 --- a/include/nw4r/snd/snd_Channel.h +++ b/include/nw4r/snd/snd_Channel.h @@ -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; } diff --git a/include/nw4r/snd/snd_SeqTrack.h b/include/nw4r/snd/snd_SeqTrack.h index dd013b77..0cec4aa4 100644 --- a/include/nw4r/snd/snd_SeqTrack.h +++ b/include/nw4r/snd/snd_SeqTrack.h @@ -93,9 +93,9 @@ namespace nw4r { namespace snd { namespace detail MoveValue volume; // size 0x06, offset 0x54 MoveValue pan; // size 0x06, offset 0x5a MoveValue surroundPan; // size 0x06, offset 0x60 + MoveValue 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); diff --git a/src/nw4r/snd/snd_MmlParser.cpp b/src/nw4r/snd/snd_MmlParser.cpp index 56fe73b2..18b4537a 100644 --- a/src/nw4r/snd/snd_MmlParser.cpp +++ b/src/nw4r/snd/snd_MmlParser.cpp @@ -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: diff --git a/src/nw4r/snd/snd_SeqTrack.cpp b/src/nw4r/snd/snd_SeqTrack.cpp index 81b2cb69..217925e6 100644 --- a/src/nw4r/snd/snd_SeqTrack.cpp +++ b/src/nw4r/snd/snd_SeqTrack.cpp @@ -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(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) { From 98f5df52eb9e8e5d55db99c5011c6cc2243a74b3 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 02:05:57 +0200 Subject: [PATCH 32/91] snd_MmlParser OK --- config/SOUE01/splits.txt | 4 ++++ config/SOUE01/symbols.txt | 26 +++++++++++++------------- configure.py | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index b32a4628..e170b4ed 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2979,6 +2979,10 @@ nw4r/snd/snd_MidiSeqPlayer.cpp: nw4r/snd/snd_MmlParser.cpp: .text start:0x8046E460 end:0x8046F63C align:16 + .data start:0x8056DD18 end:0x8056DF48 + .sdata start:0x80574E90 end:0x80574EA0 + .sbss start:0x80576690 end:0x80576698 + .sdata2 start:0x8057F048 end:0x8057F068 nw4r/snd/snd_MmlSeqTrack.cpp: .text start:0x8046F640 end:0x8046F6F8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index af37808a..2d802951 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -38594,9 +38594,9 @@ __vt__Q34nw4r3snd15DvdSoundArchive = .data:0x8056DC50; // type:object size:0x20 lbl_8056DC70 = .data:0x8056DC70; // type:object size:0x28 __vt__Q44nw4r3snd18MemorySoundArchive16MemoryFileStream = .data:0x8056DC98; // type:object size:0x5C __vt__Q34nw4r3snd18MemorySoundArchive = .data:0x8056DCF8; // type:object size:0x20 -lbl_8056DD18 = .data:0x8056DD18; // type:object size:0x28 -jumptable_8056DD40 = .data:0x8056DD40; // type:object size:0x1F4 scope:local -lbl_8056DF38 = .data:0x8056DF38; // type:object size:0x10 +@3186 = .data:0x8056DD18; // type:object size:0x27 scope:local data:string +@3190 = .data:0x8056DD40; // type:object size:0x1F4 scope:local +__vt__Q44nw4r3snd6detail9MmlParser = .data:0x8056DF38; // type:object size:0x10 lbl_8056DF48 = .data:0x8056DF48; // type:object size:0x10 lbl_8056DF58 = .data:0x8056DF58; // type:object size:0x18 lbl_8056DF70 = .data:0x8056DF70; // type:object size:0x60 @@ -41144,9 +41144,9 @@ pG3DStateIndMtxOp__Q44nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@ = .sdata:0x8057 @13309 = .sdata:0x80574E78; // type:object size:0x8 scope:local data:string @13310 = .sdata:0x80574E80; // type:object size:0x8 scope:local data:string NW4R_G3D_Version___22@unnamed@g3d_init_cpp@ = .sdata:0x80574E88; // type:object size:0x4 scope:local data:4byte -lbl_80574E90 = .sdata:0x80574E90; // type:object size:0x4 -lbl_80574E94 = .sdata:0x80574E94; // type:object size:0x4 -lbl_80574E98 = .sdata:0x80574E98; // type:object size:0x8 +@3183 = .sdata:0x80574E90; // type:object size:0x2 scope:local data:string +@3184 = .sdata:0x80574E94; // type:object size:0x2 scope:local data:string +@3185 = .sdata:0x80574E98; // type:object size:0x1 scope:local lbl_80574EA0 = .sdata:0x80574EA0; // type:object size:0x8 data:4byte @LOCAL@CalcRandom__Q44nw4r3snd6detail4UtilFv@u = .sdata:0x80574EA8; // type:object size:0x4 scope:weak data:4byte NW4R_LYT_Version___22@unnamed@lyt_init_cpp@ = .sdata:0x80574EB0; // type:object size:0x4 scope:local data:4byte @@ -42426,7 +42426,7 @@ lbl_80576674 = .sbss:0x80576674; // type:object size:0x4 data:4byte lbl_80576678 = .sbss:0x80576678; // type:object size:0x8 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail14ChannelManagerFv@instance = .sbss:0x80576680; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .sbss:0x80576688; // type:object size:0x1 scope:weak data:byte -lbl_80576690 = .sbss:0x80576690; // type:object size:0x8 data:byte +mPrintVarEnabledFlag__Q44nw4r3snd6detail9MmlParser = .sbss:0x80576690; // type:object size:0x1 data:byte 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 @@ -49698,12 +49698,12 @@ lbl_8057F014 = .sdata2:0x8057F014; // type:object size:0x4 align:4 data:float @124 = .sdata2:0x8057F034; // type:object size:0x4 scope:local align:4 data:float @125 = .sdata2:0x8057F038; // type:object size:0x4 scope:local align:4 data:float @129 = .sdata2:0x8057F040; // type:object size:0x8 scope:local align:8 data:double -lbl_8057F048 = .sdata2:0x8057F048; // type:object size:0x4 align:4 data:float -lbl_8057F04C = .sdata2:0x8057F04C; // type:object size:0x4 align:4 data:float -lbl_8057F050 = .sdata2:0x8057F050; // type:object size:0x4 align:4 data:float -lbl_8057F054 = .sdata2:0x8057F054; // type:object size:0x4 align:4 data:float -lbl_8057F058 = .sdata2:0x8057F058; // type:object size:0x8 align:8 data:double -lbl_8057F060 = .sdata2:0x8057F060; // type:object size:0x8 align:8 data:double +@3179 = .sdata2:0x8057F048; // type:object size:0x4 scope:local align:4 data:float +@3180 = .sdata2:0x8057F04C; // type:object size:0x4 scope:local align:4 data:float +@3181 = .sdata2:0x8057F050; // type:object size:0x4 scope:local align:4 data:float +@3182 = .sdata2:0x8057F054; // type:object size:0x4 scope:local align:4 data:float +@3191 = .sdata2:0x8057F058; // type:object size:0x8 scope:local align:8 data:double +@3192 = .sdata2:0x8057F060; // type:object size:0x8 scope:local align:8 data:double 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 diff --git a/configure.py b/configure.py index b4c83b6f..7d6c9e89 100644 --- a/configure.py +++ b/configure.py @@ -1040,7 +1040,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_Lfo.cpp"), Object(Matching, "nw4r/snd/snd_MemorySoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_MmlParser.cpp"), + Object(Matching, "nw4r/snd/snd_MmlParser.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlSeqTrack.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), From 338bb0869c91369ba012ace1457f1b306232a3a0 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 02:07:36 +0200 Subject: [PATCH 33/91] snd_MmlSeqTrack OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 4 ++-- configure.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index e170b4ed..90ac484a 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2986,6 +2986,7 @@ nw4r/snd/snd_MmlParser.cpp: nw4r/snd/snd_MmlSeqTrack.cpp: .text start:0x8046F640 end:0x8046F6F8 align:16 + .data start:0x8056DF48 end:0x8056DF58 nw4r/snd/snd_MmlSeqTrackAllocator.cpp: .text start:0x8046F700 end:0x8046F850 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 2d802951..925dc390 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25297,7 +25297,7 @@ ReadArg__Q44nw4r3snd6detail9MmlParserCFPPCUcPQ44nw4r3snd6detail9SeqPlayerPQ44nw4 ParseAllocTrack__Q44nw4r3snd6detail9MmlParserFPCvUlPUl = .text:0x8046F600; // type:function size:0x3C __ct__Q44nw4r3snd6detail11MmlSeqTrackFv = .text:0x8046F640; // type:function size:0x3C Parse__Q44nw4r3snd6detail11MmlSeqTrackFb = .text:0x8046F680; // type:function size:0x14 -__dt__Q44nw4r3snd6detail11MmlSeqTrackFv = .text:0x8046F6A0; // type:function size:0x58 +__dt__Q44nw4r3snd6detail11MmlSeqTrackFv = .text:0x8046F6A0; // type:function size:0x58 scope:weak AllocTrack__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFPQ44nw4r3snd6detail9SeqPlayer = .text:0x8046F700; // type:function size:0x68 FreeTrack__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFPQ44nw4r3snd6detail8SeqTrack = .text:0x8046F770; // type:function size:0x68 Create__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFPvUl = .text:0x8046F7E0; // type:function size:0xC @@ -38597,7 +38597,7 @@ __vt__Q34nw4r3snd18MemorySoundArchive = .data:0x8056DCF8; // type:object size:0x @3186 = .data:0x8056DD18; // type:object size:0x27 scope:local data:string @3190 = .data:0x8056DD40; // type:object size:0x1F4 scope:local __vt__Q44nw4r3snd6detail9MmlParser = .data:0x8056DF38; // type:object size:0x10 -lbl_8056DF48 = .data:0x8056DF48; // type:object size:0x10 +__vt__Q44nw4r3snd6detail11MmlSeqTrack = .data:0x8056DF48; // type:object size:0x10 lbl_8056DF58 = .data:0x8056DF58; // type:object size:0x18 lbl_8056DF70 = .data:0x8056DF70; // type:object size:0x60 lbl_8056DFD0 = .data:0x8056DFD0; // type:object size:0x20 diff --git a/configure.py b/configure.py index 7d6c9e89..abdcf881 100644 --- a/configure.py +++ b/configure.py @@ -1041,7 +1041,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_MemorySoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), Object(Matching, "nw4r/snd/snd_MmlParser.cpp"), - Object(NonMatching, "nw4r/snd/snd_MmlSeqTrack.cpp"), + Object(Matching, "nw4r/snd/snd_MmlSeqTrack.cpp"), Object(NonMatching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_PlayerHeap.cpp"), From 2e5c4230eae3f72b954521e3a25390a58071a838 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 02:10:29 +0200 Subject: [PATCH 34/91] snd_MmlSeqTrackAllocator OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 6 +++--- configure.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 90ac484a..6ad9eaa0 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2990,6 +2990,7 @@ nw4r/snd/snd_MmlSeqTrack.cpp: nw4r/snd/snd_MmlSeqTrackAllocator.cpp: .text start:0x8046F700 end:0x8046F850 align:16 + .data start:0x8056DF58 end:0x8056DF70 nw4r/snd/snd_NandSoundArchive.cpp: .text start:0x8046F850 end:0x804700B8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 925dc390..75158385 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25302,8 +25302,8 @@ AllocTrack__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFPQ44nw4r3snd6detail9SeqPlay FreeTrack__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFPQ44nw4r3snd6detail8SeqTrack = .text:0x8046F770; // type:function size:0x68 Create__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFPvUl = .text:0x8046F7E0; // type:function size:0xC Destroy__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFPvUl = .text:0x8046F7F0; // type:function size:0x8 -GetAllocatableTrackCount__Q44nw4r3snd6detail20MmlSeqTrackAllocatorCFv = .text:0x8046F800; // type:function size:0x8 -__dt__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFv = .text:0x8046F810; // type:function size:0x40 +GetAllocatableTrackCount__Q44nw4r3snd6detail20MmlSeqTrackAllocatorCFv = .text:0x8046F800; // type:function size:0x8 scope:weak +__dt__Q44nw4r3snd6detail20MmlSeqTrackAllocatorFv = .text:0x8046F810; // type:function size:0x40 scope:weak __ct__Q34nw4r3snd16NandSoundArchiveFv = .text:0x8046F850; // type:function size:0x4C __dt__Q34nw4r3snd16NandSoundArchiveFv = .text:0x8046F8A0; // type:function size:0x8C Open__Q34nw4r3snd16NandSoundArchiveFPCc = .text:0x8046F930; // type:function size:0x1BC @@ -38598,7 +38598,7 @@ __vt__Q34nw4r3snd18MemorySoundArchive = .data:0x8056DCF8; // type:object size:0x @3190 = .data:0x8056DD40; // type:object size:0x1F4 scope:local __vt__Q44nw4r3snd6detail9MmlParser = .data:0x8056DF38; // type:object size:0x10 __vt__Q44nw4r3snd6detail11MmlSeqTrack = .data:0x8056DF48; // type:object size:0x10 -lbl_8056DF58 = .data:0x8056DF58; // type:object size:0x18 +__vt__Q44nw4r3snd6detail20MmlSeqTrackAllocator = .data:0x8056DF58; // type:object size:0x18 lbl_8056DF70 = .data:0x8056DF70; // type:object size:0x60 lbl_8056DFD0 = .data:0x8056DFD0; // type:object size:0x20 __vt__Q44nw4r3snd6detail10PlayerHeap = .data:0x8056DFF0; // type:object size:0x10 diff --git a/configure.py b/configure.py index abdcf881..5c6a28c8 100644 --- a/configure.py +++ b/configure.py @@ -1042,7 +1042,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), Object(Matching, "nw4r/snd/snd_MmlParser.cpp"), Object(Matching, "nw4r/snd/snd_MmlSeqTrack.cpp"), - Object(NonMatching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), + Object(Matching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_PlayerHeap.cpp"), Object(Matching, "nw4r/snd/snd_RemoteSpeaker.cpp"), From 62c34af44e89c53bd1cc395768fbb72439dffe72 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 02:32:30 +0200 Subject: [PATCH 35/91] snd_WaveSound OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 16 ++++++++-------- configure.py | 2 +- include/nw4r/snd/snd_SeqSound.h | 2 +- include/nw4r/snd/snd_StrmSound.h | 2 +- include/nw4r/snd/snd_WaveSound.h | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 6ad9eaa0..eeb8d588 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3128,6 +3128,8 @@ nw4r/snd/snd_WaveFile.cpp: nw4r/snd/snd_WaveSound.cpp: .text start:0x80484F60 end:0x8048531C align:16 .ctors start:0x804DB970 end:0x804DB974 + .data start:0x8056E350 end:0x8056E388 + .sbss start:0x805766E8 end:0x805766F0 nw4r/snd/snd_WaveSoundHandle.cpp: .text start:0x80485320 end:0x80485458 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 75158385..15dee1a5 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25801,18 +25801,18 @@ __ct__Q44nw4r3snd6detail14WaveFileReaderFPCQ54nw4r3snd6detail8WaveFile8WaveInfo ReadWaveInfo__Q44nw4r3snd6detail14WaveFileReaderCFPQ44nw4r3snd6detail8WaveInfoPCv = .text:0x80484D20; // type:function size:0x1CC GetWaveDataAddress__Q44nw4r3snd6detail14WaveFileReaderCFPCQ54nw4r3snd6detail8WaveFile15WaveChannelInfoPCv = .text:0x80484EF0; // type:function size:0x64 __ct__Q44nw4r3snd6detail9WaveSoundFPQ44nw4r3snd6detail50SoundInstanceManagerii = .text:0x80484F60; // type:function size:0x68 -__dt__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x80484FD0; // type:function size:0x40 +__dt__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x80484FD0; // type:function size:0x40 scope:weak Prepare__Q44nw4r3snd6detail9WaveSoundFPCvlQ54nw4r3snd6detail9WsdPlayer15StartOffsetTypelPCQ54nw4r3snd6detail9WsdPlayer11WsdCallbackUl = .text:0x80485010; // type:function size:0xA0 Shutdown__Q44nw4r3snd6detail9WaveSoundFv = .text:0x804850B0; // type:function size:0x9C -__dt__Q44nw4r3snd6detail9WaveSoundFv = .text:0x80485150; // type:function size:0x40 +__dt__Q44nw4r3snd6detail9WaveSoundFv = .text:0x80485150; // type:function size:0x40 scope:weak SetChannelPriority__Q44nw4r3snd6detail9WaveSoundFi = .text:0x80485190; // type:function size:0x8 SetReleasePriorityFix__Q44nw4r3snd6detail9WaveSoundFb = .text:0x804851A0; // type:function size:0x8 OnUpdatePlayerPriority__Q44nw4r3snd6detail9WaveSoundFv = .text:0x804851B0; // type:function size:0xE4 IsAttachedTempSpecialHandle__Q44nw4r3snd6detail9WaveSoundFv = .text:0x804852A0; // type:function size:0x14 DetachTempSpecialHandle__Q44nw4r3snd6detail9WaveSoundFv = .text:0x804852C0; // type:function size:0x8 -GetBasicPlayer__Q44nw4r3snd6detail9WaveSoundFv = .text:0x804852D0; // type:function size:0x8 -GetBasicPlayer__Q44nw4r3snd6detail9WaveSoundCFv = .text:0x804852E0; // type:function size:0x8 -IsPrepared__Q44nw4r3snd6detail9WaveSoundCFv = .text:0x804852F0; // type:function size:0x8 +GetBasicPlayer__Q44nw4r3snd6detail9WaveSoundFv = .text:0x804852D0; // type:function size:0x8 scope:weak +GetBasicPlayer__Q44nw4r3snd6detail9WaveSoundCFv = .text:0x804852E0; // type:function size:0x8 scope:weak +IsPrepared__Q44nw4r3snd6detail9WaveSoundCFv = .text:0x804852F0; // type:function size:0x8 scope:weak GetRuntimeTypeInfo__Q44nw4r3snd6detail9WaveSoundCFv = .text:0x80485300; // type:function size:0x8 scope:weak __sinit_\snd_WaveSound_cpp = .text:0x80485310; // type:function size:0xC scope:local __ct__Q34nw4r3snd15WaveSoundHandleFPQ34nw4r3snd11SoundHandle = .text:0x80485320; // type:function size:0xF4 @@ -38626,7 +38626,7 @@ lbl_8056E2D0 = .data:0x8056E2D0; // type:object size:0x38 jumptable_8056E308 = .data:0x8056E308; // type:object size:0x24 scope:local lbl_8056E32C = .data:0x8056E32C; // type:object size:0x14 PanTableTable__Q44nw4r3snd6detail4Util = .data:0x8056E340; // type:object size:0xC -lbl_8056E350 = .data:0x8056E350; // type:object size:0x38 +__vt__Q44nw4r3snd6detail9WaveSound = .data:0x8056E350; // type:object size:0x38 lbl_8056E388 = .data:0x8056E388; // type:object size:0x60 @324 = .data:0x8056E3E8; // type:object size:0x46 scope:local data:string __vt__Q34nw4r3lyt4Pane = .data:0x8056E430; // type:object size:0x74 @@ -42423,7 +42423,7 @@ sBiquadFilterBpf2048__Q44nw4r3snd6detail9AxManager = .sbss:0x80576660; // type:o @GUARD@GetInstance__Q44nw4r3snd6detail14AxVoiceManagerFv@instance = .sbss:0x80576668; // type:object size:0x1 scope:weak data:byte lbl_80576670 = .sbss:0x80576670; // type:object size:0x4 data:4byte lbl_80576674 = .sbss:0x80576674; // type:object size:0x4 data:4byte -lbl_80576678 = .sbss:0x80576678; // type:object size:0x8 data:4byte +typeInfo__Q44nw4r3snd6detail10BasicSound = .sbss:0x80576678; // type:object size:0x8 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail14ChannelManagerFv@instance = .sbss:0x80576680; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .sbss:0x80576688; // type:object size:0x1 scope:weak data:byte mPrintVarEnabledFlag__Q44nw4r3snd6detail9MmlParser = .sbss:0x80576690; // type:object size:0x1 data:byte @@ -42439,7 +42439,7 @@ 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:0x1 scope:weak data:byte lbl_805766E0 = .sbss:0x805766E0; // type:object size:0x8 data:byte -lbl_805766E8 = .sbss:0x805766E8; // type:object size:0x8 data:4byte +typeInfo__Q44nw4r3snd6detail9WaveSound = .sbss:0x805766E8; // type:object size:0x4 data:4byte typeInfo__Q34nw4r3lyt4Pane = .sbss:0x805766F0; // type:object size:0x4 data:4byte mspAllocator__Q34nw4r3lyt6Layout = .sbss:0x805766F8; // type:object size:0x4 data:4byte typeInfo__Q34nw4r3lyt7Picture = .sbss:0x80576700; // type:object size:0x4 data:4byte diff --git a/configure.py b/configure.py index 5c6a28c8..7dcd938f 100644 --- a/configure.py +++ b/configure.py @@ -1081,7 +1081,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_Util.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveFile.cpp"), - Object(NonMatching, "nw4r/snd/snd_WaveSound.cpp"), + Object(Matching, "nw4r/snd/snd_WaveSound.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_WsdFile.cpp"), Object(NonMatching, "nw4r/snd/snd_WsdPlayer.cpp"), diff --git a/include/nw4r/snd/snd_SeqSound.h b/include/nw4r/snd/snd_SeqSound.h index 0960cbb9..d700b34f 100644 --- a/include/nw4r/snd/snd_SeqSound.h +++ b/include/nw4r/snd/snd_SeqSound.h @@ -41,7 +41,7 @@ namespace nw4r { namespace snd { namespace detail /* redeclare with this class instead of BasicSound for * SoundInstanceManager */ - typedef ut::LinkList PriorityLinkList; + typedef ut::LinkList PriorityLinkList; // nested types public: diff --git a/include/nw4r/snd/snd_StrmSound.h b/include/nw4r/snd/snd_StrmSound.h index 45175c92..db0d52d1 100644 --- a/include/nw4r/snd/snd_StrmSound.h +++ b/include/nw4r/snd/snd_StrmSound.h @@ -40,7 +40,7 @@ namespace nw4r { namespace snd { namespace detail /* redeclare with this class instead of BasicSound for * SoundInstanceManager */ - typedef ut::LinkList PriorityLinkList; + typedef ut::LinkList PriorityLinkList; // methods public: diff --git a/include/nw4r/snd/snd_WaveSound.h b/include/nw4r/snd/snd_WaveSound.h index ebac599c..87989c8e 100644 --- a/include/nw4r/snd/snd_WaveSound.h +++ b/include/nw4r/snd/snd_WaveSound.h @@ -36,7 +36,7 @@ namespace nw4r { namespace snd { namespace detail /* redeclare with this class instead of BasicSound for * SoundInstanceManager */ - typedef ut::LinkList PriorityLinkList; + typedef ut::LinkList PriorityLinkList; // methods public: From ae18395969ced5c92d8d20c6150c879b12be8f8b Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 02:32:57 +0200 Subject: [PATCH 36/91] snd_WaveSoundHandle OK --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 7dcd938f..ce7ab97b 100644 --- a/configure.py +++ b/configure.py @@ -1082,7 +1082,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_WaveArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveFile.cpp"), Object(Matching, "nw4r/snd/snd_WaveSound.cpp"), - Object(NonMatching, "nw4r/snd/snd_WaveSoundHandle.cpp"), + Object(Matching, "nw4r/snd/snd_WaveSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_WsdFile.cpp"), Object(NonMatching, "nw4r/snd/snd_WsdPlayer.cpp"), Object(Matching, "nw4r/snd/snd_adpcm.cpp"), From 097c070b9275231f882075db5567c2dbc027bfcb Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 20:11:18 +0200 Subject: [PATCH 37/91] snd_WsdPlayer OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 40 ++++++++++++++++---------------- configure.py | 2 +- include/nw4r/snd/snd_WsdPlayer.h | 12 +++++++++- src/nw4r/snd/snd_WsdPlayer.cpp | 20 ++++++++++++++++ 5 files changed, 54 insertions(+), 22 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index eeb8d588..28275ab0 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3140,6 +3140,8 @@ nw4r/snd/snd_WsdFile.cpp: nw4r/snd/snd_WsdPlayer.cpp: .text start:0x80485830 end:0x804869D8 align:16 + .data start:0x8056E388 end:0x8056E3E8 + .sdata2 start:0x8057F1F8 end:0x8057F220 nw4r/snd/snd_adpcm.cpp: .text start:0x804869E0 end:0x80486A6C align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 15dee1a5..e2399f25 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25836,18 +25836,18 @@ Update__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x80486000; // type:function size StartChannel__Q44nw4r3snd6detail9WsdPlayerFPCQ54nw4r3snd6detail9WsdPlayer11WsdCallbackUl = .text:0x804862B0; // type:function size:0x1B8 UpdateChannel__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x80486470; // type:function size:0x404 ChannelCallbackFunc__Q44nw4r3snd6detail9WsdPlayerFPQ44nw4r3snd6detail7ChannelQ54nw4r3snd6detail7Channel21ChannelCallbackStatusUl = .text:0x80486880; // type:function size:0x70 -OnUpdateFrameSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804868F0; // type:function size:0x4 -OnShutdownSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x80486900; // type:function size:0x10 -InvalidateWaveData__Q44nw4r3snd6detail9WsdPlayerFPCvPCv = .text:0x80486910; // type:function size:0x4 -IsPause__Q44nw4r3snd6detail9WsdPlayerCFv = .text:0x80486920; // type:function size:0x14 -IsStarted__Q44nw4r3snd6detail9WsdPlayerCFv = .text:0x80486940; // type:function size:0x14 -IsActive__Q44nw4r3snd6detail9WsdPlayerCFv = .text:0x80486960; // type:function size:0x14 -@180@InvalidateWaveData__Q44nw4r3snd6detail9WsdPlayerFPCvPCv = .text:0x80486980; // type:function size:0x8 -@180@InvalidateData__Q44nw4r3snd6detail9WsdPlayerFPCvPCv = .text:0x80486990; // type:function size:0x8 -@180@__dt__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869A0; // type:function size:0x8 -@192@OnShutdownSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869B0; // type:function size:0x8 -@192@OnUpdateFrameSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869C0; // type:function size:0x8 -@192@__dt__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869D0; // type:function size:0x8 +OnUpdateFrameSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804868F0; // type:function size:0x4 scope:weak +OnShutdownSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x80486900; // type:function size:0x10 scope:weak +InvalidateWaveData__Q44nw4r3snd6detail9WsdPlayerFPCvPCv = .text:0x80486910; // type:function size:0x4 scope:weak +IsPause__Q44nw4r3snd6detail9WsdPlayerCFv = .text:0x80486920; // type:function size:0x14 scope:weak +IsStarted__Q44nw4r3snd6detail9WsdPlayerCFv = .text:0x80486940; // type:function size:0x14 scope:weak +IsActive__Q44nw4r3snd6detail9WsdPlayerCFv = .text:0x80486960; // type:function size:0x14 scope:weak +@180@InvalidateWaveData__Q44nw4r3snd6detail9WsdPlayerFPCvPCv = .text:0x80486980; // type:function size:0x8 scope:weak +@180@InvalidateData__Q44nw4r3snd6detail9WsdPlayerFPCvPCv = .text:0x80486990; // type:function size:0x8 scope:weak +@180@__dt__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869A0; // type:function size:0x8 scope:weak +@192@OnShutdownSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869B0; // type:function size:0x8 scope:weak +@192@OnUpdateFrameSoundThread__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869C0; // type:function size:0x8 scope:weak +@192@__dt__Q44nw4r3snd6detail9WsdPlayerFv = .text:0x804869D0; // type:function size:0x8 scope:weak DecodeDspAdpcm__Q34nw4r3snd6detailFP10_AXPBADPCMUc = .text:0x804869E0; // type:function size:0x8C LytInit__Q24nw4r3lytFv = .text:0x80486A70; // type:function size:0x54 __ct__Q34nw4r3lyt4PaneFPCQ44nw4r3lyt3res4Pane = .text:0x80486AD0; // type:function size:0x128 @@ -38627,7 +38627,7 @@ jumptable_8056E308 = .data:0x8056E308; // type:object size:0x24 scope:local lbl_8056E32C = .data:0x8056E32C; // type:object size:0x14 PanTableTable__Q44nw4r3snd6detail4Util = .data:0x8056E340; // type:object size:0xC __vt__Q44nw4r3snd6detail9WaveSound = .data:0x8056E350; // type:object size:0x38 -lbl_8056E388 = .data:0x8056E388; // type:object size:0x60 +__vt__Q44nw4r3snd6detail9WsdPlayer = .data:0x8056E388; // type:object size:0x60 @324 = .data:0x8056E3E8; // type:object size:0x46 scope:local data:string __vt__Q34nw4r3lyt4Pane = .data:0x8056E430; // type:object size:0x74 __vt__Q34nw4r3lyt5Group = .data:0x8056E4A8; // type:object size:0xC @@ -49784,13 +49784,13 @@ lbl_8057F1B8 = .sdata2:0x8057F1B8; // type:object size:0x4 align:4 data:float @410 = .sdata2:0x8057F1E8; // type:object size:0x4 scope:local align:4 data:float @411 = .sdata2:0x8057F1EC; // type:object size:0x4 scope:local align:4 data:float @1628 = .sdata2:0x8057F1F0; // type:object size:0x4 scope:local align:4 data:float -lbl_8057F1F8 = .sdata2:0x8057F1F8; // type:object size:0x4 align:4 data:float -lbl_8057F1FC = .sdata2:0x8057F1FC; // type:object size:0x4 align:4 data:float -lbl_8057F200 = .sdata2:0x8057F200; // type:object size:0x4 align:4 data:float -lbl_8057F204 = .sdata2:0x8057F204; // type:object size:0x4 align:4 data:float -lbl_8057F208 = .sdata2:0x8057F208; // type:object size:0x4 align:4 data:float -lbl_8057F210 = .sdata2:0x8057F210; // type:object size:0x8 align:8 data:double -lbl_8057F218 = .sdata2:0x8057F218; // type:object size:0x8 align:8 data:double +@2739 = .sdata2:0x8057F1F8; // type:object size:0x4 scope:local align:4 data:float +@3148 = .sdata2:0x8057F1FC; // type:object size:0x4 scope:local align:4 data:float +@3149 = .sdata2:0x8057F200; // type:object size:0x4 scope:local align:4 data:float +@3150 = .sdata2:0x8057F204; // type:object size:0x4 scope:local align:4 data:float +@3151 = .sdata2:0x8057F208; // type:object size:0x4 scope:local align:4 data:float +@3155 = .sdata2:0x8057F210; // type:object size:0x8 scope:local align:8 data:double +@3156 = .sdata2:0x8057F218; // type:object size:0x8 scope:local align:8 data:double @5330 = .sdata2:0x8057F220; // type:object size:0x4 scope:local align:4 data:float @5331 = .sdata2:0x8057F224; // type:object size:0x4 scope:local align:4 data:float @5589 = .sdata2:0x8057F228; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index ce7ab97b..92bf7d63 100644 --- a/configure.py +++ b/configure.py @@ -1084,7 +1084,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_WaveSound.cpp"), Object(Matching, "nw4r/snd/snd_WaveSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_WsdFile.cpp"), - Object(NonMatching, "nw4r/snd/snd_WsdPlayer.cpp"), + Object(Matching, "nw4r/snd/snd_WsdPlayer.cpp"), Object(Matching, "nw4r/snd/snd_adpcm.cpp"), ], mw_version="Wii/1.6", diff --git a/include/nw4r/snd/snd_WsdPlayer.h b/include/nw4r/snd/snd_WsdPlayer.h index 6116cf0e..5cf90b48 100644 --- a/include/nw4r/snd/snd_WsdPlayer.h +++ b/include/nw4r/snd/snd_WsdPlayer.h @@ -18,7 +18,16 @@ * classes and functions */ -namespace nw4r { namespace snd { namespace detail +namespace nw4r { namespace snd { + +struct WsdDataInfo { + /* 0x00 */ bool loopFlag; + /* 0x04 */ int sampleRate; + /* 0x08 */ u32 loopStart; + /* 0x0C */ u32 loopEnd; +}; + +namespace detail { // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x30b74 class WsdPlayer : public BasicPlayer, @@ -98,6 +107,7 @@ namespace nw4r { namespace snd { namespace detail { return mChannel != nullptr && mChannel->IsActive(); } + bool ReadWsdDataInfo(WsdDataInfo*) const; u32 GetPlaySamplePosition() const; private: diff --git a/src/nw4r/snd/snd_WsdPlayer.cpp b/src/nw4r/snd/snd_WsdPlayer.cpp index c7f60adc..2b4734c6 100644 --- a/src/nw4r/snd/snd_WsdPlayer.cpp +++ b/src/nw4r/snd/snd_WsdPlayer.cpp @@ -141,6 +141,23 @@ void WsdPlayer::InvalidateData(void const *start, void const *end) } } +bool WsdPlayer::ReadWsdDataInfo(WsdDataInfo *info) const +{ + SoundThread::AutoLock lock; + + WaveSoundInfo wsInfo; + WaveSoundNoteInfo wsNoteInfo; + WaveInfo waveInfo; + bool result = mCallback->GetWaveSoundData(&wsInfo, &wsNoteInfo, &waveInfo, mWsdData, mWsdIndex, 0, mCallbackData); + if (result) { + info->loopFlag = waveInfo.loopFlag != false; + info->sampleRate = waveInfo.sampleRate; + info->loopStart = waveInfo.loopStart; + info->loopEnd = waveInfo.loopEnd; + } + return result; +} + void WsdPlayer::FinishPlayer() { SoundThread::AutoLock lock; @@ -349,6 +366,9 @@ void WsdPlayer::UpdateChannel() mChannel->SetFxSend(bus, fxSend[i]); } + for (int i = 0; i < 4; i++) + mChannel->SetRemoteOutVolume(i, GetRemoteOutVolume(i)); + for (int i = 0; i < mVoiceOutCount; i++) mChannel->SetVoiceOutParam(i, GetVoiceOutParam(i)); From fd749c7bbc38fd00cf98367e08616a5cad2ab72b Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 20:59:12 +0200 Subject: [PATCH 38/91] snd_Voice OK --- config/SOUE01/splits.txt | 2 + config/SOUE01/symbols.txt | 32 ++++++------ configure.py | 2 +- include/nw4r/snd/snd_AxManager.h | 7 ++- include/nw4r/snd/snd_AxVoice.h | 4 +- include/nw4r/snd/snd_Voice.h | 3 +- include/nw4r/ut/ut_LinkList.h | 4 +- src/nw4r/snd/snd_AxManager.cpp | 2 +- src/nw4r/snd/snd_AxVoice.cpp | 2 +- src/nw4r/snd/snd_Voice.cpp | 86 ++++++++++++++++++++++++-------- 10 files changed, 100 insertions(+), 44 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 28275ab0..81a69863 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3111,6 +3111,8 @@ nw4r/snd/snd_TaskThread.cpp: nw4r/snd/snd_Voice.cpp: .text start:0x804817A0 end:0x80484034 align:16 + .data start:0x8056E308 end:0x8056E340 + .sdata2 start:0x8057F188 end:0x8057F1C0 nw4r/snd/snd_VoiceManager.cpp: .text start:0x80484040 end:0x804846F4 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index e2399f25..7b946182 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25775,7 +25775,7 @@ AxVoiceCallbackFunc__Q44nw4r3snd6detail5VoiceFPQ44nw4r3snd6detail7AxVoiceQ54nw4r TransformDpl2Pan__Q44nw4r3snd6detail5VoiceFPfPfff = .text:0x80483190; // type:function size:0x1A0 CalcMixParam__Q44nw4r3snd6detail5VoiceFiiPQ54nw4r3snd6detail7AxVoice8MixParamPQ54nw4r3snd6detail7AxVoice14RemoteMixParam = .text:0x80483330; // type:function size:0xBAC InvalidateWaveData__Q44nw4r3snd6detail5VoiceFPCvPCv = .text:0x80483EE0; // type:function size:0x14C -InvalidateData__Q44nw4r3snd6detail5VoiceFPCvPCv = .text:0x80484030; // type:function size:0x4 +InvalidateData__Q44nw4r3snd6detail5VoiceFPCvPCv = .text:0x80484030; // type:function size:0x4 scope:weak GetInstance__Q44nw4r3snd6detail12VoiceManagerFv = .text:0x80484040; // type:function size:0x7C __dt__Q44nw4r3snd6detail12VoiceManagerFv = .text:0x804840C0; // type:function size:0x70 GetRequiredMemSize__Q44nw4r3snd6detail12VoiceManagerFi = .text:0x80484130; // type:function size:0x8 @@ -38623,8 +38623,8 @@ lbl_8056E258 = .data:0x8056E258; // type:object size:0x48 lbl_8056E2A0 = .data:0x8056E2A0; // type:object size:0x18 lbl_8056E2B8 = .data:0x8056E2B8; // type:object size:0x18 lbl_8056E2D0 = .data:0x8056E2D0; // type:object size:0x38 -jumptable_8056E308 = .data:0x8056E308; // type:object size:0x24 scope:local -lbl_8056E32C = .data:0x8056E32C; // type:object size:0x14 +@5068 = .data:0x8056E308; // type:object size:0x24 scope:local +__vt__Q44nw4r3snd6detail5Voice = .data:0x8056E32C; // type:object size:0x14 PanTableTable__Q44nw4r3snd6detail4Util = .data:0x8056E340; // type:object size:0xC __vt__Q44nw4r3snd6detail9WaveSound = .data:0x8056E350; // type:object size:0x38 __vt__Q44nw4r3snd6detail9WsdPlayer = .data:0x8056E388; // type:object size:0x60 @@ -49758,19 +49758,19 @@ lbl_8057F170 = .sdata2:0x8057F170; // type:object size:0x4 align:4 data:float lbl_8057F178 = .sdata2:0x8057F178; // type:object size:0x4 align:4 data:float lbl_8057F17C = .sdata2:0x8057F17C; // type:object size:0x4 align:4 data:float lbl_8057F180 = .sdata2:0x8057F180; // type:object size:0x8 align:8 data:double -lbl_8057F188 = .sdata2:0x8057F188; // type:object size:0x4 align:4 data:float -lbl_8057F18C = .sdata2:0x8057F18C; // type:object size:0x4 align:4 data:float -lbl_8057F190 = .sdata2:0x8057F190; // type:object size:0x4 align:4 data:float -lbl_8057F194 = .sdata2:0x8057F194; // type:object size:0x4 align:4 data:float -lbl_8057F198 = .sdata2:0x8057F198; // type:object size:0x4 align:4 data:float -lbl_8057F19C = .sdata2:0x8057F19C; // type:object size:0x4 align:4 data:float -lbl_8057F1A0 = .sdata2:0x8057F1A0; // type:object size:0x4 align:4 data:float -lbl_8057F1A4 = .sdata2:0x8057F1A4; // type:object size:0x4 align:4 data:float -lbl_8057F1A8 = .sdata2:0x8057F1A8; // type:object size:0x4 align:4 data:float -lbl_8057F1AC = .sdata2:0x8057F1AC; // type:object size:0x4 align:4 data:float -lbl_8057F1B0 = .sdata2:0x8057F1B0; // type:object size:0x4 align:4 data:float -lbl_8057F1B4 = .sdata2:0x8057F1B4; // type:object size:0x4 align:4 data:float -lbl_8057F1B8 = .sdata2:0x8057F1B8; // type:object size:0x4 align:4 data:float +@4083 = .sdata2:0x8057F188; // type:object size:0x4 scope:local align:4 data:float +@4084 = .sdata2:0x8057F18C; // type:object size:0x4 scope:local align:4 data:float +@4815 = .sdata2:0x8057F190; // type:object size:0x4 scope:local align:4 data:float +@4816 = .sdata2:0x8057F194; // type:object size:0x4 scope:local align:4 data:float +@4817 = .sdata2:0x8057F198; // type:object size:0x4 scope:local align:4 data:float +@4818 = .sdata2:0x8057F19C; // type:object size:0x4 scope:local align:4 data:float +@4819 = .sdata2:0x8057F1A0; // type:object size:0x4 scope:local align:4 data:float +@4820 = .sdata2:0x8057F1A4; // type:object size:0x4 scope:local align:4 data:float +@4821 = .sdata2:0x8057F1A8; // type:object size:0x4 scope:local align:4 data:float +@4822 = .sdata2:0x8057F1AC; // type:object size:0x4 scope:local align:4 data:float +@5062 = .sdata2:0x8057F1B0; // type:object size:0x4 scope:local align:4 data:float +@5063 = .sdata2:0x8057F1B4; // type:object size:0x4 scope:local align:4 data:float +@5064 = .sdata2:0x8057F1B8; // type:object size:0x4 scope:local align:4 data:float @312 = .sdata2:0x8057F1C0; // type:object size:0x4 scope:local align:4 data:float @313 = .sdata2:0x8057F1C4; // type:object size:0x4 scope:local align:4 data:float @314 = .sdata2:0x8057F1C8; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index 92bf7d63..72b54367 100644 --- a/configure.py +++ b/configure.py @@ -1076,7 +1076,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_Task.cpp"), Object(Matching, "nw4r/snd/snd_TaskManager.cpp"), Object(Matching, "nw4r/snd/snd_TaskThread.cpp"), - Object(NonMatching, "nw4r/snd/snd_Voice.cpp"), + Object(Matching, "nw4r/snd/snd_Voice.cpp"), Object(NonMatching, "nw4r/snd/snd_VoiceManager.cpp"), Object(Matching, "nw4r/snd/snd_Util.cpp"), Object(NonMatching, "nw4r/snd/snd_WaveArchive.cpp"), diff --git a/include/nw4r/snd/snd_AxManager.h b/include/nw4r/snd/snd_AxManager.h index 01df41f9..1aad4de5 100644 --- a/include/nw4r/snd/snd_AxManager.h +++ b/include/nw4r/snd/snd_AxManager.h @@ -7,6 +7,7 @@ #include "common.h" +#include "nw4r/snd/snd_AxVoice.h" #include "nw4r/snd/snd_global.h" #include "nw4r/snd/snd_FxBase.h" @@ -106,6 +107,10 @@ namespace nw4r { namespace snd { namespace detail return mResetReadyCounter == 0; } + AxVoice::SrcType GetSrcType() const { + return mSrcType; + } + private: // cdtors AxManager(); @@ -156,7 +161,7 @@ namespace nw4r { namespace snd { namespace detail u8 mAuxCallbackWaitCounter[AUX_BUS_NUM]; // size 0x03, offset 0xf0 /* 1 byte padding */ u32 mEffectProcessTick[AUX_BUS_NUM]; // size 0x0c, offset 0xf4 - u32 field_0x100; + AxVoice::SrcType mSrcType; }; // size 0x104 }}} // namespace nw4r::snd::detail diff --git a/include/nw4r/snd/snd_AxVoice.h b/include/nw4r/snd/snd_AxVoice.h index 45bd9575..4e6d34b7 100644 --- a/include/nw4r/snd/snd_AxVoice.h +++ b/include/nw4r/snd/snd_AxVoice.h @@ -235,6 +235,7 @@ namespace nw4r { namespace snd { namespace detail void SetLoopFlag(bool loopFlag); void SetPriority(u32 priority); void SetVoiceType(VoiceType type); + void EnableRemote(bool enable); void ResetDelta(); void SetAddr(bool loopFlag, void const *waveAddr, u32 startOffset, u32 loopStart, u32 loopEnd); @@ -242,6 +243,7 @@ namespace nw4r { namespace snd { namespace detail void SetAdpcm(AdpcmParam const *param); void SetAdpcmLoop(AdpcmLoopParam const *param); bool SetMix(MixParam const ¶m); + bool SetRmtMix(const RemoteMixParam ¶m); void SetSrc(f32 ratio, bool initialUpdate); void SetVe(f32 volume, f32 initVolume); void SetLpf(u16 freq); @@ -269,7 +271,7 @@ namespace nw4r { namespace snd { namespace detail static void CalcOffsetAdpcmParam(u16 *outPredScale, u16 *outYn1, u16 *outYn2, u32 offset, - void *dataAddr, + const void *dataAddr, AdpcmParam const &adpcmParam); private: diff --git a/include/nw4r/snd/snd_Voice.h b/include/nw4r/snd/snd_Voice.h index 0aee71a3..96cd4455 100644 --- a/include/nw4r/snd/snd_Voice.h +++ b/include/nw4r/snd/snd_Voice.h @@ -55,7 +55,7 @@ namespace nw4r { namespace snd { namespace detail // typedefs public: - typedef ut::LinkList LinkList; + typedef ut::LinkList LinkList; typedef void Callback(Voice *dropVoice, VoiceCallbackStatus status, void *callbackData); @@ -229,6 +229,7 @@ namespace nw4r { namespace snd { namespace detail f32 mMainOutVolume; // size 0x04, offset 0xc0 f32 mMainSend; // size 0x04, offset 0xc4 f32 mFxSend[AUX_BUS_NUM]; // size 0x0c, offset 0xc8 + f32 mRemoteOutVolume[4]; // size 0x10, offset 0xd4 TODO following sizes wrong f32 mPitch; // size 0x04, offset 0xd4 f32 mVolume; // size 0x04, offset 0xd8 f32 mVeInitVolume; // size 0x04, offset 0xdc diff --git a/include/nw4r/ut/ut_LinkList.h b/include/nw4r/ut/ut_LinkList.h index e96cfa3d..5d890f34 100644 --- a/include/nw4r/ut/ut_LinkList.h +++ b/include/nw4r/ut/ut_LinkList.h @@ -328,7 +328,7 @@ public: return Iterator(LinkListImpl::GetBeginIter()); } ConstIterator GetBeginIter() const { - return ConstIterator(GetBeginIter()); + return const_cast(this)->LinkListImpl::GetBeginIter(); } detail::ReverseIterator GetBeginReverseIter() { return detail::ReverseIterator(GetBeginIter()); @@ -338,7 +338,7 @@ public: return Iterator(LinkListImpl::GetEndIter()); } ConstIterator GetEndIter() const { - return ConstIterator(GetEndIter()); + return const_cast(this)->LinkListImpl::GetEndIter(); } detail::ReverseIterator GetEndReverseIter() { return detail::ReverseIterator(GetEndIter()); diff --git a/src/nw4r/snd/snd_AxManager.cpp b/src/nw4r/snd/snd_AxManager.cpp index 971f5e4b..1a944bac 100644 --- a/src/nw4r/snd/snd_AxManager.cpp +++ b/src/nw4r/snd/snd_AxManager.cpp @@ -69,7 +69,7 @@ AxManager::AxManager() : mUpdateVoicePrioFlag (true), mOldAidCallback (nullptr), mResetReadyCounter (-1), - field_0x100(5) + mSrcType(AxVoice::SRC_4TAP_AUTO) { mMainOutVolume.InitValue(1.0f); mMasterVolume.InitValue(1.0f); diff --git a/src/nw4r/snd/snd_AxVoice.cpp b/src/nw4r/snd/snd_AxVoice.cpp index 57e8adc4..81d8213d 100644 --- a/src/nw4r/snd/snd_AxVoice.cpp +++ b/src/nw4r/snd/snd_AxVoice.cpp @@ -847,7 +847,7 @@ void AxVoice::SetRemoteFilter(u8 filter) } void AxVoice::CalcOffsetAdpcmParam(u16 *outPredScale, u16 *outYn1, u16 *outYn2, - u32 offset, void *dataAddr, + u32 offset, const void *dataAddr, AdpcmParam const &adpcmParam) { AXPBADPCM adpcm; diff --git a/src/nw4r/snd/snd_Voice.cpp b/src/nw4r/snd/snd_Voice.cpp index dde56c19..b422b842 100644 --- a/src/nw4r/snd/snd_Voice.cpp +++ b/src/nw4r/snd/snd_Voice.cpp @@ -136,6 +136,9 @@ void Voice::InitParam(int channelCount, int voiceOutCount, Callback *callback, for (int i = 0; i < AUX_BUS_NUM; i++) mFxSend[i] = 0.0f; + for (int i = 0; i < 4; i++) + mRemoteOutVolume[i] = 1.0f; + mPitch = 1.0f; mRemoteFilter = 0; mPanMode = PAN_MODE_DUAL; @@ -417,7 +420,7 @@ void Voice::Setup(WaveInfo const &waveParam, u32 startOffset) &waveParam.channelParam[channelIndex].adpcmLoopParam); } - axVoice->SetSrcType(AxVoice::SRC_4TAP_AUTO, mPitch); + axVoice->SetSrcType(AxManager::GetInstance().GetSrcType(), mPitch); axVoice->SetVoiceType(AxVoice::VOICE_TYPE_NORMAL); } } @@ -486,7 +489,8 @@ SampleFormat Voice::GetFormat() const void Voice::SetVolume(f32 volume) { - volume = ut::Clamp(volume, VOLUME_MIN, VOLUME_MAX); + if (volume < 0.0f) + volume = 0.0f; if (volume != mVolume) { @@ -498,8 +502,10 @@ void Voice::SetVolume(f32 volume) void Voice::SetVeVolume(f32 targetVolume, f32 initVolume) { - targetVolume = ut::Clamp(targetVolume, VOLUME_MIN, VOLUME_MAX); - initVolume = ut::Clamp(initVolume, VOLUME_MIN, VOLUME_MAX); + if (targetVolume < 0.0f) + targetVolume = 0.0f; + if (initVolume < 0.0f) + initVolume = 0.0f; if (initVolume < 0.0f) { @@ -632,7 +638,8 @@ void Voice::SetOutputLine(int lineFlag) void Voice::SetMainOutVolume(f32 volume) { - volume = ut::Clamp(volume, VOLUME_MIN, VOLUME_MAX); + if (volume < 0.0f) + volume = 0.0f; if (volume != mMainOutVolume) { @@ -645,7 +652,8 @@ void Voice::SetMainOutVolume(f32 volume) void Voice::SetMainSend(f32 send) { send += 1.0f; - send = ut::Clamp(send, SEND_MIN, SEND_MAX); + if (send < SEND_MIN) + send = SEND_MIN; if (send != mMainSend) { @@ -660,7 +668,8 @@ void Voice::SetFxSend(AuxBus bus, f32 send) // specifically not the source variant NW4RAssertHeaderClampedLValue_Line(748, bus, 0, AUX_BUS_NUM); - send = ut::Clamp(send, SEND_MIN, SEND_MAX); + if (send < SEND_MIN) + send = SEND_MIN; if (send != mFxSend[bus]) { @@ -670,6 +679,18 @@ void Voice::SetFxSend(AuxBus bus, f32 send) } } +void Voice::SetRemoteOutVolume(int remote, f32 volume) +{ + if (volume < 0.0f) + volume = 0.0f; + + if (mRemoteOutVolume[remote] == volume) + return; + + mRemoteOutVolume[remote] = volume; + mSyncFlag |= UPDATE_MIX; +} + void Voice::SetVoiceOutParam(int voiceOutIndex, VoiceOutParam const &voiceOutParam) { @@ -719,9 +740,10 @@ void Voice::UpdateVoicesPriority() } } } - +#if 0 // Voice::GetAxVoice ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14824) DECOMP_FORCE(NW4RAssert_String(channelIndex < CHANNEL_MAX)); +#endif void Voice::SetAdpcmLoop(int channelIndex, AdpcmLoopParam const *param) { @@ -839,7 +861,7 @@ bool Voice::CalcAxMix() /* The address is taken and the members are set, but the members aren't used * after that */ - AxVoice::RemoteMixParam rmtmix ATTR_UNUSED; + AxVoice::RemoteMixParam rmtmix; for (int channelIndex = 0; channelIndex < mChannelCount; channelIndex++) { @@ -851,6 +873,12 @@ bool Voice::CalcAxMix() CalcMixParam(channelIndex, voiceOutIndex, &mix, &rmtmix); nextUpdateFlag |= axVoice->SetMix(mix); + if (mOutputLineFlag == 0 || mOutputLineFlag == 1) { + axVoice->EnableRemote(false); + } else { + axVoice->EnableRemote(true); + axVoice->SetRmtMix(rmtmix); + } } } } @@ -1054,17 +1082,31 @@ void Voice::CalcMixParam(int channelIndex, int voiceOutIndex, mainVolume = mMainOutVolume; mainSend = mMainSend; - fxSendA = - ut::Clamp(mFxSend[AUX_A] + mVoiceOutParam[voiceOutIndex].fxSend, - SEND_MIN, SEND_MAX); + fxSendA = mFxSend[AUX_A] + mVoiceOutParam[voiceOutIndex].fxSend; + if (fxSendA < SEND_MIN) { + fxSendA = SEND_MIN; + } fxSendB = mFxSend[AUX_B]; fxSendC = mFxSend[AUX_C]; } - f32 main = mainVolume * mainSend; - f32 fx_a = mainVolume * fxSendA; - f32 fx_b = mainVolume * fxSendB; - f32 fx_c = mainVolume * fxSendC; + f32 main = mainVolume * nw4r::ut::Clamp(mainSend, 0.0f, 1.0f); + f32 fx_a = mainVolume * nw4r::ut::Clamp(fxSendA, 0.0f, 1.0f); + f32 fx_b = mainVolume * nw4r::ut::Clamp(fxSendB, 0.0f, 1.0f); + f32 fx_c = mainVolume * nw4r::ut::Clamp(fxSendC, 0.0f, 1.0f); + + f32 remoteOutVolumeOrig[4]; + for (int i = 0; i < 4; i++) + { + if (mOutputLineFlag & (2 << i)) + { + remoteOutVolumeOrig[i] = mRemoteOutVolume[i]; + } + else + { + remoteOutVolumeOrig[i] = 0.0f; + } + } f32 left, right, surround, lrMixed; f32 front, rear; @@ -1302,6 +1344,10 @@ void Voice::CalcMixParam(int channelIndex, int voiceOutIndex, break; } + f32 remoteOutVolume[4]; + for (int i = 0; i < 4; i++) + remoteOutVolume[i] = lrMixed * remoteOutVolumeOrig[i]; + mix->vL = CalcMixVolume(m_l); mix->vR = CalcMixVolume(m_r); mix->vS = CalcMixVolume(m_s); @@ -1315,13 +1361,13 @@ void Voice::CalcMixParam(int channelIndex, int voiceOutIndex, mix->vAuxCR = CalcMixVolume(c_r); mix->vAuxCS = CalcMixVolume(c_s); - rmtmix->vMain0 = 0; + rmtmix->vMain0 = CalcMixVolume(remoteOutVolume[0]); rmtmix->vAux0 = 0; - rmtmix->vMain1 = 0; + rmtmix->vMain1 = CalcMixVolume(remoteOutVolume[1]); rmtmix->vAux1 = 0; - rmtmix->vMain2 = 0; + rmtmix->vMain2 = CalcMixVolume(remoteOutVolume[2]); rmtmix->vAux2 = 0; - rmtmix->vMain3 = 0; + rmtmix->vMain3 = CalcMixVolume(remoteOutVolume[3]); rmtmix->vAux3 = 0; } From 827d72297cb476237e5dfcea0cd509374011990f Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 21:01:13 +0200 Subject: [PATCH 39/91] snd_VoiceManager OK --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 8 ++++---- configure.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 81a69863..fd954d27 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3116,6 +3116,8 @@ nw4r/snd/snd_Voice.cpp: nw4r/snd/snd_VoiceManager.cpp: .text start:0x80484040 end:0x804846F4 align:16 + .sbss start:0x805766E0 end:0x805766E8 + .bss start:0x80673A80 end:0x80673AA8 nw4r/snd/snd_Util.cpp: .text start:0x80484700 end:0x80484BD4 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 7b946182..1c220bfd 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25777,7 +25777,7 @@ CalcMixParam__Q44nw4r3snd6detail5VoiceFiiPQ54nw4r3snd6detail7AxVoice8MixParamPQ5 InvalidateWaveData__Q44nw4r3snd6detail5VoiceFPCvPCv = .text:0x80483EE0; // type:function size:0x14C InvalidateData__Q44nw4r3snd6detail5VoiceFPCvPCv = .text:0x80484030; // type:function size:0x4 scope:weak GetInstance__Q44nw4r3snd6detail12VoiceManagerFv = .text:0x80484040; // type:function size:0x7C -__dt__Q44nw4r3snd6detail12VoiceManagerFv = .text:0x804840C0; // type:function size:0x70 +__dt__Q44nw4r3snd6detail12VoiceManagerFv = .text:0x804840C0; // type:function size:0x70 scope:weak GetRequiredMemSize__Q44nw4r3snd6detail12VoiceManagerFi = .text:0x80484130; // type:function size:0x8 Setup__Q44nw4r3snd6detail12VoiceManagerFPvUl = .text:0x80484140; // type:function size:0xA4 AllocVoice__Q44nw4r3snd6detail12VoiceManagerFiiiPFPQ44nw4r3snd6detail5VoiceQ54nw4r3snd6detail5Voice19VoiceCallbackStatusPv_vPv = .text:0x804841F0; // type:function size:0x1C0 @@ -42438,7 +42438,7 @@ lbl_805766BC = .sbss:0x805766BC; // type:object size:0x4 data:4byte 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:0x1 scope:weak data:byte -lbl_805766E0 = .sbss:0x805766E0; // type:object size:0x8 data:byte +@GUARD@GetInstance__Q44nw4r3snd6detail12VoiceManagerFv@instance = .sbss:0x805766E0; // type:object size:0x1 scope:weak data:byte typeInfo__Q44nw4r3snd6detail9WaveSound = .sbss:0x805766E8; // type:object size:0x4 data:4byte typeInfo__Q34nw4r3lyt4Pane = .sbss:0x805766F0; // type:object size:0x4 data:4byte mspAllocator__Q34nw4r3lyt6Layout = .sbss:0x805766F8; // type:object size:0x4 data:4byte @@ -51952,8 +51952,8 @@ lbl_8066FA20 = .bss:0x8066FA20; // type:object size:0x4000 align:32 lbl_80673A20 = .bss:0x80673A20; // type:object size:0x18 @886 = .bss:0x80673A38; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .bss:0x80673A44; // type:object size:0x3C scope:weak -lbl_80673A80 = .bss:0x80673A80; // type:object size:0xC -lbl_80673A8C = .bss:0x80673A8C; // type:object size:0x1C data:byte +@1109 = .bss:0x80673A80; // type:object size:0xC scope:local +@LOCAL@GetInstance__Q44nw4r3snd6detail12VoiceManagerFv@instance = .bss:0x80673A8C; // type:object size:0x1C scope:weak data:byte @LOCAL@SetSize__Q44nw4r3lyt6detail11TexCoordAryFUc@texCoords = .bss:0x80673AA8; // type:object size:0x20 scope:weak align:4 data:float sArchiveList__Q23EGG7Archive = .bss:0x80673AC8; // type:object size:0xC sDvdList__Q23EGG7DvdFile = .bss:0x80673AD8; // type:object size:0xC diff --git a/configure.py b/configure.py index 72b54367..fc0bf7de 100644 --- a/configure.py +++ b/configure.py @@ -1077,7 +1077,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_TaskManager.cpp"), Object(Matching, "nw4r/snd/snd_TaskThread.cpp"), Object(Matching, "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"), From 88a0679158ed761d487597bc8515541aef740cab Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 21:58:00 +0200 Subject: [PATCH 40/91] snd_StrmPlayer OK --- config/SOUE01/splits.txt | 4 ++ config/SOUE01/symbols.txt | 48 +++++++++++------------ configure.py | 2 +- include/nw4r/snd/snd_StrmPlayer.h | 16 +++++++- include/nw4r/snd/snd_Voice.h | 4 ++ src/nw4r/snd/snd_StrmPlayer.cpp | 63 ++++++++++++++++++++++++++++++- 6 files changed, 109 insertions(+), 28 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index fd954d27..02f9f13e 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3090,6 +3090,10 @@ nw4r/snd/snd_StrmFile.cpp: nw4r/snd/snd_StrmPlayer.cpp: .text start:0x8047D8E0 end:0x80480588 align:16 + .data start:0x8056E258 end:0x8056E2D0 + .sbss start:0x805766C8 end:0x805766D0 + .sdata2 start:0x8057F150 end:0x8057F178 + .bss start:0x8066FA20 end:0x80673A38 nw4r/snd/snd_StrmSound.cpp: .text start:0x80480590 end:0x80480D8C align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 1c220bfd..9c6dfa3f 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25649,8 +25649,8 @@ ReadStrmTrackInfo__Q44nw4r3snd6detail14StrmFileLoaderCFPQ54nw4r3snd6detail14Strm ReadAdpcmInfo__Q44nw4r3snd6detail14StrmFileLoaderCFPQ34nw4r3snd10AdpcmParamPQ44nw4r3snd6detail14AdpcmLoopParami = .text:0x8047D5D0; // type:function size:0x14C ReadAdpcBlockData__Q44nw4r3snd6detail14StrmFileLoaderFPUsPUsii = .text:0x8047D720; // type:function size:0x1B4 __ct__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x8047D8E0; // type:function size:0xF0 -__dt__Q54nw4r3snd6detail10StrmPlayer18StrmHeaderLoadTaskFv = .text:0x8047D9D0; // type:function size:0x58 -__dt__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTaskFv = .text:0x8047DA30; // type:function size:0x58 +__dt__Q54nw4r3snd6detail10StrmPlayer18StrmHeaderLoadTaskFv = .text:0x8047D9D0; // type:function size:0x58 scope:weak +__dt__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTaskFv = .text:0x8047DA30; // type:function size:0x58 scope:weak __dt__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x8047DA90; // type:function size:0x100 Setup__Q44nw4r3snd6detail10StrmPlayerFPQ44nw4r3snd6detail14StrmBufferPooliUsi = .text:0x8047DB90; // type:function size:0x218 Shutdown__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x8047DDB0; // type:function size:0x90 @@ -25685,16 +25685,16 @@ __ct__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTaskFv = .text:0x80480290; // Execute__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTaskFv = .text:0x804802E0; // type:function size:0xD0 Cancel__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTaskFv = .text:0x804803B0; // type:function size:0x8C OnCancel__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTaskFv = .text:0x80480440; // type:function size:0xA8 -OnUpdateFrameSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x804804F0; // type:function size:0x4 -OnUpdateVoiceSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480500; // type:function size:0x4 -OnShutdownSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480510; // type:function size:0x10 -IsPause__Q44nw4r3snd6detail10StrmPlayerCFv = .text:0x80480520; // type:function size:0x8 -IsStarted__Q44nw4r3snd6detail10StrmPlayerCFv = .text:0x80480530; // type:function size:0x8 -IsActive__Q44nw4r3snd6detail10StrmPlayerCFv = .text:0x80480540; // type:function size:0x8 -@180@OnShutdownSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480550; // type:function size:0x8 -@180@OnUpdateVoiceSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480560; // type:function size:0x8 -@180@OnUpdateFrameSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480570; // type:function size:0x8 -@180@__dt__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480580; // type:function size:0x8 +OnUpdateFrameSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x804804F0; // type:function size:0x4 scope:weak +OnUpdateVoiceSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480500; // type:function size:0x4 scope:weak +OnShutdownSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480510; // type:function size:0x10 scope:weak +IsPause__Q44nw4r3snd6detail10StrmPlayerCFv = .text:0x80480520; // type:function size:0x8 scope:weak +IsStarted__Q44nw4r3snd6detail10StrmPlayerCFv = .text:0x80480530; // type:function size:0x8 scope:weak +IsActive__Q44nw4r3snd6detail10StrmPlayerCFv = .text:0x80480540; // type:function size:0x8 scope:weak +@180@OnShutdownSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480550; // type:function size:0x8 scope:weak +@180@OnUpdateVoiceSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480560; // type:function size:0x8 scope:weak +@180@OnUpdateFrameSoundThread__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480570; // type:function size:0x8 scope:weak +@180@__dt__Q44nw4r3snd6detail10StrmPlayerFv = .text:0x80480580; // type:function size:0x8 scope:weak __ct__Q44nw4r3snd6detail9StrmSoundFPQ44nw4r3snd6detail50SoundInstanceManagerii = .text:0x80480590; // type:function size:0xB4 InitParam__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480650; // type:function size:0x138 Setup__Q44nw4r3snd6detail9StrmSoundFPQ44nw4r3snd6detail14StrmBufferPooliUs = .text:0x80480790; // type:function size:0x7C @@ -38619,9 +38619,9 @@ WSDCallback = .data:0x8056E1E0; // type:object size:0x10 SeqCallback = .data:0x8056E1F0; // type:object size:0x10 __vt__Q34nw4r3snd9SoundHeap = .data:0x8056E200; // type:object size:0x10 lbl_8056E210 = .data:0x8056E210; // type:object size:0x48 -lbl_8056E258 = .data:0x8056E258; // type:object size:0x48 -lbl_8056E2A0 = .data:0x8056E2A0; // type:object size:0x18 -lbl_8056E2B8 = .data:0x8056E2B8; // type:object size:0x18 +__vt__Q44nw4r3snd6detail10StrmPlayer = .data:0x8056E258; // type:object size:0x48 +__vt__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTask = .data:0x8056E2A0; // type:object size:0x18 +__vt__Q54nw4r3snd6detail10StrmPlayer18StrmHeaderLoadTask = .data:0x8056E2B8; // type:object size:0x18 lbl_8056E2D0 = .data:0x8056E2D0; // type:object size:0x38 @5068 = .data:0x8056E308; // type:object size:0x24 scope:local __vt__Q44nw4r3snd6detail5Voice = .data:0x8056E32C; // type:object size:0x14 @@ -42435,7 +42435,7 @@ lbl_805766B0 = .sbss:0x805766B0; // type:object size:0x8 data:byte isSoundSystemInit = .sbss:0x805766B8; // type:object size:0x1 data:byte lbl_805766BC = .sbss:0x805766BC; // type:object size:0x4 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .sbss:0x805766C0; // type:object size:0x1 scope:weak data:byte -lbl_805766C8 = .sbss:0x805766C8; // type:object size:0x8 data:byte +sStaticInitFlag__Q44nw4r3snd6detail10StrmPlayer = .sbss:0x805766C8; // type:object size:0x1 data:byte lbl_805766D0 = .sbss:0x805766D0; // type:object size:0x8 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .sbss:0x805766D8; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail12VoiceManagerFv@instance = .sbss:0x805766E0; // type:object size:0x1 scope:weak data:byte @@ -49749,12 +49749,12 @@ lbl_8057F138 = .sdata2:0x8057F138; // type:object size:0x4 align:4 data:float lbl_8057F140 = .sdata2:0x8057F140; // type:object size:0x8 align:8 data:double lbl_8057F148 = .sdata2:0x8057F148; // type:object size:0x4 align:4 data:float lbl_8057F14C = .sdata2:0x8057F14C; // type:object size:0x4 align:4 data:float -lbl_8057F150 = .sdata2:0x8057F150; // type:object size:0x4 align:4 data:float -lbl_8057F158 = .sdata2:0x8057F158; // type:object size:0x8 align:8 data:double -lbl_8057F160 = .sdata2:0x8057F160; // type:object size:0x8 align:8 data:double -lbl_8057F168 = .sdata2:0x8057F168; // type:object size:0x4 align:4 data:float -lbl_8057F16C = .sdata2:0x8057F16C; // type:object size:0x4 align:4 data:float -lbl_8057F170 = .sdata2:0x8057F170; // type:object size:0x4 align:4 data:float +@5421 = .sdata2:0x8057F150; // type:object size:0x4 scope:local align:4 data:float +@5423 = .sdata2:0x8057F158; // type:object size:0x8 scope:local align:8 data:double +@5425 = .sdata2:0x8057F160; // type:object size:0x8 scope:local align:8 data:double +@5492 = .sdata2:0x8057F168; // type:object size:0x4 scope:local align:4 data:float +@5765 = .sdata2:0x8057F16C; // type:object size:0x4 scope:local align:4 data:float +@5766 = .sdata2:0x8057F170; // type:object size:0x4 scope:local align:4 data:float lbl_8057F178 = .sdata2:0x8057F178; // type:object size:0x4 align:4 data:float lbl_8057F17C = .sdata2:0x8057F17C; // type:object size:0x4 align:4 data:float lbl_8057F180 = .sdata2:0x8057F180; // type:object size:0x8 align:8 data:double @@ -51948,8 +51948,8 @@ lbl_80659D50 = .bss:0x80659D50; // type:object size:0x330 lbl_8065A080 = .bss:0x8065A080; // type:object size:0x155E0 @1941 = .bss:0x8066F660; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .bss:0x8066F670; // type:object size:0x398 scope:weak -lbl_8066FA20 = .bss:0x8066FA20; // type:object size:0x4000 align:32 -lbl_80673A20 = .bss:0x80673A20; // type:object size:0x18 +sLoadBuffer__Q44nw4r3snd6detail10StrmPlayer = .bss:0x8066FA20; // type:object size:0x4000 align:32 +sLoadBufferMutex__Q44nw4r3snd6detail10StrmPlayer = .bss:0x80673A20; // type:object size:0x18 @886 = .bss:0x80673A38; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .bss:0x80673A44; // type:object size:0x3C scope:weak @1109 = .bss:0x80673A80; // type:object size:0xC scope:local diff --git a/configure.py b/configure.py index fc0bf7de..28172939 100644 --- a/configure.py +++ b/configure.py @@ -1070,7 +1070,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SoundThread.cpp"), Object(Matching, "nw4r/snd/snd_StrmChannel.cpp"), Object(Matching, "nw4r/snd/snd_StrmFile.cpp"), - Object(NonMatching, "nw4r/snd/snd_StrmPlayer.cpp"), + Object(Matching, "nw4r/snd/snd_StrmPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSound.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_Task.cpp"), diff --git a/include/nw4r/snd/snd_StrmPlayer.h b/include/nw4r/snd/snd_StrmPlayer.h index aee8101e..a4889945 100644 --- a/include/nw4r/snd/snd_StrmPlayer.h +++ b/include/nw4r/snd/snd_StrmPlayer.h @@ -31,7 +31,17 @@ namespace nw4r { namespace ut { class FileStream; }} * classes and functions */ -namespace nw4r { namespace snd { namespace detail +namespace nw4r { namespace snd { + +struct StrmDataInfo +{ + /* 0x00 */ bool loopFlag; + /* 0x04 */ int sampleRate; + /* 0x08 */ u32 loopStart; + /* 0x0C */ u32 loopEnd; +}; + +namespace detail { // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x2fcda class StrmPlayer : public BasicPlayer, public SoundThread::PlayerCallback @@ -162,7 +172,9 @@ namespace nw4r { namespace snd { namespace detail void SetAdpcmLoopContext(int channelNum, u16 *predScale); void SetTrackVolume(u32 trackBitFlag, f32 volume); + u32 GetPlaySamplePosition() const; + bool ReadStrmDataInfo(StrmDataInfo*) const; void InitParam(); bool SetupPlayer(); bool Prepare(ut::FileStream *fileStream, @@ -221,7 +233,7 @@ namespace nw4r { namespace snd { namespace detail /* base BasicPlayer */ // size 0x0a4, offset 0x000 /* base SoundThread::PlayerCallback */ // size 0x00c, offset 0x0a4 StrmFileReader::StrmInfo mStrmInfo; // size 0x040, offset 0x0b0 - bool mSetupFlag; // size 0x001, offset 0x0f0 + bool volatile mSetupFlag; // size 0x001, offset 0x0f0 bool mActiveFlag; // size 0x001, offset 0x0f1 bool mStartedFlag; // size 0x001, offset 0x0f2 bool mPreparedFlag; // size 0x001, offset 0x0f3 diff --git a/include/nw4r/snd/snd_Voice.h b/include/nw4r/snd/snd_Voice.h index 96cd4455..3c43d741 100644 --- a/include/nw4r/snd/snd_Voice.h +++ b/include/nw4r/snd/snd_Voice.h @@ -104,6 +104,10 @@ namespace nw4r { namespace snd { namespace detail { return IsActive() && mAxVoice[0][0]->IsPlayFinished(); } + bool IsRun() const + { + return IsActive() && mAxVoice[0][0]->IsRun(); + } SampleFormat GetFormat() const; u32 GetCurrentPlayingSample() const; int GetPhysicalVoiceCount() const diff --git a/src/nw4r/snd/snd_StrmPlayer.cpp b/src/nw4r/snd/snd_StrmPlayer.cpp index 0a6f74d1..6833aca5 100644 --- a/src/nw4r/snd/snd_StrmPlayer.cpp +++ b/src/nw4r/snd/snd_StrmPlayer.cpp @@ -48,7 +48,7 @@ namespace nw4r { namespace snd { namespace detail { // .bss - byte_t StrmPlayer::sLoadBuffer[LOAD_BUFFER_SIZE]; + byte_t ALIGN_DECL(32) StrmPlayer::sLoadBuffer[LOAD_BUFFER_SIZE]; OSMutex StrmPlayer::sLoadBufferMutex; // .sbss @@ -375,10 +375,61 @@ void StrmPlayer::Pause(bool flag) UpdatePauseStatus(); } +void float_order_snd_StrmPlayer() { + 0.0f; + int zero = 0; + unsigned uzero = 0; + f32 z = zero; + z = uzero; +} +#if 0 // Some functions in between idk DECOMP_FORCE(0.0f); DECOMP_FORCE(SI2D_CONSTANT); DECOMP_FORCE(UI2D_CONSTANT); +#endif + +bool StrmPlayer::ReadStrmDataInfo(StrmDataInfo* info) const +{ + SoundThread::AutoLock lock; + + if (!mPreparedFlag) + return false; + + info->loopFlag = mStrmInfo.loopFlag != 0; + info->sampleRate = mStrmInfo.sampleRate; + info->loopStart = mStrmInfo.loopStart; + info->loopEnd = mStrmInfo.loopEnd; + + return true; +} + +u32 StrmPlayer::GetPlaySamplePosition() const +{ + SoundThread::AutoLock lock; + + if (!mActiveFlag) + return -1; + + if (!mTracks[0].mActiveFlag) + return -1; + + if (!mPreparedFlag) + return 0; + + u32 sample = 0; + u32 t1; + { + ut::AutoInterruptLock lock2; + + if (mTracks[0].mVoice) + sample = mTracks[0].mVoice->GetCurrentPlayingSample(); + + t1 = mPlayingDataBlockIndex - mPlayingBufferBlockIndex; + } + u32 t2 = t1 * mStrmInfo.blockSamples; + return t2 + sample; +} void StrmPlayer::InitParam() { @@ -836,6 +887,10 @@ void StrmPlayer::UpdateVoiceParams(StrmTrack *track) fxsend[i] += GetFxSend(static_cast(i)); } + f32 remoteOutVolume[4]; + for (int i = 0; i < 4; i++) + remoteOutVolume[i] = GetRemoteOutVolume(i); + ut::AutoInterruptLock lock; if (Voice *voice = track->mVoice) @@ -857,6 +912,9 @@ void StrmPlayer::UpdateVoiceParams(StrmTrack *track) voice->SetFxSend(bus, fxsend[i]); } + for (int i = 0; i < 4; i++) + voice->SetRemoteOutVolume(i, remoteOutVolume[i]); + for (int i = 0; i < mVoiceOutCount; i++) voice->SetVoiceOutParam(i, GetVoiceOutParam(i)); } @@ -893,6 +951,9 @@ void StrmPlayer::UpdateBuffer() if (!voice) return; + if (!voice->IsRun()) + return; + if (CheckDiskDriveError()) { mLoadWaitFlag = true; From b70fc43156059a27919e61465ed3c67b25586919 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 22:04:18 +0200 Subject: [PATCH 41/91] snd_SoundSystem OK --- config/SOUE01/splits.txt | 4 ++++ config/SOUE01/symbols.txt | 14 +++++++------- configure.py | 2 +- src/nw4r/snd/snd_SoundSystem.cpp | 11 ++++++++--- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 02f9f13e..f98e1429 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3076,6 +3076,10 @@ nw4r/snd/snd_SoundStartable.cpp: nw4r/snd/snd_SoundSystem.cpp: .text start:0x8047C3B0 end:0x8047C708 align:16 .ctors start:0x804DB968 end:0x804DB96C + .data start:0x8056E210 end:0x8056E258 + .sdata start:0x80574EA0 end:0x80574EA8 + .sbss start:0x805766B8 end:0x805766C0 + .bss start:0x80659D40 end:0x8066F660 nw4r/snd/snd_SoundThread.cpp: .text start:0x8047C710 end:0x8047CD10 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 9c6dfa3f..4e7dae7f 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -38618,7 +38618,7 @@ lbl_8056E1B0 = .data:0x8056E1B0; // type:object size:0x30 WSDCallback = .data:0x8056E1E0; // type:object size:0x10 SeqCallback = .data:0x8056E1F0; // type:object size:0x10 __vt__Q34nw4r3snd9SoundHeap = .data:0x8056E200; // type:object size:0x10 -lbl_8056E210 = .data:0x8056E210; // type:object size:0x48 +@2785 = .data:0x8056E210; // type:object size:0x46 scope:local data:string __vt__Q44nw4r3snd6detail10StrmPlayer = .data:0x8056E258; // type:object size:0x48 __vt__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTask = .data:0x8056E2A0; // type:object size:0x18 __vt__Q54nw4r3snd6detail10StrmPlayer18StrmHeaderLoadTask = .data:0x8056E2B8; // type:object size:0x18 @@ -41147,7 +41147,7 @@ NW4R_G3D_Version___22@unnamed@g3d_init_cpp@ = .sdata:0x80574E88; // type:object @3183 = .sdata:0x80574E90; // type:object size:0x2 scope:local data:string @3184 = .sdata:0x80574E94; // type:object size:0x2 scope:local data:string @3185 = .sdata:0x80574E98; // type:object size:0x1 scope:local -lbl_80574EA0 = .sdata:0x80574EA0; // type:object size:0x8 data:4byte +NW4R_SND_Version_ = .sdata:0x80574EA0; // type:object size:0x4 data:4byte @LOCAL@CalcRandom__Q44nw4r3snd6detail4UtilFv@u = .sdata:0x80574EA8; // type:object size:0x4 scope:weak data:4byte NW4R_LYT_Version___22@unnamed@lyt_init_cpp@ = .sdata:0x80574EB0; // type:object size:0x4 scope:local data:4byte @6623 = .sdata:0x80574EB8; // type:object size:0x4 scope:local data:string @@ -42432,8 +42432,8 @@ 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 lbl_805766B0 = .sbss:0x805766B0; // type:object size:0x8 data:byte -isSoundSystemInit = .sbss:0x805766B8; // type:object size:0x1 data:byte -lbl_805766BC = .sbss:0x805766BC; // type:object size:0x4 data:4byte +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 @GUARD@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .sbss:0x805766C0; // type:object size:0x1 scope:weak data:byte sStaticInitFlag__Q44nw4r3snd6detail10StrmPlayer = .sbss:0x805766C8; // type:object size:0x1 data:byte lbl_805766D0 = .sbss:0x805766D0; // type:object size:0x8 data:4byte @@ -51943,9 +51943,9 @@ lbl_806596E8 = .bss:0x806596E8; // type:object size:0x20 data:2byte lbl_80659708 = .bss:0x80659708; // type:object size:0x18 lbl_80659720 = .bss:0x80659720; // type:object size:0x10 lbl_80659730 = .bss:0x80659730; // type:object size:0x610 data:4byte -lbl_80659D40 = .bss:0x80659D40; // type:object size:0x10 -lbl_80659D50 = .bss:0x80659D50; // type:object size:0x330 -lbl_8065A080 = .bss:0x8065A080; // type:object size:0x155E0 +@2786 = .bss:0x80659D40; // type:object size:0xC scope:local +sTaskThread__Q34nw4r3snd11SoundSystem = .bss:0x80659D50; // type:object size:0x320 +@LOCAL@InitSoundSystem__Q34nw4r3snd11SoundSystemFll@defaultSoundSystemWork@0 = .bss:0x8065A080; // type:object size:0x155E0 scope:weak @1941 = .bss:0x8066F660; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .bss:0x8066F670; // type:object size:0x398 scope:weak sLoadBuffer__Q44nw4r3snd6detail10StrmPlayer = .bss:0x8066FA20; // type:object size:0x4000 align:32 diff --git a/configure.py b/configure.py index 28172939..28aa9f98 100644 --- a/configure.py +++ b/configure.py @@ -1066,7 +1066,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SoundHeap.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundSystem.cpp"), + Object(Matching, "nw4r/snd/snd_SoundSystem.cpp"), Object(Matching, "nw4r/snd/snd_SoundThread.cpp"), Object(Matching, "nw4r/snd/snd_StrmChannel.cpp"), Object(Matching, "nw4r/snd/snd_StrmFile.cpp"), diff --git a/src/nw4r/snd/snd_SoundSystem.cpp b/src/nw4r/snd/snd_SoundSystem.cpp index ef27f5a5..9a13738c 100644 --- a/src/nw4r/snd/snd_SoundSystem.cpp +++ b/src/nw4r/snd/snd_SoundSystem.cpp @@ -15,6 +15,7 @@ #include "nw4r/snd/snd_AxVoiceManager.h" #include "nw4r/snd/snd_AxManager.h" #include "nw4r/snd/snd_Channel.h" // ChannelManager +#include "nw4r/snd/snd_RemoteSpeakerManager.h" #include "nw4r/snd/snd_global.h" #include "nw4r/snd/snd_SeqPlayer.h" #include "nw4r/snd/snd_SoundThread.h" @@ -37,9 +38,9 @@ #define BUILDSTAMP_LIB_NAME "SND" // You probably want to change these -#define BUILDSTAMP_BUILD_TYPE "release" -#define BUILDSTAMP_DATE __DATE__ -#define BUILDSTAMP_TIME __TIME__ +#define BUILDSTAMP_BUILD_TYPE "final " +#define BUILDSTAMP_DATE "Sep 25 2011" +#define BUILDSTAMP_TIME "05:32:58" #define BUILDSTAMP_CW_MAJOR_REV STR(__CWCC__) #define BUILDSTAMP_CW_MINOR_REV STR(__CWBUILD__) @@ -159,6 +160,8 @@ void SoundSystem::InitSoundSystem(SoundSystemParam const ¶m, void *workMem, break; } + detail::RemoteSpeakerManager::GetInstance().Setup(); + byte_t *ptr = static_cast(workMem); void *dvdThreadStack = ptr; @@ -245,7 +248,9 @@ void SoundSystem::WaitForResetReady() { } } } +#if 0 // SoundSystem::WaitForResetReady ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14493) DECOMP_FORCE("SoundSystem::WaitForResetReady is TIME OUT.\n"); +#endif }} // namespace nw4r::snd From cb438c5fc6fcda31d1d783e3445cd7a3cf9ecc3b Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 22:16:08 +0200 Subject: [PATCH 42/91] snd_SoundPlayer OK --- config/SOUE01/splits.txt | 3 +++ config/SOUE01/symbols.txt | 20 ++++++++++---------- configure.py | 2 +- include/nw4r/snd/snd_SoundPlayer.h | 4 ++++ src/nw4r/snd/snd_SoundPlayer.cpp | 29 +++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index f98e1429..ec39f061 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3069,6 +3069,9 @@ nw4r/snd/snd_SoundHeap.cpp: nw4r/snd/snd_SoundPlayer.cpp: .text start:0x8047B420 end:0x8047C050 align:16 + .sbss start:0x805766B0 end:0x805766B8 + .sdata2 start:0x8057F148 end:0x8057F150 + .bss start:0x80659720 end:0x80659D40 nw4r/snd/snd_SoundStartable.cpp: .text start:0x8047C050 end:0x8047C3AC align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 4e7dae7f..586bc28d 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25594,19 +25594,19 @@ SaveState__Q34nw4r3snd9SoundHeapFv = .text:0x8047B2D0; // type:function size:0x5 LoadState__Q34nw4r3snd9SoundHeapFi = .text:0x8047B330; // type:function size:0x74 DisposeCallbackFunc__Q34nw4r3snd9SoundHeapFPvUlPv = .text:0x8047B3B0; // type:function size:0x68 __ct__Q34nw4r3snd11SoundPlayerFv = .text:0x8047B420; // type:function size:0x8C -__ct__Q34nw4r2ut44LinkListFv = .text:0x8047B4B0; // type:function size:0x18 -__dt__Q34nw4r2ut44LinkListFv = .text:0x8047B4D0; // type:function size:0x58 +__ct__Q34nw4r2ut44LinkListFv = .text:0x8047B4B0; // type:function size:0x18 scope:weak +__dt__Q34nw4r2ut44LinkListFv = .text:0x8047B4D0; // type:function size:0x58 scope:weak __dt__Q34nw4r3snd11SoundPlayerFv = .text:0x8047B530; // type:function size:0xD4 Update__Q34nw4r3snd11SoundPlayerFv = .text:0x8047B610; // type:function size:0x7C StopAllSound__Q34nw4r3snd11SoundPlayerFi = .text:0x8047B690; // type:function size:0x78 PauseAllSound__Q34nw4r3snd11SoundPlayerFbi = .text:0x8047B710; // type:function size:0x88 -nw4r__snd__SoundPlayer__SetMainOutVolume = .text:0x8047B7A0; // type:function size:0x18 -SetDefaultOutputLine__Q34nw4r3snd11SoundPlayerFi = .text:0x8047B7C0; // type:function size:0x8 +SetVolume__Q34nw4r3snd11SoundPlayerFf = .text:0x8047B7A0; // type:function size:0x18 +SetLpfFreq__Q34nw4r3snd11SoundPlayerFf = .text:0x8047B7C0; // type:function size:0x8 GetRemoteOutVolume__Q34nw4r3snd11SoundPlayerCFi = .text:0x8047B7D0; // type:function size:0x10 SetFxSend__Q34nw4r3snd11SoundPlayerFQ34nw4r3snd6AuxBusf = .text:0x8047B7E0; // type:function size:0x10 detail_SortPriorityList__Q34nw4r3snd11SoundPlayerFPQ44nw4r3snd6detail10BasicSound = .text:0x8047B7F0; // type:function size:0xF8 detail_SortPriorityList__Q34nw4r3snd11SoundPlayerFv = .text:0x8047B8F0; // type:function size:0x184 -__arraydtor$1018 = .text:0x8047BA80; // type:function size:0x1C +__arraydtor$1419 = .text:0x8047BA80; // type:function size:0x1C scope:local detail_AppendSound__Q34nw4r3snd11SoundPlayerFPQ44nw4r3snd6detail10BasicSound = .text:0x8047BAA0; // type:function size:0x1DC detail_RemoveSound__Q34nw4r3snd11SoundPlayerFPQ44nw4r3snd6detail10BasicSound = .text:0x8047BC80; // type:function size:0x88 SetPlayableSoundCount__Q34nw4r3snd11SoundPlayerFi = .text:0x8047BD10; // type:function size:0x90 @@ -42431,7 +42431,7 @@ 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 -lbl_805766B0 = .sbss:0x805766B0; // type:object size:0x8 data:byte +@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 @GUARD@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .sbss:0x805766C0; // type:object size:0x1 scope:weak data:byte @@ -49747,8 +49747,8 @@ lbl_8057F130 = .sdata2:0x8057F130; // type:object size:0x4 align:4 data:float lbl_8057F134 = .sdata2:0x8057F134; // type:object size:0x4 align:4 data:float lbl_8057F138 = .sdata2:0x8057F138; // type:object size:0x4 align:4 data:float lbl_8057F140 = .sdata2:0x8057F140; // type:object size:0x8 align:8 data:double -lbl_8057F148 = .sdata2:0x8057F148; // type:object size:0x4 align:4 data:float -lbl_8057F14C = .sdata2:0x8057F14C; // type:object size:0x4 align:4 data:float +@2452 = .sdata2:0x8057F148; // type:object size:0x4 scope:local align:4 data:float +@2453 = .sdata2:0x8057F14C; // type:object size:0x4 scope:local align:4 data:float @5421 = .sdata2:0x8057F150; // type:object size:0x4 scope:local align:4 data:float @5423 = .sdata2:0x8057F158; // type:object size:0x8 scope:local align:8 data:double @5425 = .sdata2:0x8057F160; // type:object size:0x8 scope:local align:8 data:double @@ -51941,8 +51941,8 @@ sBiquadFilterCallbackTable__Q44nw4r3snd6detail9AxManager = .bss:0x80659080; // t @LOCAL@GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv@instance = .bss:0x80659410; // type:object size:0x2D8 scope:weak data:byte lbl_806596E8 = .bss:0x806596E8; // type:object size:0x20 data:2byte lbl_80659708 = .bss:0x80659708; // type:object size:0x18 -lbl_80659720 = .bss:0x80659720; // type:object size:0x10 -lbl_80659730 = .bss:0x80659730; // type:object size:0x610 data:4byte +@1420 = .bss:0x80659720; // type:object size:0xC scope:local +@LOCAL@detail_SortPriorityList__Q34nw4r3snd11SoundPlayerFv@tmplist = .bss:0x80659730; // type:object size:0x600 scope:weak data:4byte @2786 = .bss:0x80659D40; // type:object size:0xC scope:local sTaskThread__Q34nw4r3snd11SoundSystem = .bss:0x80659D50; // type:object size:0x320 @LOCAL@InitSoundSystem__Q34nw4r3snd11SoundSystemFll@defaultSoundSystemWork@0 = .bss:0x8065A080; // type:object size:0x155E0 scope:weak diff --git a/configure.py b/configure.py index 28aa9f98..00633161 100644 --- a/configure.py +++ b/configure.py @@ -1064,7 +1064,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), Object(Matching, "nw4r/snd/snd_SoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SoundHeap.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundPlayer.cpp"), + Object(Matching, "nw4r/snd/snd_SoundPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), Object(Matching, "nw4r/snd/snd_SoundSystem.cpp"), Object(Matching, "nw4r/snd/snd_SoundThread.cpp"), diff --git a/include/nw4r/snd/snd_SoundPlayer.h b/include/nw4r/snd/snd_SoundPlayer.h index 45da6493..dfdcded2 100644 --- a/include/nw4r/snd/snd_SoundPlayer.h +++ b/include/nw4r/snd/snd_SoundPlayer.h @@ -30,13 +30,16 @@ namespace nw4r { namespace snd // methods int GetPlayableSoundCount() const { return mPlayableCount; } f32 GetVolume() const { return mVolume; } + void SetVolume(f32 volume); f32 GetLpfFreq() const { return mLpfFreq; } + void SetLpfFreq(f32 freq); int GetDefaultOutputLine() const { return mOutputLineFlag; } f32 GetMainOutVolume() const { return mMainOutVolume; } int GetBiquadFilterType() const { return mBiquadType; } f32 GetBiquadFilterValue() const { return mBiquadValue; } f32 GetMainSend() const { return mMainSend; } f32 GetFxSend(int index) const { return mFxSend[index]; } + void SetFxSend(AuxBus, f32); void SetPlayableSoundCount(int count); f32 GetRemoteOutVolume(int remote) const; @@ -79,6 +82,7 @@ namespace nw4r { namespace snd f32 mMainOutVolume; // size 0x04, offset 0x38 int mBiquadType; // size 0x04, offset 0x3c f32 mBiquadValue; // size 0x04, offset 0x40 + f32 mRemoteOutVolume[4]; f32 mMainSend; // size 0x04, offset 0x44 f32 mFxSend[AUX_BUS_NUM]; // size 0x0c, offset 0x48 }; // size 0x54 diff --git a/src/nw4r/snd/snd_SoundPlayer.cpp b/src/nw4r/snd/snd_SoundPlayer.cpp index 81e1f800..112135ec 100644 --- a/src/nw4r/snd/snd_SoundPlayer.cpp +++ b/src/nw4r/snd/snd_SoundPlayer.cpp @@ -40,8 +40,12 @@ SoundPlayer::SoundPlayer() : mBiquadValue (0.0f), mMainSend (0.0f) { + for (int i = 0; i < 4; i++) + mRemoteOutVolume[i] = 1.0f; + for (int i = 0; i < AUX_BUS_NUM; i++) mFxSend[i] = 0.0f; + } SoundPlayer::~SoundPlayer() @@ -87,6 +91,30 @@ void SoundPlayer::PauseAllSound(bool flag, int fadeFrames) } } +void SoundPlayer::SetVolume(f32 volume) +{ + if (volume < 0.0f) + volume = 0.0f; + + mVolume = volume; +} + +void SoundPlayer::SetLpfFreq(f32 freq) +{ + mLpfFreq = freq; +} + +f32 SoundPlayer::GetRemoteOutVolume(int remote) const +{ + return mRemoteOutVolume[remote]; +} + +void SoundPlayer::SetFxSend(AuxBus bus, f32 send) +{ + mFxSend[bus] = send; +} + +#if 0 // SoundPlayer::SetVolume ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14397) /* also __FILE__ because this is the first assert in the file so it needs to * reference that first as well @@ -96,6 +124,7 @@ DECOMP_FORCE(NW4RAssert_String(volume >= 0.0f)); // SoundPlayer::SetFxSend ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14405) DECOMP_FORCE(NW4RAssertHeaderClampedLValue_String(bus)); +#endif void SoundPlayer::RemoveSoundList(detail::BasicSound *sound) { From 62b35d862998fa84d2e9f6f9f5633788bce931b5 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 22:42:46 +0200 Subject: [PATCH 43/91] 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); From b4a79946bf374e341f65f373cc430c73bad5f441 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 23:50:15 +0200 Subject: [PATCH 44/91] snd_SoundArchivePlayer not OK (instruction scheduling) --- config/SOUE01/splits.txt | 2 ++ config/SOUE01/symbols.txt | 4 +-- include/nw4r/snd/snd_SoundArchivePlayer.h | 8 ++++-- src/nw4r/snd/snd_SoundArchivePlayer.cpp | 34 +++++++++++++++++++++-- 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 2cdd573e..89dbf801 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3060,6 +3060,8 @@ nw4r/snd/snd_SoundArchiveLoader.cpp: nw4r/snd/snd_SoundArchivePlayer.cpp: .text start:0x80478560 end:0x8047B018 align:16 + .data start:0x8056E1B0 end:0x8056E200 + .sdata2 start:0x8057F138 end:0x8057F148 nw4r/snd/snd_SoundHandle.cpp: .text start:0x8047B020 end:0x8047B110 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 9e1323e9..7dc53880 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -21804,8 +21804,8 @@ fn_803A18B0 = .text:0x803A18B0; // type:function size:0xF0 fn_803A19A0 = .text:0x803A19A0; // type:function size:0x2B0 fn_803A1C50 = .text:0x803A1C50; // type:function size:0xC fn_803A1C60 = .text:0x803A1C60; // type:function size:0xC -fn_803A1C70 = .text:0x803A1C70; // type:function size:0xC -fn_803A1C80 = .text:0x803A1C80; // type:function size:0x14 +AXFXSetHooks = .text:0x803A1C70; // type:function size:0xC +AXFXGetHooks = .text:0x803A1C80; // type:function size:0x14 PPCMfmsr = .text:0x803A1CA0; // type:function size:0x8 scope:global PPCMtmsr = .text:0x803A1CB0; // type:function size:0x8 scope:global PPCMfhid0 = .text:0x803A1CC0; // type:function size:0x8 scope:global diff --git a/include/nw4r/snd/snd_SoundArchivePlayer.h b/include/nw4r/snd/snd_SoundArchivePlayer.h index 34231be7..f8126d73 100644 --- a/include/nw4r/snd/snd_SoundArchivePlayer.h +++ b/include/nw4r/snd/snd_SoundArchivePlayer.h @@ -55,8 +55,8 @@ namespace nw4r { namespace snd public: // virtual function ordering // vtable SoundArchivePlayer_FileManager - virtual void const *at_0x08(int) = 0; - virtual void const *at_0x0c(int) = 0; + virtual void const *GetFileAddress(u32) = 0; + virtual void const *GetFileWaveDataAddress(u32) = 0; // members private: @@ -98,6 +98,8 @@ namespace nw4r { namespace snd { } + virtual ~SeqNoteOnCallback() {} + // virtual function ordering // vtable NoteOnCallback virtual detail::Channel *NoteOn( @@ -176,6 +178,8 @@ namespace nw4r { namespace snd return LoadGroup(static_cast(id), pAllocatable, blockSize); } + bool IsLoadedGroup(u32 groupId) const; + SoundArchive const &GetSoundArchive() const; u32 GetSoundPlayerCount() const { return mSoundPlayerCount; } SoundPlayer &GetSoundPlayer(u32 playerId); diff --git a/src/nw4r/snd/snd_SoundArchivePlayer.cpp b/src/nw4r/snd/snd_SoundArchivePlayer.cpp index 8e9019d6..93996870 100644 --- a/src/nw4r/snd/snd_SoundArchivePlayer.cpp +++ b/src/nw4r/snd/snd_SoundArchivePlayer.cpp @@ -517,16 +517,18 @@ SoundPlayer &SoundArchivePlayer::GetSoundPlayer(u32 playerId) return mSoundPlayers[playerId]; } +#if 0 /* SoundArchivePlayer::GetSoundPlayer(char const *) * ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14216) */ DECOMP_FORCE(NW4RAssertPointerNonnull_String(mSoundArchive)); +#endif void const *SoundArchivePlayer::detail_GetFileAddress(u32 fileId) const { if (mFileManager) { - if (void const *addr = mFileManager->at_0x08(fileId)) + if (void const *addr = mFileManager->GetFileAddress(fileId)) return addr; } @@ -567,7 +569,7 @@ void const *SoundArchivePlayer::detail_GetFileWaveDataAddress(u32 fileId) const { if (mFileManager) { - if (void const *addr = mFileManager->at_0x0c(fileId)) + if (void const *addr = mFileManager->GetFileWaveDataAddress(fileId)) return addr; } @@ -621,9 +623,19 @@ void const *SoundArchivePlayer::GetGroupAddress(u32 groupId) const return mGroupTable->item[groupId].address; } +#if 0 // SoundArchivePlayer::SetGroupAddress ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14220) DECOMP_FORCE("Failed to SoundArchivePlayer::SetGroupAddress because group " "table is not allocated.\n"); +#endif + +void SoundArchivePlayer::SetGroupAddress(u32 id, const void* pAddr) +{ + if (mGroupTable == NULL) + return; + + mGroupTable->item[id].address = pAddr; +} void const *SoundArchivePlayer::GetGroupWaveDataAddress(u32 groupId) const { @@ -643,6 +655,15 @@ void const *SoundArchivePlayer::GetGroupWaveDataAddress(u32 groupId) const return mGroupTable->item[groupId].waveDataAddress; } +void SoundArchivePlayer::SetGroupWaveDataAddress(u32 id, const void* pAddr) +{ + if (mGroupTable == NULL) + return; + + mGroupTable->item[id].waveDataAddress = pAddr; +} + +#if 0 /* SoundArchivePlayer::SetGroupWaveDataAddress * ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14222) */ @@ -660,6 +681,7 @@ DECOMP_FORCE("Failed to SoundArchivePlayer::SetFileAddress because file table " DECOMP_FORCE(NW4RAssertHeaderClampedLValue_String(fileId)); DECOMP_FORCE("Failed to SoundArchivePlayer::SetFileWaveDataAddress because " "file table is not allocated.\n"); +#endif void const *SoundArchivePlayer::GetFileAddress(u32 fileId) const { @@ -1323,10 +1345,12 @@ void SoundArchivePlayer::UpdateCommonSoundParam( sound->SetPanCurve(commonInfo->panCurve); } +#if 0 /* SoundArchivePlayer::LoadGroup(u32, SoundMemoryAllocatable *, u32) * ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14234) */ DECOMP_FORCE(NW4RAssertAligned_String(loadBlockSize, 32)); +#endif bool SoundArchivePlayer::LoadGroup(u32 id, SoundMemoryAllocatable* pAllocatable, u32 blockSize) { @@ -1373,6 +1397,12 @@ bool SoundArchivePlayer::LoadGroup(const char* pLabel, return LoadGroup(id, pAllocatable, blockSize); } +bool SoundArchivePlayer::IsLoadedGroup(u32 groupId) const +{ + void const *groupAddress = GetGroupAddress(groupId); + return groupAddress != NULL; +} + void SoundArchivePlayer::InvalidateData(void const *start, void const *end) { if (mFileTable) From 29dd9ea4f05a1aad7add312674c1785b8ab867cc Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 26 May 2025 23:51:31 +0200 Subject: [PATCH 45/91] snd_AxfxImpl OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 4 ++-- configure.py | 2 +- include/nw4r/snd/snd_AxfxImpl.h | 5 ++--- src/nw4r/snd/snd_AxfxImpl.cpp | 10 +++++++++- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 89dbf801..587515b8 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2909,6 +2909,7 @@ nw4r/snd/snd_AxVoiceManager.cpp: nw4r/snd/snd_AxfxImpl.cpp: .text start:0x80467DD0 end:0x80467FC8 align:16 + .sbss start:0x80576670 end:0x80576678 nw4r/snd/snd_Bank.cpp: .text start:0x80467FD0 end:0x80468248 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 7dc53880..b0c1735c 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -42421,8 +42421,8 @@ sBiquadFilterBpf2048__Q44nw4r3snd6detail9AxManager = .sbss:0x80576660; // type:o @GUARD@GetInstance__Q44nw4r3snd6detail9AxManagerFv@instance = .sbss:0x80576664; // type:object size:0x1 scope:weak data:byte @LOCAL@AiDmaCallbackFunc__Q44nw4r3snd6detail9AxManagerFv@finishedFlag = .sbss:0x80576665; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail14AxVoiceManagerFv@instance = .sbss:0x80576668; // type:object size:0x1 scope:weak data:byte -lbl_80576670 = .sbss:0x80576670; // type:object size:0x4 data:4byte -lbl_80576674 = .sbss:0x80576674; // type:object size:0x4 data:4byte +mCurrentFx__Q44nw4r3snd6detail8AxfxImpl = .sbss:0x80576670; // type:object size:0x4 data:4byte +mAllocatedSize__Q44nw4r3snd6detail8AxfxImpl = .sbss:0x80576674; // type:object size:0x4 data:4byte typeInfo__Q44nw4r3snd6detail10BasicSound = .sbss:0x80576678; // type:object size:0x8 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail14ChannelManagerFv@instance = .sbss:0x80576680; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .sbss:0x80576688; // type:object size:0x1 scope:weak data:byte diff --git a/configure.py b/configure.py index a41a2431..cadd2c42 100644 --- a/configure.py +++ b/configure.py @@ -1016,7 +1016,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_AxManager.cpp"), Object(NonMatching, "nw4r/snd/snd_AxVoice.cpp"), Object(Matching, "nw4r/snd/snd_AxVoiceManager.cpp"), - Object(NonMatching, "nw4r/snd/snd_AxfxImpl.cpp"), + Object(Matching, "nw4r/snd/snd_AxfxImpl.cpp"), Object(Matching, "nw4r/snd/snd_Bank.cpp"), Object(Matching, "nw4r/snd/snd_BankFile.cpp"), Object(Matching, "nw4r/snd/snd_BasicPlayer.cpp"), diff --git a/include/nw4r/snd/snd_AxfxImpl.h b/include/nw4r/snd/snd_AxfxImpl.h index 4721ddaf..06334ff7 100644 --- a/include/nw4r/snd/snd_AxfxImpl.h +++ b/include/nw4r/snd/snd_AxfxImpl.h @@ -9,13 +9,12 @@ namespace snd { namespace detail { struct AxfxImpl { - bool mIsActive; // at 0x0 MEMiHeapHead *mHeap; // at 0x4 u32 mAllocCount; // at 0x8 static const u32 HEAP_SIZE_MIN = MEM_FRM_HEAP_MIN_SIZE + 32; - AxfxImpl() : mIsActive(false), mHeap(NULL), mAllocCount(0) {} + AxfxImpl() : mHeap(NULL), mAllocCount(0) {} bool CreateHeap(void *pBuffer, u32 size); void DestroyHeap(); @@ -29,7 +28,7 @@ struct AxfxImpl { } void HookAlloc(AXFXAllocHook *pAllocHook, AXFXFreeHook *pFreeHook); - void RestoreAlloc(AXFXAllocHook allocHook, AXFXFreeHook freeHook); + u32 RestoreAlloc(AXFXAllocHook allocHook, AXFXFreeHook freeHook); static void *Alloc(u32 size); static void Free(void *pBlock); diff --git a/src/nw4r/snd/snd_AxfxImpl.cpp b/src/nw4r/snd/snd_AxfxImpl.cpp index ba4a6394..4e757cfb 100644 --- a/src/nw4r/snd/snd_AxfxImpl.cpp +++ b/src/nw4r/snd/snd_AxfxImpl.cpp @@ -10,6 +10,11 @@ AxfxImpl* AxfxImpl::mCurrentFx = NULL; u32 AxfxImpl::mAllocatedSize = 0; bool AxfxImpl::CreateHeap(void* pBuffer, u32 size) { + if (pBuffer == NULL || size == 0) + { + mHeap = NULL; + return false; + } mHeap = MEMCreateFrmHeap(pBuffer, size); return mHeap != NULL; } @@ -17,6 +22,7 @@ bool AxfxImpl::CreateHeap(void* pBuffer, u32 size) { void AxfxImpl::DestroyHeap() { if (mHeap != NULL) { MEMDestroyFrmHeap(mHeap); + mHeap = NULL; } } @@ -24,11 +30,13 @@ void AxfxImpl::HookAlloc(AXFXAllocHook* pAllocHook, AXFXFreeHook* pFreeHook) { AXFXGetHooks(pAllocHook, pFreeHook); AXFXSetHooks(Alloc, Free); mCurrentFx = this; + mAllocatedSize = 0; } -void AxfxImpl::RestoreAlloc(AXFXAllocHook allocHook, AXFXFreeHook freeHook) { +u32 AxfxImpl::RestoreAlloc(AXFXAllocHook allocHook, AXFXFreeHook freeHook) { AXFXSetHooks(allocHook, freeHook); mCurrentFx = NULL; + return mAllocatedSize; } void* AxfxImpl::Alloc(u32 size) { From c283825ba66099ea2a6885b9bb557130229d36e0 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 00:57:43 +0200 Subject: [PATCH 46/91] snd_BasicSound OK --- config/SOUE01/splits.txt | 3 ++ config/SOUE01/symbols.txt | 24 ++++++------ configure.py | 2 +- include/nw4r/snd/snd_BasicSound.h | 18 +++++++-- include/nw4r/snd/snd_MoveValue.h | 4 ++ src/nw4r/snd/snd_BasicSound.cpp | 63 +++++++++++++++++++++++++++++-- 6 files changed, 93 insertions(+), 21 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 587515b8..5887703a 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2927,6 +2927,9 @@ nw4r/snd/snd_BasicPlayer.cpp: nw4r/snd/snd_BasicSound.cpp: .text start:0x80468B50 end:0x8046A36C align:16 .ctors start:0x804DB95C end:0x804DB960 + .data start:0x8056DB60 end:0x8056DB98 + .sbss start:0x80576678 end:0x80576680 + .sdata2 start:0x8057EF88 end:0x8057EF98 nw4r/snd/snd_BiquadFilterPreset.cpp: .text start:0x8046A370 end:0x8046A7B0 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index b0c1735c..508ef954 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25139,18 +25139,18 @@ AttachSoundActor__Q44nw4r3snd6detail10BasicSoundFPQ34nw4r3snd10SoundActor = .tex DetachSoundActor__Q44nw4r3snd6detail10BasicSoundFPQ34nw4r3snd10SoundActor = .text:0x80469EB0; // type:function size:0xC AttachExternalSoundPlayer__Q44nw4r3snd6detail10BasicSoundFPQ44nw4r3snd6detail19ExternalSoundPlayer = .text:0x80469EC0; // type:function size:0x8 DetachExternalSoundPlayer__Q44nw4r3snd6detail10BasicSoundFPQ44nw4r3snd6detail19ExternalSoundPlayer = .text:0x80469ED0; // type:function size:0xC -FUN_80469ee0 = .text:0x80469EE0; // type:function size:0x24 +GetRemainingFadeFrames__Q44nw4r3snd6detail10BasicSoundCFv = .text:0x80469EE0; // type:function size:0x24 GetVoiceOutCount__Q44nw4r3snd6detail10BasicSoundCFv = .text:0x80469F10; // type:function size:0x8 SetPlayerPriority__Q44nw4r3snd6detail10BasicSoundFi = .text:0x80469F20; // type:function size:0x58 -OnUpdatePlayerPriority__Q44nw4r3snd6detail10BasicSoundFv = .text:0x80469F80; // type:function size:0x4 +OnUpdatePlayerPriority__Q44nw4r3snd6detail10BasicSoundFv = .text:0x80469F80; // type:function size:0x4 scope:weak SetInitialVolume__Q44nw4r3snd6detail10BasicSoundFf = .text:0x80469F90; // type:function size:0x18 SetVolume__Q44nw4r3snd6detail10BasicSoundFfi = .text:0x80469FB0; // type:function size:0x90 SetPitch__Q44nw4r3snd6detail10BasicSoundFf = .text:0x8046A040; // type:function size:0x8 SetPan__Q44nw4r3snd6detail10BasicSoundFf = .text:0x8046A050; // type:function size:0x8 -FUN_8046a060 = .text:0x8046A060; // type:function size:0x8 -FUN_8046a070 = .text:0x8046A070; // type:function size:0x8 -FUN_8046a080 = .text:0x8046A080; // type:function size:0x8 -SetRemoteOutVolume__Q44nw4r3snd6detail10BasicSoundFif = .text:0x8046A090; // type:function size:0x10 +SetSurroundPan__Q44nw4r3snd6detail10BasicSoundFf = .text:0x8046A060; // type:function size:0x8 +SetLpfFreq__Q44nw4r3snd6detail10BasicSoundFf = .text:0x8046A070; // type:function size:0x8 +SetOutputLineFlag__Q44nw4r3snd6detail10BasicSoundFi = .text:0x8046A080; // type:function size:0x8 +SetFxSend__Q44nw4r3snd6detail10BasicSoundFQ34nw4r3snd6AuxBusf = .text:0x8046A090; // type:function size:0x10 SetRemoteFilter__Q44nw4r3snd6detail10BasicSoundFi = .text:0x8046A0A0; // type:function size:0x40 SetPanMode__Q44nw4r3snd6detail10BasicSoundFQ34nw4r3snd7PanMode = .text:0x8046A0E0; // type:function size:0x3C SetPanCurve__Q44nw4r3snd6detail10BasicSoundFQ34nw4r3snd8PanCurve = .text:0x8046A120; // type:function size:0x3C @@ -25161,7 +25161,7 @@ IsAttachedTempGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A290 DetachGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A2B0; // type:function size:0x8 DetachTempGeneralHandle__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A2C0; // type:function size:0x8 SetId__Q44nw4r3snd6detail10BasicSoundFUl = .text:0x8046A2D0; // type:function size:0x40 -__dt__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A310; // type:function size:0x40 +__dt__Q44nw4r3snd6detail10BasicSoundFv = .text:0x8046A310; // type:function size:0x40 scope:weak GetRuntimeTypeInfo__Q44nw4r3snd6detail10BasicSoundCFv = .text:0x8046A350; // type:function size:0x8 scope:weak __sinit_\snd_BasicSound_cpp = .text:0x8046A360; // type:function size:0xC scope:local GetCoef__Q44nw4r3snd6detail15BiquadFilterLpfCFifPQ44nw4r3snd20BiquadFilterCallback10BiquadCoef = .text:0x8046A370; // type:function size:0x88 @@ -38583,7 +38583,7 @@ __vt__Q34nw4r3g3d6ScnMdl = .data:0x8056DA70; // type:object size:0x48 @10666 = .data:0x8056DAB8; // type:object size:0x46 scope:local data:string __vt__Q34nw4r3g3d7ScnProc = .data:0x8056DB00; // type:object size:0x34 __vt__Q44nw4r3snd6detail11BasicPlayer = .data:0x8056DB38; // type:object size:0x24 scope:weak -lbl_8056DB60 = .data:0x8056DB60; // type:object size:0x38 +__vt__Q44nw4r3snd6detail10BasicSound = .data:0x8056DB60; // type:object size:0x38 __vt__Q44nw4r3snd6detail19BiquadFilterBpf2048 = .data:0x8056DB98; // type:object size:0x10 __vt__Q44nw4r3snd6detail19BiquadFilterBpf1024 = .data:0x8056DBA8; // type:object size:0x10 __vt__Q44nw4r3snd6detail18BiquadFilterBpf512 = .data:0x8056DBB8; // type:object size:0x10 @@ -42423,7 +42423,7 @@ sBiquadFilterBpf2048__Q44nw4r3snd6detail9AxManager = .sbss:0x80576660; // type:o @GUARD@GetInstance__Q44nw4r3snd6detail14AxVoiceManagerFv@instance = .sbss:0x80576668; // type:object size:0x1 scope:weak data:byte mCurrentFx__Q44nw4r3snd6detail8AxfxImpl = .sbss:0x80576670; // type:object size:0x4 data:4byte mAllocatedSize__Q44nw4r3snd6detail8AxfxImpl = .sbss:0x80576674; // type:object size:0x4 data:4byte -typeInfo__Q44nw4r3snd6detail10BasicSound = .sbss:0x80576678; // type:object size:0x8 data:4byte +typeInfo__Q44nw4r3snd6detail10BasicSound = .sbss:0x80576678; // type:object size:0x4 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail14ChannelManagerFv@instance = .sbss:0x80576680; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .sbss:0x80576688; // type:object size:0x1 scope:weak data:byte mPrintVarEnabledFlag__Q44nw4r3snd6detail9MmlParser = .sbss:0x80576690; // type:object size:0x1 data:byte @@ -49662,9 +49662,9 @@ lbl_8057EF54 = .sdata2:0x8057EF54; // type:object size:0x4 align:4 data:float @1860 = .sdata2:0x8057EF78; // type:object size:0x4 scope:local align:4 data:float @608 = .sdata2:0x8057EF80; // type:object size:0x4 scope:local align:4 data:float @609 = .sdata2:0x8057EF84; // type:object size:0x4 scope:local align:4 data:float -lbl_8057EF88 = .sdata2:0x8057EF88; // type:object size:0x4 align:4 data:float -lbl_8057EF8C = .sdata2:0x8057EF8C; // type:object size:0x4 align:4 data:float -lbl_8057EF90 = .sdata2:0x8057EF90; // type:object size:0x8 align:8 data:double +@1976 = .sdata2:0x8057EF88; // type:object size:0x4 scope:local align:4 data:float +@1977 = .sdata2:0x8057EF8C; // type:object size:0x4 scope:local align:4 data:float +@2034 = .sdata2:0x8057EF90; // type:object size:0x8 scope:local align:8 data:double @212 = .sdata2:0x8057EF98; // type:object size:0x8 scope:local align:8 data:double @247 = .sdata2:0x8057EFA0; // type:object size:0x4 scope:local align:4 data:float @2816 = .sdata2:0x8057EFA8; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index cadd2c42..86b595c0 100644 --- a/configure.py +++ b/configure.py @@ -1020,7 +1020,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_Bank.cpp"), Object(Matching, "nw4r/snd/snd_BankFile.cpp"), Object(Matching, "nw4r/snd/snd_BasicPlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), + Object(Matching, "nw4r/snd/snd_BasicSound.cpp"), Object(Matching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), Object(Matching, "nw4r/snd/snd_Channel.cpp"), Object(Matching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index c1fe052f..49d9b3a8 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -44,7 +44,8 @@ namespace nw4r { namespace snd lpf (0.0f), biquadFilterValue (0.0f), biquadFilterType (0), - priority (0) + priority (0), + field_0x24 (0) { } @@ -59,6 +60,7 @@ namespace nw4r { namespace snd f32 biquadFilterValue; // size 0x04, offset 0x18 int biquadFilterType; // size 0x04, offset 0x1c int priority; // size 0x04, offset 0x20 + UNKWORD field_0x24; }; // size 0x24 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x27514 @@ -76,7 +78,8 @@ namespace nw4r { namespace snd lpf (0.0f), biquadFilterValue (0.0f), biquadFilterType (0), - priority (0) + priority (0), + field_0x24 (0) { } @@ -91,6 +94,7 @@ namespace nw4r { namespace snd f32 biquadFilterValue; // size 0x04, offset 0x18 int biquadFilterType; // size 0x04, offset 0x1c int priority; // size 0x04, offset 0x20 + UNKWORD field_0x24; VoiceOutParam voiceOutParam[4]; // size 0x60, offset 0x24 }; // size 0x84 @@ -244,9 +248,10 @@ namespace nw4r { namespace snd { namespace detail void StartPrepared(); void Update(); void Pause(bool flag, int fadeFrames); - bool IsPaused() const; + bool IsPause() const; void Stop(int fadeFrames); void SetAutoStopCounter(int count); + void FadeIn(int fadeFrames); u32 GetId() const { return mId; } PlayerHeap *GetPlayerHeap() { return mPlayerHeap; } @@ -257,12 +262,16 @@ namespace nw4r { namespace snd { namespace detail void SetInitialVolume(f32 volume); void SetVolume(f32 volume, int frames); void SetPitch(f32 pitch); + void SetPan(f32 pan); + void SetSurroundPan(f32 pan); + void SetLpfFreq(f32 freq); void SetFxSend(AuxBus bus, f32 send); void SetRemoteFilter(int filter); void SetPanMode(PanMode mode); void SetPanCurve(PanCurve curve); void SetAmbientInfo(AmbientInfo const &ambientArgInfo); void SetId(u32 id); + void SetOutputLineFlag(int flag); void AttachPlayerHeap(PlayerHeap *heap); void AttachSoundPlayer(SoundPlayer *player); @@ -279,6 +288,8 @@ namespace nw4r { namespace snd { namespace detail void DetachGeneralHandle(); void DetachTempGeneralHandle(); + int GetRemainingFadeFrames() const; + int CalcCurrentPlayerPriority() const { return ut::Clamp(mPriority + mAmbientParam.priority, PRIORITY_MIN, @@ -308,7 +319,6 @@ 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 mFadeVolume; // size 0x10, offset 0x60 MoveValue mPauseFadeVolume; // size 0x10, offset 0x70 diff --git a/include/nw4r/snd/snd_MoveValue.h b/include/nw4r/snd/snd_MoveValue.h index 3d2def72..31592473 100644 --- a/include/nw4r/snd/snd_MoveValue.h +++ b/include/nw4r/snd/snd_MoveValue.h @@ -41,6 +41,10 @@ namespace nw4r { namespace snd { namespace detail bool IsFinished() const { return mCounter >= mFrame; } + TTime GetRemainingTime() const { + return IsFinished() ? 0 : mFrame - mCounter; + } + void InitValue(TValue value) { mOrigin = value; diff --git a/src/nw4r/snd/snd_BasicSound.cpp b/src/nw4r/snd/snd_BasicSound.cpp index 96014df5..db6b61fc 100644 --- a/src/nw4r/snd/snd_BasicSound.cpp +++ b/src/nw4r/snd/snd_BasicSound.cpp @@ -54,7 +54,6 @@ BasicSound::BasicSound(int priority, int ambientPriority) : mGeneralHandle (nullptr), mTempGeneralHandle (nullptr), mSoundPlayer (nullptr), - field_0x54 (0), mSoundActor (nullptr), mExtSoundPlayer (nullptr), mId (INVALID_ID) @@ -222,7 +221,16 @@ void BasicSound::SetAutoStopCounter(int count) mAutoStopFlag = count > 0; } -bool BasicSound::IsPaused() const +void BasicSound::FadeIn(int fadeFrames) +{ + if (!mFadeOutFlag) + { + int duration = fadeFrames * (1.0f - mFadeVolume.GetValue()); + mFadeVolume.SetTarget(1.0f, duration); + } +} + +bool BasicSound::IsPause() const { return mPauseState == PAUSE_STATE_PAUSING || mPauseState == PAUSE_STATE_PAUSED; @@ -293,6 +301,27 @@ void BasicSound::Update() { SoundAmbientParam ambientParam; + if (mUpdateCounter != 0) + { + ambientParam.volume = mAmbientParam.volume; + ambientParam.pitch = mAmbientParam.pitch; + ambientParam.pan = mAmbientParam.pan; + ambientParam.surroundPan = mAmbientParam.surroundPan; + ambientParam.fxSend = mAmbientParam.fxSend; + ambientParam.lpf = mAmbientParam.lpf; + ambientParam.biquadFilterValue = mAmbientParam.biquadFilterValue; + ambientParam.biquadFilterType = mAmbientParam.biquadFilterType; + ambientParam.priority = mAmbientParam.priority; + ambientParam.field_0x24 = mAmbientParam.field_0x24; + } + else + { + ambientParam.field_0x24 = 0; + } + + for (int i = 0; i < mVoiceOutCount; i++) + ambientParam.voiceOutParam[i] = basicPlayer.GetVoiceOutParam(i); + mAmbientInfo.paramUpdateCallback->at_0x0c( mAmbientInfo.arg, mId, mVoiceOutCount, &ambientParam); @@ -305,10 +334,11 @@ void BasicSound::Update() mAmbientParam.biquadFilterValue = ambientParam.biquadFilterValue; mAmbientParam.biquadFilterType = ambientParam.biquadFilterType; mAmbientParam.priority = ambientParam.priority; + mAmbientParam.field_0x24 = ambientParam.field_0x24; for (int i = 0; i < mVoiceOutCount; i++) basicPlayer.SetVoiceOutParam(i, ambientParam.voiceOutParam[i]); - } + } if (mSoundActor) mActorParam = mSoundActor->detail_GetActorParam(); @@ -562,6 +592,11 @@ void BasicSound::DetachExternalSoundPlayer(ExternalSoundPlayer *extPlayer) mExtSoundPlayer = nullptr; } +int BasicSound::GetRemainingFadeFrames() const +{ + return mPauseFadeVolume.GetRemainingTime(); +} + int BasicSound::GetVoiceOutCount() const { return mVoiceOutCount; @@ -608,12 +643,32 @@ void BasicSound::SetPitch(f32 pitch) mExtPitch = pitch; } +void BasicSound::SetPan(f32 pan) +{ + mExtPan = pan; +} + +void BasicSound::SetSurroundPan(f32 pan) +{ + mExtSurroundPan = pan; +} + +void BasicSound::SetLpfFreq(f32 freq) +{ + mLpfFreq = freq; +} + +void BasicSound::SetOutputLineFlag(int flag) +{ + mOutputLineFlag = flag; +} + void BasicSound::SetFxSend(AuxBus bus, f32 send) { // specifically not the source variant NW4RAssertHeaderClampedLValue_Line(979, bus, AUX_A, AUX_BUS_NUM); - GetBasicPlayer().SetFxSend(bus, send); + mFxSend[bus] = send; } void BasicSound::SetRemoteFilter(int filter) From 6b9aeb9a9ae29154d55150ea25361b826cbc18f6 Mon Sep 17 00:00:00 2001 From: CovenEsme <84377742+CovenEsme@users.noreply.github.com> Date: Tue, 27 May 2025 05:26:02 +0100 Subject: [PATCH 47/91] d_a_obj_distant_ship OK --- .../rels/d_a_obj_distant_shipNP/symbols.txt | 14 ++--- configure.py | 2 +- include/d/a/obj/d_a_obj_distant_ship.h | 12 ++++ src/REL/d/a/obj/d_a_obj_distant_ship.cpp | 58 +++++++++++++++++++ 4 files changed, 78 insertions(+), 8 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt b/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt index 6461e3b5..9c6df247 100644 --- a/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt @@ -2,12 +2,12 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dAcOdistantShip_c_classInit__Fv = .text:0x00000070; // type:function size:0x5C -AcOdistantShip__initModels = .text:0x000000D0; // type:function size:0x90 -AcOdistantShip__init = .text:0x00000160; // type:function size:0x100 -fn_616_260 = .text:0x00000260; // type:function size:0x8 -fn_616_270 = .text:0x00000270; // type:function size:0x8 -AcOdistantShip__draw = .text:0x00000280; // type:function size:0x34 -AcOdistantShip__getModelName = .text:0x000002C0; // type:function size:0x38 +createHeap__17dAcOdistantShip_cFv = .text:0x000000D0; // type:function size:0x90 +create__17dAcOdistantShip_cFv = .text:0x00000160; // type:function size:0x100 +doDelete__17dAcOdistantShip_cFv = .text:0x00000260; // type:function size:0x8 +actorExecute__17dAcOdistantShip_cFv = .text:0x00000270; // type:function size:0x8 +draw__17dAcOdistantShip_cFv = .text:0x00000280; // type:function size:0x34 +getModelName__17dAcOdistantShip_cFv = .text:0x000002C0; // type:function size:0x38 __dt__17dAcOdistantShip_cFv = .text:0x00000300; // type:function size:0x68 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global @@ -18,4 +18,4 @@ lbl_616_data_10 = .data:0x00000010; // type:object size:0x10 data:string lbl_616_data_20 = .data:0x00000020; // type:object size:0x20 lbl_616_data_40 = .data:0x00000040; // type:object size:0x10 lbl_616_data_50 = .data:0x00000050; // type:object size:0x18 -AcOdistantShip__vtable = .data:0x00000068; // type:object size:0x80 +__vt__17dAcOdistantShip_c = .data:0x00000068; // type:object size:0x80 diff --git a/configure.py b/configure.py index 566db45b..e85da535 100644 --- a/configure.py +++ b/configure.py @@ -2017,7 +2017,7 @@ config.libs = [ "d_a_obj_display_only_nbs", "REL/d/a/obj/d_a_obj_display_only_nbs.cpp", ), - Rel(NonMatching, "d_a_obj_distant_ship", "REL/d/a/obj/d_a_obj_distant_ship.cpp"), + Rel(Matching, "d_a_obj_distant_ship", "REL/d/a/obj/d_a_obj_distant_ship.cpp"), Rel( NonMatching, "d_a_obj_diviner_crystal", diff --git a/include/d/a/obj/d_a_obj_distant_ship.h b/include/d/a/obj/d_a_obj_distant_ship.h index 42261420..0771a1f6 100644 --- a/include/d/a/obj/d_a_obj_distant_ship.h +++ b/include/d/a/obj/d_a_obj_distant_ship.h @@ -2,13 +2,25 @@ #define D_A_OBJ_DISTANT_SHIP_H #include "d/a/obj/d_a_obj_base.h" +#include "m/m3d/m_smdl.h" +#include "nw4r/g3d/res/g3d_resfile.h" class dAcOdistantShip_c : public dAcObjBase_c { public: dAcOdistantShip_c() {} virtual ~dAcOdistantShip_c() {} + virtual int create() override; + virtual int doDelete() override; + virtual int draw() override; + virtual bool createHeap() override; + virtual int actorExecute() override; + char *getModelName(); private: + /* 0x330 */ nw4r::g3d::ResFile mBrres; + /* 0x334 */ m3d::smdl_c mModel; + /* 0x350 */ u8 mSubtype; + /* 0x351 */ bool mIsVisible; }; #endif diff --git a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp index af5666b7..2c8bf662 100644 --- a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp @@ -1,3 +1,61 @@ #include "d/a/obj/d_a_obj_distant_ship.h" +#include "common.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/flag/sceneflag_manager.h" +#include "f/f_base.h" +#include "nw4r/g3d/res/g3d_resfile.h" +#include "toBeSorted/arc_managers/current_stage_arc_manager.h" + SPECIAL_ACTOR_PROFILE(OBJ_DIS_SHIP, dAcOdistantShip_c, fProfile::OBJ_DIS_SHIP, 0x143, 0, 0); + +bool dAcOdistantShip_c::createHeap() { + char *modelName = getModelName(); + mBrres = (nw4r::g3d::ResFile)CurrentStageArcManager::GetInstance()->getData("g3d/stage.brres"); + TRY_CREATE(mModel.create(mBrres.GetResMdl(modelName), &heap_allocator, 0x120, 1, 0)); + return SUCCEEDED; +} + +int dAcOdistantShip_c::create() { + // Sure, why not + mIsVisible = false; + u32 p = params; + u16 r = (s32)roomid; + mSubtype = (p >> 8) & 0xF; + + bool flag = SceneflagManager::sInstance->checkFlag(r, p & 0xFF); + if (flag) { + mIsVisible = true; + } + + if (mIsVisible) { + CREATE_ALLOCATOR(dAcOdistantShip_c); + updateMatrix(); + mModel.setLocalMtx(mWorldMtx); + boundingBox.Set(mVec3_c(-0.0f, -0.0f, -0.0f), mVec3_c(0.0f, 0.0f, 0.0f)); + } + return SUCCEEDED; +} + +int dAcOdistantShip_c::doDelete() { + return SUCCEEDED; +} + +int dAcOdistantShip_c::actorExecute() { + return SUCCEEDED; +} + +int dAcOdistantShip_c::draw() { + if (mIsVisible) { + drawModelType1(&mModel); + } + return SUCCEEDED; +} + +char *dAcOdistantShip_c::getModelName() { + switch (mSubtype) { + case 0: return "StageF301_D300"; + case 1: return "StageF301_3_D300"; + default: return nullptr; + } +} From 18785a094da8528b1c7212d202782d46aca965e1 Mon Sep 17 00:00:00 2001 From: CovenEsme <84377742+CovenEsme@users.noreply.github.com> Date: Tue, 27 May 2025 15:06:53 +0100 Subject: [PATCH 48/91] Apply feedback --- include/f/f_base.h | 2 +- src/REL/d/a/obj/d_a_obj_distant_ship.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/f/f_base.h b/include/f/f_base.h index 34bc8bec..34ecfa13 100644 --- a/include/f/f_base.h +++ b/include/f/f_base.h @@ -90,7 +90,7 @@ public: group_type = m_tmpCtData.group_type; } - inline u32 getFromParams(u8 shift, u32 mask) { + u32 getFromParams(u8 shift, u32 mask) { return (params >> shift) & mask; } diff --git a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp index 2c8bf662..6d7e8870 100644 --- a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp @@ -20,11 +20,10 @@ int dAcOdistantShip_c::create() { // Sure, why not mIsVisible = false; u32 p = params; - u16 r = (s32)roomid; + u16 r = getRoomId(); mSubtype = (p >> 8) & 0xF; - bool flag = SceneflagManager::sInstance->checkFlag(r, p & 0xFF); - if (flag) { + if (SceneflagManager::sInstance->checkBoolFlag(r, p & 0xFF)) { mIsVisible = true; } From 0c9d9fa357d0733058c792556aca9b70f702a3fd Mon Sep 17 00:00:00 2001 From: CovenEsme <84377742+CovenEsme@users.noreply.github.com> Date: Tue, 27 May 2025 15:15:13 +0100 Subject: [PATCH 49/91] Add scratch comment for odd dAcOdistantShip_c::create match --- src/REL/d/a/obj/d_a_obj_distant_ship.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp index 6d7e8870..b30fde1e 100644 --- a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp @@ -18,6 +18,8 @@ bool dAcOdistantShip_c::createHeap() { int dAcOdistantShip_c::create() { // Sure, why not + // Scratch for anyone who wants to look for a better solution: + // https://decomp.me/scratch/0qPPj mIsVisible = false; u32 p = params; u16 r = getRoomId(); From b1381add583cb995bf2c3c9ba577cfc61f1a2eb5 Mon Sep 17 00:00:00 2001 From: CovenEsme <84377742+CovenEsme@users.noreply.github.com> Date: Tue, 27 May 2025 15:50:39 +0100 Subject: [PATCH 50/91] Improve dAcOdistantShip_c::create --- src/REL/d/a/obj/d_a_obj_distant_ship.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp index b30fde1e..6ca6c8ef 100644 --- a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp @@ -17,15 +17,11 @@ bool dAcOdistantShip_c::createHeap() { } int dAcOdistantShip_c::create() { - // Sure, why not - // Scratch for anyone who wants to look for a better solution: - // https://decomp.me/scratch/0qPPj mIsVisible = false; - u32 p = params; - u16 r = getRoomId(); - mSubtype = (p >> 8) & 0xF; + u8 flag = getFromParams(0, 0xFF); + mSubtype = getFromParams(8, 0xF); - if (SceneflagManager::sInstance->checkBoolFlag(r, p & 0xFF)) { + if (SceneflagManager::sInstance->checkBoolFlag(roomid, flag)) { mIsVisible = true; } From 45f9cf1e7c6f736807cf9ec66543bf6b89f66c16 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 19:27:56 +0200 Subject: [PATCH 51/91] snd_AxVoice OK --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 16 ++-- configure.py | 2 +- include/nw4r/snd/snd_AxVoice.h | 4 +- src/nw4r/snd/snd_AxVoice.cpp | 139 ++++++++++++++++++++++++++++++++- 5 files changed, 150 insertions(+), 12 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 5887703a..28496ea4 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2901,6 +2901,7 @@ nw4r/snd/snd_AxManager.cpp: nw4r/snd/snd_AxVoice.cpp: .text start:0x80464880 end:0x80467634 align:16 + .sdata2 start:0x8057EF30 end:0x8057EF58 nw4r/snd/snd_AxVoiceManager.cpp: .text start:0x80467640 end:0x80467DC8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 508ef954..f4433999 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -49646,14 +49646,14 @@ lbl_8057EF14 = .sdata2:0x8057EF14; // type:object size:0x4 align:4 data:float @2523 = .sdata2:0x8057EF20; // type:object size:0x8 scope:local align:8 data:double @2626 = .sdata2:0x8057EF28; // type:object size:0x4 scope:local align:4 data:float @3157 = .sdata2:0x8057EF2C; // type:object size:0x4 scope:local align:4 data:float -lbl_8057EF30 = .sdata2:0x8057EF30; // type:object size:0x4 align:4 data:float -lbl_8057EF34 = .sdata2:0x8057EF34; // type:object size:0x4 align:4 data:float -lbl_8057EF38 = .sdata2:0x8057EF38; // type:object size:0x4 align:4 data:float -lbl_8057EF40 = .sdata2:0x8057EF40; // type:object size:0x8 align:8 data:double -lbl_8057EF48 = .sdata2:0x8057EF48; // type:object size:0x4 align:4 data:float -lbl_8057EF4C = .sdata2:0x8057EF4C; // type:object size:0x4 align:4 data:float -lbl_8057EF50 = .sdata2:0x8057EF50; // type:object size:0x4 align:4 data:float -lbl_8057EF54 = .sdata2:0x8057EF54; // type:object size:0x4 align:4 data:float +@5196 = .sdata2:0x8057EF30; // type:object size:0x4 scope:local align:4 data:float +@5197 = .sdata2:0x8057EF34; // type:object size:0x4 scope:local align:4 data:float +@5198 = .sdata2:0x8057EF38; // type:object size:0x4 scope:local align:4 data:float +@5201 = .sdata2:0x8057EF40; // type:object size:0x8 scope:local align:8 data:double +@5425 = .sdata2:0x8057EF48; // type:object size:0x4 scope:local align:4 data:float +@5426 = .sdata2:0x8057EF4C; // type:object size:0x4 scope:local align:4 data:float +@5427 = .sdata2:0x8057EF50; // type:object size:0x4 scope:local align:4 data:float +@5467 = .sdata2:0x8057EF54; // type:object size:0x4 scope:local align:4 data:float @1517 = .sdata2:0x8057EF58; // type:object size:0x4 scope:local align:4 data:float @1518 = .sdata2:0x8057EF5C; // type:object size:0x4 scope:local align:4 data:float @1519 = .sdata2:0x8057EF60; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index 86b595c0..02e791cb 100644 --- a/configure.py +++ b/configure.py @@ -1014,7 +1014,7 @@ config.libs = [ [ Object(NonMatching, "nw4r/snd/snd_AnimSound.cpp"), Object(Matching, "nw4r/snd/snd_AxManager.cpp"), - Object(NonMatching, "nw4r/snd/snd_AxVoice.cpp"), + Object(Matching, "nw4r/snd/snd_AxVoice.cpp"), Object(Matching, "nw4r/snd/snd_AxVoiceManager.cpp"), Object(Matching, "nw4r/snd/snd_AxfxImpl.cpp"), Object(Matching, "nw4r/snd/snd_Bank.cpp"), diff --git a/include/nw4r/snd/snd_AxVoice.h b/include/nw4r/snd/snd_AxVoice.h index 4e6d34b7..0b709c4b 100644 --- a/include/nw4r/snd/snd_AxVoice.h +++ b/include/nw4r/snd/snd_AxVoice.h @@ -121,6 +121,8 @@ namespace nw4r { namespace snd { namespace detail void SetVoiceBiquad(AXPBBIQUAD const &biquad); void SetVoiceBiquadCoefs(u16 b0, u16 b1, u16 b2, u16 a1, u16 a2); void SetVoiceRmtIIR(__AXPBRMTIIR const &iir); + void SetVoiceRmtOn(u16 on); + void SetVoiceRmtMix(_AXPBRMTMIX const &iir); void SetVoiceRmtIIRCoefs(u16 type, ...); void Set(AXVPB *vpb); @@ -243,7 +245,7 @@ namespace nw4r { namespace snd { namespace detail void SetAdpcm(AdpcmParam const *param); void SetAdpcmLoop(AdpcmLoopParam const *param); bool SetMix(MixParam const ¶m); - bool SetRmtMix(const RemoteMixParam ¶m); + void SetRmtMix(const RemoteMixParam ¶m); void SetSrc(f32 ratio, bool initialUpdate); void SetVe(f32 volume, f32 initVolume); void SetLpf(u16 freq); diff --git a/src/nw4r/snd/snd_AxVoice.cpp b/src/nw4r/snd/snd_AxVoice.cpp index 81d8213d..656786d6 100644 --- a/src/nw4r/snd/snd_AxVoice.cpp +++ b/src/nw4r/snd/snd_AxVoice.cpp @@ -302,6 +302,10 @@ void AxVoice::SetVoiceType(VoiceType type) mVpb.SetVoiceType(type); } +void AxVoice::EnableRemote(bool enable) { + mVpb.SetVoiceRmtOn(enable); +} + void AxVoice::ResetDelta() { ut::AutoInterruptLock lock; @@ -674,6 +678,37 @@ bool AxVoice::SetMix(MixParam const ¶m) return needUpdateFlag; } +void AxVoice::SetRmtMix(const RemoteMixParam& rParam) { + AXPBRMTMIX mix; + + mix.vMain0 = rParam.vMain0; + mix.vDeltaMain0 = 0; + + mix.vAux0 = rParam.vAux0; + mix.vDeltaAux0 = 0; + + mix.vMain1 = rParam.vMain1; + mix.vDeltaMain1 = 0; + + mix.vAux1 = rParam.vAux1; + mix.vDeltaAux1 = 0; + + mix.vMain2 = rParam.vMain2; + mix.vDeltaMain2 = 0; + + mix.vAux2 = rParam.vAux2; + mix.vDeltaAux2 = 0; + + mix.vMain3 = rParam.vMain3; + mix.vDeltaMain3 = 0; + + mix.vAux3 = rParam.vAux3; + mix.vDeltaAux3 = 0; + + mVpb.SetVoiceRmtMix(mix); +} + + void AxVoice::SetSrc(f32 ratio, bool initialUpdate) { ut::AutoInterruptLock lock; @@ -713,8 +748,12 @@ void AxVoice::SetVe(f32 volume, f32 initVolume) if (!mVpb.IsAvailable()) return; - mVpb.SetVoiceVe(volume * (AX_MAX_VOLUME - 1), - initVolume * (AX_MAX_VOLUME - 1)); + int v = volume * (AX_MAX_VOLUME - 1); + int iv = initVolume * (AX_MAX_VOLUME - 1); + v = ut::Clamp(v, 0, 0xFFFF); + iv = ut::Clamp(iv, 0, 0xFFFF); + + mVpb.SetVoiceVe(v, iv); } void AxVoice::SetLpf(u16 freq) @@ -1277,6 +1316,102 @@ void AxVoiceParamBlock::SetVoiceBiquadCoefs(u16 b0, u16 b1, u16 b2, u16 a1, mSync |= AX_VPB_SYNC_FLAG_BIQUAD_COEFS; } +void AxVoiceParamBlock::SetVoiceRmtOn(u16 on) { + ut::AutoInterruptLock lock; + + if (!IsAvailable()) { + return; + } + + mVpb->pb.remote = on; + mSync |= AX_VPB_SYNC_FLAG_RMT_ON; +} + +void AxVoiceParamBlock::SetVoiceRmtMix(_AXPBRMTMIX const &rMix) +{ + ut::AutoInterruptLock lock; + + if (!IsAvailable()) { + return; + } + + u16* pDst = reinterpret_cast(&mVpb->pb.rmtMix); + const u16* pSrc = reinterpret_cast(&rMix); + + u16 ctrl = 0; + + // vMain0 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_M0; + } + // vDeltaMain0 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_M0; + } + // vAux0 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_A0; + } + // vDeltaAux0 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_A0; + } + + // vMain1 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_M1; + } + // vDeltaMain1 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_M1; + } + // vAux1 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_A1; + } + // vDeltaAux1 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_A1; + } + + // vMain2 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_M2; + } + // vDeltaMain2 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_M2; + } + // vAux2 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_A2; + } + // vDeltaAux2 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_A2; + } + + // vMain3 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_M3; + } + // vDeltaMain3 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_M3; + } + // vAux3 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_A3; + } + // vDeltaAux3 + if ((*pDst++ = *pSrc++) != 0) { + ctrl |= AX_MIXER_CTRL_RMT_DELTA_A3; + } + + mVpb->pb.rmtMixerCtrl = ctrl; + mSync |= AX_VPB_SYNC_FLAG_RMT_MIXER_CTRL | AX_VPB_SYNC_FLAG_RMT_MIX; +} + void AxVoiceParamBlock::SetVoiceRmtIIR(__AXPBRMTIIR const &iir) { ut::AutoInterruptLock lock; From 11c4cb31307240492b3b2c4a950b0539a1b90955 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 20:40:52 +0200 Subject: [PATCH 52/91] Fully split snd --- config/SOUE01/splits.txt | 27 ++++++++++++++++++++++++++- config/SOUE01/symbols.txt | 26 +++++++++++++------------- configure.py | 2 +- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 28496ea4..c613b099 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2863,6 +2863,9 @@ nw4r/g3d/g3d_scnmdl.cpp: .rodata start:0x804F7B48 end:0x804F7B58 .data start:0x8056DA70 end:0x8056DAB8 +nw4r/g3d/g3d_scnmdl1mat1shp.cpp: + .rodata start:0x804F7B58 end:0x804F7B70 + nw4r/g3d/g3d_calcmaterial.cpp: .text start:0x8045FDB0 end:0x8045FFE4 align:16 @@ -2891,6 +2894,7 @@ nw4r/g3d/g3d_calcvtx.cpp: nw4r/snd/snd_AnimSound.cpp: .text start:0x80461700 end:0x804630D4 align:16 + .sdata2 start:0x8057EEF8 end:0x8057EF18 nw4r/snd/snd_AxManager.cpp: .text start:0x804630E0 end:0x80464880 align:16 @@ -2966,6 +2970,8 @@ nw4r/snd/snd_FrameHeap.cpp: nw4r/snd/snd_FxReverbStdDpl2.cpp: .text start:0x8046D2E0 end:0x8046DA10 align:16 + .data start:0x8056DC70 end:0x8056DC98 + .sdata2 start:0x8057F000 end:0x8057F018 nw4r/snd/snd_InstancePool.cpp: .text start:0x8046DA10 end:0x8046DCF8 align:16 @@ -2999,6 +3005,8 @@ nw4r/snd/snd_MmlSeqTrackAllocator.cpp: nw4r/snd/snd_NandSoundArchive.cpp: .text start:0x8046F850 end:0x804700B8 align:16 + .data start:0x8056DF70 end:0x8056DFF0 + .sbss start:0x80576698 end:0x805766A0 nw4r/snd/snd_PlayerHeap.cpp: .text start:0x804700C0 end:0x804702DC align:16 @@ -3017,13 +3025,15 @@ nw4r/snd/snd_SeqFile.cpp: nw4r/snd/snd_SeqPlayer.cpp: .text start:0x80471020 end:0x804727F8 align:16 - .data start:0x8056E024 end:0x8056E088 + .data start:0x8056E000 end:0x8056E088 .sdata2 start:0x8057F068 end:0x8057F080 .bss start:0x806596E8 end:0x80659708 nw4r/snd/snd_SeqSound.cpp: .text start:0x80472800 end:0x8047316C align:16 .ctors start:0x804DB960 end:0x804DB964 + .data start:0x8056E088 end:0x8056E0D8 + .sbss start:0x805766A8 end:0x805766B0 nw4r/snd/snd_SeqSoundHandle.cpp: .text start:0x80473170 end:0x804732A8 align:16 @@ -3036,22 +3046,34 @@ nw4r/snd/snd_SeqTrack.cpp: nw4r/snd/snd_Sound3DActor.cpp: .text start:0x80474820 end:0x80474BD8 align:16 + .rodata start:0x804F9308 end:0x804F9320 + .data start:0x8056E0E8 end:0x8056E118 + .sdata2 start:0x8057F0B0 end:0x8057F0B8 nw4r/snd/snd_Sound3DCalculator.cpp: .text start:0x80474BE0 end:0x804756B0 align:16 + .sdata2 start:0x8057F0B8 end:0x8057F100 nw4r/snd/snd_Sound3DEngine.cpp: .text start:0x804756B0 end:0x804759F8 align:16 + .data start:0x8056E118 end:0x8056E138 + .sdata2 start:0x8057F100 end:0x8057F118 nw4r/snd/snd_Sound3DListener.cpp: .text start:0x80475A00 end:0x80475C88 align:16 + .sdata2 start:0x8057F118 end:0x8057F128 nw4r/snd/snd_Sound3DManager.cpp: .text start:0x80475C90 end:0x80475F78 align:16 .ctors start:0x804DB964 end:0x804DB968 + .data start:0x8056E138 end:0x8056E170 + .sdata2 start:0x8057F128 end:0x8057F130 + .bss start:0x80659708 end:0x80659720 nw4r/snd/snd_SoundActor.cpp: .text start:0x80475F80 end:0x80476278 align:16 + .data start:0x8056E170 end:0x8056E190 + .sdata2 start:0x8057F130 end:0x8057F138 nw4r/snd/snd_SoundArchive.cpp: .text start:0x80476280 end:0x8047697C align:16 @@ -3113,6 +3135,9 @@ nw4r/snd/snd_StrmPlayer.cpp: nw4r/snd/snd_StrmSound.cpp: .text start:0x80480590 end:0x80480D8C align:16 .ctors start:0x804DB96C end:0x804DB970 + .data start:0x8056E2D0 end:0x8056E308 + .sbss start:0x805766D0 end:0x805766D8 + .sdata2 start:0x8057F178 end:0x8057F188 nw4r/snd/snd_StrmSoundHandle.cpp: .text start:0x80480D90 end:0x80480EC8 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index f4433999..221b808a 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -21782,22 +21782,22 @@ __AllocDelayLine = .text:0x8039FAB0; // type:function size:0x174 __BzeroDelayLines = .text:0x8039FC30; // type:function size:0x124 __FreeDelayLine = .text:0x8039FD60; // type:function size:0x114 fn_8039FE80 = .text:0x8039FE80; // type:function size:0x324 -fn_803A01B0 = .text:0x803A01B0; // type:function size:0x60 -fn_803A0210 = .text:0x803A0210; // type:function size:0x17C -fn_803A0390 = .text:0x803A0390; // type:function size:0xD0 -fn_803A0460 = .text:0x803A0460; // type:function size:0xB4 -fn_803A0520 = .text:0x803A0520; // type:function size:0x54 -fn_803A0580 = .text:0x803A0580; // type:function size:0x36C +AXFXReverbStdExpGetMemSize = .text:0x803A01B0; // type:function size:0x60 +AXFXReverbStdExpInit = .text:0x803A0210; // type:function size:0x17C +AXFXReverbStdExpSettings = .text:0x803A0390; // type:function size:0xD0 +AXFXReverbStdExpSettingsUpdate = .text:0x803A0460; // type:function size:0xB4 +AXFXReverbStdExpShutdown = .text:0x803A0520; // type:function size:0x54 +AXFXReverbStdExpCallback = .text:0x803A0580; // type:function size:0x36C fn_803A08F0 = .text:0x803A08F0; // type:function size:0x144 fn_803A0A40 = .text:0x803A0A40; // type:function size:0x100 fn_803A0B40 = .text:0x803A0B40; // type:function size:0xF0 fn_803A0C30 = .text:0x803A0C30; // type:function size:0x2AC -fn_803A0EE0 = .text:0x803A0EE0; // type:function size:0x60 -fn_803A0F40 = .text:0x803A0F40; // type:function size:0x198 -fn_803A10E0 = .text:0x803A10E0; // type:function size:0xD0 -fn_803A11B0 = .text:0x803A11B0; // type:function size:0xB4 -fn_803A1270 = .text:0x803A1270; // type:function size:0x54 -fn_803A12D0 = .text:0x803A12D0; // type:function size:0x384 +AXFXReverbStdExpGetMemSizeDpl2 = .text:0x803A0EE0; // type:function size:0x60 +AXFXReverbStdExpInitDpl2 = .text:0x803A0F40; // type:function size:0x198 +AXFXReverbStdExpSettingsDpl2 = .text:0x803A10E0; // type:function size:0xD0 +AXFXReverbStdExpSettingsUpdateDpl2 = .text:0x803A11B0; // type:function size:0xB4 +AXFXReverbStdExpShutdownDpl2 = .text:0x803A1270; // type:function size:0x54 +AXFXReverbStdExpCallbackDpl2 = .text:0x803A12D0; // type:function size:0x384 fn_803A1660 = .text:0x803A1660; // type:function size:0x144 fn_803A17B0 = .text:0x803A17B0; // type:function size:0x100 fn_803A18B0 = .text:0x803A18B0; // type:function size:0xF0 @@ -29147,7 +29147,7 @@ TYPE_NAME__Q34nw4r3g3d8ScnGroup = .rodata:0x804F7B10; // type:object size:0x10 TYPE_NAME__Q34nw4r3g3d7ScnRoot = .rodata:0x804F7B20; // type:object size:0x10 TYPE_NAME__Q34nw4r3g3d12ScnMdlSimple = .rodata:0x804F7B30; // type:object size:0x14 TYPE_NAME__Q34nw4r3g3d6ScnMdl = .rodata:0x804F7B48; // type:object size:0xC -TYPE_NAME__Q34nw4r3g3d14ScnMdl1Mat1Shp = .rodata:0x804F7B58; // type:object size:0x18 +TYPE_NAME__Q34nw4r3g3d14ScnMdl1Mat1Shp = .rodata:0x804F7B58; // type:object size:0x14 TYPE_NAME__Q34nw4r3g3d7ScnProc = .rodata:0x804F7B70; // type:object size:0x10 coefTable__Q44nw4r3snd6detail15BiquadFilterLpf = .rodata:0x804F7B80; // type:object size:0x460 coefTable__Q44nw4r3snd6detail15BiquadFilterHpf = .rodata:0x804F7FE0; // type:object size:0x3CA diff --git a/configure.py b/configure.py index 02e791cb..4f2054bc 100644 --- a/configure.py +++ b/configure.py @@ -999,7 +999,7 @@ config.libs = [ Object(Matching, "nw4r/g3d/g3d_scnmdl.cpp"), # Object(NonMatching, "nw4r/g3d/g3d_scnchoice.cpp"), # Object(NonMatching, "nw4r/g3d/g3d_scngroupex.cpp"), - # Object(NonMatching, "nw4r/g3d/g3d_scnmdl1mat1shp.cpp"), + Object(Matching, "nw4r/g3d/g3d_scnmdl1mat1shp.cpp"), # Object(NonMatching, "nw4r/g3d/g3d_scnmdlexpand.cpp"), Object(Matching, "nw4r/g3d/g3d_calcmaterial.cpp"), Object(Matching, "nw4r/g3d/g3d_init.cpp"), From bfdcb7c73ada51dcb35f57b1d70e12d643e1ced4 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 20:51:47 +0200 Subject: [PATCH 53/91] snd_ExternalSoundPlayer OK --- configure.py | 2 +- include/nw4r/snd/snd_ExternalSoundPlayer.h | 5 ++++ src/nw4r/snd/snd_ExternalSoundPlayer.cpp | 27 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 4f2054bc..72238d19 100644 --- a/configure.py +++ b/configure.py @@ -1027,7 +1027,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_debug.cpp"), Object(Matching, "nw4r/snd/snd_DvdSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_EnvGenerator.cpp"), - Object(NonMatching, "nw4r/snd/snd_ExternalSoundPlayer.cpp"), + Object(Matching, "nw4r/snd/snd_ExternalSoundPlayer.cpp"), Object(Matching, "nw4r/snd/snd_FrameHeap.cpp"), Object(NonMatching, "nw4r/snd/snd_FxBase.cpp"), Object(NonMatching, "nw4r/snd/snd_FxChorus.cpp"), diff --git a/include/nw4r/snd/snd_ExternalSoundPlayer.h b/include/nw4r/snd/snd_ExternalSoundPlayer.h index 1fd2a9ba..4da73373 100644 --- a/include/nw4r/snd/snd_ExternalSoundPlayer.h +++ b/include/nw4r/snd/snd_ExternalSoundPlayer.h @@ -11,6 +11,8 @@ * classes and functions */ +namespace nw4r { namespace snd { class SoundActor; }} + namespace nw4r { namespace snd { namespace detail { // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x27049 @@ -24,6 +26,9 @@ namespace nw4r { namespace snd { namespace detail int GetPlayingSoundCount() const { return mSoundList.GetSize(); } int GetPlayableSoundCount() const { return mPlayableCount; } void SetPlayableSoundCount(int count); + void StopAllSound(int fadeFrames); + void PauseAllSound(bool flag, int fadeFrames); + void DetachSoundActorAll(SoundActor *sound); bool AppendSound(BasicSound *sound); void RemoveSound(BasicSound *sound); diff --git a/src/nw4r/snd/snd_ExternalSoundPlayer.cpp b/src/nw4r/snd/snd_ExternalSoundPlayer.cpp index 2cd0c7e7..7f0b1d5a 100644 --- a/src/nw4r/snd/snd_ExternalSoundPlayer.cpp +++ b/src/nw4r/snd/snd_ExternalSoundPlayer.cpp @@ -42,10 +42,37 @@ ExternalSoundPlayer::~ExternalSoundPlayer() { } } +#if 0 // not sure which one uses this exactly, maybe StopAllSound? DECOMP_FORCE_CLASS_METHOD( BasicSound::ExtSoundPlayerPlayLinkList, GetPointerFromNode(static_cast(nullptr))); +#endif + +void ExternalSoundPlayer::StopAllSound(int fadeFrames) +{ + NW4R_RANGE_FOR_NO_AUTO_INC(it, mSoundList) + { + it++->Stop(fadeFrames); + } +} + +void ExternalSoundPlayer::PauseAllSound(bool flag, int fadeFrames) +{ + NW4R_RANGE_FOR_NO_AUTO_INC(it, mSoundList) + { + it++->Pause(flag, fadeFrames); + } +} + +void ExternalSoundPlayer::DetachSoundActorAll(SoundActor *sound) +{ + NW4R_RANGE_FOR_NO_AUTO_INC(it, mSoundList) + { + it++->DetachSoundActor(sound); + } +} + bool ExternalSoundPlayer::AppendSound(BasicSound *sound) { From a600b0c092380bc2bb86644fcec0451afe0f6e78 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 21:09:04 +0200 Subject: [PATCH 54/91] snd_SeqPlayer OK --- config/SOUE01/symbols.txt | 24 ++++++++--------- configure.py | 2 +- include/nw4r/snd/snd_SeqPlayer.h | 46 ++++++++++++++++++++++++++++++++ src/nw4r/snd/snd_SeqPlayer.cpp | 24 +++++++++++++++++ 4 files changed, 83 insertions(+), 13 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 221b808a..b5d17241 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25377,9 +25377,9 @@ Update__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x80472180; // type:function size UpdateTick__Q44nw4r3snd6detail9SeqPlayerFi = .text:0x80472290; // type:function size:0x264 SkipTick__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x80472500; // type:function size:0x294 NoteOn__Q44nw4r3snd6detail9SeqPlayerFiRCQ44nw4r3snd6detail10NoteOnInfo = .text:0x804727A0; // type:function size:0x28 -ChannelCallback__Q44nw4r3snd6detail9SeqPlayerFPQ44nw4r3snd6detail7Channel = .text:0x804727D0; // type:function size:0x4 -@180@__dt__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x804727E0; // type:function size:0x8 -@192@__dt__Q44nw4r3snd6detail9SeqPlayerFv = .text:0x804727F0; // type:function size:0x8 +ChannelCallback__Q44nw4r3snd6detail9SeqPlayerFPQ44nw4r3snd6detail7Channel = .text:0x804727D0; // type:function size:0x4 scope:weak +@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 InitParam__Q44nw4r3snd6detail8SeqSoundFv = .text:0x80472900; // type:function size:0x34 @@ -38602,10 +38602,10 @@ __vt__Q44nw4r3snd6detail20MmlSeqTrackAllocator = .data:0x8056DF58; // type:objec lbl_8056DF70 = .data:0x8056DF70; // type:object size:0x60 lbl_8056DFD0 = .data:0x8056DFD0; // type:object size:0x20 __vt__Q44nw4r3snd6detail10PlayerHeap = .data:0x8056DFF0; // type:object size:0x10 -lbl_8056E000 = .data:0x8056E000; // type:object size:0xC data:4byte -lbl_8056E00C = .data:0x8056E00C; // type:object size:0xC data:4byte -lbl_8056E018 = .data:0x8056E018; // type:object size:0xC data:4byte -lbl_8056E024 = .data:0x8056E024; // type:object size:0x64 +@4081 = .data:0x8056E000; // type:object size:0xC scope:local data:4byte +@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__Q44nw4r3snd6detail8SeqTrack = .data:0x8056E0D8; // type:object size:0x10 @@ -49704,10 +49704,10 @@ lbl_8057F014 = .sdata2:0x8057F014; // type:object size:0x4 align:4 data:float @3182 = .sdata2:0x8057F054; // type:object size:0x4 scope:local align:4 data:float @3191 = .sdata2:0x8057F058; // type:object size:0x8 scope:local align:8 data:double @3192 = .sdata2:0x8057F060; // type:object size:0x8 scope:local align:8 data:double -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 +@3811 = .sdata2:0x8057F068; // type:object size:0x4 scope:local align:4 data:float +@3812 = .sdata2:0x8057F06C; // type:object size:0x4 scope:local align:4 data:float +@4051 = .sdata2:0x8057F070; // type:object size:0x8 scope:local align:8 data:double +@4321 = .sdata2:0x8057F078; // type:object size:0x4 scope:local align:4 data:float @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 @@ -51939,7 +51939,7 @@ sBiquadFilterCallbackTable__Q44nw4r3snd6detail9AxManager = .bss:0x80659080; // t @781 = .bss:0x806593F8; // type:object size:0xC scope:local @LOCAL@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .bss:0x80659404; // type:object size:0xC scope:weak data:4byte @LOCAL@GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv@instance = .bss:0x80659410; // type:object size:0x2D8 scope:weak data:byte -lbl_806596E8 = .bss:0x806596E8; // type:object size:0x20 data:2byte +mGlobalVariable__Q44nw4r3snd6detail9SeqPlayer = .bss:0x806596E8; // type:object size:0x20 data:2byte lbl_80659708 = .bss:0x80659708; // type:object size:0x18 @1420 = .bss:0x80659720; // type:object size:0xC scope:local @LOCAL@detail_SortPriorityList__Q34nw4r3snd11SoundPlayerFv@tmplist = .bss:0x80659730; // type:object size:0x600 scope:weak data:4byte diff --git a/configure.py b/configure.py index 72238d19..3157afb0 100644 --- a/configure.py +++ b/configure.py @@ -1048,7 +1048,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_RemoteSpeaker.cpp"), Object(Matching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), Object(Matching, "nw4r/snd/snd_SeqFile.cpp"), - Object(NonMatching, "nw4r/snd/snd_SeqPlayer.cpp"), + Object(Matching, "nw4r/snd/snd_SeqPlayer.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqSound.cpp"), Object(NonMatching, "nw4r/snd/snd_SeqSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SeqTrack.cpp"), diff --git a/include/nw4r/snd/snd_SeqPlayer.h b/include/nw4r/snd/snd_SeqPlayer.h index 50467dfa..cb4c1a52 100644 --- a/include/nw4r/snd/snd_SeqPlayer.h +++ b/include/nw4r/snd/snd_SeqPlayer.h @@ -9,7 +9,9 @@ #include "nw4r/snd/snd_BasicPlayer.h" #include "nw4r/snd/snd_DisposeCallbackManager.h" // DisposeCallback +#include "nw4r/snd/snd_SeqTrack.h" #include "nw4r/snd/snd_SoundThread.h" +#include "nw4r/ut/ut_Lock.h" /******************************************************************************* * types @@ -128,6 +130,10 @@ namespace nw4r { namespace snd { namespace detail SeqTrack *GetPlayerTrack(int trackNo); s16 volatile *GetVariablePtr(int varNo); + s16 GetLocalVariable(int varNo) const; + void SetLocalVariable(int varNo, s16 value); + static void SetGlobalVariable(int varNo, s16 value); + void SetTempoRatio(f32 tempo); void SetReleasePriorityFix(bool fix); void SetChannelPriority(int priority); @@ -148,6 +154,10 @@ namespace nw4r { namespace snd { namespace detail void CallSeqUserprocCallback(u16 procId, SeqTrack *track); Channel *NoteOn(int bankNo, NoteOnInfo const ¬eOnInfo); + void SetTrackMute(u32 trackFlags, SeqMute mute); + void SetTrackSilence(u32 trackFlags, bool silence, int fadeFrames); + void SetTrackVolume(u32 trackFlags, f32 volume); + static void InitSeqPlayer(); private: @@ -162,6 +172,40 @@ namespace nw4r { namespace snd { namespace detail void UpdateTick(int msec); void SkipTick(); + template + void SetTrackParam(u32 trackFlags, void (SeqTrack::*pSetter)(T), T param) { + ut::AutoInterruptLock lock; + + for (int i = 0; i < TRACK_NUM && trackFlags != 0; + trackFlags >>= 1, i++) { + + if (trackFlags & 1) { + SeqTrack* pTrack = GetPlayerTrack(i); + + if (pTrack != NULL) { + (pTrack->*pSetter)(param); + } + } + } + } + + template + void SetTrackParam(u32 trackFlags, void (SeqTrack::*pSetter)(T, U), T param, U param2) { + ut::AutoInterruptLock lock; + + for (int i = 0; i < TRACK_NUM && trackFlags != 0; + trackFlags >>= 1, i++) { + + if (trackFlags & 1) { + SeqTrack* pTrack = GetPlayerTrack(i); + + if (pTrack != NULL) { + (pTrack->*pSetter)(param, param2); + } + } + } + } + // static members public: static int const MAX_SKIP_TICK_PER_FRAME = 768; @@ -172,6 +216,8 @@ namespace nw4r { namespace snd { namespace detail static int const GLOBAL_VARIABLE_NUM = 16; static int const PLAYER_VARIABLE_NUM = 16; + static const int TRACK_NUM = 16; + private: static s16 mGlobalVariable[GLOBAL_VARIABLE_NUM]; diff --git a/src/nw4r/snd/snd_SeqPlayer.cpp b/src/nw4r/snd/snd_SeqPlayer.cpp index 481c9e6b..ed40614c 100644 --- a/src/nw4r/snd/snd_SeqPlayer.cpp +++ b/src/nw4r/snd/snd_SeqPlayer.cpp @@ -286,6 +286,30 @@ void SeqPlayer::CallSeqUserprocCallback(u16 procId, SeqTrack *track) trackParam.cmpFlag = param.cmpFlag; } +s16 SeqPlayer::GetLocalVariable(int varNo) const { + return mLocalVariable[varNo]; +} + +void SeqPlayer::SetLocalVariable(int varNo, s16 value) { + mLocalVariable[varNo] = value; +} + +void SeqPlayer::SetGlobalVariable(int varNo, s16 value) { + mGlobalVariable[varNo] = value; +} + +void SeqPlayer::SetTrackMute(u32 trackFlags, SeqMute mute) { + SetTrackParam(trackFlags, &SeqTrack::SetMute, mute); +} + +void SeqPlayer::SetTrackSilence(u32 trackFlags, bool silence, int fadeFrames) { + SetTrackParam(trackFlags, &SeqTrack::SetSilence, silence, fadeFrames); +} + +void SeqPlayer::SetTrackVolume(u32 trackFlags, f32 volume) { + SetTrackParam(trackFlags, &SeqTrack::SetVolume, volume); +} + #if 0 // SeqPlayer::GetLocalVariable? maybe all of them? DECOMP_FORCE(NW4RAssertHeaderClampedLValue_String(varNo)); From d6859dfd74ca205cf9cae2fa343df56124403a9d Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 21:38:15 +0200 Subject: [PATCH 55/91] snd_SeqSound OK --- config/SOUE01/symbols.txt | 20 +++++------ configure.py | 2 +- include/nw4r/snd/snd_BasicSound.h | 1 + include/nw4r/snd/snd_SeqPlayer.h | 4 +++ include/nw4r/snd/snd_SeqSound.h | 9 +++++ src/nw4r/snd/snd_SeqSound.cpp | 60 +++++++++++++++++++++++++++++-- 6 files changed, 83 insertions(+), 13 deletions(-) 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; From cbcee6811fa7ac735c9a31052d6dc140b820c939 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 21:57:07 +0200 Subject: [PATCH 56/91] snd_WaveArchive, snd_WaveFile OK --- config/SOUE01/splits.txt | 5 ++++- configure.py | 4 ++-- src/nw4r/snd/snd_WaveArchive.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index c613b099..a66cc63d 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -3170,8 +3170,11 @@ nw4r/snd/snd_Util.cpp: .sdata start:0x80574EA8 end:0x80574EB0 .sdata2 start:0x8057F1C0 end:0x8057F1F0 +nw4r/snd/snd_WaveArchive.cpp: + .text start:0x80484BE0 end:0x80484CE8 align:16 + nw4r/snd/snd_WaveFile.cpp: - .text start:0x80484BE0 end:0x80484F54 align:16 + .text start:0x80484CF0 end:0x80484F54 align:16 nw4r/snd/snd_WaveSound.cpp: .text start:0x80484F60 end:0x8048531C align:16 diff --git a/configure.py b/configure.py index 1005d8ef..d8072128 100644 --- a/configure.py +++ b/configure.py @@ -1079,8 +1079,8 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_Voice.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"), + Object(Matching, "nw4r/snd/snd_WaveArchive.cpp"), + Object(Matching, "nw4r/snd/snd_WaveFile.cpp"), Object(Matching, "nw4r/snd/snd_WaveSound.cpp"), Object(Matching, "nw4r/snd/snd_WaveSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_WsdFile.cpp"), diff --git a/src/nw4r/snd/snd_WaveArchive.cpp b/src/nw4r/snd/snd_WaveArchive.cpp index e3255fe6..52ab01ba 100644 --- a/src/nw4r/snd/snd_WaveArchive.cpp +++ b/src/nw4r/snd/snd_WaveArchive.cpp @@ -9,7 +9,7 @@ #include "nw4r/snd/snd_Util.h" #include "nw4r/snd/snd_WaveFile.h" -#include "nw4r/ut/binaryFileFormat.h" // ut::BinaryFileHeader +#include "nw4r/ut/ut_binaryFileFormat.h" // ut::BinaryFileHeader #include "nw4r/ut/ut_algorithm.h" // ut::AddOffsetToPtr #include From 5797f4cf8a3e9bd41452263413cfdabcf3923f4c Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 22:08:22 +0200 Subject: [PATCH 57/91] snd_StrmSound OK --- config/SOUE01/symbols.txt | 18 +++++++++--------- configure.py | 2 +- include/nw4r/snd/snd_StrmSound.h | 2 ++ src/nw4r/snd/snd_StrmSound.cpp | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index aa953c96..aaa2e8fb 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25703,13 +25703,13 @@ UpdateMoveValue__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480870; // type:func UpdateParam__Q44nw4r3snd6detail9StrmSoundFv = .text:0x804808F0; // type:function size:0xE0 SetTrackVolume__Q44nw4r3snd6detail9StrmSoundFUlfi = .text:0x804809D0; // type:function size:0x144 Shutdown__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480B20; // type:function size:0x9C -__dt__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480BC0; // type:function size:0x5C +__dt__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480BC0; // type:function size:0x5C scope:weak OnUpdatePlayerPriority__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480C20; // type:function size:0xE4 IsAttachedTempSpecialHandle__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480D10; // type:function size:0x14 DetachTempSpecialHandle__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480D30; // type:function size:0x8 -GetBasicPlayer__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480D40; // type:function size:0x8 -GetBasicPlayer__Q44nw4r3snd6detail9StrmSoundCFv = .text:0x80480D50; // type:function size:0x8 -IsPrepared__Q44nw4r3snd6detail9StrmSoundCFv = .text:0x80480D60; // type:function size:0x8 +GetBasicPlayer__Q44nw4r3snd6detail9StrmSoundFv = .text:0x80480D40; // type:function size:0x8 scope:weak +GetBasicPlayer__Q44nw4r3snd6detail9StrmSoundCFv = .text:0x80480D50; // type:function size:0x8 scope:weak +IsPrepared__Q44nw4r3snd6detail9StrmSoundCFv = .text:0x80480D60; // type:function size:0x8 scope:weak GetRuntimeTypeInfo__Q44nw4r3snd6detail9StrmSoundCFv = .text:0x80480D70; // type:function size:0x8 scope:weak __sinit_\snd_StrmSound_cpp = .text:0x80480D80; // type:function size:0xC scope:local __ct__Q34nw4r3snd15StrmSoundHandleFPQ34nw4r3snd11SoundHandle = .text:0x80480D90; // type:function size:0xF4 @@ -38622,7 +38622,7 @@ __vt__Q34nw4r3snd9SoundHeap = .data:0x8056E200; // type:object size:0x10 __vt__Q44nw4r3snd6detail10StrmPlayer = .data:0x8056E258; // type:object size:0x48 __vt__Q54nw4r3snd6detail10StrmPlayer16StrmDataLoadTask = .data:0x8056E2A0; // type:object size:0x18 __vt__Q54nw4r3snd6detail10StrmPlayer18StrmHeaderLoadTask = .data:0x8056E2B8; // type:object size:0x18 -lbl_8056E2D0 = .data:0x8056E2D0; // type:object size:0x38 +__vt__Q44nw4r3snd6detail9StrmSound = .data:0x8056E2D0; // type:object size:0x38 @5068 = .data:0x8056E308; // type:object size:0x24 scope:local __vt__Q44nw4r3snd6detail5Voice = .data:0x8056E32C; // type:object size:0x14 PanTableTable__Q44nw4r3snd6detail4Util = .data:0x8056E340; // type:object size:0xC @@ -42436,7 +42436,7 @@ sInitialized__Q34nw4r3snd29@unnamed@snd_SoundSystem_cpp@ = .sbss:0x805766B8; // sMaxVoices__Q34nw4r3snd11SoundSystem = .sbss:0x805766BC; // type:object size:0x4 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail11SoundThreadFv@instance = .sbss:0x805766C0; // type:object size:0x1 scope:weak data:byte sStaticInitFlag__Q44nw4r3snd6detail10StrmPlayer = .sbss:0x805766C8; // type:object size:0x1 data:byte -lbl_805766D0 = .sbss:0x805766D0; // type:object size:0x8 data:4byte +typeInfo__Q44nw4r3snd6detail9StrmSound = .sbss:0x805766D0; // type:object size:0x4 data:4byte @GUARD@GetInstance__Q44nw4r3snd6detail11TaskManagerFv@instance = .sbss:0x805766D8; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail12VoiceManagerFv@instance = .sbss:0x805766E0; // type:object size:0x1 scope:weak data:byte typeInfo__Q44nw4r3snd6detail9WaveSound = .sbss:0x805766E8; // type:object size:0x4 data:4byte @@ -49755,9 +49755,9 @@ lbl_8057F140 = .sdata2:0x8057F140; // type:object size:0x8 align:8 data:double @5492 = .sdata2:0x8057F168; // type:object size:0x4 scope:local align:4 data:float @5765 = .sdata2:0x8057F16C; // type:object size:0x4 scope:local align:4 data:float @5766 = .sdata2:0x8057F170; // type:object size:0x4 scope:local align:4 data:float -lbl_8057F178 = .sdata2:0x8057F178; // type:object size:0x4 align:4 data:float -lbl_8057F17C = .sdata2:0x8057F17C; // type:object size:0x4 align:4 data:float -lbl_8057F180 = .sdata2:0x8057F180; // type:object size:0x8 align:8 data:double +@2698 = .sdata2:0x8057F178; // type:object size:0x4 scope:local align:4 data:float +@2727 = .sdata2:0x8057F17C; // type:object size:0x4 scope:local align:4 data:float +@2730 = .sdata2:0x8057F180; // type:object size:0x8 scope:local align:8 data:double @4083 = .sdata2:0x8057F188; // type:object size:0x4 scope:local align:4 data:float @4084 = .sdata2:0x8057F18C; // type:object size:0x4 scope:local align:4 data:float @4815 = .sdata2:0x8057F190; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index d8072128..c6ce4377 100644 --- a/configure.py +++ b/configure.py @@ -1071,7 +1071,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_StrmChannel.cpp"), Object(Matching, "nw4r/snd/snd_StrmFile.cpp"), Object(Matching, "nw4r/snd/snd_StrmPlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_StrmSound.cpp"), + Object(Matching, "nw4r/snd/snd_StrmSound.cpp"), Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_Task.cpp"), Object(Matching, "nw4r/snd/snd_TaskManager.cpp"), diff --git a/include/nw4r/snd/snd_StrmSound.h b/include/nw4r/snd/snd_StrmSound.h index db0d52d1..240659ea 100644 --- a/include/nw4r/snd/snd_StrmSound.h +++ b/include/nw4r/snd/snd_StrmSound.h @@ -80,6 +80,8 @@ namespace nw4r { namespace snd { namespace detail bool Prepare(StrmPlayer::StartOffsetType startOffsetType, s32 offset, ut::FileStream *fileStream); + + void SetTrackVolume(u32 trackFlags, f32 volume, int fadeFrames); static DebugSoundType GetSoundType() { diff --git a/src/nw4r/snd/snd_StrmSound.cpp b/src/nw4r/snd/snd_StrmSound.cpp index 480e0957..25ea0a38 100644 --- a/src/nw4r/snd/snd_StrmSound.cpp +++ b/src/nw4r/snd/snd_StrmSound.cpp @@ -17,6 +17,7 @@ #include "nw4r/snd/snd_StrmSoundHandle.h" #include "nw4r/snd/snd_MoveValue.h" +#include "nw4r/ut/ut_Lock.h" #include "nw4r/ut/ut_RuntimeTypeInfo.h" #include "nw4r/NW4RAssert.hpp" @@ -116,6 +117,22 @@ void StrmSound::UpdateParam() } } +void StrmSound::SetTrackVolume(u32 trackFlags, f32 volume, int fadeFrames) +{ + ut::AutoInterruptLock lock; + for (int trackNo = 0; trackNo < (int)ARRAY_LENGTH(mTrackVolume) && trackFlags != 0; trackNo++, trackFlags >>= 1) + { + StrmPlayer::StrmTrack *track = mStrmPlayer.GetPlayerTrack(trackNo); + if (track != NULL && ((trackFlags & 1) != 0)) + { + if (volume < 0.0f) + volume = 0.0f; + + mTrackVolume[trackNo].SetTarget(volume, fadeFrames); + } + } +} + void StrmSound::Shutdown() { BasicSound::Shutdown(); From 8f7362eb4d33cb4ac6d2f77c82826c197de9dbf8 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 22:10:58 +0200 Subject: [PATCH 58/91] snd_StrmSoundHandle OK --- configure.py | 2 +- include/nw4r/snd/snd_StrmSoundHandle.h | 2 ++ src/nw4r/snd/snd_StrmSoundHandle.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index c6ce4377..21cbaef5 100644 --- a/configure.py +++ b/configure.py @@ -1072,7 +1072,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_StrmFile.cpp"), Object(Matching, "nw4r/snd/snd_StrmPlayer.cpp"), Object(Matching, "nw4r/snd/snd_StrmSound.cpp"), - Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), + Object(Matching, "nw4r/snd/snd_StrmSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_Task.cpp"), Object(Matching, "nw4r/snd/snd_TaskManager.cpp"), Object(Matching, "nw4r/snd/snd_TaskThread.cpp"), diff --git a/include/nw4r/snd/snd_StrmSoundHandle.h b/include/nw4r/snd/snd_StrmSoundHandle.h index bebb9e40..3e92331c 100644 --- a/include/nw4r/snd/snd_StrmSoundHandle.h +++ b/include/nw4r/snd/snd_StrmSoundHandle.h @@ -7,6 +7,7 @@ #include "common.h" // nullptr +#include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/ut/ut_NonCopyable.h" // ut::NonCopyable /******************************************************************************* @@ -28,6 +29,7 @@ namespace nw4r { namespace snd // methods public: // methods + StrmSoundHandle(SoundHandle*); bool IsAttachedSound() const { return mSound != nullptr; } void DetachSound(); diff --git a/src/nw4r/snd/snd_StrmSoundHandle.cpp b/src/nw4r/snd/snd_StrmSoundHandle.cpp index 09c687d8..63c59b7b 100644 --- a/src/nw4r/snd/snd_StrmSoundHandle.cpp +++ b/src/nw4r/snd/snd_StrmSoundHandle.cpp @@ -11,7 +11,9 @@ #include "common.h" // nullptr +#include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/snd/snd_StrmSound.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" /******************************************************************************* * functions @@ -19,6 +21,29 @@ namespace nw4r { namespace snd { +StrmSoundHandle::StrmSoundHandle(SoundHandle* handle) + : mSound(nullptr) +{ + if (!handle) + return; + + detail::BasicSound *basicSound = handle->detail_GetAttachedSound(); + if (!basicSound) + return; + + if (detail::StrmSound *sound = + ut::DynamicCast(basicSound)) + { + + mSound = sound; + + if (mSound->IsAttachedTempSpecialHandle()) + mSound->DetachTempSpecialHandle(); + + mSound->mTempSpecialHandle = this; + } +} + void StrmSoundHandle::DetachSound() { if (IsAttachedSound()) From 6e38f7ad9076030730b1d311933501a72a1c88c5 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 22:12:41 +0200 Subject: [PATCH 59/91] snd_SeqSoundHandle OK --- configure.py | 2 +- include/nw4r/snd/snd_SeqSoundHandle.h | 1 + src/nw4r/snd/snd_SeqSoundHandle.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 21cbaef5..6771f437 100644 --- a/configure.py +++ b/configure.py @@ -1050,7 +1050,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SeqFile.cpp"), Object(Matching, "nw4r/snd/snd_SeqPlayer.cpp"), Object(Matching, "nw4r/snd/snd_SeqSound.cpp"), - Object(NonMatching, "nw4r/snd/snd_SeqSoundHandle.cpp"), + Object(Matching, "nw4r/snd/snd_SeqSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SeqTrack.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DActor.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DCalculator.cpp"), diff --git a/include/nw4r/snd/snd_SeqSoundHandle.h b/include/nw4r/snd/snd_SeqSoundHandle.h index 745132ad..b5e775b2 100644 --- a/include/nw4r/snd/snd_SeqSoundHandle.h +++ b/include/nw4r/snd/snd_SeqSoundHandle.h @@ -27,6 +27,7 @@ namespace nw4r { namespace snd { // methods public: + SeqSoundHandle(SoundHandle*); // methods bool IsAttachedSound() const { return mSound != nullptr; } diff --git a/src/nw4r/snd/snd_SeqSoundHandle.cpp b/src/nw4r/snd/snd_SeqSoundHandle.cpp index b5562bd7..a30d8f39 100644 --- a/src/nw4r/snd/snd_SeqSoundHandle.cpp +++ b/src/nw4r/snd/snd_SeqSoundHandle.cpp @@ -12,6 +12,8 @@ #include "common.h" // nullptr #include "nw4r/snd/snd_SeqSound.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" /******************************************************************************* * functions @@ -19,6 +21,29 @@ namespace nw4r { namespace snd { +SeqSoundHandle::SeqSoundHandle(SoundHandle *handle) : + mSound (nullptr) +{ + if (!handle) + return; + + detail::BasicSound *basicSound = handle->detail_GetAttachedSound(); + if (!basicSound) + return; + + if (detail::SeqSound *sound = + ut::DynamicCast(basicSound)) + { + + mSound = sound; + + if (mSound->IsAttachedTempSpecialHandle()) + mSound->DetachTempSpecialHandle(); + + mSound->mTempSpecialHandle = this; + } +} + void SeqSoundHandle::DetachSound() { if (IsAttachedSound()) From 5bbbf093479390ea98f8324ca849f186b0948c95 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 22:26:16 +0200 Subject: [PATCH 60/91] snd_SoundStartable OK --- configure.py | 2 +- include/nw4r/snd/snd_SoundStartable.h | 19 ++++++++++++++ src/nw4r/snd/snd_SoundStartable.cpp | 38 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 6771f437..dcbcd67d 100644 --- a/configure.py +++ b/configure.py @@ -1065,7 +1065,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SoundHeap.cpp"), Object(Matching, "nw4r/snd/snd_SoundPlayer.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), + Object(Matching, "nw4r/snd/snd_SoundStartable.cpp"), Object(Matching, "nw4r/snd/snd_SoundSystem.cpp"), Object(Matching, "nw4r/snd/snd_SoundThread.cpp"), Object(Matching, "nw4r/snd/snd_StrmChannel.cpp"), diff --git a/include/nw4r/snd/snd_SoundStartable.h b/include/nw4r/snd/snd_SoundStartable.h index c438be45..5f0a70df 100644 --- a/include/nw4r/snd/snd_SoundStartable.h +++ b/include/nw4r/snd/snd_SoundStartable.h @@ -107,6 +107,11 @@ namespace nw4r { namespace snd StartResult detail_StartSound( SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo ); + StartResult detail_StartSound( + SoundHandle *pHandle, const char *label, const StartInfo *pStartInfo + ); + + // TODO: Remove StartResult detail_StartSound( SoundHandle *pHandle, u32 id, detail::BasicSound::AmbientInfo *pArgInfo, detail::ExternalSoundPlayer *pPlayer, const StartInfo *pStartInfo @@ -115,17 +120,31 @@ namespace nw4r { namespace snd StartResult detail_HoldSound( SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo ); + StartResult detail_HoldSound( + SoundHandle *pHandle, const char *label, const StartInfo *pStartInfo + ); + // TODO: Remove StartResult detail_HoldSound( SoundHandle *pHandle, u32 id, detail::BasicSound::AmbientInfo *pArgInfo, detail::ExternalSoundPlayer *pPlayer, const StartInfo *pStartInfo ); + // TODO: Remove StartResult detail_PrepareSound( SoundHandle *pHandle, u32 id, detail::BasicSound::AmbientInfo *pArgInfo, detail::ExternalSoundPlayer *pPlayer, const StartInfo *pStartInfo ); + StartResult detail_PrepareSound( + SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo + ); + StartResult detail_PrepareSound( + SoundHandle *pHandle, const char *label, + const StartInfo *pStartInfo + ); + + // TODO: Fix after removal of above functions bool StartSound(SoundHandle *pHandle, u32 id) { return detail_StartSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; } diff --git a/src/nw4r/snd/snd_SoundStartable.cpp b/src/nw4r/snd/snd_SoundStartable.cpp index 4488ef60..f098d1d8 100644 --- a/src/nw4r/snd/snd_SoundStartable.cpp +++ b/src/nw4r/snd/snd_SoundStartable.cpp @@ -31,6 +31,16 @@ SoundStartable::StartResult SoundStartable::detail_StartSound( return START_SUCCESS; } +SoundStartable::StartResult SoundStartable::detail_StartSound( + SoundHandle *pHandle, const char *label, const StartInfo *pStartInfo) +{ + u32 soundId = detail_ConvertLabelStringToSoundId(label); + if (soundId == -1) + return START_ERR_INVALID_LABEL_STRING; + + return detail_StartSound(pHandle, soundId, pStartInfo); +} + SoundStartable::StartResult SoundStartable::detail_HoldSound( SoundHandle *handle, u32 soundId, StartInfo const *startInfo) { @@ -49,4 +59,32 @@ SoundStartable::StartResult SoundStartable::detail_HoldSound( return START_SUCCESS; } +SoundStartable::StartResult SoundStartable::detail_HoldSound( + SoundHandle *pHandle, const char *label, const StartInfo *pStartInfo) +{ + u32 soundId = detail_ConvertLabelStringToSoundId(label); + if (soundId == -1) + return START_ERR_INVALID_LABEL_STRING; + + return detail_HoldSound(pHandle, soundId, pStartInfo); +} + +SoundStartable::StartResult SoundStartable::detail_PrepareSound( + SoundHandle *pHandle, u32 id, + const StartInfo *pStartInfo) +{ + return detail_SetupSound(pHandle, id, false, pStartInfo); +} + +SoundStartable::StartResult SoundStartable::detail_PrepareSound( + SoundHandle *pHandle, const char *label, + const StartInfo *pStartInfo) +{ + u32 soundId = detail_ConvertLabelStringToSoundId(label); + if (soundId == -1) + return START_ERR_INVALID_LABEL_STRING; + + return detail_PrepareSound(pHandle, soundId, pStartInfo); +} + }} // namespace nw4r::snd From e95b03506bf3e6419dd7beaf9870d6771246fbd0 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 27 May 2025 23:22:39 +0200 Subject: [PATCH 61/91] snd_SoundActor OK --- config/SOUE01/symbols.txt | 42 +++++++-------- configure.py | 2 +- include/nw4r/snd/snd_SoundActor.h | 15 +++++- include/nw4r/snd/snd_SoundArchivePlayer.h | 9 ++-- src/nw4r/snd/snd_SoundActor.cpp | 64 +++++++++++++++++++++-- 5 files changed, 101 insertions(+), 31 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index aaa2e8fb..a42c2e35 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25013,23 +25013,23 @@ __ct__Q44nw4r3snd6detail13AnimSoundImplFRQ34nw4r3snd14SoundStartablePQ44nw4r3snd __dt__Q44nw4r3snd6detail13AnimSoundImplFv = .text:0x80461780; // type:function size:0xC8 Setup__Q44nw4r3snd6detail13AnimSoundImplFPCv = .text:0x80461850; // type:function size:0xE8 Shutdown__Q44nw4r3snd6detail13AnimSoundImplFv = .text:0x80461940; // type:function size:0xA0 -FUN_804619e0 = .text:0x804619E0; // type:function size:0x1C -FUN_80461a00 = .text:0x80461A00; // type:function size:0x14C -FUN_80461b50 = .text:0x80461B50; // type:function size:0x220 -FUN_80461d70 = .text:0x80461D70; // type:function size:0x284 -FUN_80462000 = .text:0x80462000; // type:function size:0x2B0 -FUN_804622b0 = .text:0x804622B0; // type:function size:0x30C -FUN_804625c0 = .text:0x804625C0; // type:function size:0x30C -FUN_804628d0 = .text:0x804628D0; // type:function size:0x2B8 -nw4r__snd__detail__shdAnimSoundImpl__HoldEvent = .text:0x80462B90; // type:function size:0x2E0 -nw4r__snd__detail__shdAnimEventPlayer____ct = .text:0x80462E70; // type:function size:0x14 -nw4r__snd__detail__shdAnimEventPlayer____dt = .text:0x80462E90; // type:function size:0x88 -nw4r__snd__detail__AnimSoundFileReader__AnimSoundFileReader = .text:0x80462F20; // type:function size:0xC -nw4r__snd__detail__AnimSoundFileReader__Setup = .text:0x80462F30; // type:function size:0x6C -nw4r__snd__detail__AnimSoundFileReader__Shutdown = .text:0x80462FA0; // type:function size:0x10 -nw4r__snd__detail__AnimSoundFileReader__GetEventCount = .text:0x80462FB0; // type:function size:0x44 -nw4r__snd__detail__AnimSoundFileReader__GetEventRef = .text:0x80463000; // type:function size:0x58 -nw4r__snd__detail__AnimSoundFileReader__GetEvent = .text:0x80463060; // type:function size:0x74 +ResetFrame__Q44nw4r3snd6detail13AnimSoundImplFfi = .text:0x804619E0; // type:function size:0x1C +UpdateFrame__Q44nw4r3snd6detail13AnimSoundImplFfQ54nw4r3snd6detail13AnimSoundImpl13PlayDirection = .text:0x80461A00; // type:function size:0x14C +UpdateForward__Q44nw4r3snd6detail13AnimSoundImplFf = .text:0x80461B50; // type:function size:0x220 +UpdateBackward__Q44nw4r3snd6detail13AnimSoundImplFf = .text:0x80461D70; // type:function size:0x284 +UpdateTrigger__Q44nw4r3snd6detail13AnimSoundImplFPCQ44nw4r3snd6detail12AnimEventReflQ54nw4r3snd6detail13AnimSoundImpl13PlayDirection = .text:0x80462000; // type:function size:0x2B0 +UpdateForwardRange__Q44nw4r3snd6detail13AnimSoundImplFPCQ44nw4r3snd6detail12AnimEventRefl = .text:0x804622B0; // type:function size:0x30C +UpdateBackwardRange__Q44nw4r3snd6detail13AnimSoundImplFPCQ44nw4r3snd6detail12AnimEventRefl = .text:0x804625C0; // type:function size:0x30C +StartEvent__Q44nw4r3snd6detail13AnimSoundImplFPCQ44nw4r3snd6detail9AnimEventb = .text:0x804628D0; // type:function size:0x2B8 +HoldEvent__Q44nw4r3snd6detail13AnimSoundImplFPCQ44nw4r3snd6detail9AnimEventb = .text:0x80462B90; // type:function size:0x2E0 +__ct__Q44nw4r3snd6detail15AnimEventPlayerFv = .text:0x80462E70; // type:function size:0x14 +__dt__Q44nw4r3snd6detail15AnimEventPlayerFv = .text:0x80462E90; // type:function size:0x88 +__ct__Q44nw4r3snd6detail19AnimSoundFileReaderFv = .text:0x80462F20; // type:function size:0xC +Setup__Q44nw4r3snd6detail19AnimSoundFileReaderFPCv = .text:0x80462F30; // type:function size:0x6C +Shutdown__Q44nw4r3snd6detail19AnimSoundFileReaderFv = .text:0x80462FA0; // type:function size:0x10 +GetEventCount__Q44nw4r3snd6detail19AnimSoundFileReaderCFv = .text:0x80462FB0; // type:function size:0x44 +GetEventRef__Q44nw4r3snd6detail19AnimSoundFileReaderCFUl = .text:0x80463000; // type:function size:0x58 +GetEvent__Q44nw4r3snd6detail19AnimSoundFileReaderCFPCQ44nw4r3snd6detail12AnimEventRef = .text:0x80463060; // type:function size:0x74 __ct__Q44nw4r3snd6detail9AxManagerFv = .text:0x804630E0; // type:function size:0x218 __ct__Q34nw4r2ut30LinkListFv = .text:0x80463300; // type:function size:0x18 scope:weak __dt__Q34nw4r2ut30LinkListFv = .text:0x80463320; // type:function size:0x58 scope:weak @@ -25483,7 +25483,7 @@ SetupSound__Q34nw4r3snd10SoundActorFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14So detail_SetupSoundWithAmbientInfo__Q34nw4r3snd10SoundActorFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPQ54nw4r3snd6detail10BasicSound11AmbientInfoPv = .text:0x804761F0; // type:function size:0x1C detail_SetupSound__Q34nw4r3snd10SoundActorFPQ34nw4r3snd11SoundHandleUlbPCQ44nw4r3snd14SoundStartable9StartInfo = .text:0x80476210; // type:function size:0x38 detail_ConvertLabelStringToSoundId__Q34nw4r3snd10SoundActorFPCc = .text:0x80476250; // type:function size:0x14 -detail_ConvertLabelStringToSoundId__Q34nw4r3snd18SoundArchivePlayerFPCc = .text:0x80476270; // type:function size:0x8 +detail_ConvertLabelStringToSoundId__Q34nw4r3snd18SoundArchivePlayerFPCc = .text:0x80476270; // type:function size:0x8 scope:weak __ct__Q34nw4r3snd12SoundArchiveFv = .text:0x80476280; // type:function size:0x24 __dt__Q34nw4r3snd12SoundArchiveFv = .text:0x804762B0; // type:function size:0x40 IsAvailable__Q34nw4r3snd12SoundArchiveCFv = .text:0x804762F0; // type:function size:0x14 @@ -38612,7 +38612,7 @@ __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 -lbl_8056E170 = .data:0x8056E170; // type:object size:0x20 +__vt__Q34nw4r3snd10SoundActor = .data:0x8056E170; // type:object size:0x1C __vt__Q34nw4r3snd12SoundArchive = .data:0x8056E190; // type:object size:0x20 lbl_8056E1B0 = .data:0x8056E1B0; // type:object size:0x30 WSDCallback = .data:0x8056E1E0; // type:object size:0x10 @@ -49743,8 +49743,8 @@ lbl_8057F11C = .sdata2:0x8057F11C; // type:object size:0x4 align:4 data:float lbl_8057F120 = .sdata2:0x8057F120; // type:object size:0x4 align:4 data:float lbl_8057F128 = .sdata2:0x8057F128; // type:object size:0x4 align:4 data:float lbl_8057F12C = .sdata2:0x8057F12C; // type:object size:0x4 align:4 data:float -lbl_8057F130 = .sdata2:0x8057F130; // type:object size:0x4 align:4 data:float -lbl_8057F134 = .sdata2:0x8057F134; // type:object size:0x4 align:4 data:float +@3454 = .sdata2:0x8057F130; // type:object size:0x4 scope:local align:4 data:float +@3455 = .sdata2:0x8057F134; // type:object size:0x4 scope:local align:4 data:float lbl_8057F138 = .sdata2:0x8057F138; // type:object size:0x4 align:4 data:float lbl_8057F140 = .sdata2:0x8057F140; // type:object size:0x8 align:8 data:double @2452 = .sdata2:0x8057F148; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index dcbcd67d..7c129f6d 100644 --- a/configure.py +++ b/configure.py @@ -1057,7 +1057,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_Sound3DEngine.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DListener.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DManager.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundActor.cpp"), + Object(Matching, "nw4r/snd/snd_SoundActor.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchiveFile.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), diff --git a/include/nw4r/snd/snd_SoundActor.h b/include/nw4r/snd/snd_SoundActor.h index eeb1941d..1a608e2e 100644 --- a/include/nw4r/snd/snd_SoundActor.h +++ b/include/nw4r/snd/snd_SoundActor.h @@ -30,8 +30,17 @@ namespace nw4r { namespace snd // methods public: // cdtors - SoundActor(); + SoundActor(SoundArchivePlayer &player); + virtual ~SoundActor(); + virtual u32 detail_ConvertLabelStringToSoundId(const char* label) override; + virtual StartResult detail_SetupSound(SoundHandle *pHandle, u32 soundId, bool holdFlag, const StartInfo *pStartInfo) override; + + + virtual StartResult SetupSound(SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void*); + virtual StartResult detail_SetupSoundWithAmbientInfo(SoundHandle*, u32, const StartInfo*, detail::BasicSound::AmbientInfo*, void*); + + // methods detail::ExternalSoundPlayer *detail_GetActorPlayer(int actorPlayerId) { @@ -46,6 +55,10 @@ namespace nw4r { namespace snd return mActorParam; } + void StopAllSound(int fadeFrames); + void PauseAllSound(bool flag, int fadeFrames); + int GetPlayingSoundCount(int playerId) const; + // static members public: static int const ACTOR_PLAYER_COUNT = 4; diff --git a/include/nw4r/snd/snd_SoundArchivePlayer.h b/include/nw4r/snd/snd_SoundArchivePlayer.h index f8126d73..8724fde1 100644 --- a/include/nw4r/snd/snd_SoundArchivePlayer.h +++ b/include/nw4r/snd/snd_SoundArchivePlayer.h @@ -222,6 +222,11 @@ namespace nw4r { namespace snd void UpdateCommonSoundParam(detail::BasicSound *sound, SoundArchive::SoundInfo const *commonInfo); + SoundStartable::StartResult detail_SetupSoundImpl( + SoundHandle *handle, u32 soundId, + detail::BasicSound::AmbientInfo *ambientArgInfo, SoundActor *actor, + bool holdFlag, SoundStartable::StartInfo const *startInfo); + private: template Sound *AllocSound( @@ -229,10 +234,6 @@ namespace nw4r { namespace snd int priority, int ambientPriority, detail::BasicSound::AmbientInfo *ambientArgInfo); - SoundStartable::StartResult detail_SetupSoundImpl( - SoundHandle *handle, u32 soundId, - detail::BasicSound::AmbientInfo *ambientArgInfo, SoundActor *actor, - bool holdFlag, SoundStartable::StartInfo const *startInfo); SoundStartable::StartResult PrepareSeqImpl( detail::SeqSound *sound, SoundArchive::SoundInfo const *commonInfo, SoundArchive::SeqSoundInfo const *info, diff --git a/src/nw4r/snd/snd_SoundActor.cpp b/src/nw4r/snd/snd_SoundActor.cpp index c390dc15..6c286dc9 100644 --- a/src/nw4r/snd/snd_SoundActor.cpp +++ b/src/nw4r/snd/snd_SoundActor.cpp @@ -8,9 +8,65 @@ #include "nw4r/snd/snd_SoundArchivePlayer.h" -nw4r::snd::SoundActor::SoundActor() : - mSoundArchivePlayer (*new SoundArchivePlayer) +namespace nw4r { namespace snd { + +SoundActor::SoundActor(SoundArchivePlayer &player) : + mSoundArchivePlayer (player) { - // DECOMP_FORCE_CLASS_METHOD - (void)mSoundArchivePlayer.detail_ConvertLabelStringToSoundId(nullptr); + + for (int i = 0; i < ACTOR_PLAYER_COUNT; i++) + { + mActorPlayer[i].SetPlayableSoundCount(i == 0 ? INT_MAX : 1); + } } + +SoundActor::~SoundActor() +{ + for (int i = 0; i < ACTOR_PLAYER_COUNT; i++) + { + mActorPlayer[i].DetachSoundActorAll(this); + } +} + +void SoundActor::StopAllSound(int fadeFrames) +{ + for (int i = 0; i < ACTOR_PLAYER_COUNT; i++) + { + mActorPlayer[i].StopAllSound(fadeFrames); + } +} + +void SoundActor::PauseAllSound(bool flag, int fadeFrames) +{ + for (int i = 0; i < ACTOR_PLAYER_COUNT; i++) + { + mActorPlayer[i].PauseAllSound(flag, fadeFrames); + } +} + +int SoundActor::GetPlayingSoundCount(int playerId) const +{ + return mActorPlayer[playerId].GetPlayingSoundCount(); +} + +SoundStartable::StartResult SoundActor::SetupSound(SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void* arg) +{ + return mSoundArchivePlayer.detail_SetupSoundImpl(pHandle, soundId, nullptr, this, *(bool*)arg, pStartInfo); +} + +SoundStartable::StartResult SoundActor::detail_SetupSoundWithAmbientInfo(SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, detail::BasicSound::AmbientInfo *pAmbientInfo, void* arg) +{ + return mSoundArchivePlayer.detail_SetupSoundImpl(pHandle, soundId, pAmbientInfo, this, *(bool*)arg, pStartInfo); +} + +SoundStartable::StartResult SoundActor::detail_SetupSound(SoundHandle *pHandle, u32 soundId, bool holdFlag, const StartInfo *pStartInfo) +{ + return SetupSound(pHandle, soundId, pStartInfo, &holdFlag); +} + +u32 SoundActor::detail_ConvertLabelStringToSoundId(const char* label) +{ + return mSoundArchivePlayer.detail_ConvertLabelStringToSoundId(label); +} + +}} From 23fe65685a9662f1047726c8cf83ec757234b0ce Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 28 May 2025 00:25:36 +0200 Subject: [PATCH 62/91] snd_Sound3DListener OK --- config/SOUE01/symbols.txt | 8 ++-- configure.py | 2 +- include/nw4r/snd/snd_Sound3DEngine.h | 34 ++++++++++++++ include/nw4r/snd/snd_Sound3DListener.h | 36 +++++++++------ include/nw4r/snd/snd_Sound3DManager.h | 29 ++++++------ src/nw4r/snd/snd_Sound3DEngine.cpp | 35 ++++++++++++++- src/nw4r/snd/snd_Sound3DListener.cpp | 61 ++++++++++++++++++++++++++ src/nw4r/snd/snd_Sound3DManager.cpp | 26 ++++++----- 8 files changed, 188 insertions(+), 43 deletions(-) create mode 100644 include/nw4r/snd/snd_Sound3DEngine.h diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index a42c2e35..d23c8247 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -19875,7 +19875,7 @@ fn_8035BB50 = .text:0x8035BB50; // type:function size:0x8 fn_8035BB60 = .text:0x8035BB60; // type:function size:0x8 fn_8035BB70 = .text:0x8035BB70; // type:function size:0x8 fn_8035BB80 = .text:0x8035BB80; // type:function size:0x3C -fn_8035BBC0 = .text:0x8035BBC0; // type:function size:0x40 +__dt__Q34nw4r3snd13Sound3DEngineFv = .text:0x8035BBC0; // type:function size:0x40 fn_8035BC00 = .text:0x8035BC00; // type:function size:0x428 fn_8035C030 = .text:0x8035C030; // type:function size:0x188 fn_8035C1C0 = .text:0x8035C1C0; // type:function size:0xDC @@ -49738,9 +49738,9 @@ lbl_8057F104 = .sdata2:0x8057F104; // type:object size:0x4 align:4 data:float lbl_8057F108 = .sdata2:0x8057F108; // type:object size:0x4 align:4 data:float lbl_8057F10C = .sdata2:0x8057F10C; // type:object size:0x4 align:4 data:float lbl_8057F110 = .sdata2:0x8057F110; // type:object size:0x4 align:4 data:float -lbl_8057F118 = .sdata2:0x8057F118; // type:object size:0x4 align:4 data:float -lbl_8057F11C = .sdata2:0x8057F11C; // type:object size:0x4 align:4 data:float -lbl_8057F120 = .sdata2:0x8057F120; // type:object size:0x4 align:4 data:float +@1266 = .sdata2:0x8057F118; // type:object size:0x4 scope:local align:4 data:float +@1267 = .sdata2:0x8057F11C; // type:object size:0x4 scope:local align:4 data:float +@1268 = .sdata2:0x8057F120; // type:object size:0x4 scope:local align:4 data:float lbl_8057F128 = .sdata2:0x8057F128; // type:object size:0x4 align:4 data:float lbl_8057F12C = .sdata2:0x8057F12C; // type:object size:0x4 align:4 data:float @3454 = .sdata2:0x8057F130; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index 7c129f6d..72596482 100644 --- a/configure.py +++ b/configure.py @@ -1055,7 +1055,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_Sound3DActor.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DCalculator.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DEngine.cpp"), - Object(NonMatching, "nw4r/snd/snd_Sound3DListener.cpp"), + Object(Matching, "nw4r/snd/snd_Sound3DListener.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DManager.cpp"), Object(Matching, "nw4r/snd/snd_SoundActor.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchive.cpp"), diff --git a/include/nw4r/snd/snd_Sound3DEngine.h b/include/nw4r/snd/snd_Sound3DEngine.h new file mode 100644 index 00000000..3cfd4168 --- /dev/null +++ b/include/nw4r/snd/snd_Sound3DEngine.h @@ -0,0 +1,34 @@ +#ifndef NW4R_SND_SOUND_3D_ENGINE_H +#define NW4R_SND_SOUND_3D_ENGINE_H + +#include "nw4r/math.h" +#include "nw4r/types_nw4r.h" +#include "nw4r/snd/snd_Sound3DManager.h" + + +namespace nw4r { +namespace snd { + +class Sound3DManager; + +class Sound3DEngine { +public: + Sound3DEngine(); + virtual ~Sound3DEngine() {} + + virtual void UpdateAmbientParam(const Sound3DManager*, const Sound3DParam*, u32, int, SoundAmbientParam*); + virtual void GetAmbientPriority(const Sound3DManager*, const Sound3DParam*, u32); + virtual s32 GetRequiredVoiceOutCount(const Sound3DManager*, const Sound3DParam*, u32); + virtual void UpdateAmbientParam(const Sound3DManager*, const Sound3DParam*, u32, u32, SoundAmbientParam*); + +private: + f32 mSpeakerAngleStereo; // at 0x04 + f32 mFrontSpeakerAngleDpl2; // at 0x08 + f32 mRearSpeakerAngleDpl2; // at 0x0C + f32 mInitPan; // at 0x10 +}; + +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_Sound3DListener.h b/include/nw4r/snd/snd_Sound3DListener.h index 911279ac..414343e7 100644 --- a/include/nw4r/snd/snd_Sound3DListener.h +++ b/include/nw4r/snd/snd_Sound3DListener.h @@ -1,8 +1,9 @@ #ifndef NW4R_SND_SOUND_3D_LISTENER_H #define NW4R_SND_SOUND_3D_LISTENER_H -#include "nw4r/math.h" +#include "common.h" #include "nw4r/types_nw4r.h" +#include "nw4r/math.h" namespace nw4r { namespace snd { @@ -15,32 +16,39 @@ public: return mMtx; } + void SetMatrix(const math::MTX34 &mtx); + f32 GetInteriorSize() const { return mInteriorSize; } - void SetInteriorSize(f32 size) { - mInteriorSize = size; - } + void SetInteriorSize(f32 size); f32 GetMaxVolumeDistance() const { return mMaxVolumeDistance; } - void SetMaxVolumeDistance(f32 distance) { - mMaxVolumeDistance = distance; - } + void SetMaxVolumeDistance(f32 distance); f32 GetUnitDistance() const { return mUnitDistance; } - void SetUnitDistance(f32 distance) { - mUnitDistance = distance; - } + void SetUnitDistance(f32 distance); + + void SetUnitBiquadFilterValue(f32 value); + void SetUnitBiquadFilterMax(f32 value); private: - math::MTX34 mMtx; // at 0x0 - f32 mInteriorSize; // at 0x30 - f32 mMaxVolumeDistance; // at 0x34 - f32 mUnitDistance; // at 0x38 + math::MTX34 mMtx; // at 0x0 + math::VEC3 mPosition; // at 0x30 + math::VEC3 mVelocity; // at 0x3C + f32 mInteriorSize; // at 0x48 + f32 mMaxVolumeDistance; // at 0x4C + f32 mUnitDistance; // at 0x50 + UNKWORD field_0x54; // at 0x54 + u8 mSkipVelocityUpdate; // at 0x58 + f32 mUnitBiquadFilterValue; // at 0x5C + f32 mUnitBiquadFilterMax; // at 0x60 + UNKWORD field_0x64; // at 0x64 + UNKWORD field_0x68; // at 0x68 }; } // namespace snd diff --git a/include/nw4r/snd/snd_Sound3DManager.h b/include/nw4r/snd/snd_Sound3DManager.h index 2ec2204c..8609b453 100644 --- a/include/nw4r/snd/snd_Sound3DManager.h +++ b/include/nw4r/snd/snd_Sound3DManager.h @@ -10,6 +10,19 @@ namespace nw4r { namespace snd { +struct Sound3DParam +{ + /* 0x00 */ u8 _0x00[0x18]; + /* 0x18 */ UNKWORD field_0x18; + /* 0x1C */ u8 field_0x1C; + /* 0x1D */ u8 field_0x1D; + /* 0x1E */ u8 field_0x1E; + /* 0x20 */ UNKWORD field_0x20; + /* 0x24 */ UNKWORD field_0x24; + + Sound3DParam(); +}; + class Sound3DManager : public detail::BasicSound::AmbientInfo::AmbientParamUpdateCallback, public detail::BasicSound::AmbientInfo::AmbientArgAllocaterCallback { public: @@ -51,10 +64,6 @@ public: mMaxPriorityReduction = max; } - f32 GetPanRange() const { - return mPanRange; - } - private: enum ParamDecayCurve { DECAY_CURVE_NONE, @@ -63,16 +72,10 @@ private: }; private: - detail::InstancePool mParamPool; // at 0x8 + detail::InstancePool mParamPool; // at 0x8 Sound3DListener *mListener; // at 0xC - s32 mMaxPriorityReduction; // at 0x10 - - f32 mSpeakerAngleStereo; // at 0x14 - f32 mFrontSpeakerAngleDpl2; // at 0x18 - f32 mRearSpeakerAngleDpl2; // at 0x1C - - f32 mInitPan; // at 0x20 - f32 mPanRange; // at 0x24 + u8 _0x10[0x1C - 0x10]; + s32 mMaxPriorityReduction; // at 0x1C }; } // namespace snd diff --git a/src/nw4r/snd/snd_Sound3DEngine.cpp b/src/nw4r/snd/snd_Sound3DEngine.cpp index e6ddfd4d..f398c5a4 100644 --- a/src/nw4r/snd/snd_Sound3DEngine.cpp +++ b/src/nw4r/snd/snd_Sound3DEngine.cpp @@ -1 +1,34 @@ -// #include "nw4r/snd/snd_Sound3DEngine.h" +#include "nw4r/snd/snd_Sound3DEngine.h" + +namespace nw4r { namespace snd { + +Sound3DEngine::Sound3DEngine() + : mSpeakerAngleStereo(NW4R_MATH_PI / 4), + mFrontSpeakerAngleDpl2(NW4R_MATH_PI / 6), + mRearSpeakerAngleDpl2(2 * NW4R_MATH_PI / 3), + mInitPan(0.0f) {} + +void Sound3DEngine::UpdateAmbientParam( + const Sound3DManager *mgr, const Sound3DParam *pParam, u32, u32 flags, SoundAmbientParam *pAmbientParam +) { + if (flags & 1) + pAmbientParam->volume = 0.0f; + + if (flags & 8) + pAmbientParam->priority = - mgr->GetMaxPriorityReduction(); +} + +void Sound3DEngine::UpdateAmbientParam(const Sound3DManager* mgr, const Sound3DParam* param, u32, int, SoundAmbientParam*) { + +} + +void Sound3DEngine::GetAmbientPriority(const Sound3DManager*, const Sound3DParam*, u32) { + +} + +s32 Sound3DEngine::GetRequiredVoiceOutCount(const Sound3DManager*, const Sound3DParam*, u32) { + return 1; +} + + +}} diff --git a/src/nw4r/snd/snd_Sound3DListener.cpp b/src/nw4r/snd/snd_Sound3DListener.cpp index 9d6a9533..08d64440 100644 --- a/src/nw4r/snd/snd_Sound3DListener.cpp +++ b/src/nw4r/snd/snd_Sound3DListener.cpp @@ -1 +1,62 @@ #include "nw4r/snd/snd_Sound3DListener.h" + +namespace nw4r { +namespace snd { + +Sound3DListener::Sound3DListener() { + mPosition.x = 0.0f; + mPosition.y = 0.0f; + mPosition.z = 0.0f; + mVelocity.x = 0.0f; + mVelocity.y = 0.0f; + mVelocity.z = 0.0f; + mInteriorSize = 1.0f; + mMaxVolumeDistance = 1.0f; + mUnitDistance = 1.0f; + field_0x54 = 0; + mSkipVelocityUpdate = 1; + mUnitBiquadFilterValue = 0.5f; + mUnitBiquadFilterMax = 1.0f; + field_0x64 = 0; + field_0x68 = 0; + math::MTX34Zero(&mMtx); +} + +void Sound3DListener::SetMatrix(const math::MTX34 &mtx) { + math::VEC3 prevPosition = mPosition; + + mPosition.x = -(mtx._00 * mtx._03 + mtx._10 * mtx._13 + mtx._20 * mtx._23); + mPosition.y = -(mtx._01 * mtx._03 + mtx._11 * mtx._13 + mtx._21 * mtx._23); + mPosition.z = -(mtx._02 * mtx._03 + mtx._12 * mtx._13 + mtx._22 * mtx._23); + + if (mSkipVelocityUpdate) { + mMtx = mtx; + mSkipVelocityUpdate = 0; + } else { + mMtx = mtx; + VEC3Sub(&mVelocity, &mPosition, &prevPosition); + } +} + +void Sound3DListener::SetInteriorSize(f32 size) { + mInteriorSize = size; +} + +void Sound3DListener::SetMaxVolumeDistance(f32 distance) { + mMaxVolumeDistance = distance; +} + +void Sound3DListener::SetUnitDistance(f32 distance) { + mUnitDistance = distance; +} + +void Sound3DListener::SetUnitBiquadFilterValue(f32 value) { + mUnitBiquadFilterValue = value; +} + +void Sound3DListener::SetUnitBiquadFilterMax(f32 value) { + mUnitBiquadFilterMax = value; +} + +} // namespace snd +} // namespace nw4r diff --git a/src/nw4r/snd/snd_Sound3DManager.cpp b/src/nw4r/snd/snd_Sound3DManager.cpp index 8a75b573..9fe22d6d 100644 --- a/src/nw4r/snd/snd_Sound3DManager.cpp +++ b/src/nw4r/snd/snd_Sound3DManager.cpp @@ -36,12 +36,7 @@ inline f32 SolveLinerFunction(f32 x, f32 dAngle, f32 cAngle, f32 dFactor, } // namespace Sound3DManager::Sound3DManager() - : mMaxPriorityReduction(32), - mSpeakerAngleStereo(NW4R_MATH_PI / 4), - mFrontSpeakerAngleDpl2(NW4R_MATH_PI / 6), - mRearSpeakerAngleDpl2(2 * NW4R_MATH_PI / 3), - mInitPan(0.0f), - mPanRange(0.9f) {} + {} u32 Sound3DManager::GetRequiredMemSize(const SoundArchive* pArchive) { u32 numParam = 0; @@ -53,7 +48,7 @@ u32 Sound3DManager::GetRequiredMemSize(const SoundArchive* pArchive) { numParam += playerInfo.waveSoundCount; } - return numParam * sizeof(Sound3DActorParam); + return numParam * sizeof(Sound3DParam); } bool Sound3DManager::Setup(const SoundArchive* pArchive, void* pBuffer, @@ -83,7 +78,7 @@ void Sound3DManager::Update(SoundParam* pParam, u32 id, SoundHandle* pHandle, f32 angle; f32 panLR, panFR; f32 pan, surroundPan; - +#if 0 const Sound3DActorParam* pActorParam = static_cast(pArg); @@ -267,10 +262,11 @@ void Sound3DManager::Update(SoundParam* pParam, u32 id, SoundHandle* pHandle, pParam->priority = -static_cast((1.0f - volume) * GetMaxPriorityReduction()); } +#endif } void* Sound3DManager::detail_AllocAmbientArg(u32 size) { - if (size != sizeof(Sound3DActorParam)) { + if (size != sizeof(Sound3DParam)) { return NULL; } @@ -281,7 +277,17 @@ void Sound3DManager::detail_FreeAmbientArg(void* pArg, const detail::BasicSound* pSound) { #pragma unused(pSound) - mParamPool.Free(static_cast(pArg)); + mParamPool.Free(static_cast(pArg)); +} + +Sound3DParam::Sound3DParam() +{ + field_0x18 = 0; + field_0x1C = 1; + field_0x1D = 0x80; + field_0x1E = 0; + field_0x20 = 0; + field_0x24 = 0; } Sound3DManager::Sound3DActorParam::Sound3DActorParam() : userParam(-1) { From 7dde7fec51b43b82ee558e6ca963ce5f1d420754 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 28 May 2025 01:18:53 +0200 Subject: [PATCH 63/91] snd_Sound3DEngine OK --- config/SOUE01/symbols.txt | 12 +-- configure.py | 2 +- include/nw4r/snd/snd_Sound3DCalculator.h | 44 ++++++++++ include/nw4r/snd/snd_Sound3DEngine.h | 8 +- include/nw4r/snd/snd_Sound3DListener.h | 4 +- include/nw4r/snd/snd_Sound3DManager.h | 28 ++++-- src/nw4r/snd/snd_Sound3DCalculator.cpp | 2 +- src/nw4r/snd/snd_Sound3DEngine.cpp | 106 +++++++++++++++++++---- src/nw4r/snd/snd_Sound3DListener.cpp | 26 +++--- 9 files changed, 178 insertions(+), 54 deletions(-) create mode 100644 include/nw4r/snd/snd_Sound3DCalculator.h diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index d23c8247..d8b54fc0 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -38610,7 +38610,7 @@ __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 +__vt__Q34nw4r3snd13Sound3DEngine = .data:0x8056E118; // type:object size:0x1C lbl_8056E138 = .data:0x8056E138; // type:object size:0x38 __vt__Q34nw4r3snd10SoundActor = .data:0x8056E170; // type:object size:0x1C __vt__Q34nw4r3snd12SoundArchive = .data:0x8056E190; // type:object size:0x20 @@ -49733,11 +49733,11 @@ lbl_8057F0F0 = .sdata2:0x8057F0F0; // type:object size:0x4 align:4 data:float lbl_8057F0F4 = .sdata2:0x8057F0F4; // type:object size:0x4 align:4 data:float lbl_8057F0F8 = .sdata2:0x8057F0F8; // type:object size:0x4 align:4 data:float lbl_8057F0FC = .sdata2:0x8057F0FC; // type:object size:0x4 align:4 data:float -lbl_8057F100 = .sdata2:0x8057F100; // type:object size:0x4 align:4 data:float -lbl_8057F104 = .sdata2:0x8057F104; // type:object size:0x4 align:4 data:float -lbl_8057F108 = .sdata2:0x8057F108; // type:object size:0x4 align:4 data:float -lbl_8057F10C = .sdata2:0x8057F10C; // type:object size:0x4 align:4 data:float -lbl_8057F110 = .sdata2:0x8057F110; // type:object size:0x4 align:4 data:float +@2216 = .sdata2:0x8057F100; // type:object size:0x4 scope:local align:4 data:float +@2217 = .sdata2:0x8057F104; // type:object size:0x4 scope:local align:4 data:float +@2218 = .sdata2:0x8057F108; // type:object size:0x4 scope:local align:4 data:float +@2219 = .sdata2:0x8057F10C; // type:object size:0x4 scope:local align:4 data:float +@2392 = .sdata2:0x8057F110; // type:object size:0x4 scope:local align:4 data:float @1266 = .sdata2:0x8057F118; // type:object size:0x4 scope:local align:4 data:float @1267 = .sdata2:0x8057F11C; // type:object size:0x4 scope:local align:4 data:float @1268 = .sdata2:0x8057F120; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index 72596482..d2ca639e 100644 --- a/configure.py +++ b/configure.py @@ -1054,7 +1054,7 @@ config.libs = [ 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"), + Object(Matching, "nw4r/snd/snd_Sound3DEngine.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DListener.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DManager.cpp"), Object(Matching, "nw4r/snd/snd_SoundActor.cpp"), diff --git a/include/nw4r/snd/snd_Sound3DCalculator.h b/include/nw4r/snd/snd_Sound3DCalculator.h new file mode 100644 index 00000000..b2c578d5 --- /dev/null +++ b/include/nw4r/snd/snd_Sound3DCalculator.h @@ -0,0 +1,44 @@ +#ifndef NW4R_SND_SOUND_3D_CALCULATOR_H +#define NW4R_SND_SOUND_3D_CALCULATOR_H + +#include "nw4r/snd/snd_Sound3DManager.h" + +namespace nw4r { +namespace snd { + +class Sound3DCalculator { +public: + struct CalcPanParam { +#if 0 + f32 mSpeakerAngleStereo; // at 0x04 + f32 mFrontSpeakerAngleDpl2; // at 0x08 + f32 mRearSpeakerAngleDpl2; // at 0x0C + f32 mInitPan; // at 0x10 +#endif + f32 field_0x00; + f32 field_0x04; + f32 field_0x08; + f32 field_0x0C; + + CalcPanParam() + : field_0x00(NW4R_MATH_PI / 4), + field_0x04(NW4R_MATH_PI / 6), + field_0x08(2 * NW4R_MATH_PI / 3), + field_0x0C(0.0f) {} + }; + + static void + CalcVolumeAndPriority(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, float *, int *); + static void + CalcPan(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, const Sound3DCalculator::CalcPanParam &, float *pan, float *surroundPan); + static void CalcPitch(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, float *); + static void CalcBiquadFilterValue(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, float *); + static void CalcPanDpl2(const nw4r::math::VEC3 &, float, float, float, float, float, float, float *, float *); + static void CalcPanStereo(const nw4r::math::VEC3 &, float, float, float, float, float *, float *); + static void CalcAngleAndDistance(const nw4r::math::VEC3 &, float, float, float *, float *); +}; + +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_Sound3DEngine.h b/include/nw4r/snd/snd_Sound3DEngine.h index 3cfd4168..ae15de01 100644 --- a/include/nw4r/snd/snd_Sound3DEngine.h +++ b/include/nw4r/snd/snd_Sound3DEngine.h @@ -4,6 +4,7 @@ #include "nw4r/math.h" #include "nw4r/types_nw4r.h" #include "nw4r/snd/snd_Sound3DManager.h" +#include "nw4r/snd/snd_Sound3DCalculator.h" namespace nw4r { @@ -17,15 +18,12 @@ public: virtual ~Sound3DEngine() {} virtual void UpdateAmbientParam(const Sound3DManager*, const Sound3DParam*, u32, int, SoundAmbientParam*); - virtual void GetAmbientPriority(const Sound3DManager*, const Sound3DParam*, u32); + virtual s32 GetAmbientPriority(const Sound3DManager*, const Sound3DParam*, u32); virtual s32 GetRequiredVoiceOutCount(const Sound3DManager*, const Sound3DParam*, u32); virtual void UpdateAmbientParam(const Sound3DManager*, const Sound3DParam*, u32, u32, SoundAmbientParam*); private: - f32 mSpeakerAngleStereo; // at 0x04 - f32 mFrontSpeakerAngleDpl2; // at 0x08 - f32 mRearSpeakerAngleDpl2; // at 0x0C - f32 mInitPan; // at 0x10 + Sound3DCalculator::CalcPanParam mPanParam; // at 0x04 }; } // namespace snd diff --git a/include/nw4r/snd/snd_Sound3DListener.h b/include/nw4r/snd/snd_Sound3DListener.h index 414343e7..9162cc86 100644 --- a/include/nw4r/snd/snd_Sound3DListener.h +++ b/include/nw4r/snd/snd_Sound3DListener.h @@ -2,6 +2,7 @@ #define NW4R_SND_SOUND_3D_LISTENER_H #include "common.h" #include "nw4r/types_nw4r.h" +#include "nw4r/ut/ut_LinkList.h" #include "nw4r/math.h" @@ -47,8 +48,7 @@ private: u8 mSkipVelocityUpdate; // at 0x58 f32 mUnitBiquadFilterValue; // at 0x5C f32 mUnitBiquadFilterMax; // at 0x60 - UNKWORD field_0x64; // at 0x64 - UNKWORD field_0x68; // at 0x68 + ut::LinkListNode mNode; // at 0x64 }; } // namespace snd diff --git a/include/nw4r/snd/snd_Sound3DManager.h b/include/nw4r/snd/snd_Sound3DManager.h index 8609b453..afcf3b85 100644 --- a/include/nw4r/snd/snd_Sound3DManager.h +++ b/include/nw4r/snd/snd_Sound3DManager.h @@ -1,17 +1,17 @@ #ifndef NW4R_SND_SOUND_3D_MANAGER_H #define NW4R_SND_SOUND_3D_MANAGER_H -#include "nw4r/math.h" #include "nw4r/snd/snd_BasicSound.h" #include "nw4r/snd/snd_InstancePool.h" #include "nw4r/snd/snd_SoundArchive.h" #include "nw4r/types_nw4r.h" +#include "nw4r/ut/ut_LinkList.h" +#include "nw4r/math.h" namespace nw4r { namespace snd { -struct Sound3DParam -{ +struct Sound3DParam { /* 0x00 */ u8 _0x00[0x18]; /* 0x18 */ UNKWORD field_0x18; /* 0x1C */ u8 field_0x1C; @@ -35,6 +35,8 @@ public: }; public: + typedef ut::LinkList ListenerList; + Sound3DManager(); virtual void detail_Update( @@ -53,8 +55,12 @@ public: u32 GetRequiredMemSize(const SoundArchive *pArchive); bool Setup(const SoundArchive *pArchive, void *pBuffer, u32 size); - Sound3DListener *GetListener() const { - return mListener; + const ListenerList &GetListenerList() const { + return mListenerList; + } + + ListenerList &GetListenerList() { + return mListenerList; } int GetMaxPriorityReduction() const { @@ -64,6 +70,10 @@ public: mMaxPriorityReduction = max; } + int GetBiquadFilterType() const { + return biquadFilterType; + } + private: enum ParamDecayCurve { DECAY_CURVE_NONE, @@ -73,9 +83,11 @@ private: private: detail::InstancePool mParamPool; // at 0x8 - Sound3DListener *mListener; // at 0xC - u8 _0x10[0x1C - 0x10]; - s32 mMaxPriorityReduction; // at 0x1C + ListenerList mListenerList; // at 0x0C + u8 _0x18[0x1C - 0x18]; + s32 mMaxPriorityReduction; // at 0x1C + u8 _0x1C[0x28 - 0x20]; + int biquadFilterType; // at 0x28 }; } // namespace snd diff --git a/src/nw4r/snd/snd_Sound3DCalculator.cpp b/src/nw4r/snd/snd_Sound3DCalculator.cpp index e061638f..4812cf46 100644 --- a/src/nw4r/snd/snd_Sound3DCalculator.cpp +++ b/src/nw4r/snd/snd_Sound3DCalculator.cpp @@ -1 +1 @@ -// #include "nw4r/snd/snd_Sound3DCalculator.h" +#include "nw4r/snd/snd_Sound3DCalculator.h" diff --git a/src/nw4r/snd/snd_Sound3DEngine.cpp b/src/nw4r/snd/snd_Sound3DEngine.cpp index f398c5a4..7f4f79e7 100644 --- a/src/nw4r/snd/snd_Sound3DEngine.cpp +++ b/src/nw4r/snd/snd_Sound3DEngine.cpp @@ -1,34 +1,110 @@ #include "nw4r/snd/snd_Sound3DEngine.h" -namespace nw4r { namespace snd { +#include "nw4r/snd/snd_Sound3DCalculator.h" +#include "nw4r/snd/snd_Sound3DListener.h" +#include "nw4r/snd/snd_Sound3DManager.h" +#include "nw4r/snd/snd_global.h" -Sound3DEngine::Sound3DEngine() - : mSpeakerAngleStereo(NW4R_MATH_PI / 4), - mFrontSpeakerAngleDpl2(NW4R_MATH_PI / 6), - mRearSpeakerAngleDpl2(2 * NW4R_MATH_PI / 3), - mInitPan(0.0f) {} +namespace nw4r { +namespace snd { + +Sound3DEngine::Sound3DEngine() {} void Sound3DEngine::UpdateAmbientParam( const Sound3DManager *mgr, const Sound3DParam *pParam, u32, u32 flags, SoundAmbientParam *pAmbientParam ) { - if (flags & 1) + if (flags & 1) { pAmbientParam->volume = 0.0f; + } - if (flags & 8) - pAmbientParam->priority = - mgr->GetMaxPriorityReduction(); + if (flags & 8) { + pAmbientParam->priority = -mgr->GetMaxPriorityReduction(); + } + + if (mgr->GetListenerList().GetSize() > 1) { + flags &= -0x17; + } + + NW4R_RANGE_FOR(it, mgr->GetListenerList()) { + const Sound3DListener &listener = *it; + if (flags & 9) { + f32 volume; + int priority; + Sound3DCalculator::CalcVolumeAndPriority(*mgr, listener, *pParam, &volume, &priority); + if (flags & 1) { + pAmbientParam->volume = ut::Max(volume, pAmbientParam->volume); + } + + if (flags & 8) { + pAmbientParam->priority = ut::Max(priority, pAmbientParam->priority); + } + } + if (flags & 6) { + f32 pan, surroundPan; + Sound3DCalculator::CalcPan(*mgr, listener, *pParam, mPanParam, &pan, &surroundPan); + if (flags & 2) { + pAmbientParam->pan = pan; + } + if (flags & 4) { + pAmbientParam->surroundPan = surroundPan; + } + } + + if (flags & 0x10) { + f32 pitch; + Sound3DCalculator::CalcPitch(*mgr, listener, *pParam, &pitch); + pAmbientParam->pitch = pitch; + } + + if (flags & 0x20) { + f32 biquadFilterValue; + Sound3DCalculator::CalcBiquadFilterValue(*mgr, listener, *pParam, &biquadFilterValue); + pAmbientParam->biquadFilterType = mgr->GetBiquadFilterType(); + pAmbientParam->biquadFilterValue = ut::Min(biquadFilterValue, pAmbientParam->biquadFilterValue); + } + } } -void Sound3DEngine::UpdateAmbientParam(const Sound3DManager* mgr, const Sound3DParam* param, u32, int, SoundAmbientParam*) { - +void Sound3DEngine::UpdateAmbientParam( + const Sound3DManager *mgr, const Sound3DParam *param, u32 unused1, int unused2, SoundAmbientParam *pAmbientParam +) { + u32 flags = 0x1F; + if (param->field_0x18 & 1) { + flags &= ~1; + } + if (param->field_0x18 & 2) { + flags &= ~2; + } + if (param->field_0x18 & 4) { + flags &= ~4; + } + if (param->field_0x18 & 8) { + flags &= ~8; + } + if (!param->field_0x1E) { + flags &= ~0x10; + } + if (param->field_0x18 & 0x10) { + flags |= 0x20; + } + UpdateAmbientParam(mgr, param, unused1, flags, pAmbientParam); } -void Sound3DEngine::GetAmbientPriority(const Sound3DManager*, const Sound3DParam*, u32) { +s32 Sound3DEngine::GetAmbientPriority(const Sound3DManager *mgr, const Sound3DParam *param, u32 arg) { + u32 flags = 0x1000008; + if (param->field_0x18 & 8) { + flags &= ~8; + } + SoundAmbientParam ambientParam; + + UpdateAmbientParam(mgr, param, arg, flags, &ambientParam); + return ambientParam.priority; } -s32 Sound3DEngine::GetRequiredVoiceOutCount(const Sound3DManager*, const Sound3DParam*, u32) { +s32 Sound3DEngine::GetRequiredVoiceOutCount(const Sound3DManager *, const Sound3DParam *, u32) { return 1; } - -}} +} // namespace snd +} // namespace nw4r diff --git a/src/nw4r/snd/snd_Sound3DListener.cpp b/src/nw4r/snd/snd_Sound3DListener.cpp index 08d64440..1ec06b11 100644 --- a/src/nw4r/snd/snd_Sound3DListener.cpp +++ b/src/nw4r/snd/snd_Sound3DListener.cpp @@ -3,22 +3,16 @@ namespace nw4r { namespace snd { -Sound3DListener::Sound3DListener() { - mPosition.x = 0.0f; - mPosition.y = 0.0f; - mPosition.z = 0.0f; - mVelocity.x = 0.0f; - mVelocity.y = 0.0f; - mVelocity.z = 0.0f; - mInteriorSize = 1.0f; - mMaxVolumeDistance = 1.0f; - mUnitDistance = 1.0f; - field_0x54 = 0; - mSkipVelocityUpdate = 1; - mUnitBiquadFilterValue = 0.5f; - mUnitBiquadFilterMax = 1.0f; - field_0x64 = 0; - field_0x68 = 0; +Sound3DListener::Sound3DListener() + : mPosition(0.0f, 0.0f, 0.0f), + mVelocity(0.0f, 0.0f, 0.0f), + mInteriorSize(1.0f), + mMaxVolumeDistance(1.0f), + mUnitDistance(1.0f), + field_0x54(0), + mSkipVelocityUpdate(1), + mUnitBiquadFilterValue(0.5f), + mUnitBiquadFilterMax(1.0f) { math::MTX34Zero(&mMtx); } From d004459b3c8af2e5ada3b44093feff260c8d9e35 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 28 May 2025 21:53:10 +0200 Subject: [PATCH 64/91] snd_Sound3DCalculator OK --- configure.py | 2 +- include/nw4r/snd/snd_Sound3DCalculator.h | 34 +-- include/nw4r/snd/snd_Sound3DEngine.h | 3 +- include/nw4r/snd/snd_Sound3DListener.h | 15 + include/nw4r/snd/snd_Sound3DManager.h | 35 +-- .../MSL/MSL_C/MSL_Common/Include/cmath | 6 +- src/nw4r/snd/snd_Sound3DCalculator.cpp | 285 ++++++++++++++++++ src/nw4r/snd/snd_Sound3DManager.cpp | 44 ++- 8 files changed, 360 insertions(+), 64 deletions(-) diff --git a/configure.py b/configure.py index d2ca639e..79551cb7 100644 --- a/configure.py +++ b/configure.py @@ -1053,7 +1053,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SeqSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SeqTrack.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DActor.cpp"), - Object(NonMatching, "nw4r/snd/snd_Sound3DCalculator.cpp"), + Object(Matching, "nw4r/snd/snd_Sound3DCalculator.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DEngine.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DListener.cpp"), Object(NonMatching, "nw4r/snd/snd_Sound3DManager.cpp"), diff --git a/include/nw4r/snd/snd_Sound3DCalculator.h b/include/nw4r/snd/snd_Sound3DCalculator.h index b2c578d5..29c23c69 100644 --- a/include/nw4r/snd/snd_Sound3DCalculator.h +++ b/include/nw4r/snd/snd_Sound3DCalculator.h @@ -1,36 +1,36 @@ #ifndef NW4R_SND_SOUND_3D_CALCULATOR_H #define NW4R_SND_SOUND_3D_CALCULATOR_H -#include "nw4r/snd/snd_Sound3DManager.h" +#include "common.h" +#include "nw4r/math/math_triangular.h" namespace nw4r { namespace snd { +class Sound3DManager; +class Sound3DParam; + class Sound3DCalculator { public: struct CalcPanParam { -#if 0 - f32 mSpeakerAngleStereo; // at 0x04 - f32 mFrontSpeakerAngleDpl2; // at 0x08 - f32 mRearSpeakerAngleDpl2; // at 0x0C - f32 mInitPan; // at 0x10 -#endif - f32 field_0x00; - f32 field_0x04; - f32 field_0x08; - f32 field_0x0C; + f32 speakerAngleStereo; // at 0x00 + f32 frontSpeakerAngleDpl2; // at 0x04 + f32 rearSpeakerAngleDpl2; // at 0x08 + f32 initPan; // at 0x0C CalcPanParam() - : field_0x00(NW4R_MATH_PI / 4), - field_0x04(NW4R_MATH_PI / 6), - field_0x08(2 * NW4R_MATH_PI / 3), - field_0x0C(0.0f) {} + : speakerAngleStereo(NW4R_MATH_PI / 4), + frontSpeakerAngleDpl2(NW4R_MATH_PI / 6), + rearSpeakerAngleDpl2(2 * NW4R_MATH_PI / 3), + initPan(0.0f) {} }; static void CalcVolumeAndPriority(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, float *, int *); - static void - CalcPan(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, const Sound3DCalculator::CalcPanParam &, float *pan, float *surroundPan); + static void CalcPan( + const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, const Sound3DCalculator::CalcPanParam &, + float *pan, float *surroundPan + ); static void CalcPitch(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, float *); static void CalcBiquadFilterValue(const Sound3DManager &, const Sound3DListener &, const Sound3DParam &, float *); static void CalcPanDpl2(const nw4r::math::VEC3 &, float, float, float, float, float, float, float *, float *); diff --git a/include/nw4r/snd/snd_Sound3DEngine.h b/include/nw4r/snd/snd_Sound3DEngine.h index ae15de01..e643d5f5 100644 --- a/include/nw4r/snd/snd_Sound3DEngine.h +++ b/include/nw4r/snd/snd_Sound3DEngine.h @@ -1,9 +1,7 @@ #ifndef NW4R_SND_SOUND_3D_ENGINE_H #define NW4R_SND_SOUND_3D_ENGINE_H -#include "nw4r/math.h" #include "nw4r/types_nw4r.h" -#include "nw4r/snd/snd_Sound3DManager.h" #include "nw4r/snd/snd_Sound3DCalculator.h" @@ -11,6 +9,7 @@ namespace nw4r { namespace snd { class Sound3DManager; +class SoundAmbientParam; class Sound3DEngine { public: diff --git a/include/nw4r/snd/snd_Sound3DListener.h b/include/nw4r/snd/snd_Sound3DListener.h index 9162cc86..dc97054f 100644 --- a/include/nw4r/snd/snd_Sound3DListener.h +++ b/include/nw4r/snd/snd_Sound3DListener.h @@ -17,6 +17,14 @@ public: return mMtx; } + const math::VEC3 &GetPosition() const { + return mPosition; + } + + const math::VEC3 &GetVelocity() const { + return mVelocity; + } + void SetMatrix(const math::MTX34 &mtx); f32 GetInteriorSize() const { @@ -34,7 +42,14 @@ public: } void SetUnitDistance(f32 distance); + f32 GetUnitBiquadFilterValue() const { + return mUnitBiquadFilterValue; + } void SetUnitBiquadFilterValue(f32 value); + + f32 GetUnitBiquadFilterMax() const { + return mUnitBiquadFilterMax; + } void SetUnitBiquadFilterMax(f32 value); private: diff --git a/include/nw4r/snd/snd_Sound3DManager.h b/include/nw4r/snd/snd_Sound3DManager.h index afcf3b85..a8f8df43 100644 --- a/include/nw4r/snd/snd_Sound3DManager.h +++ b/include/nw4r/snd/snd_Sound3DManager.h @@ -2,6 +2,7 @@ #define NW4R_SND_SOUND_3D_MANAGER_H #include "nw4r/snd/snd_BasicSound.h" #include "nw4r/snd/snd_InstancePool.h" +#include "nw4r/snd/snd_Sound3DEngine.h" #include "nw4r/snd/snd_SoundArchive.h" #include "nw4r/types_nw4r.h" #include "nw4r/ut/ut_LinkList.h" @@ -12,10 +13,11 @@ namespace nw4r { namespace snd { struct Sound3DParam { - /* 0x00 */ u8 _0x00[0x18]; + /* 0x00 */ math::VEC3 position; + /* 0x0C */ math::VEC3 field_0x0C; /* 0x18 */ UNKWORD field_0x18; - /* 0x1C */ u8 field_0x1C; - /* 0x1D */ u8 field_0x1D; + /* 0x1C */ u8 decayCurve; + /* 0x1D */ u8 decayRatio; /* 0x1E */ u8 field_0x1E; /* 0x20 */ UNKWORD field_0x20; /* 0x24 */ UNKWORD field_0x24; @@ -25,15 +27,6 @@ struct Sound3DParam { class Sound3DManager : public detail::BasicSound::AmbientInfo::AmbientParamUpdateCallback, public detail::BasicSound::AmbientInfo::AmbientArgAllocaterCallback { -public: - struct Sound3DActorParam { - u32 userParam; // at 0x0 - SoundArchive::Sound3DParam soundParam; // at 0x4 - math::VEC3 position; // at 0xC - - Sound3DActorParam(); - }; - public: typedef ut::LinkList ListenerList; @@ -74,7 +67,14 @@ public: return biquadFilterType; } -private: + f32 GetField0x20() const { + return field_0x20; + } + + f32 GetField0x24() const { + return field_0x24; + } + enum ParamDecayCurve { DECAY_CURVE_NONE, DECAY_CURVE_LOGARITHMIC, @@ -84,10 +84,11 @@ private: private: detail::InstancePool mParamPool; // at 0x8 ListenerList mListenerList; // at 0x0C - u8 _0x18[0x1C - 0x18]; - s32 mMaxPriorityReduction; // at 0x1C - u8 _0x1C[0x28 - 0x20]; - int biquadFilterType; // at 0x28 + Sound3DEngine *mpEngine; // at 0x18 + s32 mMaxPriorityReduction; // at 0x1C + f32 field_0x20; // at 0x20 + f32 field_0x24; // at 0x24 + int biquadFilterType; // at 0x28 }; } // namespace snd diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath index 7517fae0..57ceb903 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath @@ -18,7 +18,7 @@ using ::ceil; using ::ceilf; using ::copysign; using ::cos; -using ::cosf; +// using ::cosf; using ::fabsf; using ::floor; using ::floorf; @@ -43,6 +43,10 @@ inline float sqrt(float x) { return ::sqrtf(x); } +inline float cosf(float x) { + return cos(x); +} + // TODO: Very fake! // inline double fabs_wrapper(double x) { // return __fabs(x); diff --git a/src/nw4r/snd/snd_Sound3DCalculator.cpp b/src/nw4r/snd/snd_Sound3DCalculator.cpp index 4812cf46..59b27a18 100644 --- a/src/nw4r/snd/snd_Sound3DCalculator.cpp +++ b/src/nw4r/snd/snd_Sound3DCalculator.cpp @@ -1 +1,286 @@ #include "nw4r/snd/snd_Sound3DCalculator.h" + +#include "nw4r/snd/snd_AxManager.h" +#include "nw4r/snd/snd_Sound3DListener.h" +#include "nw4r/snd/snd_Sound3DManager.h" + +#include + +namespace nw4r { + +namespace snd { + +namespace { + +/** + * Solves the linear equation: + * a*x + b*y + c = d + * + * Where: + * a = dFactor - cFactor + * b = dAngle - cAngle + * c = cAngle * cFactor + * d = dAngle * dFactor + */ +inline f32 SolveLinerFunction(f32 x, f32 dAngle, f32 cAngle, f32 dFactor, + f32 cFactor) { // @typo + if (dAngle == cAngle) { + return (dFactor + cFactor) / 2; + } + + f32 b = dAngle - cAngle; + + return x * (cFactor - dFactor) / b + (dAngle * dFactor - cAngle * cFactor) / b; +} + +} // namespace + +void Sound3DCalculator::CalcVolumeAndPriority( + const nw4r::snd::Sound3DManager &mgr, const nw4r::snd::Sound3DListener &listener, + const nw4r::snd::Sound3DParam ¶m, f32 *pVolume, int *pPriority +) { + math::VEC3 relativePos; + math::VEC3Sub(&relativePos, ¶m.position, &listener.GetPosition()); + + f32 distance = VEC3Len(&relativePos); + f32 decayRatio = param.decayRatio / 256.0f; + f32 maxVolumeDistance = listener.GetMaxVolumeDistance(); + f32 unitDistance = listener.GetUnitDistance(); + s32 maxPriorityReduction = mgr.GetMaxPriorityReduction(); + u8 decayCurve = param.decayCurve; + + f32 volume = 1.0f; + if (distance > maxVolumeDistance) { + switch (decayCurve) { + case Sound3DManager::DECAY_CURVE_LOGARITHMIC: { + f32 units = (distance - maxVolumeDistance) / unitDistance; + + volume = std::pow(decayRatio, units); + break; + } + + case Sound3DManager::DECAY_CURVE_LINEAR: { + f32 units = (distance - maxVolumeDistance) / unitDistance * (1.0f - decayRatio); + + volume = 1.0f - units; + if (volume < 0.0f) { + volume = 0.0f; + } + break; + } + } + } + *pVolume = volume; + *pPriority = -static_cast((1.0f - volume) * maxPriorityReduction); +} + +inline void CalcPanInline( + const nw4r::math::VEC3 &relativePos, f32 speakerAngleStereo, f32 interiorSize, f32 distance, f32 panRange, + f32 frontSpeakerAngleDpl2, f32 rearSpeakerAngleDpl2, f32 initPan, f32 *pan, f32 *surroundPan +) { + switch (detail::AxManager::GetInstance().GetOutputMode()) { + case OUTPUT_MODE_SURROUND: + case OUTPUT_MODE_DPL2: + Sound3DCalculator::CalcPanDpl2( + relativePos, interiorSize, distance, panRange, frontSpeakerAngleDpl2, rearSpeakerAngleDpl2, initPan, + pan, surroundPan + ); + break; + case OUTPUT_MODE_STEREO: + Sound3DCalculator::CalcPanStereo( + relativePos, interiorSize, distance, panRange, speakerAngleStereo, pan, surroundPan + ); + break; + default: + *pan = 0.0f; + *surroundPan = 0.0f; + break; + } +} + +void Sound3DCalculator::CalcPan( + const Sound3DManager &mgr, const Sound3DListener &listener, const Sound3DParam ¶m, + const Sound3DCalculator::CalcPanParam &panParam, f32 *pan, f32 *surroundPan +) { + math::VEC3 relativePos; + VEC3Transform(&relativePos, &listener.GetMatrix(), ¶m.position); + f32 distance = math::VEC3Len(&relativePos); + + CalcPanInline( + relativePos, panParam.speakerAngleStereo, listener.GetInteriorSize(), distance, mgr.GetField0x20(), panParam.frontSpeakerAngleDpl2, + panParam.rearSpeakerAngleDpl2, panParam.initPan, pan, surroundPan + ); +} + +void Sound3DCalculator::CalcPitch( + const nw4r::snd::Sound3DManager &mgr, const nw4r::snd::Sound3DListener &listener, + const nw4r::snd::Sound3DParam ¶m, f32 *pPitch +) { + f32 f0 = mgr.GetField0x24(); + if (f0 == 0.0f) { + *pPitch = 1.0f; + return; + } + + math::VEC3 relativePos; + math::VEC3Sub(&relativePos, ¶m.position, &listener.GetPosition()); + f32 distance = VEC3Len(&relativePos); + if (distance > 0.0f) { + relativePos /= distance; + } + f32 f3 = param.field_0x1E / 32.0f; + f32 f1, f2; + if (distance > 0.0f) { + f1 = -math::VEC3Dot(&relativePos, ¶m.field_0x0C); + f2 = -math::VEC3Dot(&relativePos, &listener.GetVelocity()); + } else { + f1 = -math::VEC3Len(¶m.field_0x0C); + f2 = math::VEC3Len(&listener.GetVelocity()); + } + f32 pitch; + f1 *= f3; + f2 *= f3; + if (f2 > f0) { + pitch = 0.0f; + } else if (f1 >= f0) { + pitch = 65535.0f; + } else { + pitch = (f0 - f2) / (f0 - f1); + } + *pPitch = pitch; +} + +void Sound3DCalculator::CalcBiquadFilterValue( + const nw4r::snd::Sound3DManager &mgr, const nw4r::snd::Sound3DListener &listener, + const nw4r::snd::Sound3DParam ¶m, f32 *pBiquadValue +) { + math::VEC3 relativePos; + math::VEC3Sub(&relativePos, ¶m.position, &listener.GetPosition()); + f32 distance = VEC3Len(&relativePos); + + f32 value = 0.0f; + f32 maxVolumeDistance = listener.GetMaxVolumeDistance(); + f32 maxValue = listener.GetUnitBiquadFilterMax(); + + if (distance > maxVolumeDistance) { + value = ((distance - maxVolumeDistance) / listener.GetUnitDistance()) * listener.GetUnitBiquadFilterValue(); + if (value > maxValue) { + value = maxValue; + } + } + *pBiquadValue = value; +} + +void Sound3DCalculator::CalcPanDpl2( + const nw4r::math::VEC3 &relativePos, f32 interiorSize, f32 distance, f32 mPanRange, f32 mFrontSpeakerAngleDpl2, + f32 mRearSpeakerAngleDpl2, f32 mInitPan, f32 *pan, f32 *surroundPan +) { + f32 angle, distanceNrm; + CalcAngleAndDistance(relativePos, distance, interiorSize, &angle, &distanceNrm); + + f32 panLR, panFR; + + f32 angleRearLeft = -mRearSpeakerAngleDpl2; + f32 angleFrontLeft = -mFrontSpeakerAngleDpl2; + f32 angleFrontRight = mFrontSpeakerAngleDpl2; + f32 angleRearRight = mRearSpeakerAngleDpl2; + + // clang-format off + if (angle < angleRearLeft) { + panLR = SolveLinerFunction(angle, -NW4R_MATH_PI, angleRearLeft, -1.0f, 0.0f); + panFR = 1.0f; + } else if (angle < -NW4R_MATH_PI / 2) { + panLR = -1.0f; + panFR = SolveLinerFunction(angle, angleRearLeft, -NW4R_MATH_PI / 2, 0.0f, 1.0f); + } else if (angle < angleFrontLeft) { + panLR = -1.0f; + panFR = SolveLinerFunction(angle, -NW4R_MATH_PI / 2, angleFrontLeft, -1.0f, 0.0f); + } else if (angle < angleFrontRight) { + panLR = SolveLinerFunction(angle, angleFrontLeft, angleFrontRight, 1.0f, -1.0f); + panFR = -1.0f; + } else if (angle < NW4R_MATH_PI / 2) { + panLR = 1.0f; + panFR = SolveLinerFunction(angle, angleFrontRight, NW4R_MATH_PI / 2, 0.0f, -1.0f); + } else if (angle < angleRearRight) { + panLR = 1.0f; + panFR = SolveLinerFunction(angle, NW4R_MATH_PI / 2, angleRearRight, 1.0f, 0.0f); + } else { + panLR = SolveLinerFunction(angle, angleRearRight, NW4R_MATH_PI, 0.0f, 1.0f); + panFR = 1.0f; + } + // clang-format on + + f32 cosAvg = (std::cosf(mFrontSpeakerAngleDpl2) + std::cosf(mRearSpeakerAngleDpl2)) / 2.0f; + + f32 rearFactor = cosAvg / (cosAvg + -std::cosf(mRearSpeakerAngleDpl2)); + + panLR *= mPanRange; + panFR *= mPanRange; + + *pan = panLR * distanceNrm; + + *surroundPan = mInitPan + (1.0f + (panFR * distanceNrm + rearFactor * (1.0f - distanceNrm))); +} + +void Sound3DCalculator::CalcPanStereo( + const nw4r::math::VEC3 &relativePos, f32 interiorSize, f32 distance, f32 panRange, f32 speakerAngleStereo, + f32 *surroundPan, f32 *pan +) { + f32 angle, distanceNrm; + CalcAngleAndDistance(relativePos, distance, interiorSize, &angle, &distanceNrm); + + f32 factor; + + f32 angleRearLeft = -NW4R_MATH_PI + speakerAngleStereo; + f32 angleFrontLeft = -speakerAngleStereo; + f32 angleFrontRight = speakerAngleStereo; + f32 angleRearRight = NW4R_MATH_PI - speakerAngleStereo; + + if (angle < angleRearLeft) { + factor = SolveLinerFunction(angle, -NW4R_MATH_PI, angleRearLeft, -1.0f, 0.0f); + } else if (angle < angleFrontLeft) { + factor = -1.0f; + } else if (angle < angleFrontRight) { + factor = SolveLinerFunction(angle, angleFrontLeft, angleFrontRight, 1.0f, -1.0f); + } else if (angle < angleRearRight) { + factor = 1.0f; + } else { + factor = SolveLinerFunction(angle, angleRearRight, NW4R_MATH_PI, 0.0f, 1.0f); + } + + factor *= panRange; + + *surroundPan = factor * distanceNrm; + *pan = 0.0f; +} + +void Sound3DCalculator::CalcAngleAndDistance( + const nw4r::math::VEC3 &relativePos, f32 distance, f32 interiorSize, f32 *pAngle, f32 *pDistance +) { + math::VEC3 adjustedPos; + + if (0.0f == distance) { + adjustedPos.z = 0.0f; + adjustedPos.y = 0.0f; + adjustedPos.x = 0.0f; + } else { + math::VEC3 relativeXZ(relativePos.x, 0.0f, relativePos.z); + + f32 distanceXZ = VEC3Len(&relativeXZ); + if (distanceXZ > interiorSize) { + relativeXZ.x *= interiorSize / distanceXZ; + relativeXZ.z *= interiorSize / distanceXZ; + } + + f32 ratioXZ = VEC3Len(&relativeXZ); + adjustedPos.x = relativePos.x * ratioXZ / distance; + adjustedPos.y = 0.0f; + adjustedPos.z = relativePos.z * ratioXZ / distance; + } + + *pAngle = atan2(adjustedPos.x, -adjustedPos.z); + *pDistance = VEC3Len(&adjustedPos) / interiorSize; +} + +} // namespace snd +} // namespace nw4r diff --git a/src/nw4r/snd/snd_Sound3DManager.cpp b/src/nw4r/snd/snd_Sound3DManager.cpp index 9fe22d6d..ebd0771c 100644 --- a/src/nw4r/snd/snd_Sound3DManager.cpp +++ b/src/nw4r/snd/snd_Sound3DManager.cpp @@ -1,5 +1,7 @@ #include "nw4r/snd/snd_Sound3DManager.h" + #include "nw4r/snd/snd_AxManager.h" +#include "nw4r/snd/snd_Sound3DEngine.h" #include "nw4r/snd/snd_Sound3DListener.h" #include "nw4r/snd/snd_SoundHandle.h" @@ -11,6 +13,8 @@ namespace nw4r { namespace snd { namespace { +static Sound3DEngine sEngine; + /** * Solves the linear equation: * a*x + b*y + c = d @@ -29,16 +33,14 @@ inline f32 SolveLinerFunction(f32 x, f32 dAngle, f32 cAngle, f32 dFactor, f32 b = dAngle - cAngle; - return x * (cFactor - dFactor) / b + - (dAngle * dFactor - cAngle * cFactor) / b; + return x * (cFactor - dFactor) / b + (dAngle * dFactor - cAngle * cFactor) / b; } } // namespace -Sound3DManager::Sound3DManager() - {} +Sound3DManager::Sound3DManager() : mpEngine(&sEngine), mMaxPriorityReduction(32), field_0x20(0.9f), field_0x24(0.0f), biquadFilterType(0) {} -u32 Sound3DManager::GetRequiredMemSize(const SoundArchive* pArchive) { +u32 Sound3DManager::GetRequiredMemSize(const SoundArchive *pArchive) { u32 numParam = 0; SoundArchive::SoundArchivePlayerInfo playerInfo; @@ -51,17 +53,16 @@ u32 Sound3DManager::GetRequiredMemSize(const SoundArchive* pArchive) { return numParam * sizeof(Sound3DParam); } -bool Sound3DManager::Setup(const SoundArchive* pArchive, void* pBuffer, - u32 size) { +bool Sound3DManager::Setup(const SoundArchive *pArchive, void *pBuffer, u32 size) { #pragma unused(pArchive) mParamPool.Create(pBuffer, size); return true; } -void Sound3DManager::detail_Update(SoundParam* pParam, u32 id, - detail::BasicSound* pSound, const void* pArg, - u32 flags) { +void Sound3DManager::detail_Update( + SoundParam *pParam, u32 id, detail::BasicSound *pSound, const void *pArg, u32 flags +) { SoundHandle handle; if (pSound != NULL) { handle.detail_AttachSoundAsTempHandle(pSound); @@ -70,8 +71,7 @@ void Sound3DManager::detail_Update(SoundParam* pParam, u32 id, Update(pParam, id, pSound != NULL ? &handle : NULL, pArg, flags); } -void Sound3DManager::Update(SoundParam* pParam, u32 id, SoundHandle* pHandle, - const void* pArg, u32 flags) { +void Sound3DManager::Update(SoundParam *pParam, u32 id, SoundHandle *pHandle, const void *pArg, u32 flags) { #pragma unused(id) #pragma unused(pHandle) @@ -265,7 +265,7 @@ void Sound3DManager::Update(SoundParam* pParam, u32 id, SoundHandle* pHandle, #endif } -void* Sound3DManager::detail_AllocAmbientArg(u32 size) { +void *Sound3DManager::detail_AllocAmbientArg(u32 size) { if (size != sizeof(Sound3DParam)) { return NULL; } @@ -273,28 +273,20 @@ void* Sound3DManager::detail_AllocAmbientArg(u32 size) { return mParamPool.Alloc(); } -void Sound3DManager::detail_FreeAmbientArg(void* pArg, - const detail::BasicSound* pSound) { +void Sound3DManager::detail_FreeAmbientArg(void *pArg, const detail::BasicSound *pSound) { #pragma unused(pSound) - mParamPool.Free(static_cast(pArg)); + mParamPool.Free(static_cast(pArg)); } -Sound3DParam::Sound3DParam() -{ +Sound3DParam::Sound3DParam() { field_0x18 = 0; - field_0x1C = 1; - field_0x1D = 0x80; + decayCurve = Sound3DManager::DECAY_CURVE_LOGARITHMIC; + decayRatio = 128; field_0x1E = 0; field_0x20 = 0; field_0x24 = 0; } -Sound3DManager::Sound3DActorParam::Sound3DActorParam() : userParam(-1) { - soundParam.flags = 0; - soundParam.decayCurve = DECAY_CURVE_LOGARITHMIC; - soundParam.decayRatio = 128; -} - } // namespace snd } // namespace nw4r From bd2adcab70991550f79ba76e035381e03ce89f60 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 28 May 2025 22:19:53 +0200 Subject: [PATCH 65/91] snd_Sound3DManager OK --- config/SOUE01/symbols.txt | 48 ++--- configure.py | 2 +- include/nw4r/snd/snd_BasicSound.h | 16 +- include/nw4r/snd/snd_Sound3DManager.h | 21 ++- src/nw4r/snd/snd_BasicSound.cpp | 10 +- src/nw4r/snd/snd_Sound3DManager.cpp | 246 +++----------------------- 6 files changed, 77 insertions(+), 266 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index d8b54fc0..d3cfc41e 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -20038,7 +20038,7 @@ fn_80360C30 = .text:0x80360C30; // type:function size:0x78 fn_80360CB0 = .text:0x80360CB0; // type:function size:0x48 fn_80360D00 = .text:0x80360D00; // type:function size:0x10 fn_80360D10 = .text:0x80360D10; // type:function size:0xE4 -fn_80360E00 = .text:0x80360E00; // type:function size:0x60 +__dt__Q34nw4r3snd14Sound3DManagerFv = .text:0x80360E00; // type:function size:0x60 fn_80360E60 = .text:0x80360E60; // type:function size:0x118 fn_80360F80 = .text:0x80360F80; // type:function size:0xC fn_80360F90 = .text:0x80360F90; // type:function size:0x20 @@ -25470,10 +25470,10 @@ detail_AllocAmbientArg__Q34nw4r3snd14Sound3DManagerFUl = .text:0x80475E70; // ty detail_FreeAmbientArg__Q34nw4r3snd14Sound3DManagerFPvPCQ44nw4r3snd6detail10BasicSound = .text:0x80475EE0; // type:function size:0x14 SetBiquadFilterType__Q34nw4r3snd14Sound3DManagerFi = .text:0x80475F00; // type:function size:0x8 __ct__Q34nw4r3snd12Sound3DParamFv = .text:0x80475F10; // type:function size:0x28 -__sinit_snd_Sound3DManager_cpp = .text:0x80475F40; // type:function size:0xC scope:local -@4@detail_FreeAmbientArg__Q34nw4r3snd14Sound3DManagerFPvPCQ44nw4r3snd6detail10BasicSound = .text:0x80475F50; // type:function size:0x8 -@4@detail_AllocAmbientArg__Q34nw4r3snd14Sound3DManagerFUl = .text:0x80475F60; // type:function size:0x8 -@4@__dt__Q34nw4r3snd14Sound3DManagerFv = .text:0x80475F70; // type:function size:0x8 +__sinit_\snd_Sound3DManager_cpp = .text:0x80475F40; // type:function size:0xC scope:local +@4@detail_FreeAmbientArg__Q34nw4r3snd14Sound3DManagerFPvPCQ44nw4r3snd6detail10BasicSound = .text:0x80475F50; // type:function size:0x8 scope:weak +@4@detail_AllocAmbientArg__Q34nw4r3snd14Sound3DManagerFUl = .text:0x80475F60; // type:function size:0x8 scope:weak +@4@__dt__Q34nw4r3snd14Sound3DManagerFv = .text:0x80475F70; // type:function size:0x8 scope:weak __ct__Q34nw4r3snd10SoundActorFRQ34nw4r3snd18SoundArchivePlayer = .text:0x80475F80; // type:function size:0xC0 __dt__Q34nw4r3snd10SoundActorFv = .text:0x80476040; // type:function size:0xAC StopAllSound__Q34nw4r3snd10SoundActorFi = .text:0x804760F0; // type:function size:0x5C @@ -38611,7 +38611,7 @@ __vt__Q54nw4r3snd6detail8SeqSound11SeqLoadTask = .data:0x8056E0C0; // type:objec __vt__Q44nw4r3snd6detail8SeqTrack = .data:0x8056E0D8; // type:object size:0x10 lbl_8056E0E8 = .data:0x8056E0E8; // type:object size:0x30 __vt__Q34nw4r3snd13Sound3DEngine = .data:0x8056E118; // type:object size:0x1C -lbl_8056E138 = .data:0x8056E138; // type:object size:0x38 +__vt__Q34nw4r3snd14Sound3DManager = .data:0x8056E138; // type:object size:0x34 __vt__Q34nw4r3snd10SoundActor = .data:0x8056E170; // type:object size:0x1C __vt__Q34nw4r3snd12SoundArchive = .data:0x8056E190; // type:object size:0x20 lbl_8056E1B0 = .data:0x8056E1B0; // type:object size:0x30 @@ -49718,21 +49718,21 @@ lbl_8057F014 = .sdata2:0x8057F014; // type:object size:0x4 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 -lbl_8057F0C0 = .sdata2:0x8057F0C0; // type:object size:0x4 align:4 data:float -lbl_8057F0C8 = .sdata2:0x8057F0C8; // type:object size:0x8 align:8 data:double -lbl_8057F0D0 = .sdata2:0x8057F0D0; // type:object size:0x8 align:8 data:double -lbl_8057F0D8 = .sdata2:0x8057F0D8; // type:object size:0x4 align:4 data:float -lbl_8057F0DC = .sdata2:0x8057F0DC; // type:object size:0x4 align:4 data:float -lbl_8057F0E0 = .sdata2:0x8057F0E0; // type:object size:0x4 align:4 data:float -lbl_8057F0E4 = .sdata2:0x8057F0E4; // type:object size:0x4 align:4 data:float -lbl_8057F0E8 = .sdata2:0x8057F0E8; // type:object size:0x4 align:4 data:float -lbl_8057F0EC = .sdata2:0x8057F0EC; // type:object size:0x4 align:4 data:float -lbl_8057F0F0 = .sdata2:0x8057F0F0; // type:object size:0x4 align:4 data:float -lbl_8057F0F4 = .sdata2:0x8057F0F4; // type:object size:0x4 align:4 data:float -lbl_8057F0F8 = .sdata2:0x8057F0F8; // type:object size:0x4 align:4 data:float -lbl_8057F0FC = .sdata2:0x8057F0FC; // type:object size:0x4 align:4 data:float +@2828 = .sdata2:0x8057F0B8; // type:object size:0x4 scope:local align:4 data:float +@2829 = .sdata2:0x8057F0BC; // type:object size:0x4 scope:local align:4 data:float +@2830 = .sdata2:0x8057F0C0; // type:object size:0x4 scope:local align:4 data:float +@2837 = .sdata2:0x8057F0C8; // type:object size:0x8 scope:local align:8 data:double +@2838 = .sdata2:0x8057F0D0; // type:object size:0x8 scope:local align:8 data:double +@2902 = .sdata2:0x8057F0D8; // type:object size:0x4 scope:local align:4 data:float +@2903 = .sdata2:0x8057F0DC; // type:object size:0x4 scope:local align:4 data:float +@2962 = .sdata2:0x8057F0E0; // type:object size:0x4 scope:local align:4 data:float +@2963 = .sdata2:0x8057F0E4; // type:object size:0x4 scope:local align:4 data:float +@2964 = .sdata2:0x8057F0E8; // type:object size:0x4 scope:local align:4 data:float +@2965 = .sdata2:0x8057F0EC; // type:object size:0x4 scope:local align:4 data:float +@2966 = .sdata2:0x8057F0F0; // type:object size:0x4 scope:local align:4 data:float +@2967 = .sdata2:0x8057F0F4; // type:object size:0x4 scope:local align:4 data:float +@2968 = .sdata2:0x8057F0F8; // type:object size:0x4 scope:local align:4 data:float +@2969 = .sdata2:0x8057F0FC; // type:object size:0x4 scope:local align:4 data:float @2216 = .sdata2:0x8057F100; // type:object size:0x4 scope:local align:4 data:float @2217 = .sdata2:0x8057F104; // type:object size:0x4 scope:local align:4 data:float @2218 = .sdata2:0x8057F108; // type:object size:0x4 scope:local align:4 data:float @@ -49741,8 +49741,8 @@ lbl_8057F0FC = .sdata2:0x8057F0FC; // type:object size:0x4 align:4 data:float @1266 = .sdata2:0x8057F118; // type:object size:0x4 scope:local align:4 data:float @1267 = .sdata2:0x8057F11C; // type:object size:0x4 scope:local align:4 data:float @1268 = .sdata2:0x8057F120; // type:object size:0x4 scope:local align:4 data:float -lbl_8057F128 = .sdata2:0x8057F128; // type:object size:0x4 align:4 data:float -lbl_8057F12C = .sdata2:0x8057F12C; // type:object size:0x4 align:4 data:float +@2580 = .sdata2:0x8057F128; // type:object size:0x4 scope:local align:4 data:float +@2581 = .sdata2:0x8057F12C; // type:object size:0x4 scope:local align:4 data:float @3454 = .sdata2:0x8057F130; // type:object size:0x4 scope:local align:4 data:float @3455 = .sdata2:0x8057F134; // type:object size:0x4 scope:local align:4 data:float lbl_8057F138 = .sdata2:0x8057F138; // type:object size:0x4 align:4 data:float @@ -51940,7 +51940,7 @@ sBiquadFilterCallbackTable__Q44nw4r3snd6detail9AxManager = .bss:0x80659080; // t @LOCAL@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .bss:0x80659404; // type:object size:0xC scope:weak data:4byte @LOCAL@GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv@instance = .bss:0x80659410; // type:object size:0x2D8 scope:weak data:byte mGlobalVariable__Q44nw4r3snd6detail9SeqPlayer = .bss:0x806596E8; // type:object size:0x20 data:2byte -lbl_80659708 = .bss:0x80659708; // type:object size:0x18 +sEngine__Q34nw4r3snd32@unnamed@snd_Sound3DManager_cpp@ = .bss:0x80659708; // type:object size:0x14 scope:local @1420 = .bss:0x80659720; // type:object size:0xC scope:local @LOCAL@detail_SortPriorityList__Q34nw4r3snd11SoundPlayerFv@tmplist = .bss:0x80659730; // type:object size:0x600 scope:weak data:4byte @2786 = .bss:0x80659D40; // type:object size:0xC scope:local diff --git a/configure.py b/configure.py index 79551cb7..30d11743 100644 --- a/configure.py +++ b/configure.py @@ -1056,7 +1056,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_Sound3DCalculator.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DEngine.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DListener.cpp"), - Object(NonMatching, "nw4r/snd/snd_Sound3DManager.cpp"), + Object(Matching, "nw4r/snd/snd_Sound3DManager.cpp"), Object(Matching, "nw4r/snd/snd_SoundActor.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchive.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchiveFile.cpp"), diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index 84a4d5e4..fcfa1366 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -169,10 +169,10 @@ namespace nw4r { namespace snd { namespace detail }; // methods public: - virtual void at_0x08(); - virtual void at_0x0c(void *, int, int, void *); - virtual int at_0x10(void *, int); - virtual int at_0x14(void *, int); + virtual ~AmbientParamUpdateCallback() {} + virtual void detail_UpdateAmbientParam(const void*, u32, int, SoundAmbientParam*); + virtual int detail_GetAmbientPriority(const void*, u32); + virtual int detail_GetRequiredVoiceOutCount(const void*, u32); // members private: @@ -202,9 +202,11 @@ namespace nw4r { namespace snd { namespace detail public: // virtual function ordering // vtable AmbientArgAllocaterCallback - virtual void at_0x08(); - virtual void *at_0x0c(int); - virtual void at_0x10(void *, void *); + virtual ~AmbientArgAllocaterCallback() {} + virtual void *detail_AllocAmbientArg(u32 size); // at 0x8 + + virtual void detail_FreeAmbientArg(void *pArg, + const detail::BasicSound *pSound); // at 0xC // members private: diff --git a/include/nw4r/snd/snd_Sound3DManager.h b/include/nw4r/snd/snd_Sound3DManager.h index a8f8df43..f3674247 100644 --- a/include/nw4r/snd/snd_Sound3DManager.h +++ b/include/nw4r/snd/snd_Sound3DManager.h @@ -32,18 +32,14 @@ public: Sound3DManager(); - virtual void detail_Update( - SoundParam *pParam, u32 id, detail::BasicSound *pSound, const void *pArg, - u32 flags - ); // at 0x8 + virtual void detail_UpdateAmbientParam(const void*, u32, int, SoundAmbientParam*) override; + virtual int detail_GetAmbientPriority(const void*, u32) override; + virtual int detail_GetRequiredVoiceOutCount(const void*, u32) override; - virtual void Update(SoundParam *pParam, u32 id, SoundHandle *pHandle, const void *pArg, - u32 flags); // at 0x10 - - virtual void *detail_AllocAmbientArg(u32 size); // at 0x14 + virtual void *detail_AllocAmbientArg(u32 size) override; virtual void detail_FreeAmbientArg(void *pArg, - const detail::BasicSound *pSound); // at 0x18 + const detail::BasicSound *pSound) override; u32 GetRequiredMemSize(const SoundArchive *pArchive); bool Setup(const SoundArchive *pArchive, void *pBuffer, u32 size); @@ -64,8 +60,9 @@ public: } int GetBiquadFilterType() const { - return biquadFilterType; + return mBiquadFilterType; } + void SetBiquadFilterType(int type); f32 GetField0x20() const { return field_0x20; @@ -75,6 +72,8 @@ public: return field_0x24; } + void SetEngine(Sound3DEngine *engine); + enum ParamDecayCurve { DECAY_CURVE_NONE, DECAY_CURVE_LOGARITHMIC, @@ -88,7 +87,7 @@ private: s32 mMaxPriorityReduction; // at 0x1C f32 field_0x20; // at 0x20 f32 field_0x24; // at 0x24 - int biquadFilterType; // at 0x28 + int mBiquadFilterType; // at 0x28 }; } // namespace snd diff --git a/src/nw4r/snd/snd_BasicSound.cpp b/src/nw4r/snd/snd_BasicSound.cpp index db6b61fc..d6e29c09 100644 --- a/src/nw4r/snd/snd_BasicSound.cpp +++ b/src/nw4r/snd/snd_BasicSound.cpp @@ -322,7 +322,7 @@ void BasicSound::Update() for (int i = 0; i < mVoiceOutCount; i++) ambientParam.voiceOutParam[i] = basicPlayer.GetVoiceOutParam(i); - mAmbientInfo.paramUpdateCallback->at_0x0c( + mAmbientInfo.paramUpdateCallback->detail_UpdateAmbientParam( mAmbientInfo.arg, mId, mVoiceOutCount, &ambientParam); mAmbientParam.volume = ambientParam.volume; @@ -519,7 +519,7 @@ void BasicSound::Shutdown() if (mAmbientInfo.argAllocaterCallback) { - mAmbientInfo.argAllocaterCallback->at_0x10(mAmbientInfo.arg, this); + mAmbientInfo.argAllocaterCallback->detail_FreeAmbientArg(mAmbientInfo.arg, this); mAmbientInfo.arg = nullptr; } @@ -691,7 +691,7 @@ void BasicSound::SetAmbientInfo(AmbientInfo const &ambientArgInfo) NW4RAssertPointerNonnull_Line(1090, ambientArgInfo.argAllocaterCallback); void *ambientArg = - ambientArgInfo.argAllocaterCallback->at_0x0c(ambientArgInfo.argSize); + ambientArgInfo.argAllocaterCallback->detail_AllocAmbientArg(ambientArgInfo.argSize); if (!ambientArg) { NW4RCheckMessage_Line(1093, ambientArg, "Failed to alloc AmbientArg."); @@ -705,7 +705,7 @@ void BasicSound::SetAmbientInfo(AmbientInfo const &ambientArgInfo) if (ambientArgInfo.paramUpdateCallback) { int voiceOutCount = - mAmbientInfo.paramUpdateCallback->at_0x14(mAmbientInfo.arg, mId); + mAmbientInfo.paramUpdateCallback->detail_GetRequiredVoiceOutCount(mAmbientInfo.arg, mId); if (voiceOutCount > 4) voiceOutCount = 4; @@ -720,7 +720,7 @@ int BasicSound::GetAmbientPriority(AmbientInfo const &ambientInfo, u32 soundId) return PRIORITY_MIN; int priority = - ambientInfo.paramUpdateCallback->at_0x10(ambientInfo.arg, soundId); + ambientInfo.paramUpdateCallback->detail_GetAmbientPriority(ambientInfo.arg, soundId); return priority; } diff --git a/src/nw4r/snd/snd_Sound3DManager.cpp b/src/nw4r/snd/snd_Sound3DManager.cpp index ebd0771c..1c8172e7 100644 --- a/src/nw4r/snd/snd_Sound3DManager.cpp +++ b/src/nw4r/snd/snd_Sound3DManager.cpp @@ -15,30 +15,10 @@ namespace { static Sound3DEngine sEngine; -/** - * Solves the linear equation: - * a*x + b*y + c = d - * - * Where: - * a = dFactor - cFactor - * b = dAngle - cAngle - * c = cAngle * cFactor - * d = dAngle * dFactor - */ -inline f32 SolveLinerFunction(f32 x, f32 dAngle, f32 cAngle, f32 dFactor, - f32 cFactor) { // @typo - if (dAngle == cAngle) { - return (dFactor + cFactor) / 2; - } - - f32 b = dAngle - cAngle; - - return x * (cFactor - dFactor) / b + (dAngle * dFactor - cAngle * cFactor) / b; -} - } // namespace -Sound3DManager::Sound3DManager() : mpEngine(&sEngine), mMaxPriorityReduction(32), field_0x20(0.9f), field_0x24(0.0f), biquadFilterType(0) {} +Sound3DManager::Sound3DManager() + : mpEngine(&sEngine), mMaxPriorityReduction(32), field_0x20(0.9f), field_0x24(0.0f), mBiquadFilterType(0) {} u32 Sound3DManager::GetRequiredMemSize(const SoundArchive *pArchive) { u32 numParam = 0; @@ -60,209 +40,35 @@ bool Sound3DManager::Setup(const SoundArchive *pArchive, void *pBuffer, u32 size return true; } -void Sound3DManager::detail_Update( - SoundParam *pParam, u32 id, detail::BasicSound *pSound, const void *pArg, u32 flags -) { - SoundHandle handle; - if (pSound != NULL) { - handle.detail_AttachSoundAsTempHandle(pSound); - } - - Update(pParam, id, pSound != NULL ? &handle : NULL, pArg, flags); +void Sound3DManager::SetEngine(Sound3DEngine *engine) { + mpEngine = engine; } -void Sound3DManager::Update(SoundParam *pParam, u32 id, SoundHandle *pHandle, const void *pArg, u32 flags) { -#pragma unused(id) -#pragma unused(pHandle) - - f32 angle; - f32 panLR, panFR; - f32 pan, surroundPan; -#if 0 - const Sound3DActorParam* pActorParam = - static_cast(pArg); - - Sound3DListener* pListener = GetListener(); - if (pListener == NULL) { - pParam->volume = 0.0f; - return; +void Sound3DManager::detail_UpdateAmbientParam( + const void *param, u32 unused1, int unused2, SoundAmbientParam *ambientParam +) { + const Sound3DParam *p = static_cast(param); + if (mpEngine != NULL) { + mpEngine->UpdateAmbientParam(this, p, unused1, unused2, ambientParam); } +} - math::VEC3 relativePos; - VEC3Transform(&relativePos, &pListener->GetMatrix(), - &pActorParam->position); - - f32 distance = VEC3Len(&relativePos); - f32 volume = 1.0f; - - if ((flags & (PARAM_UPDATE_VOLUME | PARAM_UPDATE_PRIORITY)) && - distance > pListener->GetMaxVolumeDistance()) { - - switch (pActorParam->soundParam.decayCurve) { - case DECAY_CURVE_LOGARITHMIC: { - f32 units = (distance - pListener->GetMaxVolumeDistance()) / - pListener->GetUnitDistance(); - - volume = - std::pow(pActorParam->soundParam.decayRatio / 256.0f, units); - break; - } - - case DECAY_CURVE_LINEAR: { - f32 units = (distance - pListener->GetMaxVolumeDistance()) / - pListener->GetUnitDistance() * - pActorParam->soundParam.decayRatio; - - units = units / 256.0f; - volume = ut::Max(0.0f, 1.0f - units); - break; - } - } +int Sound3DManager::detail_GetAmbientPriority(const void *param, u32 arg) { + int result = 0; + if (mpEngine != NULL) { + const Sound3DParam *p = static_cast(param); + result = mpEngine->GetAmbientPriority(this, p, arg); } + return result; +} - if ((flags & PARAM_UPDATE_VOLUME) && - !(pActorParam->soundParam.flags & PARAM_UPDATE_VOLUME)) { - - pParam->volume = volume; +int Sound3DManager::detail_GetRequiredVoiceOutCount(const void *param, u32 arg) { + int result = 1; + if (mpEngine != NULL) { + const Sound3DParam *p = static_cast(param); + result = mpEngine->GetRequiredVoiceOutCount(this, p, arg); } - - if (flags & (PARAM_UPDATE_PAN | PARAM_UPDATE_SURROUND_PAN)) { - math::VEC3 adjustedPos; - - if (0.0f == distance) { - adjustedPos.z = 0.0f; - adjustedPos.y = 0.0f; - adjustedPos.x = 0.0f; - } else { - math::VEC3 relativeXZ(relativePos.x, 0.0f, relativePos.z); - - f32 distanceXZ = VEC3Len(&relativeXZ); - if (distanceXZ > pListener->GetInteriorSize()) { - relativeXZ.x *= pListener->GetInteriorSize() / distanceXZ; - relativeXZ.z *= pListener->GetInteriorSize() / distanceXZ; - } - - f32 ratioXZ = VEC3Len(&relativeXZ); - adjustedPos.x = relativePos.x * ratioXZ / distance; - adjustedPos.y = 0.0f; - adjustedPos.z = relativePos.z * ratioXZ / distance; - } - - angle = atan2(adjustedPos.x, -adjustedPos.z); - f32 distanceNrm = VEC3Len(&adjustedPos) / pListener->GetInteriorSize(); - - switch (detail::AxManager::GetInstance().GetOutputMode()) { - case OUTPUT_MODE_SURROUND: - case OUTPUT_MODE_DPL2: { - static f32 angleRearLeft = -mRearSpeakerAngleDpl2; - static f32 angleFrontLeft = -mFrontSpeakerAngleDpl2; - static f32 angleFrontRight = mFrontSpeakerAngleDpl2; - static f32 angleRearRight = mRearSpeakerAngleDpl2; - - // clang-format off - if (angle < angleRearLeft) { - panLR = SolveLinerFunction(angle, -NW4R_MATH_PI, angleRearLeft, -1.0f, 0.0f); - panFR = 1.0f; - } else if (angle < -NW4R_MATH_PI / 2) { - panLR = -1.0f; - panFR = SolveLinerFunction(angle, angleRearLeft, -NW4R_MATH_PI / 2, 0.0f, 1.0f); - } else if (angle < angleFrontLeft) { - panLR = -1.0f; - panFR = SolveLinerFunction(angle, -NW4R_MATH_PI / 2, angleFrontLeft, -1.0f, 0.0f); - } else if (angle < angleFrontRight) { - panLR = SolveLinerFunction(angle, angleFrontLeft, angleFrontRight, 1.0f, -1.0f); - panFR = -1.0f; - } else if (angle < NW4R_MATH_PI / 2) { - panLR = 1.0f; - panFR = SolveLinerFunction(angle, angleFrontRight, NW4R_MATH_PI / 2, 0.0f, -1.0f); - } else if (angle < angleRearRight) { - panLR = 1.0f; - panFR = SolveLinerFunction(angle, NW4R_MATH_PI / 2, angleRearRight, 1.0f, 0.0f); - } else { - panLR = SolveLinerFunction(angle, angleRearRight, NW4R_MATH_PI, 0.0f, 1.0f); - panFR = 1.0f; - } - // clang-format on - - f32 cosAvg = (std::cosf(mFrontSpeakerAngleDpl2) + - std::cosf(mRearSpeakerAngleDpl2)) / - 2.0f; - - f32 rearFactor = - cosAvg / (cosAvg + -std::cosf(mRearSpeakerAngleDpl2)); - - panLR *= mPanRange; - panFR *= mPanRange; - - pan = panLR * distanceNrm; - - surroundPan = - mInitPan + (1.0f + (panFR * distanceNrm + - rearFactor * (1.0f - distanceNrm))); - break; - } - - case OUTPUT_MODE_STEREO: { - static f32 angleRearLeft = -NW4R_MATH_PI + mSpeakerAngleStereo; - static f32 angleFrontLeft = -mSpeakerAngleStereo; - static f32 angleFrontRight = mSpeakerAngleStereo; - static f32 angleRearRight = NW4R_MATH_PI - mSpeakerAngleStereo; - - // clang-format off - if (angle < angleRearLeft) { - panLR = SolveLinerFunction(angle, -NW4R_MATH_PI, angleRearLeft, -1.0f, 0.0f); - panFR = 1.0f; - } else if (angle < angleFrontLeft) { - panLR = -1.0f; - panFR = SolveLinerFunction(angle, angleRearLeft, angleFrontLeft, -1.0f, 1.0f); - } else if (angle < angleFrontRight) { - panLR = SolveLinerFunction(angle, angleFrontLeft, angleFrontRight, 1.0f, -1.0f); - panFR = -1.0f; - } else if (angle < angleRearRight) { - panLR = 1.0f; - panFR = SolveLinerFunction(angle, angleFrontRight, angleRearRight, 1.0f, -1.0f); - } else { - panLR = SolveLinerFunction(angle, angleRearRight, NW4R_MATH_PI, 0.0f, 1.0f); - panFR = 1.0f; - } - // clang-format on - - panLR *= mPanRange; - panFR *= mPanRange; - - surroundPan = 1.0f + panFR * distanceNrm; - pan = panLR * distanceNrm; - break; - } - - case OUTPUT_MODE_MONO: - default: { - pan = 0.0f; - surroundPan = 0.0f; - break; - } - } - } - - if ((flags & PARAM_UPDATE_PAN) && - !(pActorParam->soundParam.flags & PARAM_UPDATE_PAN)) { - - pParam->pan = pan; - } - - if ((flags & PARAM_UPDATE_SURROUND_PAN) && - !(pActorParam->soundParam.flags & PARAM_UPDATE_SURROUND_PAN)) { - - pParam->surroundPan = surroundPan; - } - - if ((flags & PARAM_UPDATE_PRIORITY) && - !(pActorParam->soundParam.flags & PARAM_UPDATE_PRIORITY)) { - - pParam->priority = - -static_cast((1.0f - volume) * GetMaxPriorityReduction()); - } -#endif + return result; } void *Sound3DManager::detail_AllocAmbientArg(u32 size) { @@ -279,6 +85,10 @@ void Sound3DManager::detail_FreeAmbientArg(void *pArg, const detail::BasicSound mParamPool.Free(static_cast(pArg)); } +void Sound3DManager::SetBiquadFilterType(int type) { + mBiquadFilterType = type; +} + Sound3DParam::Sound3DParam() { field_0x18 = 0; decayCurve = Sound3DManager::DECAY_CURVE_LOGARITHMIC; From 2374b07ba445619478958af82e19166075378552 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 28 May 2025 23:47:10 +0200 Subject: [PATCH 66/91] snd_FxReverbStdDpl2 OK --- config/SOUE01/symbols.txt | 16 +-- configure.py | 2 +- include/nw4r/snd/snd_FxBase.h | 2 +- include/nw4r/snd/snd_FxReverbStdDpl2.h | 78 +++++++++++ include/rvl/AXFX.h | 1 + include/rvl/AXFX/AXFXReverbStd.h | 62 ++++++++ src/nw4r/snd/snd_FxReverbStdDpl2.cpp | 187 ++++++++++++++++++++++++- 7 files changed, 337 insertions(+), 11 deletions(-) create mode 100644 include/nw4r/snd/snd_FxReverbStdDpl2.h create mode 100644 include/rvl/AXFX/AXFXReverbStd.h diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index d3cfc41e..938c9af2 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -20050,7 +20050,7 @@ EnemySoundMgr__dtor = .text:0x80361460; // type:function size:0x78 initEnemySoundMgr = .text:0x803614E0; // type:function size:0x48 EnemySoundMgr__deref = .text:0x80361530; // type:function size:0x10 EnemySoundMgr__ctor = .text:0x80361540; // type:function size:0x15C -fn_803616A0 = .text:0x803616A0; // type:function size:0x7C +__dt__Q34nw4r3snd15FxReverbStdDpl2Fv = .text:0x803616A0; // type:function size:0x7C fn_80361720 = .text:0x80361720; // type:function size:0x1CC fn_803618F0 = .text:0x803618F0; // type:function size:0x3DC GetStageTypeFlags = .text:0x80361CD0; // type:function size:0x2FC @@ -38591,7 +38591,7 @@ __vt__Q44nw4r3snd6detail15BiquadFilterHpf = .data:0x8056DBC8; // type:object siz __vt__Q44nw4r3snd6detail15BiquadFilterLpf = .data:0x8056DBD8; // type:object size:0x10 __vt__Q44nw4r3snd15DvdSoundArchive13DvdFileStream = .data:0x8056DBE8; // type:object size:0x64 __vt__Q34nw4r3snd15DvdSoundArchive = .data:0x8056DC50; // type:object size:0x20 -lbl_8056DC70 = .data:0x8056DC70; // type:object size:0x28 +__vt__Q34nw4r3snd15FxReverbStdDpl2 = .data:0x8056DC70; // type:object size:0x24 __vt__Q44nw4r3snd18MemorySoundArchive16MemoryFileStream = .data:0x8056DC98; // type:object size:0x5C __vt__Q34nw4r3snd18MemorySoundArchive = .data:0x8056DCF8; // type:object size:0x20 @3186 = .data:0x8056DD18; // type:object size:0x27 scope:local data:string @@ -49684,12 +49684,12 @@ VOLUME_INIT__Q44nw4r3snd6detail12EnvGenerator = .sdata2:0x8057EFD0; // type:obje @225 = .sdata2:0x8057EFF4; // type:object size:0x4 scope:local align:4 data:float @226 = .sdata2:0x8057EFF8; // type:object size:0x4 scope:local align:4 data:float @227 = .sdata2:0x8057EFFC; // type:object size:0x4 scope:local align:4 data:float -lbl_8057F000 = .sdata2:0x8057F000; // type:object size:0x4 align:4 data:float -lbl_8057F004 = .sdata2:0x8057F004; // type:object size:0x4 align:4 data:float -lbl_8057F008 = .sdata2:0x8057F008; // type:object size:0x4 align:4 data:float -lbl_8057F00C = .sdata2:0x8057F00C; // type:object size:0x4 align:4 data:float -lbl_8057F010 = .sdata2:0x8057F010; // type:object size:0x4 align:4 data:float -lbl_8057F014 = .sdata2:0x8057F014; // type:object size:0x4 align:4 data:float +@1730 = .sdata2:0x8057F000; // type:object size:0x4 scope:local align:4 data:float +@1731 = .sdata2:0x8057F004; // type:object size:0x4 scope:local align:4 data:float +@1732 = .sdata2:0x8057F008; // type:object size:0x4 scope:local align:4 data:float +@1733 = .sdata2:0x8057F00C; // type:object size:0x4 scope:local align:4 data:float +@1734 = .sdata2:0x8057F010; // type:object size:0x4 scope:local align:4 data:float +@1735 = .sdata2:0x8057F014; // type:object size:0x4 scope:local align:4 data:float @94 = .sdata2:0x8057F018; // type:object size:0x4 scope:local align:4 data:float @95 = .sdata2:0x8057F01C; // type:object size:0x4 scope:local align:4 data:float @110 = .sdata2:0x8057F020; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index 30d11743..b2680f20 100644 --- a/configure.py +++ b/configure.py @@ -1035,7 +1035,7 @@ config.libs = [ Object(NonMatching, "nw4r/snd/snd_FxReverbHi.cpp"), Object(NonMatching, "nw4r/snd/snd_FxReverbHiDpl2.cpp"), Object(NonMatching, "nw4r/snd/snd_FxReverbStd.cpp"), - Object(NonMatching, "nw4r/snd/snd_FxReverbStdDpl2.cpp"), + Object(Matching, "nw4r/snd/snd_FxReverbStdDpl2.cpp"), Object(Matching, "nw4r/snd/snd_InstancePool.cpp"), Object(Matching, "nw4r/snd/snd_Lfo.cpp"), Object(Matching, "nw4r/snd/snd_MemorySoundArchive.cpp"), diff --git a/include/nw4r/snd/snd_FxBase.h b/include/nw4r/snd/snd_FxBase.h index 187b105e..34694095 100644 --- a/include/nw4r/snd/snd_FxBase.h +++ b/include/nw4r/snd/snd_FxBase.h @@ -34,7 +34,7 @@ namespace nw4r { namespace snd // vtable FxBase virtual bool StartUp(); virtual void Shutdown(); - virtual void UpdateBuffer(int, void *, u32, SampleFormat, f32, + virtual void UpdateBuffer(int, void **, u32, SampleFormat, f32, OutputMode); virtual void OnChangeOutputMode(); diff --git a/include/nw4r/snd/snd_FxReverbStdDpl2.h b/include/nw4r/snd/snd_FxReverbStdDpl2.h new file mode 100644 index 00000000..033a8fc1 --- /dev/null +++ b/include/nw4r/snd/snd_FxReverbStdDpl2.h @@ -0,0 +1,78 @@ +#ifndef NW4R_SND_FX_REVERB_STD_DPL2_H +#define NW4R_SND_FX_REVERB_STD_DPL2_H + +#include "nw4r/snd/snd_AxfxImpl.h" +#include "nw4r/snd/snd_FxBase.h" +#include "nw4r/types_nw4r.h" + +#include "rvl/AXFX.h" // IWYU pragma: export + +namespace nw4r { +namespace snd { + +namespace detail { +struct FxReverbStdParam { + f32 field_0x00; + f32 field_0x04; + f32 field_0x08; + f32 field_0x0C; + f32 field_0x10; + int field_0x14; + f32 field_0x18; + int field_0x1C; + f32 field_0x20; + f32 field_0x24; + + FxReverbStdParam() + : field_0x00(0.02f), + field_0x04(3.0f), + field_0x08(0.6f), + field_0x0C(0.4f), + field_0x10(1.0f), + field_0x14(5), + field_0x18(0.02f), + field_0x1C(0), + field_0x20(0.0f), + field_0x24(1.0f) {} +}; +} // namespace detail + +class FxReverbStdDpl2 : public FxBase { +public: +public: + FxReverbStdDpl2(); + + virtual ~FxReverbStdDpl2() { + Shutdown(); + ReleaseWorkBuffer(); + } // at 0x8 + + virtual bool StartUp() override; // at 0xC + virtual void Shutdown() override; // at 0x10 + + virtual void UpdateBuffer( + int channels, void **ppBuffer, u32 size, SampleFormat format, f32 sampleRate, + OutputMode mode + ) override; // at 0x14 + + virtual bool AssignWorkBuffer(void *pBuffer, u32 size); // at 0x18 + virtual void ReleaseWorkBuffer(); // at 0x1C + + u32 GetRequiredMemSize(); + bool SetParam(const detail::FxReverbStdParam &rParam); + + void OnChangeOutputMode() override; + +private: + u8 mIsActive; + int mOutputMode; // at 0x10 + detail::AxfxImpl mImpl; // at 0x14 + detail::FxReverbStdParam mParam; // at 0x1C + AXFX_REVERBSTD_EXP mAxfxParam; // at 0x44 + AXFX_REVERBSTD_EXP_DPL2 mAxfxParamDpl; // at 0x12C +}; + +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/rvl/AXFX.h b/include/rvl/AXFX.h index fbfaaa60..5046b176 100644 --- a/include/rvl/AXFX.h +++ b/include/rvl/AXFX.h @@ -15,6 +15,7 @@ extern "C" { #include "rvl/AXFX/AXFXReverbHiExp.h" #include "rvl/AXFX/AXFXReverbHiExpDpl2.h" #include "rvl/AXFX/AXFXSrcCoef.h" +#include "rvl/AXFX/AXFXReverbStd.h" #ifdef __cplusplus } diff --git a/include/rvl/AXFX/AXFXReverbStd.h b/include/rvl/AXFX/AXFXReverbStd.h new file mode 100644 index 00000000..5bf34d1d --- /dev/null +++ b/include/rvl/AXFX/AXFXReverbStd.h @@ -0,0 +1,62 @@ +#ifndef RVL_SDK_AXFX_REVERB_STD_H +#define RVL_SDK_AXFX_REVERB_STD_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct AXFX_REVERBSTD_EXP { + u8 _0x00[0xB4]; + u32 field_0xB4; + f32 field_0xB8; + f32 field_0xBC; + u32 field_0xC0; + f32 field_0xC4; + f32 field_0xC8; + f32 field_0xCC; + f32 field_0xD0; + f32 field_0xD4; + u32 field_0xD8; + u32 field_0xDC; + f32 field_0xE0; + f32 field_0xE4; +} AXFX_REVERBSTD_EXP; + +typedef struct AXFX_REVERBSTD_EXP_DPL2 { + u8 _0x00[0xD0]; + u32 field_0xD0; + f32 field_0xD4; + f32 field_0xD8; + u32 field_0xDC; + f32 field_0xE0; + f32 field_0xE4; + f32 field_0xE8; + f32 field_0xEC; + f32 field_0xF0; + u32 field_0xF4; + u32 field_0xF8; + f32 field_0xFC; + f32 field_0x100; +} AXFX_REVERBSTD_EXP_DPL2; + +u32 AXFXReverbStdExpGetMemSize(const AXFX_REVERBSTD_EXP *fx); +BOOL AXFXReverbStdExpInit(AXFX_REVERBSTD_EXP *fx); +void AXFXReverbStdExpShutdown(AXFX_REVERBSTD_EXP *fx); +BOOL AXFXReverbStdExpSettings(AXFX_REVERBSTD_EXP *fx); +BOOL AXFXReverbStdExpSettingsUpdate(AXFX_REVERBSTD_EXP *fx); +void AXFXReverbStdExpCallback(void* chans, AXFX_REVERBSTD_EXP* context); + +u32 AXFXReverbStdExpGetMemSizeDpl2(const AXFX_REVERBSTD_EXP_DPL2 *fx); +BOOL AXFXReverbStdExpInitDpl2(AXFX_REVERBSTD_EXP_DPL2 *fx); +void AXFXReverbStdExpShutdownDpl2(AXFX_REVERBSTD_EXP_DPL2 *fx); +BOOL AXFXReverbStdExpSettingsDpl2(AXFX_REVERBSTD_EXP_DPL2 *fx); +BOOL AXFXReverbStdExpSettingsUpdateDpl2(AXFX_REVERBSTD_EXP_DPL2 *fx); + +void AXFXReverbStdExpCallbackDpl2(void* chans, AXFX_REVERBSTD_EXP_DPL2* context); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/nw4r/snd/snd_FxReverbStdDpl2.cpp b/src/nw4r/snd/snd_FxReverbStdDpl2.cpp index ed62b7ac..8cf03423 100644 --- a/src/nw4r/snd/snd_FxReverbStdDpl2.cpp +++ b/src/nw4r/snd/snd_FxReverbStdDpl2.cpp @@ -1 +1,186 @@ -// #include "nw4r/snd/snd_FxReverbStdDpl2.h" +#include "nw4r/snd/snd_FxReverbStdDpl2.h" + +#include "common.h" +#include "nw4r/snd/snd_AxManager.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/ut/ut_algorithm.h" + +namespace nw4r { +namespace snd { + +FxReverbStdDpl2::FxReverbStdDpl2() : mIsActive(0) { + detail::FxReverbStdParam p; + SetParam(p); +} + +u32 FxReverbStdDpl2::GetRequiredMemSize() { + return ut::Max( + ut::RoundUp(AXFXReverbStdExpGetMemSizeDpl2(&mAxfxParamDpl) + detail::AxfxImpl::HEAP_SIZE_MIN, 32), + ut::RoundUp(AXFXReverbStdExpGetMemSize(&mAxfxParam) + detail::AxfxImpl::HEAP_SIZE_MIN, 32) + ); +} + +bool FxReverbStdDpl2::AssignWorkBuffer(void *pBuffer, u32 size) { + return mImpl.CreateHeap(pBuffer, size); +} + +void FxReverbStdDpl2::ReleaseWorkBuffer() { + mImpl.DestroyHeap(); +} + +bool FxReverbStdDpl2::StartUp() { + u32 memSize = GetRequiredMemSize(); + if (memSize > mImpl.GetHeapTotalSize()) { + return false; + } + + AXFXAllocHook allocHook; + AXFXFreeHook freeHook; + BOOL success; + switch (detail::AxManager::GetInstance().GetOutputMode()) { + case OUTPUT_MODE_DPL2: { + mOutputMode = 1; + + mImpl.HookAlloc(&allocHook, &freeHook); + success = AXFXReverbStdExpInitDpl2(&mAxfxParamDpl); + mImpl.RestoreAlloc(allocHook, freeHook); + + (void)AXFXReverbStdExpGetMemSizeDpl2(&mAxfxParamDpl); // debug leftover + break; + } + default: { + mOutputMode = 0; + + mImpl.HookAlloc(&allocHook, &freeHook); + success = AXFXReverbStdExpInit(&mAxfxParam); + mImpl.RestoreAlloc(allocHook, freeHook); + + (void)AXFXReverbStdExpGetMemSize(&mAxfxParam); // debug leftover + break; + } + } + + mIsActive = 1; + + return success; +} + +void FxReverbStdDpl2::Shutdown() { + if (!mIsActive) { + return; + } + AXFXAllocHook allocHook; + AXFXFreeHook freeHook; + mIsActive = 0; + mImpl.HookAlloc(&allocHook, &freeHook); + + switch (mOutputMode) { + case 1: { + AXFXReverbStdExpShutdownDpl2(&mAxfxParamDpl); + break; + } + default: { + AXFXReverbStdExpShutdown(&mAxfxParam); + break; + } + } + mImpl.RestoreAlloc(allocHook, freeHook); +} + +bool FxReverbStdDpl2::SetParam(const detail::FxReverbStdParam &rParam) { + mParam = rParam; + + f32 f1 = ut::Max(rParam.field_0x18, 0.0f); + bool b = f1 != mAxfxParam.field_0xB8; + + mAxfxParam.field_0xB4 = mAxfxParamDpl.field_0xD0 = rParam.field_0x14; + mAxfxParam.field_0xB8 = mAxfxParamDpl.field_0xD4 = f1; + + mAxfxParam.field_0xBC = mAxfxParamDpl.field_0xD8 = ut::Clamp(rParam.field_0x00, 0.0f, rParam.field_0x18); + mAxfxParam.field_0xC0 = mAxfxParamDpl.field_0xDC = rParam.field_0x1C; + mAxfxParam.field_0xC4 = mAxfxParamDpl.field_0xE0 = ut::Max(rParam.field_0x04, 0.0f); + mAxfxParam.field_0xC8 = mAxfxParamDpl.field_0xE4 = ut::Clamp(rParam.field_0x08, 0.0f, 1.0f); + mAxfxParam.field_0xCC = mAxfxParamDpl.field_0xE8 = ut::Clamp(rParam.field_0x0C, 0.0f, 1.0f); + mAxfxParam.field_0xD0 = mAxfxParamDpl.field_0xEC = ut::Clamp(rParam.field_0x20, 0.0f, 1.0f); + mAxfxParam.field_0xD4 = mAxfxParamDpl.field_0xF0 = ut::Clamp(rParam.field_0x24, 0.0f, 1.0f); + mAxfxParam.field_0xE0 = mAxfxParamDpl.field_0xFC = ut::Clamp(rParam.field_0x10, 0.0f, 1.0f); + + mAxfxParam.field_0xD8 = 0; + mAxfxParam.field_0xDC = 0; + mAxfxParam.field_0xE4 = 0.0f; + + mAxfxParamDpl.field_0xF4 = 0; + mAxfxParamDpl.field_0xF8 = 0; + mAxfxParamDpl.field_0x100 = 0.0f; + + if (!mIsActive) { + return true; + } + + u32 memSize = GetRequiredMemSize(); + if (memSize > mImpl.GetHeapTotalSize()) { + return false; + } + + AXFXAllocHook allocHook; + AXFXFreeHook freeHook; + BOOL success; + if (b) { + mImpl.HookAlloc(&allocHook, &freeHook); + switch (mOutputMode) { + case 1: success = AXFXReverbStdExpSettingsDpl2(&mAxfxParamDpl); break; + default: success = AXFXReverbStdExpSettings(&mAxfxParam); break; + } + + mImpl.RestoreAlloc(allocHook, freeHook); + } else { + switch (mOutputMode) { + case 1: success = AXFXReverbStdExpSettingsUpdateDpl2(&mAxfxParamDpl); break; + default: success = AXFXReverbStdExpSettingsUpdate(&mAxfxParam); break; + } + } + + return success; +} + +void FxReverbStdDpl2::UpdateBuffer( + int channels, void **ppBuffer, u32 size, SampleFormat sampleFormat, f32 sampleRate, OutputMode outputMode +) { + if (!mIsActive) { + return; + } + + if ((outputMode == OUTPUT_MODE_DPL2) != mOutputMode) { + return; + } + + switch (mOutputMode) { + case 1: { + void *chans[AX_DPL2_MAX]; + chans[AX_DPL2_L] = ppBuffer[AX_DPL2_L]; + chans[AX_DPL2_R] = ppBuffer[AX_DPL2_R]; + chans[AX_DPL2_LS] = ppBuffer[AX_DPL2_LS]; + chans[AX_DPL2_RS] = ppBuffer[AX_DPL2_RS]; + AXFXReverbStdExpCallbackDpl2(chans, &mAxfxParamDpl); + break; + } + default: { + void *chans[3]; + chans[0] = ppBuffer[0]; + chans[1] = ppBuffer[1]; + chans[2] = ppBuffer[2]; + AXFXReverbStdExpCallback(chans, &mAxfxParam); + break; + } + } +} + +void FxReverbStdDpl2::OnChangeOutputMode() { + if (mOutputMode != (detail::AxManager::GetInstance().GetOutputMode() == OUTPUT_MODE_DPL2)) { + Shutdown(); + StartUp(); + } +} + +} // namespace snd +} // namespace nw4r From 05fe105f5dcadd1b46bc6ffcd99695abab94f182 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 00:59:18 +0200 Subject: [PATCH 67/91] snd_Sound3DActor OK --- config/SOUE01/symbols.txt | 14 ++-- configure.py | 16 ++-- include/nw4r/snd/snd_BasicSound.h | 8 +- include/nw4r/snd/snd_ExternalSoundPlayer.h | 30 ++++++++ include/nw4r/snd/snd_Sound3DActor.h | 24 +++--- include/nw4r/snd/snd_Sound3DManager.h | 4 +- include/nw4r/snd/snd_SoundActor.h | 10 +++ include/nw4r/snd/snd_SoundArchive.h | 1 + src/nw4r/snd/snd_Sound3DActor.cpp | 86 ++++++++++++++++++++++ src/nw4r/snd/snd_Sound3DCalculator.cpp | 4 +- src/nw4r/snd/snd_Sound3DManager.cpp | 2 +- 11 files changed, 164 insertions(+), 35 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 938c9af2..8df1885b 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -19872,7 +19872,7 @@ fn_8035BB20 = .text:0x8035BB20; // type:function size:0x8 fn_8035BB30 = .text:0x8035BB30; // type:function size:0x8 fn_8035BB40 = .text:0x8035BB40; // type:function size:0x8 fn_8035BB50 = .text:0x8035BB50; // type:function size:0x8 -fn_8035BB60 = .text:0x8035BB60; // type:function size:0x8 +@84@at_0x0c__Q34nw4r3snd12Sound3DActorFPvPQ44nw4r3snd6detail10BasicSound = .text:0x8035BB60; // type:function size:0x8 fn_8035BB70 = .text:0x8035BB70; // type:function size:0x8 fn_8035BB80 = .text:0x8035BB80; // type:function size:0x3C __dt__Q34nw4r3snd13Sound3DEngineFv = .text:0x8035BBC0; // type:function size:0x40 @@ -25437,9 +25437,9 @@ NoteOn__Q44nw4r3snd6detail8SeqTrackFiilb = .text:0x80474410; // type:function si __ct__Q34nw4r3snd12Sound3DActorFRQ34nw4r3snd18SoundArchivePlayerRQ34nw4r3snd14Sound3DManager = .text:0x80474820; // type:function size:0x90 __dt__Q34nw4r3snd12Sound3DActorFv = .text:0x804748B0; // type:function size:0xD4 SetupSound__Q34nw4r3snd12Sound3DActorFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80474990; // type:function size:0x1A8 -SetPosition_nw4r_snd_Sound3DActor = .text:0x80474B40; // type:function size:0x50 -FUN_80474b90 = .text:0x80474B90; // type:function size:0x3C -@84@__dt__Q34nw4r3snd12Sound3DActorFv = .text:0x80474BD0; // type:function size:0x8 +SetPosition__Q34nw4r3snd12Sound3DActorFRCQ34nw4r4math4VEC3 = .text:0x80474B40; // type:function size:0x50 +at_0x0c__Q34nw4r3snd12Sound3DActorFPvPQ44nw4r3snd6detail10BasicSound = .text:0x80474B90; // type:function size:0x3C +@84@__dt__Q34nw4r3snd12Sound3DActorFv = .text:0x80474BD0; // type:function size:0x8 scope:weak CalcVolumeAndPriority__Q34nw4r3snd17Sound3DCalculatorFRCQ34nw4r3snd14Sound3DManagerRCQ34nw4r3snd15Sound3DListenerRCQ34nw4r3snd12Sound3DParamPfPi = .text:0x80474BE0; // type:function size:0x13C CalcPan__Q34nw4r3snd17Sound3DCalculatorFRCQ34nw4r3snd14Sound3DManagerRCQ34nw4r3snd15Sound3DListenerRCQ34nw4r3snd12Sound3DParamRCQ44nw4r3snd17Sound3DCalculator12CalcPanParamPfPf = .text:0x80474D20; // type:function size:0x160 CalcPitch__Q34nw4r3snd17Sound3DCalculatorFRCQ34nw4r3snd14Sound3DManagerRCQ34nw4r3snd15Sound3DListenerRCQ34nw4r3snd12Sound3DParamPf = .text:0x80474E80; // type:function size:0x1B0 @@ -29158,7 +29158,7 @@ DecibelSquareTable__Q44nw4r3snd6detail12EnvGenerator = .rodata:0x804F8FB8; // ty @LOCAL@SetAttack__Q44nw4r3snd6detail12EnvGeneratorFi@attackTable = .rodata:0x804F90B8; // type:object size:0x200 scope:weak @LOCAL@GetSinIdx__Q44nw4r3snd6detail3LfoFi@sinTable = .rodata:0x804F92B8; // type:object size:0x21 scope:weak @2213 = .rodata:0x804F92E0; // type:object size:0x24 scope:local data:4byte -lbl_804F9308 = .rodata:0x804F9308; // type:object size:0x18 data:4byte +@4458 = .rodata:0x804F9308; // type:object size:0x14 scope:local data:4byte NoteTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9320; // type:object size:0x30 PitchTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9350; // type:object size:0x400 Decibel2RatioTable__Q44nw4r3snd6detail4Util = .rodata:0x804F9750; // type:object size:0xF14 @@ -38609,7 +38609,7 @@ __vt__Q44nw4r3snd6detail9SeqPlayer = .data:0x8056E024; // type:object size:0x64 __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 +__vt__Q34nw4r3snd12Sound3DActor = .data:0x8056E0E8; // type:object size:0x30 __vt__Q34nw4r3snd13Sound3DEngine = .data:0x8056E118; // type:object size:0x1C __vt__Q34nw4r3snd14Sound3DManager = .data:0x8056E138; // type:object size:0x34 __vt__Q34nw4r3snd10SoundActor = .data:0x8056E170; // type:object size:0x1C @@ -49717,7 +49717,7 @@ VOLUME_INIT__Q44nw4r3snd6detail12EnvGenerator = .sdata2:0x8057EFD0; // type:obje @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 +@4796 = .sdata2:0x8057F0B0; // type:object size:0x4 scope:local align:4 data:float @2828 = .sdata2:0x8057F0B8; // type:object size:0x4 scope:local align:4 data:float @2829 = .sdata2:0x8057F0BC; // type:object size:0x4 scope:local align:4 data:float @2830 = .sdata2:0x8057F0C0; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index b2680f20..501b0a6d 100644 --- a/configure.py +++ b/configure.py @@ -1024,17 +1024,17 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), Object(Matching, "nw4r/snd/snd_Channel.cpp"), Object(Matching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), - Object(NonMatching, "nw4r/snd/snd_debug.cpp"), + # Object(NonMatching, "nw4r/snd/snd_debug.cpp"), Object(Matching, "nw4r/snd/snd_DvdSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_EnvGenerator.cpp"), Object(Matching, "nw4r/snd/snd_ExternalSoundPlayer.cpp"), Object(Matching, "nw4r/snd/snd_FrameHeap.cpp"), - Object(NonMatching, "nw4r/snd/snd_FxBase.cpp"), - Object(NonMatching, "nw4r/snd/snd_FxChorus.cpp"), - Object(NonMatching, "nw4r/snd/snd_FxDelay.cpp"), - Object(NonMatching, "nw4r/snd/snd_FxReverbHi.cpp"), - Object(NonMatching, "nw4r/snd/snd_FxReverbHiDpl2.cpp"), - Object(NonMatching, "nw4r/snd/snd_FxReverbStd.cpp"), + # Object(NonMatching, "nw4r/snd/snd_FxBase.cpp"), + # Object(NonMatching, "nw4r/snd/snd_FxChorus.cpp"), + # Object(NonMatching, "nw4r/snd/snd_FxDelay.cpp"), + # Object(NonMatching, "nw4r/snd/snd_FxReverbHi.cpp"), + # Object(NonMatching, "nw4r/snd/snd_FxReverbHiDpl2.cpp"), + # Object(NonMatching, "nw4r/snd/snd_FxReverbStd.cpp"), Object(Matching, "nw4r/snd/snd_FxReverbStdDpl2.cpp"), Object(Matching, "nw4r/snd/snd_InstancePool.cpp"), Object(Matching, "nw4r/snd/snd_Lfo.cpp"), @@ -1052,7 +1052,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SeqSound.cpp"), Object(Matching, "nw4r/snd/snd_SeqSoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SeqTrack.cpp"), - Object(NonMatching, "nw4r/snd/snd_Sound3DActor.cpp"), + Object(Matching, "nw4r/snd/snd_Sound3DActor.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DCalculator.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DEngine.cpp"), Object(Matching, "nw4r/snd/snd_Sound3DListener.cpp"), diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index fcfa1366..b36f3cc9 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -186,8 +186,8 @@ namespace nw4r { namespace snd { namespace detail public: // virtual function ordering // vtable AmbientArgUpdateCallback - virtual void at_0x08(); - virtual void at_0x0c(void *, void *); + virtual ~AmbientArgUpdateCallback() {} + virtual void at_0x0c(void *, BasicSound *); // members private: @@ -299,6 +299,10 @@ namespace nw4r { namespace snd { namespace detail PRIORITY_MAX); } + void ClearAmbientArgUpdateCallback() { + mAmbientInfo.argUpdateCallback = NULL; + } + static int GetAmbientPriority(AmbientInfo const &ambientInfo, u32 soundId); diff --git a/include/nw4r/snd/snd_ExternalSoundPlayer.h b/include/nw4r/snd/snd_ExternalSoundPlayer.h index 4da73373..d76e296f 100644 --- a/include/nw4r/snd/snd_ExternalSoundPlayer.h +++ b/include/nw4r/snd/snd_ExternalSoundPlayer.h @@ -6,6 +6,8 @@ */ #include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_global.h" /******************************************************************************* * classes and functions @@ -35,6 +37,34 @@ namespace nw4r { namespace snd { namespace detail bool detail_CanPlaySound(int startPriority); + template + TForEachFunc ForEachSound(TForEachFunc pFunc, bool reverse) { + if (reverse) { + detail::BasicSound::ExtSoundPlayerPlayLinkList::ReverseIterator it = mSoundList.GetBeginReverseIter(); + + while (it != mSoundList.GetEndReverseIter()) { + detail::BasicSound::ExtSoundPlayerPlayLinkList::ReverseIterator curr = it; + + SoundHandle handle; + handle.detail_AttachSoundAsTempHandle(&*curr); + pFunc(handle); + + if (handle.IsAttachedSound()) { + ++it; + } + } + } else { + NW4R_RANGE_FOR_NO_AUTO_INC(it, mSoundList) { + decltype(it) curItr = it++; + SoundHandle handle; + handle.detail_AttachSoundAsTempHandle(&*curItr); + pFunc(handle); + } + } + + return pFunc; + } + private: BasicSound *GetLowestPrioritySound(); diff --git a/include/nw4r/snd/snd_Sound3DActor.h b/include/nw4r/snd/snd_Sound3DActor.h index 339377ac..a748bddd 100644 --- a/include/nw4r/snd/snd_Sound3DActor.h +++ b/include/nw4r/snd/snd_Sound3DActor.h @@ -2,11 +2,11 @@ #ifndef NW4R_SND_SOUND_3D_ACTOR_H #define NW4R_SND_SOUND_3D_ACTOR_H -#include "nw4r/math.h" #include "nw4r/snd/snd_BasicSound.h" #include "nw4r/snd/snd_SoundActor.h" #include "nw4r/types_nw4r.h" +#include "nw4r/math.h" namespace nw4r { namespace snd { @@ -14,16 +14,12 @@ namespace snd { class Sound3DActor : public SoundActor, public detail::BasicSound::AmbientInfo::AmbientArgUpdateCallback { public: Sound3DActor(SoundArchivePlayer &rPlayer, Sound3DManager &rManager); - virtual ~Sound3DActor(); // at 0x8 + virtual ~Sound3DActor(); - virtual StartResult detail_SetupSound( - SoundHandle *pHandle, u32 id, detail::BasicSound::AmbientInfo *pArgInfo, - detail::ExternalSoundPlayer *pPlayer, bool hold, - const StartInfo *pStartInfo - ); // at 0xC + virtual StartResult SetupSound(SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *) override; - virtual void detail_Update(void *pArg, - const detail::BasicSound *pSound); // at 0xC + // AmbientArgUpdateCallback + virtual void at_0x0c(void *arg, detail::BasicSound* sound) override; void SetPosition(const math::VEC3 &rPosition); @@ -31,10 +27,12 @@ private: static void ClearUpdateCallback(SoundHandle &rHandle); private: - Sound3DManager &m3DManager; // at 0xAC - SoundArchivePlayer &mSoundArchivePlayer; // at 0xB0 - u32 mUserParam; // at 0xB4 - math::VEC3 mPosition; // at 0xB8 + Sound3DManager &m3DManager; // at 0x58 + SoundArchivePlayer *mSoundArchivePlayer; // at 0x5C + u32 mUserParam; // at 0x60 + math::VEC3 mPosition; // at 0x64 + math::VEC3 mVelocity; // at 0x70 + bool mSkipVelocityUpdate; // at 0x7C }; } // namespace snd diff --git a/include/nw4r/snd/snd_Sound3DManager.h b/include/nw4r/snd/snd_Sound3DManager.h index f3674247..9bfa470c 100644 --- a/include/nw4r/snd/snd_Sound3DManager.h +++ b/include/nw4r/snd/snd_Sound3DManager.h @@ -14,12 +14,12 @@ namespace snd { struct Sound3DParam { /* 0x00 */ math::VEC3 position; - /* 0x0C */ math::VEC3 field_0x0C; + /* 0x0C */ math::VEC3 velocity; /* 0x18 */ UNKWORD field_0x18; /* 0x1C */ u8 decayCurve; /* 0x1D */ u8 decayRatio; /* 0x1E */ u8 field_0x1E; - /* 0x20 */ UNKWORD field_0x20; + /* 0x20 */ u32 userParam; /* 0x24 */ UNKWORD field_0x24; Sound3DParam(); diff --git a/include/nw4r/snd/snd_SoundActor.h b/include/nw4r/snd/snd_SoundActor.h index 1a608e2e..044772a7 100644 --- a/include/nw4r/snd/snd_SoundActor.h +++ b/include/nw4r/snd/snd_SoundActor.h @@ -50,6 +50,16 @@ namespace nw4r { namespace snd return &mActorPlayer[actorPlayerId]; } + + template + TForEachFunc ForEachSound(TForEachFunc pFunc, bool reverse) { + for (int i = 0; i < ACTOR_PLAYER_COUNT; i++) { + mActorPlayer[i].ForEachSound(pFunc, reverse); + } + + return pFunc; + } + detail::SoundActorParam const &detail_GetActorParam() const { return mActorParam; diff --git a/include/nw4r/snd/snd_SoundArchive.h b/include/nw4r/snd/snd_SoundArchive.h index 6ebf3a5a..8904ddf8 100644 --- a/include/nw4r/snd/snd_SoundArchive.h +++ b/include/nw4r/snd/snd_SoundArchive.h @@ -123,6 +123,7 @@ namespace nw4r { namespace snd u32 flags; // at 0x0 u8 decayCurve; // at 0x4 u8 decayRatio; // at 0x5 + u8 field_0x06; // at 0x6 }; // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x256dc diff --git a/src/nw4r/snd/snd_Sound3DActor.cpp b/src/nw4r/snd/snd_Sound3DActor.cpp index 5dc4b760..f5e30860 100644 --- a/src/nw4r/snd/snd_Sound3DActor.cpp +++ b/src/nw4r/snd/snd_Sound3DActor.cpp @@ -1 +1,87 @@ #include "nw4r/snd/snd_Sound3DActor.h" + +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_ExternalSoundPlayer.h" +#include "nw4r/snd/snd_Sound3DManager.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundArchivePlayer.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_SoundStartable.h" +#include "nw4r/snd/snd_global.h" + +namespace nw4r { +namespace snd { + +Sound3DActor::Sound3DActor(SoundArchivePlayer &rPlayer, Sound3DManager &rManager) + : SoundActor(rPlayer), + m3DManager(rManager), + mSoundArchivePlayer(&rPlayer), + mUserParam(0), + mPosition(0.0f, 0.0f, 0.0f), + mVelocity(0.0f, 0.0f, 0.0f), + mSkipVelocityUpdate(true) {} + + +Sound3DActor::~Sound3DActor() { + ForEachSound(ClearUpdateCallback, false); +} + +SoundStartable::StartResult +Sound3DActor::SetupSound(SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *pArg) { + Sound3DParam param; + param.position = mPosition; + param.velocity = mVelocity; + param.userParam = mUserParam; + + if (mSoundArchivePlayer != NULL) { + const SoundArchive &archive = mSoundArchivePlayer->GetSoundArchive(); + nw4r::snd::SoundArchive::Sound3DParam arParam; + if (archive.detail_ReadSound3DParam(soundId, &arParam)) { + param.field_0x18 = arParam.flags; + param.decayRatio = arParam.decayRatio; + param.field_0x1E = arParam.field_0x06; + switch (arParam.decayCurve) { + case 1: param.decayCurve = 1; break; + case 2: param.decayCurve = 2; break; + default: param.decayCurve = 1; break; + } + } + param.field_0x24 = archive.GetSoundUserParam(soundId); + } + + detail::BasicSound::AmbientInfo info = { + &m3DManager, this, &m3DManager, ¶m, sizeof(Sound3DParam), + + }; + SoundStartable::StartResult result = + SoundActor::detail_SetupSoundWithAmbientInfo(pHandle, soundId, pStartInfo, &info, pArg); + if (pHandle->detail_GetAttachedSound() != NULL) { + pHandle->detail_GetAttachedSound()->SetPanCurve(PAN_CURVE_SINCOS); + } + return result; +} + +void Sound3DActor::SetPosition(const math::VEC3 &position) { + if (!mSkipVelocityUpdate) { + VEC3Sub(&mVelocity, &position, &mPosition); + } + + mPosition = position; + mSkipVelocityUpdate = 0; +} + +void Sound3DActor::at_0x0c(void *arg, detail::BasicSound *sound) { + Sound3DParam *p = static_cast(arg); + p->position = mPosition; + p->velocity = mVelocity; + p->userParam = mUserParam; +} + +void Sound3DActor::ClearUpdateCallback(SoundHandle& rHandle) { + if (rHandle.IsAttachedSound()) { + rHandle.detail_GetAttachedSound()->ClearAmbientArgUpdateCallback(); + } +} + +} // namespace snd +} // namespace nw4r diff --git a/src/nw4r/snd/snd_Sound3DCalculator.cpp b/src/nw4r/snd/snd_Sound3DCalculator.cpp index 59b27a18..8c1c1b9d 100644 --- a/src/nw4r/snd/snd_Sound3DCalculator.cpp +++ b/src/nw4r/snd/snd_Sound3DCalculator.cpp @@ -131,10 +131,10 @@ void Sound3DCalculator::CalcPitch( f32 f3 = param.field_0x1E / 32.0f; f32 f1, f2; if (distance > 0.0f) { - f1 = -math::VEC3Dot(&relativePos, ¶m.field_0x0C); + f1 = -math::VEC3Dot(&relativePos, ¶m.velocity); f2 = -math::VEC3Dot(&relativePos, &listener.GetVelocity()); } else { - f1 = -math::VEC3Len(¶m.field_0x0C); + f1 = -math::VEC3Len(¶m.velocity); f2 = math::VEC3Len(&listener.GetVelocity()); } f32 pitch; diff --git a/src/nw4r/snd/snd_Sound3DManager.cpp b/src/nw4r/snd/snd_Sound3DManager.cpp index 1c8172e7..5a65c99a 100644 --- a/src/nw4r/snd/snd_Sound3DManager.cpp +++ b/src/nw4r/snd/snd_Sound3DManager.cpp @@ -94,7 +94,7 @@ Sound3DParam::Sound3DParam() { decayCurve = Sound3DManager::DECAY_CURVE_LOGARITHMIC; decayRatio = 128; field_0x1E = 0; - field_0x20 = 0; + userParam = 0; field_0x24 = 0; } From 57deb49df7823f70830d66fcb0519fb80f6134da Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 01:27:42 +0200 Subject: [PATCH 68/91] snd_NandSoundArchive OK --- config/SOUE01/symbols.txt | 18 +++++----- configure.py | 2 +- src/nw4r/snd/snd_NandSoundArchive.cpp | 50 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 22 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 8df1885b..8779a92f 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25310,17 +25310,17 @@ Open__Q34nw4r3snd16NandSoundArchiveFPCc = .text:0x8046F930; // type:function siz Close__Q34nw4r3snd16NandSoundArchiveFv = .text:0x8046FAF0; // type:function size:0x4C OpenStream__Q34nw4r3snd16NandSoundArchiveCFPviUlUl = .text:0x8046FB40; // type:function size:0xB8 OpenExtStream__Q34nw4r3snd16NandSoundArchiveCFPviPCcUlUl = .text:0x8046FC00; // type:function size:0xDC -__dt__Q44nw4r3snd16NandSoundArchive14NandFileStreamFv = .text:0x8046FCE0; // type:function size:0x58 +__dt__Q44nw4r3snd16NandSoundArchive14NandFileStreamFv = .text:0x8046FCE0; // type:function size:0x58 scope:weak detail_GetRequiredStreamBufferSize__Q34nw4r3snd16NandSoundArchiveCFv = .text:0x8046FD40; // type:function size:0x8 LoadFileHeader__Q34nw4r3snd16NandSoundArchiveFv = .text:0x8046FD50; // type:function size:0xBC LoadHeader__Q34nw4r3snd16NandSoundArchiveFPvUl = .text:0x8046FE10; // type:function size:0xB0 LoadLabelStringData__Q34nw4r3snd16NandSoundArchiveFPvUl = .text:0x8046FEC0; // type:function size:0xB0 Read__Q44nw4r3snd16NandSoundArchive14NandFileStreamFPvUl = .text:0x8046FF70; // type:function size:0x84 Seek__Q44nw4r3snd16NandSoundArchive14NandFileStreamFlUl = .text:0x80470000; // type:function size:0x80 -GetSize__Q44nw4r3snd16NandSoundArchive14NandFileStreamCFv = .text:0x80470080; // type:function size:0x8 -Tell__Q44nw4r3snd16NandSoundArchive14NandFileStreamCFv = .text:0x80470090; // type:function size:0x10 -detail_GetWaveDataFileAddress__Q34nw4r3snd16NandSoundArchiveCFUl = .text:0x804700A0; // type:function size:0x8 -detail_GetFileAddress__Q34nw4r3snd16NandSoundArchiveCFUl = .text:0x804700B0; // type:function size:0x8 +GetSize__Q44nw4r3snd16NandSoundArchive14NandFileStreamCFv = .text:0x80470080; // type:function size:0x8 scope:weak +Tell__Q44nw4r3snd16NandSoundArchive14NandFileStreamCFv = .text:0x80470090; // type:function size:0x10 scope:weak +detail_GetWaveDataFileAddress__Q34nw4r3snd16NandSoundArchiveCFUl = .text:0x804700A0; // type:function size:0x8 scope:weak +detail_GetFileAddress__Q34nw4r3snd16NandSoundArchiveCFUl = .text:0x804700B0; // type:function size:0x8 scope:weak __ct__Q44nw4r3snd6detail10PlayerHeapFv = .text:0x804700C0; // type:function size:0x30 __dt__Q44nw4r3snd6detail10PlayerHeapFv = .text:0x804700F0; // type:function size:0xC4 Create__Q44nw4r3snd6detail10PlayerHeapFPvUl = .text:0x804701C0; // type:function size:0x30 @@ -38599,8 +38599,8 @@ __vt__Q34nw4r3snd18MemorySoundArchive = .data:0x8056DCF8; // type:object size:0x __vt__Q44nw4r3snd6detail9MmlParser = .data:0x8056DF38; // type:object size:0x10 __vt__Q44nw4r3snd6detail11MmlSeqTrack = .data:0x8056DF48; // type:object size:0x10 __vt__Q44nw4r3snd6detail20MmlSeqTrackAllocator = .data:0x8056DF58; // type:object size:0x18 -lbl_8056DF70 = .data:0x8056DF70; // type:object size:0x60 -lbl_8056DFD0 = .data:0x8056DFD0; // type:object size:0x20 +__vt__Q44nw4r3snd16NandSoundArchive14NandFileStream = .data:0x8056DF70; // type:object size:0x5C +__vt__Q34nw4r3snd16NandSoundArchive = .data:0x8056DFD0; // type:object size:0x20 __vt__Q44nw4r3snd6detail10PlayerHeap = .data:0x8056DFF0; // type:object size:0x10 @4081 = .data:0x8056E000; // type:object size:0xC scope:local data:4byte @4096 = .data:0x8056E00C; // type:object size:0xC scope:local data:4byte @@ -42427,8 +42427,8 @@ typeInfo__Q44nw4r3snd6detail10BasicSound = .sbss:0x80576678; // type:object size @GUARD@GetInstance__Q44nw4r3snd6detail14ChannelManagerFv@instance = .sbss:0x80576680; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail22DisposeCallbackManagerFv@instance = .sbss:0x80576688; // type:object size:0x1 scope:weak data:byte mPrintVarEnabledFlag__Q44nw4r3snd6detail9MmlParser = .sbss:0x80576690; // type:object size:0x1 data:byte -lbl_80576698 = .sbss:0x80576698; // type:object size:0x4 data:4byte -lbl_8057669C = .sbss:0x8057669C; // type:object size:0x1 data:byte +@LOCAL@LoadFileHeader__Q34nw4r3snd16NandSoundArchiveFv@headerAlignSize = .sbss:0x80576698; // type:object size:0x4 scope:weak data:4byte +@GUARD@LoadFileHeader__Q34nw4r3snd16NandSoundArchiveFv@headerAlignSize = .sbss:0x8057669C; // type:object size:0x1 scope:weak data:byte @GUARD@GetInstance__Q44nw4r3snd6detail20RemoteSpeakerManagerFv@instance = .sbss:0x805766A0; // type:object size:0x1 scope:weak data:byte 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 diff --git a/configure.py b/configure.py index 501b0a6d..c32a6243 100644 --- a/configure.py +++ b/configure.py @@ -1043,7 +1043,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_MmlParser.cpp"), Object(Matching, "nw4r/snd/snd_MmlSeqTrack.cpp"), Object(Matching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), - Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), + Object(Matching, "nw4r/snd/snd_NandSoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_PlayerHeap.cpp"), Object(Matching, "nw4r/snd/snd_RemoteSpeaker.cpp"), Object(Matching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), diff --git a/src/nw4r/snd/snd_NandSoundArchive.cpp b/src/nw4r/snd/snd_NandSoundArchive.cpp index 2e104f72..0dfef853 100644 --- a/src/nw4r/snd/snd_NandSoundArchive.cpp +++ b/src/nw4r/snd/snd_NandSoundArchive.cpp @@ -47,22 +47,48 @@ bool NandSoundArchive::Open(const char* pPath) { return false; } - char currentDir[64]; - NANDGetCurrentDir(currentDir); - u32 currDirLen = std::strlen(currentDir); - char extRoot[FILE_PATH_MAX]; - std::strncpy(extRoot, currentDir, currDirLen + 1); - - for (int i = std::strlen(pPath) - 1; i >= 0; i--) { - if (pPath[i] == '/' || pPath[i] == '\\') { - // @bug Long path can overflow extRoot buffer - std::strncat(extRoot, pPath, i); - extRoot[currDirLen + i] = '\0'; - break; + char *pExtRoot = extRoot; + // UB: (?) Array index 256 is past the end of the array + char *pEnd = &extRoot[FILE_PATH_MAX + 1]; + if (pPath[0] != '/' && pPath[0] != '\\') { + char currentDir[64]; + if (NANDGetCurrentDir(currentDir) != NAND_RESULT_OK) { + return false; } + + char *pCurrentDir = currentDir; + while (*pCurrentDir != '\0') { + if (pExtRoot >= pEnd) { + return false; + } + *pExtRoot++ = *pCurrentDir++; + } + if (pExtRoot >= pEnd) { + return false; + } + *pExtRoot++ = '/'; } + const char *pPath2 = pPath; + const char *p3 = pPath; + while (*pPath2 != '\0') { + if (*pPath2 == '/' || *pPath2 == '\\') { + while (p3 < pPath2) { + if (pExtRoot >= pEnd) { + return false; + } + *pExtRoot++ = *p3++; + } + } + pPath2++; + } + + + if (pExtRoot >= pEnd) { + return false; + } + *pExtRoot = '\0'; SetExternalFileRoot(extRoot); return true; } From ad0f6bb1d2f0a85390766ea20f75521f94e4081c Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 01:38:12 +0200 Subject: [PATCH 69/91] snd_SoundArchiveFile OK --- configure.py | 2 +- include/nw4r/snd/snd_SoundArchiveFile.h | 8 +++- src/nw4r/snd/snd_SoundArchiveFile.cpp | 52 +++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/configure.py b/configure.py index c32a6243..280b3d62 100644 --- a/configure.py +++ b/configure.py @@ -1059,7 +1059,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_Sound3DManager.cpp"), Object(Matching, "nw4r/snd/snd_SoundActor.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchive.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundArchiveFile.cpp"), + Object(Matching, "nw4r/snd/snd_SoundArchiveFile.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), Object(Matching, "nw4r/snd/snd_SoundHandle.cpp"), diff --git a/include/nw4r/snd/snd_SoundArchiveFile.h b/include/nw4r/snd/snd_SoundArchiveFile.h index 6fffb7f4..07b52a47 100644 --- a/include/nw4r/snd/snd_SoundArchiveFile.h +++ b/include/nw4r/snd/snd_SoundArchiveFile.h @@ -99,7 +99,12 @@ namespace nw4r { namespace snd { namespace detail SOUND_TYPE_WAVE, }; - struct Sound3DParam; + struct Sound3DParam { + u32 flags; + u8 decayCurve; + u8 decayRatio; + u8 field_0x06; + }; // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x25183 struct SeqSoundInfo @@ -295,6 +300,7 @@ namespace nw4r { namespace snd { namespace detail char const *GetString(u32 id) const; SoundArchive::SoundType GetSoundType(u32 soundId) const; + u32 GetSoundStringId(u32 id) const; u32 GetBankCount() const; u32 GetPlayerCount() const; u32 GetGroupCount() const; diff --git a/src/nw4r/snd/snd_SoundArchiveFile.cpp b/src/nw4r/snd/snd_SoundArchiveFile.cpp index 802422aa..e202a085 100644 --- a/src/nw4r/snd/snd_SoundArchiveFile.cpp +++ b/src/nw4r/snd/snd_SoundArchiveFile.cpp @@ -200,12 +200,30 @@ bool SoundArchiveFileReader::ReadSoundInfo(u32 soundId, return true; } - +#if 0 /* SoundArchiveFileReader::ReadSound3DParam * ([R89JEL]:/bin/RVL/Debug/mainD.MAP:14110) */ DECOMP_FORCE(Util::GetDataRefAddress0( *(Util::DataRef *)(nullptr), nullptr)); +#endif + +bool SoundArchiveFileReader::ReadSound3DParam(u32 soundId, SoundArchive::Sound3DParam *param) const { + SoundArchiveFile::SoundCommonInfo const *src = impl_GetSoundInfo(soundId); + if (!src) + return false; + + SoundArchiveFile::Sound3DParam const *arParam = + Util::GetDataRefAddress0(src->param3dRef, mInfo); + if (!arParam) + return false; + + param->flags = arParam->flags; + param->decayCurve = arParam->decayCurve; + param->decayRatio = arParam->decayRatio; + param->field_0x06 = arParam->field_0x06; + return true; +} bool SoundArchiveFileReader::ReadSeqSoundInfo( u32 soundId, SoundArchive::SeqSoundInfo *info) const @@ -374,11 +392,21 @@ bool SoundArchiveFileReader::ReadSoundArchivePlayerInfo( return true; } +u32 SoundArchiveFileReader::GetSoundStringId(u32 id) const { + const SoundArchiveFile::SoundCommonInfo* pInfo = impl_GetSoundInfo(id); + + if (pInfo == NULL) { + return SoundArchive::INVALID_ID; + } + + return pInfo->stringId; +} + u32 SoundArchiveFileReader::GetPlayerCount() const { SoundArchiveFile::PlayerInfoTable const *table = Util::GetDataRefAddress0(mInfo->playerTableRef, mInfo); - if (!table) + if (table == NULL) return false; return table->count; @@ -388,21 +416,37 @@ u32 SoundArchiveFileReader::GetGroupCount() const { SoundArchiveFile::GroupInfoTable const *table = Util::GetDataRefAddress0(mInfo->groupTableRef, mInfo); - if (!table) + if (table == NULL) return false; // TODO: why - 1? return table->count - 1; } +#if 0 DECOMP_FORCE(Util::GetDataRefAddress0( *(Util::DataRef *)(nullptr), nullptr)); +#endif + +const char* SoundArchiveFileReader::GetSoundLabelString(u32 id) const { + return GetString(GetSoundStringId(id)); +} + +u32 SoundArchiveFileReader::GetSoundUserParam(u32 id) const { + const SoundArchiveFile::SoundCommonInfo* pInfo = impl_GetSoundInfo(id); + + if (pInfo == NULL) { + return 0; + } + + return pInfo->userParam[0]; +} u32 SoundArchiveFileReader::GetFileCount() const { SoundArchiveFile::FileInfoTable const *table = Util::GetDataRefAddress0(mInfo->fileTableRef, mInfo); - if (!table) + if (table == NULL) return false; return table->count; From 363fe5e17b420a8adfdd905821d881a2956bfd3c Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 01:55:44 +0200 Subject: [PATCH 70/91] snd_SoundArchiveLoader OK --- configure.py | 2 +- include/nw4r/snd/snd_SoundArchiveLoader.h | 2 ++ src/nw4r/snd/snd_SoundArchiveLoader.cpp | 43 +++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 280b3d62..c7f4608c 100644 --- a/configure.py +++ b/configure.py @@ -1060,7 +1060,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SoundActor.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchiveFile.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), + Object(Matching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), Object(Matching, "nw4r/snd/snd_SoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SoundHeap.cpp"), diff --git a/include/nw4r/snd/snd_SoundArchiveLoader.h b/include/nw4r/snd/snd_SoundArchiveLoader.h index da2f22e9..4c55479c 100644 --- a/include/nw4r/snd/snd_SoundArchiveLoader.h +++ b/include/nw4r/snd/snd_SoundArchiveLoader.h @@ -44,6 +44,8 @@ public: ~SoundArchiveLoader(); void *LoadGroup(u32 id, SoundMemoryAllocatable *pAllocatable, void **ppWaveBuffer, u32 blockSize); + s32 ReadFile(u32, void *, s32, s32); + void *LoadFile(u32 id, SoundMemoryAllocatable* pAllocatable); private: mutable OSMutex mMutex; // at 0x0 diff --git a/src/nw4r/snd/snd_SoundArchiveLoader.cpp b/src/nw4r/snd/snd_SoundArchiveLoader.cpp index 57c8b893..c7b726e8 100644 --- a/src/nw4r/snd/snd_SoundArchiveLoader.cpp +++ b/src/nw4r/snd/snd_SoundArchiveLoader.cpp @@ -2,6 +2,9 @@ #include "nw4r/snd/snd_SoundArchive.h" #include "nw4r/snd/snd_SoundMemoryAllocatable.h" +#include "nw4r/types_nw4r.h" +#include "nw4r/ut/ut_FileStream.h" +#include "rvl/OS/OSMutex.h" namespace nw4r { namespace snd { @@ -134,6 +137,46 @@ void* SoundArchiveLoader::LoadGroup(u32 id, return pGroupBuffer; } +s32 SoundArchiveLoader::ReadFile(u32 id, void *dst, s32 size, s32 offset) { + ut::detail::AutoLock lock(mMutex); + + FileStreamHandle fileHandle(mArc.detail_OpenFileStream(id, mStreamArea, sizeof(mStreamArea))); + if (!fileHandle) + return -1; + + if (!fileHandle->CanSeek() || !fileHandle->CanRead()) + return -1; + + fileHandle->Seek(offset, ut::FileStream::SEEKORG_BEG); + mStream = fileHandle.GetFileStream(); + s32 read = mStream->Read(dst, ut::RoundUp(size, 32)); + mStream = NULL; + if (read < 0) + return -1; + + return size; +} + +void *SoundArchiveLoader::LoadFile(u32 id, SoundMemoryAllocatable* pAllocatable) { + SoundArchive::FileInfo info; + if (!mArc.detail_ReadFileInfo(id, &info)) + return NULL; + + u32 size = info.fileSize; + if (size == 0) + return NULL; + + void *buf = pAllocatable->Alloc(size); + if (buf == NULL) + return NULL; + + if (ReadFile(id, buf, size, 0) != size) { + return NULL; + } + DCStoreRange(buf, size); + return buf; +} + } // namespace detail } // namespace snd } // namespace nw4r From 79b20186423b791b8bacb4dfbfc4ea764bbd8051 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 03:09:42 +0200 Subject: [PATCH 71/91] snd_AnimSoundReader OK --- config/SOUE01/splits.txt | 5 +- configure.py | 1 + include/nw4r/snd/snd_AnimSoundReader.h | 53 ++++++++++++++++++ src/nw4r/snd/snd_AnimSoundReader.cpp | 74 ++++++++++++++++++++++++++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 include/nw4r/snd/snd_AnimSoundReader.h create mode 100644 src/nw4r/snd/snd_AnimSoundReader.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index a66cc63d..e2fe6784 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -2893,9 +2893,12 @@ nw4r/g3d/g3d_calcvtx.cpp: .sdata2 start:0x8057EEF0 end:0x8057EEF8 nw4r/snd/snd_AnimSound.cpp: - .text start:0x80461700 end:0x804630D4 align:16 + .text start:0x80461700 end:0x80462F18 align:16 .sdata2 start:0x8057EEF8 end:0x8057EF18 +nw4r/snd/snd_AnimSoundReader.cpp: + .text start:0x80462F20 end:0x804630D4 align:16 + nw4r/snd/snd_AxManager.cpp: .text start:0x804630E0 end:0x80464880 align:16 .ctors start:0x804DB958 end:0x804DB95C diff --git a/configure.py b/configure.py index c7f4608c..7b6c3265 100644 --- a/configure.py +++ b/configure.py @@ -1013,6 +1013,7 @@ config.libs = [ "snd", [ Object(NonMatching, "nw4r/snd/snd_AnimSound.cpp"), + Object(Matching, "nw4r/snd/snd_AnimSoundReader.cpp"), Object(Matching, "nw4r/snd/snd_AxManager.cpp"), Object(Matching, "nw4r/snd/snd_AxVoice.cpp"), Object(Matching, "nw4r/snd/snd_AxVoiceManager.cpp"), diff --git a/include/nw4r/snd/snd_AnimSoundReader.h b/include/nw4r/snd/snd_AnimSoundReader.h new file mode 100644 index 00000000..4ab47f21 --- /dev/null +++ b/include/nw4r/snd/snd_AnimSoundReader.h @@ -0,0 +1,53 @@ +#include "nw4r/snd/snd_Util.h" +#include "nw4r/ut/ut_binaryFileFormat.h" + +namespace nw4r { +namespace snd { +namespace detail { + +struct AnimEvent {}; + +struct AnimEventRef { + u8 _0x00[0xC]; + Util::DataRef event; // at 0x08 +}; + +struct AnimSoundFile { + static u32 const SIGNATURE_FILE = NW4R_FOUR_BYTE('R', 'A', 'S', 'D'); + static int const FILE_VERSION = NW4R_FILE_VERSION(1, 0); + + struct Header { + ut::BinaryFileHeader fileHeader; // size 0x10, offset 0x00 + u32 blockOffset; // at 0x10 + }; + + struct EventTable { + Util::Table eventRef; // at 0x00 + }; + + struct Block { + ut::BinaryBlockHeader blockHeader; // at 0x00 + UNKWORD _0x08; // at 0x08 + Util::DataRef eventTable; // at 0x0C + }; +}; + +class AnimSoundFileReader { +public: + AnimSoundFileReader(); + bool Setup(const void *buf); + void Shutdown(); + u32 GetEventCount() const; + + const AnimSoundFile::EventTable *GetEventTable() const; + const AnimEventRef *GetEventRef(u32 id) const; + const AnimEvent *GetEvent(const AnimEventRef *ref) const; + +private: + const AnimSoundFile::Header *mpHeader; // at 0x00 + const AnimSoundFile::Block *mpBlock; // at 0x04 +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r diff --git a/src/nw4r/snd/snd_AnimSoundReader.cpp b/src/nw4r/snd/snd_AnimSoundReader.cpp new file mode 100644 index 00000000..555e5e94 --- /dev/null +++ b/src/nw4r/snd/snd_AnimSoundReader.cpp @@ -0,0 +1,74 @@ +/* Only implemented to the extent necessary to match data sections. */ + +#include "nw4r/snd/snd_AnimSound.h" + +#include "common.h" // nullptr +#include "nw4r/snd/snd_Util.h" +#include "nw4r/ut/ut_binaryFileFormat.h" + +namespace nw4r { +namespace snd { +namespace detail { + +bool IsValidFileHeader(const void *data) { + ut::BinaryFileHeader const *fileHeader = static_cast(data); + + if (fileHeader->signature != AnimSoundFile::SIGNATURE_FILE) { + return false; + } + + if (fileHeader->version < AnimSoundFile::FILE_VERSION) { + return false; + } + + if (fileHeader->version > AnimSoundFile::FILE_VERSION) { + return false; + } + + return true; +} + +AnimSoundFileReader::AnimSoundFileReader() : mpHeader(NULL) {} + +bool AnimSoundFileReader::Setup(const void *buf) { + if (!IsValidFileHeader(buf)) { + return false; + } + mpHeader = static_cast(buf); + mpBlock = static_cast(ut::AddOffsetToPtr(buf, mpHeader->blockOffset)); + return true; +} + +void AnimSoundFileReader::Shutdown() { + mpHeader = NULL; + mpBlock = NULL; +} + +u32 AnimSoundFileReader::GetEventCount() const { + const AnimSoundFile::EventTable *event = GetEventTable(); + return event->eventRef.count; +} + +const AnimEventRef *AnimSoundFileReader::GetEventRef(u32 id) const { + const AnimSoundFile::EventTable *event = GetEventTable(); + return &event->eventRef.item[id]; +} + +const AnimSoundFile::EventTable *AnimSoundFileReader::GetEventTable() const { + if (mpBlock == NULL) { + return NULL; + } + return Util::GetDataRefAddress0(mpBlock->eventTable, &mpBlock->_0x08); +} + +const AnimEvent *AnimSoundFileReader::GetEvent(const AnimEventRef *ref) const { + if (ref == NULL) { + return NULL; + } + const AnimSoundFile::EventTable *event = GetEventTable(); // unused + return Util::GetDataRefAddress0(ref->event, &mpBlock->_0x08); +} + +} // namespace detail +} // namespace snd +} // namespace nw4r From 8894f73305da296dd7d67036eae97865b5f29876 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 15:10:23 +0200 Subject: [PATCH 72/91] snd_AnimSound OK --- config/SOUE01/symbols.txt | 12 +- configure.py | 2 +- include/nw4r/math/math_arithmetic.h | 6 +- include/nw4r/snd/snd_AnimSound.h | 137 +++++ include/nw4r/snd/snd_AnimSoundReader.h | 62 ++- include/nw4r/snd/snd_BasicSound.h | 1 + include/nw4r/snd/snd_RemoteSpeakerManager.h | 5 +- include/nw4r/snd/snd_SeqSoundHandle.h | 6 + include/nw4r/snd/snd_SoundHandle.h | 6 + include/nw4r/snd/snd_SoundStartable.h | 25 +- .../MSL/MSL_C/MSL_Common/Include/cmath | 20 +- .../MSL/MSL_C/MSL_Common/Include/cmath.h | 9 +- .../MSL/MSL_C/MSL_Common/Include/math.h | 2 +- src/REL/d/a/e/d_a_e_sm.cpp | 2 + src/nw4r/snd/snd_AnimSound.cpp | 481 +++++++++++++++++- src/nw4r/snd/snd_AnimSoundReader.cpp | 4 +- 16 files changed, 733 insertions(+), 47 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 8779a92f..0dfcce5d 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -49635,12 +49635,12 @@ norm_epsilon__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@ = .sdata2:0x8057EDF0; // t @11135 = .sdata2:0x8057EEE4; // type:object size:0x4 scope:local align:4 data:float @11136 = .sdata2:0x8057EEE8; // type:object size:0x4 scope:local align:4 data:float @11190 = .sdata2:0x8057EEF0; // type:object size:0x4 scope:local align:4 data:float -lbl_8057EEF8 = .sdata2:0x8057EEF8; // type:object size:0x4 align:4 data:float -lbl_8057EEFC = .sdata2:0x8057EEFC; // type:object size:0x4 align:4 data:float -lbl_8057EF00 = .sdata2:0x8057EF00; // type:object size:0x8 align:8 data:double -lbl_8057EF08 = .sdata2:0x8057EF08; // type:object size:0x8 align:8 data:double -lbl_8057EF10 = .sdata2:0x8057EF10; // type:object size:0x4 align:4 data:float -lbl_8057EF14 = .sdata2:0x8057EF14; // type:object size:0x4 align:4 data:float +@4352 = .sdata2:0x8057EEF8; // type:object size:0x4 scope:local align:4 data:float +@4353 = .sdata2:0x8057EEFC; // type:object size:0x4 scope:local align:4 data:float +@4474 = .sdata2:0x8057EF00; // type:object size:0x8 scope:local align:8 data:double +@4600 = .sdata2:0x8057EF08; // type:object size:0x8 scope:local align:8 data:double +@5006 = .sdata2:0x8057EF10; // type:object size:0x4 scope:local align:4 data:float +@5007 = .sdata2:0x8057EF14; // type:object size:0x4 scope:local align:4 data:float @2457 = .sdata2:0x8057EF18; // type:object size:0x4 scope:local align:4 data:float @2458 = .sdata2:0x8057EF1C; // type:object size:0x4 scope:local align:4 data:float @2523 = .sdata2:0x8057EF20; // type:object size:0x8 scope:local align:8 data:double diff --git a/configure.py b/configure.py index 7b6c3265..9d62279b 100644 --- a/configure.py +++ b/configure.py @@ -1012,7 +1012,7 @@ config.libs = [ nw4rLib( "snd", [ - Object(NonMatching, "nw4r/snd/snd_AnimSound.cpp"), + Object(Matching, "nw4r/snd/snd_AnimSound.cpp"), Object(Matching, "nw4r/snd/snd_AnimSoundReader.cpp"), Object(Matching, "nw4r/snd/snd_AxManager.cpp"), Object(Matching, "nw4r/snd/snd_AxVoice.cpp"), diff --git a/include/nw4r/math/math_arithmetic.h b/include/nw4r/math/math_arithmetic.h index 8bd573cb..2892128b 100644 --- a/include/nw4r/math/math_arithmetic.h +++ b/include/nw4r/math/math_arithmetic.h @@ -5,6 +5,8 @@ #include "nw4r/types_nw4r.h" // IWYU pragma: export #include "rvl/OS.h" // IWYU pragma: export +#include + #define NW4R_MATH_QNAN (-(0.0f / 0.0f)) #define NW4R_MATH_FLT_MAX 3.402823466e+38f @@ -30,7 +32,7 @@ inline f32 FAbs(register f32 x) { } inline f32 FCeil(f32 x) { - return ceilf(x); + return std::ceilf(x); } inline f32 FExp(f32 x) { @@ -38,7 +40,7 @@ inline f32 FExp(f32 x) { } inline f32 FFloor(f32 x) { - return floorf(x); + return std::floorf(x); } inline f32 FInv(register f32 x) { diff --git a/include/nw4r/snd/snd_AnimSound.h b/include/nw4r/snd/snd_AnimSound.h index 2b25ea5b..7f60bbec 100644 --- a/include/nw4r/snd/snd_AnimSound.h +++ b/include/nw4r/snd/snd_AnimSound.h @@ -1 +1,138 @@ /* Only implemented to the extent necessary to match data sections. */ + +#include "nw4r/snd/snd_AnimSoundReader.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_SoundStartable.h" + +// Class and non-inline function names from InazumaWii, everything else made up + +namespace nw4r { +namespace snd { +namespace detail { + +class AnimEventPlayer { +public: + AnimEventPlayer(); + ~AnimEventPlayer(); + + SoundHandle *GetHandle() { + return &mHandle; + } + + bool IsAttachedSound() const { + return mHandle.IsAttachedSound(); + } + + bool IsCurrentEvent(const AnimEvent *event) const { + return event == mpEvent; + } + + int GetPriority() const { + if (!IsAttachedSound()) { + return 0; + } + return mHandle.detail_GetAttachedSound()->GetPriority(); + } + + bool IsRunning() const { + return mIsRunning; + } + + void SetRunning(bool running) { + mIsRunning = running; + } + + void UpdateFrame() { + if (!mHandle.IsAttachedSound()) { + mpEvent = 0; + } + } + + void Stop() { + if (IsAttachedSound()) { + mHandle.detail_GetAttachedSound()->Stop(0); + } + mpEvent = 0; + } + + void StopEvent(const AnimEvent *event) { + if (mpEvent == event) { + Stop(); + } + } + + void SetVolume(f32 volume) { + if (IsAttachedSound()) { + mHandle.detail_GetAttachedSound()->SetVolume(volume, 0); + } + } + + void SetPitch(f32 pitch) { + if (IsAttachedSound()) { + mHandle.detail_GetAttachedSound()->SetPitch(pitch); + } + } + + bool StartSound(const AnimEvent *event, SoundStartable *startable, bool b); + bool HoldSound(const AnimEvent *event, SoundStartable *startable, bool b); + void SetVolumePitch(const AnimEvent *event, bool b); + void SetVariable(const AnimEvent *event, u32 varNo, f32 f); + +private: + SoundHandle mHandle; // at 0x00 + const AnimEvent *mpEvent; // at 0x04 + bool mIsRunning; // at 0x08 +}; + +class AnimSoundImpl { +public: + enum PlayDirection { + FORWARD, + BACKWARD, + }; + + AnimSoundImpl(SoundStartable &startable, AnimEventPlayer *player, int); + ~AnimSoundImpl(); + + bool Setup(const void *data); + void Shutdown(); + void ResetFrame(f32, int); + void UpdateFrame(f32 frame, PlayDirection dir); + void UpdateForward(f32 frame); + void UpdateBackward(f32 frame); + void UpdateTrigger(const AnimEventRef *, s32, PlayDirection); + void UpdateForwardRange(const AnimEventRef *, s32); + void UpdateBackwardRange(const AnimEventRef *, s32); + + void StartEvent(const AnimEvent *, bool); + void HoldEvent(const AnimEvent *, bool); + // StartEvent is not inlined, but there seems to be + // a corresponding StopEvent function that got inlined + void StopEvent(const AnimEvent *); + + // Made up inlines + bool ShouldPlayEvent(const AnimEventRef *ref) const; + void UpdateEvents(s32 duration, PlayDirection direction); + + typedef void (*Callback)(int, s32, const char *, UNKWORD, UNKWORD); + +private: + /* 0x00 */ SoundStartable &mStartable; + /* 0x04 */ AnimSoundFileReader mReader; + /* 0x0C */ f32 field_0x0C; + /* 0x10 */ AnimEventPlayer *mpSounds; + /* 0x14 */ int mNumSounds; + /* 0x18 */ bool mIsActive; + /* 0x19 */ u8 field_0x19; + /* 0x1A */ u8 field_0x1A; + /* 0x1C */ UNKWORD field_0x1C; + /* 0x20 */ Callback mCallback; + /* 0x24 */ UNKWORD field_0x24; + /* 0x28 */ f32 field_0x28; + /* 0x2C */ f32 mVariableValue; +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r diff --git a/include/nw4r/snd/snd_AnimSoundReader.h b/include/nw4r/snd/snd_AnimSoundReader.h index 4ab47f21..909ffecd 100644 --- a/include/nw4r/snd/snd_AnimSoundReader.h +++ b/include/nw4r/snd/snd_AnimSoundReader.h @@ -5,11 +5,54 @@ namespace nw4r { namespace snd { namespace detail { -struct AnimEvent {}; +struct AnimEvent { + u32 flags_0x00; // at 0x00 + u32 soundId; // at 0x04 + detail::Util::DataRef soundLabelRef; // at 0x08 + u8 volume; // at 0x10 + u8 field_0x11; // at 0x11 + u8 varNo; // at 0x12 + f32 pitch; // at 0x14 + UNKWORD field_0x18; // at 0x18 + UNKWORD field_0x1C; // at 0x1C + + bool ShouldPreventStart() const { + return flags_0x00 & 1; + } + + const char *GetSoundLabel() const { + return Util::GetDataRefAddress0(soundLabelRef, this); + } + + bool GetVarNo(u32 *var) const { + if (ShouldSetVariable()) { + *var = varNo; + return true; + } + return false; + } + + bool ShouldSetVariable() const { + return flags_0x00 & 2; + } + + bool MatchesDirection(int playDirection) const { + bool ret = 0; + u32 config = field_0x11; + if ((config == 0 || (playDirection == 0 && config == 1) || (playDirection == 1 && config == 2))) { + ret = true; + } + return ret; + } +}; struct AnimEventRef { - u8 _0x00[0xC]; - Util::DataRef event; // at 0x08 + int field_0x00; // at 0x08 + int field_0x04; // at 0x04 + u8 flags_0x08; // at 0x08 + s8 field_0x09; // at 0x09 + u8 field_0x0A; // at 0x0A + Util::DataRef event; // at 0x0C }; struct AnimSoundFile { @@ -27,7 +70,7 @@ struct AnimSoundFile { struct Block { ut::BinaryBlockHeader blockHeader; // at 0x00 - UNKWORD _0x08; // at 0x08 + u32 duration; // at 0x08 Util::DataRef eventTable; // at 0x0C }; }; @@ -43,6 +86,17 @@ public: const AnimEventRef *GetEventRef(u32 id) const; const AnimEvent *GetEvent(const AnimEventRef *ref) const; + bool IsValid() const { + return mpHeader != NULL; + } + + u32 GetAnimDuration() const { + if (!IsValid()) { + return 0; + } + return mpBlock->duration; + } + private: const AnimSoundFile::Header *mpHeader; // at 0x00 const AnimSoundFile::Block *mpBlock; // at 0x04 diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index b36f3cc9..8fc57508 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -260,6 +260,7 @@ namespace nw4r { namespace snd { namespace detail PlayerHeap *GetPlayerHeap() { return mPlayerHeap; } SoundPlayer *GetSoundPlayer() { return mSoundPlayer; } int GetVoiceOutCount() const; + int GetPriority() const { return mPriority; } void SetPlayerPriority(int priority); void SetInitialVolume(f32 volume); diff --git a/include/nw4r/snd/snd_RemoteSpeakerManager.h b/include/nw4r/snd/snd_RemoteSpeakerManager.h index 79ebd56d..2793637c 100644 --- a/include/nw4r/snd/snd_RemoteSpeakerManager.h +++ b/include/nw4r/snd/snd_RemoteSpeakerManager.h @@ -21,8 +21,9 @@ public: private: static const int SPEAKER_ALARM_HZ = 150; - static const int SPEAKER_ALARM_PERIOD_NSEC = static_cast(1.0f / SPEAKER_ALARM_HZ * 1000 * 1000 * 1000); - + // commented out since it causes compiler warnings + // static const int SPEAKER_ALARM_PERIOD_NSEC = static_cast(1.0f / SPEAKER_ALARM_HZ * 1000 * 1000 * 1000); + static const int SPEAKER_ALARM_PERIOD_NSEC = 6666667; private: RemoteSpeakerManager(); diff --git a/include/nw4r/snd/snd_SeqSoundHandle.h b/include/nw4r/snd/snd_SeqSoundHandle.h index b5e775b2..709701ed 100644 --- a/include/nw4r/snd/snd_SeqSoundHandle.h +++ b/include/nw4r/snd/snd_SeqSoundHandle.h @@ -7,6 +7,7 @@ #include "common.h" // nullptr +#include "nw4r/snd/snd_SeqSound.h" #include "nw4r/ut/ut_NonCopyable.h" // ut::NonCopyable /******************************************************************************* @@ -33,6 +34,11 @@ namespace nw4r { namespace snd void DetachSound(); + void WriteVariable(int varNo, s16 value) { + if (IsAttachedSound()) + mSound->WriteVariable(varNo, value); + } + // members private: /* base ut::NonCopyable */ // size 0x00, offset 0x00 diff --git a/include/nw4r/snd/snd_SoundHandle.h b/include/nw4r/snd/snd_SoundHandle.h index 19040155..e400a441 100644 --- a/include/nw4r/snd/snd_SoundHandle.h +++ b/include/nw4r/snd/snd_SoundHandle.h @@ -31,8 +31,14 @@ namespace nw4r { namespace snd void detail_AttachSound(detail::BasicSound *sound); bool IsAttachedSound() const { return mSound != nullptr; } detail::BasicSound *detail_GetAttachedSound() { return mSound; } + const detail::BasicSound *detail_GetAttachedSound() const { return mSound; } void DetachSound(); + void Stop() { + if (IsAttachedSound()) + mSound->Stop(0); + } + u32 GetId() const { if (IsAttachedSound()) diff --git a/include/nw4r/snd/snd_SoundStartable.h b/include/nw4r/snd/snd_SoundStartable.h index 5f0a70df..e92a2d02 100644 --- a/include/nw4r/snd/snd_SoundStartable.h +++ b/include/nw4r/snd/snd_SoundStartable.h @@ -144,35 +144,40 @@ namespace nw4r { namespace snd const StartInfo *pStartInfo ); - // TODO: Fix after removal of above functions bool StartSound(SoundHandle *pHandle, u32 id) { - return detail_StartSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_StartSound(pHandle, id, NULL) == START_SUCCESS; + } + bool StartSound(SoundHandle *pHandle, const char *label) { + return detail_StartSound(pHandle, label, NULL) == START_SUCCESS; } bool StartSound(SoundHandle *pHandle, unsigned int id) { - return detail_StartSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_StartSound(pHandle, id, NULL) == START_SUCCESS; } bool StartSound(SoundHandle *pHandle, int id) { - return detail_StartSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_StartSound(pHandle, id, NULL) == START_SUCCESS; } bool HoldSound(SoundHandle *pHandle, u32 id) { - return detail_HoldSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_HoldSound(pHandle, id, NULL) == START_SUCCESS; + } + bool HoldSound(SoundHandle *pHandle, const char *label) { + return detail_HoldSound(pHandle, label, NULL) == START_SUCCESS; } bool HoldSound(SoundHandle *pHandle, unsigned int id) { - return detail_HoldSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_HoldSound(pHandle, id, NULL) == START_SUCCESS; } bool HoldSound(SoundHandle *pHandle, int id) { - return detail_HoldSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_HoldSound(pHandle, id, NULL) == START_SUCCESS; } bool PrepareSound(SoundHandle *pHandle, u32 id) { - return detail_PrepareSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_PrepareSound(pHandle, id, NULL) == START_SUCCESS; } bool PrepareSound(SoundHandle *pHandle, unsigned int id) { - return detail_PrepareSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_PrepareSound(pHandle, id, NULL) == START_SUCCESS; } bool PrepareSound(SoundHandle *pHandle, int id) { - return detail_PrepareSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + return detail_PrepareSound(pHandle, id, NULL) == START_SUCCESS; } // members diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath index 57ceb903..d6685a2a 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath @@ -15,13 +15,13 @@ using ::atan; using ::atan2; using ::atan2f; using ::ceil; -using ::ceilf; +// using ::ceilf; using ::copysign; using ::cos; // using ::cosf; -using ::fabsf; +// using ::fabsf; using ::floor; -using ::floorf; +// using ::floorf; using ::fmod; using ::fmodf; using ::frexp; @@ -35,18 +35,26 @@ using ::scalbn; using ::sin; using ::sinf; using ::sqrt; -using ::sqrtf; +// using ::sqrtf; using ::tan; using ::tanf; -inline float sqrt(float x) { - return ::sqrtf(x); +inline float ceilf(float x) { + return ::ceil(x); +} + +inline float floorf(float x) { + return ::floor(x); } inline float cosf(float x) { return cos(x); } +inline float sqrtf(float x) { + return ::sqrtf(x); +} + // TODO: Very fake! // inline double fabs_wrapper(double x) { // return __fabs(x); diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h index 38e4772b..4ab23c36 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h @@ -3,21 +3,14 @@ namespace std { -/* float fabs(float num) { - return ::fabsf(num); -} */ inline float fabsf(float num) { return ::fabsf(num); } -inline float sqrt(float x) { - return ::sqrtf(x); -} - inline float abs(float x) { return ::fabsf(x); } } // namespace std -#endif \ No newline at end of file +#endif diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h index 0d311c0e..58b6b4e7 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/math.h @@ -29,7 +29,7 @@ double cos(double); float cosf(float); double exp(double); double ceil(double); -float ceilf(float); +// float ceilf(float); double frexp(double, int *); double ldexp(double, int); double modf(double, double *); diff --git a/src/REL/d/a/e/d_a_e_sm.cpp b/src/REL/d/a/e/d_a_e_sm.cpp index dae7f886..6b6e4131 100644 --- a/src/REL/d/a/e/d_a_e_sm.cpp +++ b/src/REL/d/a/e/d_a_e_sm.cpp @@ -41,6 +41,8 @@ #include "toBeSorted/small_sound_mgr.h" #include "toBeSorted/time_area_mgr.h" +#include + SPECIAL_ACTOR_PROFILE(E_SM, dAcEsm_c, fProfile::E_SM, 0xEB, 0, 4098); static dCcD_SrcSph sSphSrc = { diff --git a/src/nw4r/snd/snd_AnimSound.cpp b/src/nw4r/snd/snd_AnimSound.cpp index de514c8b..5f98612d 100644 --- a/src/nw4r/snd/snd_AnimSound.cpp +++ b/src/nw4r/snd/snd_AnimSound.cpp @@ -1,10 +1,481 @@ /* Only implemented to the extent necessary to match data sections. */ +#include "nw4r/snd/snd_AnimSound.h" + #include "common.h" // nullptr -#include +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SeqSound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_SoundStartable.h" -#include "nw4r/snd/snd_Util.h" +#include -DECOMP_FORCE(nw4r::snd::detail::Util::GetDataRefAddress0( - *static_cast const *>(nullptr), - nullptr)); +namespace nw4r { +namespace snd { +namespace detail { + +AnimSoundImpl::AnimSoundImpl(SoundStartable &startable, AnimEventPlayer *player, int numSounds) + : mStartable(startable), + mpSounds(player), + mNumSounds(numSounds), + field_0x0C(0.0f), + mIsActive(false), + field_0x19(0), + field_0x1A(0), + field_0x1C(0), + mCallback(NULL), + field_0x28(1.0f) {} + +AnimSoundImpl::~AnimSoundImpl() { + Shutdown(); +} + +bool AnimSoundImpl::Setup(const void *data) { + Shutdown(); + if (!mReader.Setup(data)) { + return false; + } + + field_0x19 = 1; + mIsActive = true; + field_0x0C = 0.0f; + field_0x1C = 0; + return true; +} + +void AnimSoundImpl::Shutdown() { + if (mIsActive) { + for (int i = 0; i < mNumSounds; i++) { + if (mpSounds[i].GetHandle()->IsAttachedSound() && mpSounds[i].IsRunning()) { + mpSounds[i].GetHandle()->Stop(); + } + } + + mReader.Shutdown(); + mIsActive = false; + } +} + +void AnimSoundImpl::ResetFrame(f32 f, int i) { + field_0x0C = f; + field_0x1C = i; + field_0x1A = 1; + field_0x19 = 0; +} + +void AnimSoundImpl::UpdateFrame(f32 frame, PlayDirection dir) { + for (int i = 0; i < mNumSounds; i++) { + mpSounds[i].UpdateFrame(); + } + + if (field_0x19) { + if (dir == FORWARD) { + ResetFrame(0.0f, 0); + } else { + u32 duration = mReader.GetAnimDuration(); + ResetFrame(duration - 1.0f, 0); + } + field_0x19 = false; + } + + mVariableValue = (frame - field_0x0C) / field_0x28; + if (dir == FORWARD) { + UpdateForward(frame); + } else { + UpdateBackward(frame); + } + field_0x0C = frame; + field_0x1A = false; +} + +bool AnimSoundImpl::ShouldPlayEvent(const AnimEventRef *ref) const { + if (!(ref->flags_0x08 & 1) && (ref->flags_0x08 & 4 || ref->flags_0x08 & 2)) { + return true; + } + int i1 = ut::Max((int)ref->field_0x09, 0); + int i2 = ut::Abs(field_0x1C); + if (ref->field_0x0A == 0) { + if (i2 < i1) { + return false; + } + } else { + if (i2 < i1) { + return false; + } + if ((i2 - i1) % ref->field_0x0A != 0) { + return false; + } + } + + return true; +} + +void AnimSoundImpl::UpdateEvents(s32 duration, PlayDirection direction) { + for (u32 eventIdx = 0; eventIdx < mReader.GetEventCount(); eventIdx++) { + const AnimEventRef *ref = mReader.GetEventRef(eventIdx); + if (ref == NULL) { + continue; + } + if (ShouldPlayEvent(ref)) { + // HACK/Fakematch: Force a reload + if ((((AnimEventRef *)ref)->flags_0x08) & 1) { + UpdateTrigger(ref, duration, direction); + } else { + if (direction == FORWARD) { + UpdateForwardRange(ref, duration); + } else { + UpdateBackwardRange(ref, duration); + } + } + } + } +} + +void AnimSoundImpl::UpdateForward(f32 frame) { + s32 duration = std::floorf(field_0x0C); + s32 iFrame = std::floorf(frame); + + if (field_0x1A && field_0x0C == duration) { + duration -= 1; + } + + if (duration == iFrame) { + return; + } + + s32 loopFrame = duration + 1; + while (true) { + if (loopFrame == mReader.GetAnimDuration()) { + loopFrame -= mReader.GetAnimDuration(); + field_0x1C++; + } + + UpdateEvents(loopFrame, FORWARD); + + if (loopFrame == iFrame) { + break; + } + loopFrame++; + } +} + +void AnimSoundImpl::UpdateBackward(f32 frame) { + s32 duration = std::ceilf(field_0x0C); + s32 iFrame = std::ceilf(frame); + + if (duration >= mReader.GetAnimDuration()) { + duration -= mReader.GetAnimDuration(); + } + + if (iFrame >= mReader.GetAnimDuration()) { + iFrame -= mReader.GetAnimDuration(); + } + + if (field_0x1A && field_0x0C == duration) { + duration += 1; + } + + if (duration == iFrame) { + return; + } + + s32 loopFrame = duration - 1; + while (true) { + if (loopFrame == -1) { + loopFrame += mReader.GetAnimDuration(); + field_0x1C--; + } + + UpdateEvents(loopFrame, BACKWARD); + + if (loopFrame == iFrame) { + break; + } + loopFrame--; + } +} + +void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirection direction) { + const AnimEvent *event = mReader.GetEvent(ref); + if (event == NULL) { + return; + } + + if (ref->flags_0x08 & 4) { + return; + } + + if (!event->MatchesDirection(direction)) { + return; + } + + if ((ref->flags_0x08 & 2)) { + if (ref->field_0x00 == frame) { + StopEvent(event); + if (mCallback != NULL) { + (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + StartEvent(event, true); + } + } else { + if (ref->field_0x00 == frame) { + StopEvent(event); + if (mCallback != NULL) { + (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + StartEvent(event, true); + } + + s32 u; + if (direction == FORWARD) { + u = ref->field_0x04; + } else { + u = ut::Max(ref->field_0x00 * 2 - ref->field_0x04, 0); + } + + if (u == frame) { + if (mCallback != NULL) { + (mCallback)(1, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + StopEvent(event); + } + } +} + +void AnimSoundImpl::UpdateForwardRange(const AnimEventRef *ref, s32 frame) { + const AnimEvent *event = mReader.GetEvent(ref); + if (event == NULL) { + return; + } + + if (ref->flags_0x08 & 4 && ref->flags_0x08 & 2) { + HoldEvent(event, true); + return; + } + + if (ref->flags_0x08 & 4) { + if (ref->field_0x04 == frame && mCallback != NULL) { + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (field_0x1C < ref->field_0x09) { + HoldEvent(event, true); + } else if (field_0x1C == ref->field_0x09) { + if (frame < ref->field_0x04) { + HoldEvent(event, true); + } else { + StopEvent(event); + } + } + } else if ((ref->flags_0x08 & 2)) { + if (ref->field_0x00 == frame && mCallback != NULL) { + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (field_0x1C > ref->field_0x09) { + HoldEvent(event, true); + } else if (field_0x1C == ref->field_0x09 && ref->field_0x00 <= frame) { + HoldEvent(event, true); + } + } else { + if (ref->field_0x00 == frame && mCallback != NULL) { + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (ref->field_0x04 == frame && mCallback != NULL) { + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (ref->field_0x00 <= frame && frame < ref->field_0x04) { + HoldEvent(event, true); + } else { + StopEvent(event); + } + } +} + +void AnimSoundImpl::UpdateBackwardRange(const AnimEventRef *ref, s32 frame) { + const AnimEvent *event = mReader.GetEvent(ref); + if (event == NULL) { + return; + } + + if (ref->flags_0x08 & 4 && ref->flags_0x08 & 2) { + HoldEvent(event, true); + return; + } + + if (ref->flags_0x08 & 4) { + if (ref->field_0x04 == frame && mCallback != NULL) { + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (field_0x1C < ref->field_0x09) { + HoldEvent(event, true); + } else if (field_0x1C == ref->field_0x09 && frame <= ref->field_0x04) { + HoldEvent(event, true); + } + } else if ((ref->flags_0x08 & 2)) { + if (ref->field_0x00 == frame && mCallback != NULL) { + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (field_0x1C > ref->field_0x09) { + HoldEvent(event, true); + } else if (field_0x1C == ref->field_0x09) { + if (ref->field_0x00 < frame) { + HoldEvent(event, true); + } else { + StopEvent(event); + } + } + } else { + if (ref->field_0x00 == frame && mCallback != NULL) { + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (ref->field_0x04 == frame && mCallback != NULL) { + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + } + if (ref->field_0x00 < frame && frame <= ref->field_0x04) { + HoldEvent(event, true); + } else { + StopEvent(event); + } + } +} + +void AnimSoundImpl::StartEvent(const AnimEvent *event, bool b) { + int leastPriority = 0x80; + int leastPriorityIdx = -1; + int i = 0; + for (; i < mNumSounds; i++) { + if (!mpSounds[i].IsAttachedSound()) { + break; + } + int priority = mpSounds[i].GetPriority(); + if (leastPriority > priority) { + leastPriorityIdx = i; + leastPriority = priority; + } + } + + if (i == mNumSounds) { + mpSounds[leastPriorityIdx].Stop(); + i = leastPriorityIdx; + } + + mpSounds[i].StartSound(event, &mStartable, b); + + u32 varNo = 0; + if (event->GetVarNo(&varNo)) { + mpSounds[i].SetVariable(event, varNo, mVariableValue); + } +} + +void AnimSoundImpl::HoldEvent(const AnimEvent *event, bool b) { + int leastPriority = 0x80; + int leastPriorityIdx = -1; + int i = 0; + for (; i < mNumSounds; i++) { + if (mpSounds[i].IsCurrentEvent(event)) { + return; + } + if (!mpSounds[i].IsAttachedSound()) { + leastPriorityIdx = i; + leastPriority = -1; + } else { + int priority = mpSounds[i].GetPriority(); + if (leastPriority > priority) { + leastPriorityIdx = i; + leastPriority = priority; + } + } + } + + if (i == mNumSounds) { + mpSounds[leastPriorityIdx].Stop(); + i = leastPriorityIdx; + } + + mpSounds[i].HoldSound(event, &mStartable, b); + + u32 varNo = 0; + if (event->GetVarNo(&varNo)) { + mpSounds[i].SetVariable(event, varNo, mVariableValue); + } +} + +void AnimSoundImpl::StopEvent(const AnimEvent *event) { + for (int i = 0; i < mNumSounds; i++) { + mpSounds[i].StopEvent(event); + } +} + +bool AnimEventPlayer::StartSound(const AnimEvent *event, SoundStartable *startable, bool b) { + if (event->soundId == 0xFFFFFFFF) { + if (!startable->StartSound(GetHandle(), event->GetSoundLabel())) { + return false; + } + } else { + if (!startable->StartSound(GetHandle(), event->soundId)) { + return false; + } + } + + SetVolumePitch(event, b); + + return true; +} + +bool AnimEventPlayer::HoldSound(const AnimEvent *event, SoundStartable *startable, bool b) { + if (event->soundId == 0xFFFFFFFF) { + if (!startable->HoldSound(GetHandle(), event->GetSoundLabel())) { + return false; + } + } else { + if (!startable->HoldSound(GetHandle(), event->soundId)) { + return false; + } + } + + GetHandle()->detail_GetAttachedSound()->SetAutoStopCounter(0); + SetVolumePitch(event, b); + + return true; +} + +void AnimEventPlayer::SetVolumePitch(const AnimEvent *event, bool b) { + if (event->volume < 128) { + SetVolume(event->volume / 128.0f); + } + if (event->pitch != 1.0f) { + SetPitch(event->pitch); + } + + mpEvent = event; + if (b) { + b = !event->ShouldPreventStart(); + } + mIsRunning = b; +} + +void AnimEventPlayer::SetVariable(const AnimEvent *event, u32 varNo, f32 f) { + if (varNo < 16) { + if (GetHandle()->IsAttachedSound()) { + SeqSoundHandle handle(GetHandle()); + int iVal = f * 100.0f; + handle.WriteVariable(varNo, ut::Clamp(iVal, -0x8000, 0x7FFF)); + handle.DetachSound(); + } + } else if (varNo < 32) { + int iVal = f * 100.0f; + SeqSound::WriteGlobalVariable(varNo - 16, ut::Clamp(iVal, -0x8000, 0x7FFF)); + } +} + +AnimEventPlayer::AnimEventPlayer() : mpEvent(0), mIsRunning(false) {} + +AnimEventPlayer::~AnimEventPlayer() { + if (mHandle.IsAttachedSound() && IsRunning()) { + mHandle.Stop(); + } +} + +} // namespace detail +} // namespace snd +} // namespace nw4r diff --git a/src/nw4r/snd/snd_AnimSoundReader.cpp b/src/nw4r/snd/snd_AnimSoundReader.cpp index 555e5e94..a003139d 100644 --- a/src/nw4r/snd/snd_AnimSoundReader.cpp +++ b/src/nw4r/snd/snd_AnimSoundReader.cpp @@ -58,7 +58,7 @@ const AnimSoundFile::EventTable *AnimSoundFileReader::GetEventTable() const { if (mpBlock == NULL) { return NULL; } - return Util::GetDataRefAddress0(mpBlock->eventTable, &mpBlock->_0x08); + return Util::GetDataRefAddress0(mpBlock->eventTable, &mpBlock->duration); } const AnimEvent *AnimSoundFileReader::GetEvent(const AnimEventRef *ref) const { @@ -66,7 +66,7 @@ const AnimEvent *AnimSoundFileReader::GetEvent(const AnimEventRef *ref) const { return NULL; } const AnimSoundFile::EventTable *event = GetEventTable(); // unused - return Util::GetDataRefAddress0(ref->event, &mpBlock->_0x08); + return Util::GetDataRefAddress0(ref->event, &mpBlock->duration); } } // namespace detail From e3b4063ff4a1537af4ea076e40941db09a963dc3 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 17:14:02 +0200 Subject: [PATCH 73/91] snd_SoundArchivePlayer OK --- config/SOUE01/symbols.txt | 32 ++++++++++----------- configure.py | 2 +- include/nw4r/snd/snd_SoundInstanceManager.h | 2 +- include/nw4r/snd/snd_SoundStartable.h | 18 ------------ 4 files changed, 18 insertions(+), 36 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 0dfcce5d..ba0f3b34 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -25544,14 +25544,14 @@ LoadGroup__Q44nw4r3snd6detail18SoundArchiveLoaderFUlPQ34nw4r3snd22SoundMemoryAll ReadFile__Q44nw4r3snd6detail18SoundArchiveLoaderFUlPvll = .text:0x804782F0; // type:function size:0x18C LoadFile__Q44nw4r3snd6detail18SoundArchiveLoaderFUlPQ34nw4r3snd22SoundMemoryAllocatable = .text:0x80478480; // type:function size:0xDC __ct__Q34nw4r3snd18SoundArchivePlayerFv = .text:0x80478560; // type:function size:0x120 -__dt__Q44nw4r3snd18SoundArchivePlayer17SeqNoteOnCallbackFv = .text:0x80478680; // type:function size:0x40 -__dt__Q44nw4r3snd18SoundArchivePlayer11WsdCallbackFv = .text:0x804786C0; // type:function size:0x40 -__ct__Q34nw4r2ut41LinkListFv = .text:0x80478700; // type:function size:0x18 -__dt__Q34nw4r2ut41LinkListFv = .text:0x80478720; // type:function size:0x58 -__ct__Q34nw4r2ut42LinkListFv = .text:0x80478780; // type:function size:0x18 -__dt__Q34nw4r2ut42LinkListFv = .text:0x804787A0; // type:function size:0x58 -__ct__Q34nw4r2ut42LinkListFv = .text:0x80478800; // type:function size:0x18 -__dt__Q34nw4r2ut42LinkListFv = .text:0x80478820; // type:function size:0x58 +__dt__Q44nw4r3snd18SoundArchivePlayer17SeqNoteOnCallbackFv = .text:0x80478680; // type:function size:0x40 scope:weak +__dt__Q44nw4r3snd18SoundArchivePlayer11WsdCallbackFv = .text:0x804786C0; // type:function size:0x40 scope:weak +__ct__Q34nw4r2ut41LinkListFv = .text:0x80478700; // type:function size:0x18 scope:weak +__dt__Q34nw4r2ut41LinkListFv = .text:0x80478720; // type:function size:0x58 scope:weak +__ct__Q34nw4r2ut42LinkListFv = .text:0x80478780; // type:function size:0x18 scope:weak +__dt__Q34nw4r2ut42LinkListFv = .text:0x804787A0; // type:function size:0x58 scope:weak +__ct__Q34nw4r2ut42LinkListFv = .text:0x80478800; // type:function size:0x18 scope:weak +__dt__Q34nw4r2ut42LinkListFv = .text:0x80478820; // type:function size:0x58 scope:weak __dt__Q34nw4r3snd18SoundArchivePlayerFv = .text:0x80478880; // type:function size:0xB8 IsAvailable__Q34nw4r3snd18SoundArchivePlayerCFv = .text:0x80478940; // type:function size:0x1C Setup__Q34nw4r3snd18SoundArchivePlayerFPCQ34nw4r3snd12SoundArchivePvUlPvUl = .text:0x80478960; // type:function size:0x104 @@ -25578,9 +25578,9 @@ InvalidateData__Q34nw4r3snd18SoundArchivePlayerFPCvPCv = .text:0x8047AC60; // ty InvalidateWaveData__Q34nw4r3snd18SoundArchivePlayerFPCvPCv = .text:0x8047AD10; // type:function size:0xA8 NoteOn__Q44nw4r3snd18SoundArchivePlayer17SeqNoteOnCallbackFPQ44nw4r3snd6detail9SeqPlayeriRCQ44nw4r3snd6detail10NoteOnInfo = .text:0x8047ADC0; // type:function size:0x128 GetWaveSoundData__Q44nw4r3snd18SoundArchivePlayer11WsdCallbackCFPQ44nw4r3snd6detail13WaveSoundInfoPQ44nw4r3snd6detail17WaveSoundNoteInfoPQ44nw4r3snd6detail8WaveInfoPCviiUl = .text:0x8047AEF0; // type:function size:0xFC -@12@detail_ConvertLabelStringToSoundId__Q34nw4r3snd18SoundArchivePlayerFPCc = .text:0x8047AFF0; // type:function size:0x8 -@12@detail_SetupSound__Q34nw4r3snd18SoundArchivePlayerFPQ34nw4r3snd11SoundHandleUlbPCQ44nw4r3snd14SoundStartable9StartInfo = .text:0x8047B000; // type:function size:0x8 -@12@__dt__Q34nw4r3snd18SoundArchivePlayerFv = .text:0x8047B010; // type:function size:0x8 +@12@detail_ConvertLabelStringToSoundId__Q34nw4r3snd18SoundArchivePlayerFPCc = .text:0x8047AFF0; // type:function size:0x8 scope:weak +@12@detail_SetupSound__Q34nw4r3snd18SoundArchivePlayerFPQ34nw4r3snd11SoundHandleUlbPCQ44nw4r3snd14SoundStartable9StartInfo = .text:0x8047B000; // type:function size:0x8 scope:weak +@12@__dt__Q34nw4r3snd18SoundArchivePlayerFv = .text:0x8047B010; // type:function size:0x8 scope:weak detail_AttachSoundAsTempHandle__Q34nw4r3snd11SoundHandleFPQ44nw4r3snd6detail10BasicSound = .text:0x8047B020; // type:function size:0x4C detail_AttachSound__Q34nw4r3snd11SoundHandleFPQ44nw4r3snd6detail10BasicSound = .text:0x8047B070; // type:function size:0x4C DetachSound__Q34nw4r3snd11SoundHandleFv = .text:0x8047B0C0; // type:function size:0x50 @@ -38614,9 +38614,9 @@ __vt__Q34nw4r3snd13Sound3DEngine = .data:0x8056E118; // type:object size:0x1C __vt__Q34nw4r3snd14Sound3DManager = .data:0x8056E138; // type:object size:0x34 __vt__Q34nw4r3snd10SoundActor = .data:0x8056E170; // type:object size:0x1C __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 +__vt__Q34nw4r3snd18SoundArchivePlayer = .data:0x8056E1B0; // type:object size:0x30 +__vt__Q44nw4r3snd18SoundArchivePlayer11WsdCallback = .data:0x8056E1E0; // type:object size:0x10 +__vt__Q44nw4r3snd18SoundArchivePlayer17SeqNoteOnCallback = .data:0x8056E1F0; // type:object size:0x10 __vt__Q34nw4r3snd9SoundHeap = .data:0x8056E200; // type:object size:0x10 @2785 = .data:0x8056E210; // type:object size:0x46 scope:local data:string __vt__Q44nw4r3snd6detail10StrmPlayer = .data:0x8056E258; // type:object size:0x48 @@ -49745,8 +49745,8 @@ VOLUME_INIT__Q44nw4r3snd6detail12EnvGenerator = .sdata2:0x8057EFD0; // type:obje @2581 = .sdata2:0x8057F12C; // type:object size:0x4 scope:local align:4 data:float @3454 = .sdata2:0x8057F130; // type:object size:0x4 scope:local align:4 data:float @3455 = .sdata2:0x8057F134; // type:object size:0x4 scope:local align:4 data:float -lbl_8057F138 = .sdata2:0x8057F138; // type:object size:0x4 align:4 data:float -lbl_8057F140 = .sdata2:0x8057F140; // type:object size:0x8 align:8 data:double +@12402 = .sdata2:0x8057F138; // type:object size:0x4 scope:local align:4 data:float +@12410 = .sdata2:0x8057F140; // type:object size:0x8 scope:local align:8 data:double @2452 = .sdata2:0x8057F148; // type:object size:0x4 scope:local align:4 data:float @2453 = .sdata2:0x8057F14C; // type:object size:0x4 scope:local align:4 data:float @5421 = .sdata2:0x8057F150; // type:object size:0x4 scope:local align:4 data:float diff --git a/configure.py b/configure.py index 9d62279b..4ccee40c 100644 --- a/configure.py +++ b/configure.py @@ -1062,7 +1062,7 @@ config.libs = [ Object(Matching, "nw4r/snd/snd_SoundArchive.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchiveFile.cpp"), Object(Matching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), - Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), + Object(Matching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), Object(Matching, "nw4r/snd/snd_SoundHandle.cpp"), Object(Matching, "nw4r/snd/snd_SoundHeap.cpp"), Object(Matching, "nw4r/snd/snd_SoundPlayer.cpp"), diff --git a/include/nw4r/snd/snd_SoundInstanceManager.h b/include/nw4r/snd/snd_SoundInstanceManager.h index c43d546e..092200ae 100644 --- a/include/nw4r/snd/snd_SoundInstanceManager.h +++ b/include/nw4r/snd/snd_SoundInstanceManager.h @@ -179,7 +179,7 @@ namespace nw4r { namespace snd { namespace detail private: MemoryPool mPool; // size 0x04, offset 0x00 typename Sound::PriorityLinkList mPriorityList; // size 0x0c, offset 0x04 - mutable OSMutex mMutex; // size 0x18, offset 0x10 + OSMutex mMutex; // size 0x18, offset 0x10 }; // size 0x28 }}} // namespace nw4r::snd::detail diff --git a/include/nw4r/snd/snd_SoundStartable.h b/include/nw4r/snd/snd_SoundStartable.h index e92a2d02..c672c7f3 100644 --- a/include/nw4r/snd/snd_SoundStartable.h +++ b/include/nw4r/snd/snd_SoundStartable.h @@ -111,12 +111,6 @@ namespace nw4r { namespace snd SoundHandle *pHandle, const char *label, const StartInfo *pStartInfo ); - // TODO: Remove - StartResult detail_StartSound( - SoundHandle *pHandle, u32 id, detail::BasicSound::AmbientInfo *pArgInfo, - detail::ExternalSoundPlayer *pPlayer, const StartInfo *pStartInfo - ); - StartResult detail_HoldSound( SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo ); @@ -124,18 +118,6 @@ namespace nw4r { namespace snd SoundHandle *pHandle, const char *label, const StartInfo *pStartInfo ); - // TODO: Remove - StartResult detail_HoldSound( - SoundHandle *pHandle, u32 id, detail::BasicSound::AmbientInfo *pArgInfo, - detail::ExternalSoundPlayer *pPlayer, const StartInfo *pStartInfo - ); - - // TODO: Remove - StartResult detail_PrepareSound( - SoundHandle *pHandle, u32 id, detail::BasicSound::AmbientInfo *pArgInfo, - detail::ExternalSoundPlayer *pPlayer, const StartInfo *pStartInfo - ); - StartResult detail_PrepareSound( SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo ); From 0666c44c0aeb95cfcb9af131229eed1e74bf4a20 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 29 May 2025 21:15:52 +0200 Subject: [PATCH 74/91] Small AnimSound cleanup --- include/nw4r/snd/snd_AnimSound.h | 8 ++---- include/nw4r/snd/snd_AnimSoundReader.h | 12 +++----- src/nw4r/snd/snd_AnimSound.cpp | 38 ++++++++++++-------------- 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/include/nw4r/snd/snd_AnimSound.h b/include/nw4r/snd/snd_AnimSound.h index 7f60bbec..4289d4bb 100644 --- a/include/nw4r/snd/snd_AnimSound.h +++ b/include/nw4r/snd/snd_AnimSound.h @@ -39,10 +39,6 @@ public: return mIsRunning; } - void SetRunning(bool running) { - mIsRunning = running; - } - void UpdateFrame() { if (!mHandle.IsAttachedSound()) { mpEvent = 0; @@ -74,8 +70,8 @@ public: } } - bool StartSound(const AnimEvent *event, SoundStartable *startable, bool b); - bool HoldSound(const AnimEvent *event, SoundStartable *startable, bool b); + void StartSound(const AnimEvent *event, SoundStartable *startable, bool b); + void HoldSound(const AnimEvent *event, SoundStartable *startable, bool b); void SetVolumePitch(const AnimEvent *event, bool b); void SetVariable(const AnimEvent *event, u32 varNo, f32 f); diff --git a/include/nw4r/snd/snd_AnimSoundReader.h b/include/nw4r/snd/snd_AnimSoundReader.h index 909ffecd..be7422bf 100644 --- a/include/nw4r/snd/snd_AnimSoundReader.h +++ b/include/nw4r/snd/snd_AnimSoundReader.h @@ -6,7 +6,7 @@ namespace snd { namespace detail { struct AnimEvent { - u32 flags_0x00; // at 0x00 + u32 flags; // at 0x00 u32 soundId; // at 0x04 detail::Util::DataRef soundLabelRef; // at 0x08 u8 volume; // at 0x10 @@ -17,7 +17,7 @@ struct AnimEvent { UNKWORD field_0x1C; // at 0x1C bool ShouldPreventStart() const { - return flags_0x00 & 1; + return flags & 1; } const char *GetSoundLabel() const { @@ -25,17 +25,13 @@ struct AnimEvent { } bool GetVarNo(u32 *var) const { - if (ShouldSetVariable()) { + if (flags & 2) { *var = varNo; return true; } return false; } - bool ShouldSetVariable() const { - return flags_0x00 & 2; - } - bool MatchesDirection(int playDirection) const { bool ret = 0; u32 config = field_0x11; @@ -49,7 +45,7 @@ struct AnimEvent { struct AnimEventRef { int field_0x00; // at 0x08 int field_0x04; // at 0x04 - u8 flags_0x08; // at 0x08 + u8 flags; // at 0x08 s8 field_0x09; // at 0x09 u8 field_0x0A; // at 0x0A Util::DataRef event; // at 0x0C diff --git a/src/nw4r/snd/snd_AnimSound.cpp b/src/nw4r/snd/snd_AnimSound.cpp index 5f98612d..6d9219e8 100644 --- a/src/nw4r/snd/snd_AnimSound.cpp +++ b/src/nw4r/snd/snd_AnimSound.cpp @@ -90,7 +90,7 @@ void AnimSoundImpl::UpdateFrame(f32 frame, PlayDirection dir) { } bool AnimSoundImpl::ShouldPlayEvent(const AnimEventRef *ref) const { - if (!(ref->flags_0x08 & 1) && (ref->flags_0x08 & 4 || ref->flags_0x08 & 2)) { + if (!(ref->flags & 1) && (ref->flags & 4 || ref->flags & 2)) { return true; } int i1 = ut::Max((int)ref->field_0x09, 0); @@ -119,7 +119,7 @@ void AnimSoundImpl::UpdateEvents(s32 duration, PlayDirection direction) { } if (ShouldPlayEvent(ref)) { // HACK/Fakematch: Force a reload - if ((((AnimEventRef *)ref)->flags_0x08) & 1) { + if ((((AnimEventRef *)ref)->flags) & 1) { UpdateTrigger(ref, duration, direction); } else { if (direction == FORWARD) { @@ -202,7 +202,7 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect return; } - if (ref->flags_0x08 & 4) { + if (ref->flags & 4) { return; } @@ -210,7 +210,7 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect return; } - if ((ref->flags_0x08 & 2)) { + if ((ref->flags & 2)) { if (ref->field_0x00 == frame) { StopEvent(event); if (mCallback != NULL) { @@ -249,12 +249,12 @@ void AnimSoundImpl::UpdateForwardRange(const AnimEventRef *ref, s32 frame) { return; } - if (ref->flags_0x08 & 4 && ref->flags_0x08 & 2) { + if (ref->flags & 4 && ref->flags & 2) { HoldEvent(event, true); return; } - if (ref->flags_0x08 & 4) { + if (ref->flags & 4) { if (ref->field_0x04 == frame && mCallback != NULL) { (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } @@ -267,7 +267,7 @@ void AnimSoundImpl::UpdateForwardRange(const AnimEventRef *ref, s32 frame) { StopEvent(event); } } - } else if ((ref->flags_0x08 & 2)) { + } else if ((ref->flags & 2)) { if (ref->field_0x00 == frame && mCallback != NULL) { (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } @@ -297,12 +297,12 @@ void AnimSoundImpl::UpdateBackwardRange(const AnimEventRef *ref, s32 frame) { return; } - if (ref->flags_0x08 & 4 && ref->flags_0x08 & 2) { + if (ref->flags & 4 && ref->flags & 2) { HoldEvent(event, true); return; } - if (ref->flags_0x08 & 4) { + if (ref->flags & 4) { if (ref->field_0x04 == frame && mCallback != NULL) { (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } @@ -311,7 +311,7 @@ void AnimSoundImpl::UpdateBackwardRange(const AnimEventRef *ref, s32 frame) { } else if (field_0x1C == ref->field_0x09 && frame <= ref->field_0x04) { HoldEvent(event, true); } - } else if ((ref->flags_0x08 & 2)) { + } else if ((ref->flags & 2)) { if (ref->field_0x00 == frame && mCallback != NULL) { (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } @@ -406,37 +406,33 @@ void AnimSoundImpl::StopEvent(const AnimEvent *event) { } } -bool AnimEventPlayer::StartSound(const AnimEvent *event, SoundStartable *startable, bool b) { +void AnimEventPlayer::StartSound(const AnimEvent *event, SoundStartable *startable, bool b) { if (event->soundId == 0xFFFFFFFF) { if (!startable->StartSound(GetHandle(), event->GetSoundLabel())) { - return false; + return; } } else { if (!startable->StartSound(GetHandle(), event->soundId)) { - return false; + return; } } SetVolumePitch(event, b); - - return true; } -bool AnimEventPlayer::HoldSound(const AnimEvent *event, SoundStartable *startable, bool b) { +void AnimEventPlayer::HoldSound(const AnimEvent *event, SoundStartable *startable, bool b) { if (event->soundId == 0xFFFFFFFF) { if (!startable->HoldSound(GetHandle(), event->GetSoundLabel())) { - return false; + return; } } else { if (!startable->HoldSound(GetHandle(), event->soundId)) { - return false; + return; } } GetHandle()->detail_GetAttachedSound()->SetAutoStopCounter(0); SetVolumePitch(event, b); - - return true; } void AnimEventPlayer::SetVolumePitch(const AnimEvent *event, bool b) { @@ -468,7 +464,7 @@ void AnimEventPlayer::SetVariable(const AnimEvent *event, u32 varNo, f32 f) { } } -AnimEventPlayer::AnimEventPlayer() : mpEvent(0), mIsRunning(false) {} +AnimEventPlayer::AnimEventPlayer() : mpEvent(NULL), mIsRunning(false) {} AnimEventPlayer::~AnimEventPlayer() { if (mHandle.IsAttachedSound() && IsRunning()) { From a1f0add8990ca5301e6161877503e6080425c5f7 Mon Sep 17 00:00:00 2001 From: Swekka Date: Fri, 30 May 2025 11:53:52 +0200 Subject: [PATCH 75/91] d_a_obj_blade OK --- .../SOUE01/rels/d_a_obj_bladeNP/symbols.txt | 10 ++--- configure.py | 2 +- include/d/a/obj/d_a_obj_blade.h | 10 +++++ src/REL/d/a/obj/d_a_obj_blade.cpp | 39 +++++++++++++++++++ 4 files changed, 55 insertions(+), 6 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt b/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt index 206eda9b..6758b5ac 100644 --- a/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt @@ -2,11 +2,11 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dAcOblade_c_classInit__Fv = .text:0x00000070; // type:function size:0x90 -fn_382_100 = .text:0x00000100; // type:function size:0x98 -fn_382_1A0 = .text:0x000001A0; // type:function size:0xC4 -fn_382_270 = .text:0x00000270; // type:function size:0x8 -fn_382_280 = .text:0x00000280; // type:function size:0x30 -fn_382_2B0 = .text:0x000002B0; // type:function size:0x28 +createHeap__11dAcOblade_cFv = .text:0x00000100; // type:function size:0x98 +create__11dAcOblade_cFv = .text:0x000001A0; // type:function size:0xC4 +doDelete__11dAcOblade_cFv = .text:0x00000270; // type:function size:0x8 +actorExecute__11dAcOblade_cFv = .text:0x00000280; // type:function size:0x30 +draw__11dAcOblade_cFv = .text:0x000002B0; // type:function size:0x28 __dt__11dAcOblade_cFv = .text:0x000002E0; // type:function size:0x68 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global diff --git a/configure.py b/configure.py index f923d459..1da9312b 100644 --- a/configure.py +++ b/configure.py @@ -1959,7 +1959,7 @@ config.libs = [ ), Rel(Matching, "d_a_obj_bird_sp", "REL/d/a/obj/d_a_obj_bird_sp.cpp"), Rel(Matching, "d_a_obj_bird_statue", "REL/d/a/obj/d_a_obj_bird_statue.cpp"), - Rel(NonMatching, "d_a_obj_blade", "REL/d/a/obj/d_a_obj_blade.cpp"), + Rel(Matching, "d_a_obj_blade", "REL/d/a/obj/d_a_obj_blade.cpp"), Rel(NonMatching, "d_a_obj_blast_rock", "REL/d/a/obj/d_a_obj_blast_rock.cpp"), Rel(NonMatching, "d_a_obj_block_rope", "REL/d/a/obj/d_a_obj_block_rope.cpp"), Rel( diff --git a/include/d/a/obj/d_a_obj_blade.h b/include/d/a/obj/d_a_obj_blade.h index d2a7f71c..b0204632 100644 --- a/include/d/a/obj/d_a_obj_blade.h +++ b/include/d/a/obj/d_a_obj_blade.h @@ -2,13 +2,23 @@ #define D_A_OBJ_BLADE_H #include "d/a/obj/d_a_obj_base.h" +#include "m/m3d/m_anmmdl.h" +#include "nw4r/g3d/res/g3d_resfile.h" class dAcOblade_c : public dAcObjBase_c { public: dAcOblade_c() {} virtual ~dAcOblade_c() {} + virtual bool createHeap() override; + virtual int create() override; + virtual int doDelete() override; + virtual int actorExecute() override; + virtual int draw() override; + private: + /* 0x330 */ nw4r::g3d::ResFile mResFile; + /* 0x334 */ m3d::mdlAnmChr mMdl; }; #endif diff --git a/src/REL/d/a/obj/d_a_obj_blade.cpp b/src/REL/d/a/obj/d_a_obj_blade.cpp index 7ac3a94b..e72061d9 100644 --- a/src/REL/d/a/obj/d_a_obj_blade.cpp +++ b/src/REL/d/a/obj/d_a_obj_blade.cpp @@ -1,3 +1,42 @@ #include "d/a/obj/d_a_obj_blade.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/d_stage.h" +#include "f/f_base.h" +#include "m/m_vec.h" +#include "nw4r/g3d/res/g3d_resfile.h" +#include "toBeSorted/arc_managers/current_stage_arc_manager.h" + SPECIAL_ACTOR_PROFILE(OBJ_BLADE, dAcOblade_c, fProfile::OBJ_BLADE, 0x1E4, 0, 4); + +bool dAcOblade_c::createHeap() { + void *data = CurrentStageArcManager::GetInstance()->getData("g3d/stage.brres"); + mResFile = nw4r::g3d::ResFile(data); + dStage_c::bindStageResToFile(&mResFile); + dStage_c::bindSkyCmnToResFile(&mResFile); + TRY_CREATE(mMdl.create(data, "StageF000Blade", "StageF000Blade", &heap_allocator, 0x120)); + return true; +} + +int dAcOblade_c::create() { + CREATE_ALLOCATOR(dAcOblade_c); + mMdl.setAnm("StageF000Blade", m3d::PLAY_MODE_4); + updateMatrix(); + mMdl.getModel().setLocalMtx(mWorldMtx); + boundingBox.Set(mVec3_c(-0.0f, -0.0f, -0.0f), mVec3_c(0.0f, 0.0f, 0.0f)); + return SUCCEEDED; +} + +int dAcOblade_c::doDelete() { + return SUCCEEDED; +} + +int dAcOblade_c::actorExecute() { + mMdl.play(); + return SUCCEEDED; +} + +int dAcOblade_c::draw() { + drawModelType1(&mMdl.getModel()); + return SUCCEEDED; +} From cefcd141f6827ae86f21b637704487f00b7240e4 Mon Sep 17 00:00:00 2001 From: Swekka Date: Fri, 30 May 2025 12:01:40 +0200 Subject: [PATCH 76/91] add scope:local to lbl --- config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt b/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt index 6758b5ac..82f04ab9 100644 --- a/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt @@ -13,7 +13,7 @@ _dtors = .dtors:0x00000000; // type:label scope:global lbl_382_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float lbl_382_rodata_4 = .rodata:0x00000004; // type:object size:0x4 align:4 data:float g_profile_OBJ_BLADE = .data:0x00000000; // type:object size:0x10 -lbl_382_data_10 = .data:0x00000010; // type:object size:0x10 data:string -lbl_382_data_20 = .data:0x00000020; // type:object size:0x10 -lbl_382_data_30 = .data:0x00000030; // type:object size:0x20 -lbl_382_data_50 = .data:0x00000050; // type:object size:0x80 +lbl_382_data_10 = .data:0x00000010; // type:object size:0x10 scope:local data:string +lbl_382_data_20 = .data:0x00000020; // type:object size:0x10 scope:local +lbl_382_data_30 = .data:0x00000030; // type:object size:0x20 scope:local +lbl_382_data_50 = .data:0x00000050; // type:object size:0x80 scope:local From 3511016604d45d7e61c776639dae24c451708b17 Mon Sep 17 00:00:00 2001 From: Swekka Date: Fri, 30 May 2025 12:26:28 +0200 Subject: [PATCH 77/91] fix incorrect scope:local --- config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt b/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt index 82f04ab9..63c0caf2 100644 --- a/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_bladeNP/symbols.txt @@ -10,10 +10,10 @@ draw__11dAcOblade_cFv = .text:0x000002B0; // type:function size:0x28 __dt__11dAcOblade_cFv = .text:0x000002E0; // type:function size:0x68 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_382_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float -lbl_382_rodata_4 = .rodata:0x00000004; // type:object size:0x4 align:4 data:float +lbl_382_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float +lbl_382_rodata_4 = .rodata:0x00000004; // type:object size:0x4 scope:local align:4 data:float g_profile_OBJ_BLADE = .data:0x00000000; // type:object size:0x10 lbl_382_data_10 = .data:0x00000010; // type:object size:0x10 scope:local data:string lbl_382_data_20 = .data:0x00000020; // type:object size:0x10 scope:local lbl_382_data_30 = .data:0x00000030; // type:object size:0x20 scope:local -lbl_382_data_50 = .data:0x00000050; // type:object size:0x80 scope:local +__vt__11dAcOblade_c = .data:0x00000050; // type:object size:0x80 From a5c1e5c4d5171d4706b32513385c15fb28328e91 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 30 May 2025 23:00:30 +0200 Subject: [PATCH 78/91] Use BBA names and type for AnimSound, fixes fakematch --- include/nw4r/snd/snd_AnimSound.h | 35 ++-- include/nw4r/snd/snd_AnimSoundReader.h | 18 +- src/nw4r/snd/snd_AnimSound.cpp | 218 +++++++++++++------------ 3 files changed, 143 insertions(+), 128 deletions(-) diff --git a/include/nw4r/snd/snd_AnimSound.h b/include/nw4r/snd/snd_AnimSound.h index 4289d4bb..37d66c2f 100644 --- a/include/nw4r/snd/snd_AnimSound.h +++ b/include/nw4r/snd/snd_AnimSound.h @@ -5,7 +5,8 @@ #include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/snd/snd_SoundStartable.h" -// Class and non-inline function names from InazumaWii, everything else made up +// Class and non-inlined function names from InazumaWii +// Names of automatically inlined functions from BBA namespace nw4r { namespace snd { @@ -39,22 +40,13 @@ public: return mIsRunning; } - void UpdateFrame() { - if (!mHandle.IsAttachedSound()) { - mpEvent = 0; - } - } + void UpdateFrame(); - void Stop() { - if (IsAttachedSound()) { - mHandle.detail_GetAttachedSound()->Stop(0); - } - mpEvent = 0; - } + void ForceStop(); void StopEvent(const AnimEvent *event) { if (mpEvent == event) { - Stop(); + ForceStop(); } } @@ -70,8 +62,14 @@ public: } } - void StartSound(const AnimEvent *event, SoundStartable *startable, bool b); - void HoldSound(const AnimEvent *event, SoundStartable *startable, bool b); + void StartEvent(const AnimEvent *event, SoundStartable *startable, bool b); + void HoldEvent(const AnimEvent *event, SoundStartable *startable, bool b); + + // Not sure about these, this could be related to + // InitParam__Q44nw4r3snd6detail15AnimEventPlayerFPCQ44nw4r3snd6detail9AnimEventb + // from BBA, but SetVariable is almost certainly an inline (duplicated code) + // but the float argument is read from AnimSoundImpl so something seems to have + // changed. void SetVolumePitch(const AnimEvent *event, bool b); void SetVariable(const AnimEvent *event, u32 varNo, f32 f); @@ -97,19 +95,16 @@ public: void UpdateFrame(f32 frame, PlayDirection dir); void UpdateForward(f32 frame); void UpdateBackward(f32 frame); + void UpdateOneFrame(s32 duration, PlayDirection direction); void UpdateTrigger(const AnimEventRef *, s32, PlayDirection); void UpdateForwardRange(const AnimEventRef *, s32); void UpdateBackwardRange(const AnimEventRef *, s32); void StartEvent(const AnimEvent *, bool); void HoldEvent(const AnimEvent *, bool); - // StartEvent is not inlined, but there seems to be - // a corresponding StopEvent function that got inlined void StopEvent(const AnimEvent *); + bool IsPlayableLoopCount(const nw4r::snd::detail::AnimEventFrameInfo&); - // Made up inlines - bool ShouldPlayEvent(const AnimEventRef *ref) const; - void UpdateEvents(s32 duration, PlayDirection direction); typedef void (*Callback)(int, s32, const char *, UNKWORD, UNKWORD); diff --git a/include/nw4r/snd/snd_AnimSoundReader.h b/include/nw4r/snd/snd_AnimSoundReader.h index be7422bf..43e9adf1 100644 --- a/include/nw4r/snd/snd_AnimSoundReader.h +++ b/include/nw4r/snd/snd_AnimSoundReader.h @@ -5,6 +5,15 @@ namespace nw4r { namespace snd { namespace detail { +// Type and name revealed by BBA +struct AnimEventFrameInfo { + int field_0x00; // at 0x00 + int field_0x04; // at 0x04 + u8 flags; // at 0x08 + s8 field_0x09; // at 0x09 + u8 field_0x0A; // at 0x0A +}; + struct AnimEvent { u32 flags; // at 0x00 u32 soundId; // at 0x04 @@ -42,15 +51,13 @@ struct AnimEvent { } }; +// Name from Inazuma, BBA struct AnimEventRef { - int field_0x00; // at 0x08 - int field_0x04; // at 0x04 - u8 flags; // at 0x08 - s8 field_0x09; // at 0x09 - u8 field_0x0A; // at 0x0A + AnimEventFrameInfo mInfo; // at 0x00 Util::DataRef event; // at 0x0C }; +// Names unknown struct AnimSoundFile { static u32 const SIGNATURE_FILE = NW4R_FOUR_BYTE('R', 'A', 'S', 'D'); static int const FILE_VERSION = NW4R_FILE_VERSION(1, 0); @@ -71,6 +78,7 @@ struct AnimSoundFile { }; }; +// Name from Inazuma class AnimSoundFileReader { public: AnimSoundFileReader(); diff --git a/src/nw4r/snd/snd_AnimSound.cpp b/src/nw4r/snd/snd_AnimSound.cpp index 6d9219e8..ab8151aa 100644 --- a/src/nw4r/snd/snd_AnimSound.cpp +++ b/src/nw4r/snd/snd_AnimSound.cpp @@ -89,49 +89,6 @@ void AnimSoundImpl::UpdateFrame(f32 frame, PlayDirection dir) { field_0x1A = false; } -bool AnimSoundImpl::ShouldPlayEvent(const AnimEventRef *ref) const { - if (!(ref->flags & 1) && (ref->flags & 4 || ref->flags & 2)) { - return true; - } - int i1 = ut::Max((int)ref->field_0x09, 0); - int i2 = ut::Abs(field_0x1C); - if (ref->field_0x0A == 0) { - if (i2 < i1) { - return false; - } - } else { - if (i2 < i1) { - return false; - } - if ((i2 - i1) % ref->field_0x0A != 0) { - return false; - } - } - - return true; -} - -void AnimSoundImpl::UpdateEvents(s32 duration, PlayDirection direction) { - for (u32 eventIdx = 0; eventIdx < mReader.GetEventCount(); eventIdx++) { - const AnimEventRef *ref = mReader.GetEventRef(eventIdx); - if (ref == NULL) { - continue; - } - if (ShouldPlayEvent(ref)) { - // HACK/Fakematch: Force a reload - if ((((AnimEventRef *)ref)->flags) & 1) { - UpdateTrigger(ref, duration, direction); - } else { - if (direction == FORWARD) { - UpdateForwardRange(ref, duration); - } else { - UpdateBackwardRange(ref, duration); - } - } - } - } -} - void AnimSoundImpl::UpdateForward(f32 frame) { s32 duration = std::floorf(field_0x0C); s32 iFrame = std::floorf(frame); @@ -151,7 +108,7 @@ void AnimSoundImpl::UpdateForward(f32 frame) { field_0x1C++; } - UpdateEvents(loopFrame, FORWARD); + UpdateOneFrame(loopFrame, FORWARD); if (loopFrame == iFrame) { break; @@ -187,7 +144,7 @@ void AnimSoundImpl::UpdateBackward(f32 frame) { field_0x1C--; } - UpdateEvents(loopFrame, BACKWARD); + UpdateOneFrame(loopFrame, BACKWARD); if (loopFrame == iFrame) { break; @@ -196,13 +153,33 @@ void AnimSoundImpl::UpdateBackward(f32 frame) { } } +void AnimSoundImpl::UpdateOneFrame(s32 duration, PlayDirection direction) { + for (u32 eventIdx = 0; eventIdx < mReader.GetEventCount(); eventIdx++) { + const AnimEventRef *ref = mReader.GetEventRef(eventIdx); + if (ref == NULL) { + continue; + } + if (IsPlayableLoopCount(ref->mInfo)) { + if ((ref->mInfo.flags) & 1) { + UpdateTrigger(ref, duration, direction); + } else { + if (direction == FORWARD) { + UpdateForwardRange(ref, duration); + } else { + UpdateBackwardRange(ref, duration); + } + } + } + } +} + void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirection direction) { const AnimEvent *event = mReader.GetEvent(ref); if (event == NULL) { return; } - if (ref->flags & 4) { + if (ref->mInfo.flags & 4) { return; } @@ -210,8 +187,8 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect return; } - if ((ref->flags & 2)) { - if (ref->field_0x00 == frame) { + if ((ref->mInfo.flags & 2)) { + if (ref->mInfo.field_0x00 == frame) { StopEvent(event); if (mCallback != NULL) { (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); @@ -219,7 +196,7 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect StartEvent(event, true); } } else { - if (ref->field_0x00 == frame) { + if (ref->mInfo.field_0x00 == frame) { StopEvent(event); if (mCallback != NULL) { (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); @@ -229,9 +206,9 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect s32 u; if (direction == FORWARD) { - u = ref->field_0x04; + u = ref->mInfo.field_0x04; } else { - u = ut::Max(ref->field_0x00 * 2 - ref->field_0x04, 0); + u = ut::Max(ref->mInfo.field_0x00 * 2 - ref->mInfo.field_0x04, 0); } if (u == frame) { @@ -249,41 +226,41 @@ void AnimSoundImpl::UpdateForwardRange(const AnimEventRef *ref, s32 frame) { return; } - if (ref->flags & 4 && ref->flags & 2) { + if (ref->mInfo.flags & 4 && ref->mInfo.flags & 2) { HoldEvent(event, true); return; } - if (ref->flags & 4) { - if (ref->field_0x04 == frame && mCallback != NULL) { + if (ref->mInfo.flags & 4) { + if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (field_0x1C < ref->field_0x09) { + if (field_0x1C < ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->field_0x09) { - if (frame < ref->field_0x04) { + } else if (field_0x1C == ref->mInfo.field_0x09) { + if (frame < ref->mInfo.field_0x04) { HoldEvent(event, true); } else { StopEvent(event); } } - } else if ((ref->flags & 2)) { - if (ref->field_0x00 == frame && mCallback != NULL) { + } else if ((ref->mInfo.flags & 2)) { + if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (field_0x1C > ref->field_0x09) { + if (field_0x1C > ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->field_0x09 && ref->field_0x00 <= frame) { + } else if (field_0x1C == ref->mInfo.field_0x09 && ref->mInfo.field_0x00 <= frame) { HoldEvent(event, true); } } else { - if (ref->field_0x00 == frame && mCallback != NULL) { + if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (ref->field_0x04 == frame && mCallback != NULL) { + if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (ref->field_0x00 <= frame && frame < ref->field_0x04) { + if (ref->mInfo.field_0x00 <= frame && frame < ref->mInfo.field_0x04) { HoldEvent(event, true); } else { StopEvent(event); @@ -297,41 +274,41 @@ void AnimSoundImpl::UpdateBackwardRange(const AnimEventRef *ref, s32 frame) { return; } - if (ref->flags & 4 && ref->flags & 2) { + if (ref->mInfo.flags & 4 && ref->mInfo.flags & 2) { HoldEvent(event, true); return; } - if (ref->flags & 4) { - if (ref->field_0x04 == frame && mCallback != NULL) { + if (ref->mInfo.flags & 4) { + if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (field_0x1C < ref->field_0x09) { + if (field_0x1C < ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->field_0x09 && frame <= ref->field_0x04) { + } else if (field_0x1C == ref->mInfo.field_0x09 && frame <= ref->mInfo.field_0x04) { HoldEvent(event, true); } - } else if ((ref->flags & 2)) { - if (ref->field_0x00 == frame && mCallback != NULL) { + } else if ((ref->mInfo.flags & 2)) { + if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (field_0x1C > ref->field_0x09) { + if (field_0x1C > ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->field_0x09) { - if (ref->field_0x00 < frame) { + } else if (field_0x1C == ref->mInfo.field_0x09) { + if (ref->mInfo.field_0x00 < frame) { HoldEvent(event, true); } else { StopEvent(event); } } } else { - if (ref->field_0x00 == frame && mCallback != NULL) { + if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (ref->field_0x04 == frame && mCallback != NULL) { + if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); } - if (ref->field_0x00 < frame && frame <= ref->field_0x04) { + if (ref->mInfo.field_0x00 < frame && frame <= ref->mInfo.field_0x04) { HoldEvent(event, true); } else { StopEvent(event); @@ -355,11 +332,11 @@ void AnimSoundImpl::StartEvent(const AnimEvent *event, bool b) { } if (i == mNumSounds) { - mpSounds[leastPriorityIdx].Stop(); + mpSounds[leastPriorityIdx].ForceStop(); i = leastPriorityIdx; } - mpSounds[i].StartSound(event, &mStartable, b); + mpSounds[i].StartEvent(event, &mStartable, b); u32 varNo = 0; if (event->GetVarNo(&varNo)) { @@ -388,11 +365,11 @@ void AnimSoundImpl::HoldEvent(const AnimEvent *event, bool b) { } if (i == mNumSounds) { - mpSounds[leastPriorityIdx].Stop(); + mpSounds[leastPriorityIdx].ForceStop(); i = leastPriorityIdx; } - mpSounds[i].HoldSound(event, &mStartable, b); + mpSounds[i].HoldEvent(event, &mStartable, b); u32 varNo = 0; if (event->GetVarNo(&varNo)) { @@ -406,33 +383,26 @@ void AnimSoundImpl::StopEvent(const AnimEvent *event) { } } -void AnimEventPlayer::StartSound(const AnimEvent *event, SoundStartable *startable, bool b) { - if (event->soundId == 0xFFFFFFFF) { - if (!startable->StartSound(GetHandle(), event->GetSoundLabel())) { - return; +bool AnimSoundImpl::IsPlayableLoopCount(const nw4r::snd::detail::AnimEventFrameInfo &ref) { + if (!(ref.flags & 1) && (ref.flags & 4 || ref.flags & 2)) { + return true; + } + int i1 = ut::Max((int)ref.field_0x09, 0); + int i2 = ut::Abs(field_0x1C); + if (ref.field_0x0A == 0) { + if (i2 < i1) { + return false; } } else { - if (!startable->StartSound(GetHandle(), event->soundId)) { - return; + if (i2 < i1) { + return false; + } + if ((i2 - i1) % ref.field_0x0A != 0) { + return false; } } - SetVolumePitch(event, b); -} - -void AnimEventPlayer::HoldSound(const AnimEvent *event, SoundStartable *startable, bool b) { - if (event->soundId == 0xFFFFFFFF) { - if (!startable->HoldSound(GetHandle(), event->GetSoundLabel())) { - return; - } - } else { - if (!startable->HoldSound(GetHandle(), event->soundId)) { - return; - } - } - - GetHandle()->detail_GetAttachedSound()->SetAutoStopCounter(0); - SetVolumePitch(event, b); + return true; } void AnimEventPlayer::SetVolumePitch(const AnimEvent *event, bool b) { @@ -472,6 +442,48 @@ AnimEventPlayer::~AnimEventPlayer() { } } +void AnimEventPlayer::StartEvent(const AnimEvent *event, SoundStartable *startable, bool b) { + if (event->soundId == 0xFFFFFFFF) { + if (!startable->StartSound(GetHandle(), event->GetSoundLabel())) { + return; + } + } else { + if (!startable->StartSound(GetHandle(), event->soundId)) { + return; + } + } + + SetVolumePitch(event, b); +} + +void AnimEventPlayer::HoldEvent(const AnimEvent *event, SoundStartable *startable, bool b) { + if (event->soundId == 0xFFFFFFFF) { + if (!startable->HoldSound(GetHandle(), event->GetSoundLabel())) { + return; + } + } else { + if (!startable->HoldSound(GetHandle(), event->soundId)) { + return; + } + } + + GetHandle()->detail_GetAttachedSound()->SetAutoStopCounter(0); + SetVolumePitch(event, b); +} + +void AnimEventPlayer::ForceStop() { + if (IsAttachedSound()) { + mHandle.detail_GetAttachedSound()->Stop(0); + } + mpEvent = 0; +} + +void AnimEventPlayer::UpdateFrame() { + if (!mHandle.IsAttachedSound()) { + mpEvent = 0; + } +} + } // namespace detail } // namespace snd } // namespace nw4r From 0eb6bae4a670d258a84a29214cdb50e29d5d68db Mon Sep 17 00:00:00 2001 From: CovenEsme <84377742+CovenEsme@users.noreply.github.com> Date: Sat, 31 May 2025 13:55:40 +0100 Subject: [PATCH 79/91] Apply feedback --- .../SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt | 12 ++++++------ include/d/a/obj/d_a_obj_distant_ship.h | 2 +- src/REL/d/a/obj/d_a_obj_distant_ship.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt b/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt index 9c6df247..0db61b3a 100644 --- a/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_distant_shipNP/symbols.txt @@ -11,11 +11,11 @@ getModelName__17dAcOdistantShip_cFv = .text:0x000002C0; // type:function size:0x __dt__17dAcOdistantShip_cFv = .text:0x00000300; // type:function size:0x68 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_616_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float -lbl_616_rodata_4 = .rodata:0x00000004; // type:object size:0x4 align:4 data:float +lbl_616_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float +lbl_616_rodata_4 = .rodata:0x00000004; // type:object size:0x4 scope:local align:4 data:float g_profile_OBJ_DIS_SHIP = .data:0x00000000; // type:object size:0x10 -lbl_616_data_10 = .data:0x00000010; // type:object size:0x10 data:string -lbl_616_data_20 = .data:0x00000020; // type:object size:0x20 -lbl_616_data_40 = .data:0x00000040; // type:object size:0x10 -lbl_616_data_50 = .data:0x00000050; // type:object size:0x18 +lbl_616_data_10 = .data:0x00000010; // type:object size:0x10 scope:local data:string +lbl_616_data_20 = .data:0x00000020; // type:object size:0x20 scope:local +lbl_616_data_40 = .data:0x00000040; // type:object size:0x10 scope:local +lbl_616_data_50 = .data:0x00000050; // type:object size:0x18 scope:local __vt__17dAcOdistantShip_c = .data:0x00000068; // type:object size:0x80 diff --git a/include/d/a/obj/d_a_obj_distant_ship.h b/include/d/a/obj/d_a_obj_distant_ship.h index 0771a1f6..d1df78b2 100644 --- a/include/d/a/obj/d_a_obj_distant_ship.h +++ b/include/d/a/obj/d_a_obj_distant_ship.h @@ -14,7 +14,7 @@ public: virtual int draw() override; virtual bool createHeap() override; virtual int actorExecute() override; - char *getModelName(); + const char *getModelName(); private: /* 0x330 */ nw4r::g3d::ResFile mBrres; diff --git a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp index 6ca6c8ef..45d773c3 100644 --- a/src/REL/d/a/obj/d_a_obj_distant_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_distant_ship.cpp @@ -10,7 +10,7 @@ SPECIAL_ACTOR_PROFILE(OBJ_DIS_SHIP, dAcOdistantShip_c, fProfile::OBJ_DIS_SHIP, 0x143, 0, 0); bool dAcOdistantShip_c::createHeap() { - char *modelName = getModelName(); + const char *modelName = getModelName(); mBrres = (nw4r::g3d::ResFile)CurrentStageArcManager::GetInstance()->getData("g3d/stage.brres"); TRY_CREATE(mModel.create(mBrres.GetResMdl(modelName), &heap_allocator, 0x120, 1, 0)); return SUCCEEDED; @@ -49,7 +49,7 @@ int dAcOdistantShip_c::draw() { return SUCCEEDED; } -char *dAcOdistantShip_c::getModelName() { +const char *dAcOdistantShip_c::getModelName() { switch (mSubtype) { case 0: return "StageF301_D300"; case 1: return "StageF301_3_D300"; From d993bb66080c7ff0f5ba674a53383743db8da9c5 Mon Sep 17 00:00:00 2001 From: Swekka Date: Sun, 1 Jun 2025 19:39:59 +0200 Subject: [PATCH 80/91] d_a_obj_mole_cover OK --- .../rels/d_a_obj_mole_coverNP/symbols.txt | 16 +++---- include/d/a/obj/d_a_obj_mole_cover.h | 12 +++++ src/REL/d/a/obj/d_a_obj_mole_cover.cpp | 48 +++++++++++++++++++ 3 files changed, 68 insertions(+), 8 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_mole_coverNP/symbols.txt b/config/SOUE01/rels/d_a_obj_mole_coverNP/symbols.txt index 5cf2e2ab..471f13ea 100644 --- a/config/SOUE01/rels/d_a_obj_mole_coverNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_mole_coverNP/symbols.txt @@ -2,15 +2,15 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dAcOmoleCover_c_classInit__Fv = .text:0x00000070; // type:function size:0x64 -AcOmoleCover__initModels = .text:0x000000E0; // type:function size:0x110 -AcOmoleCover__init = .text:0x000001F0; // type:function size:0xD0 -fn_424_2C0 = .text:0x000002C0; // type:function size:0x8 -fn_424_2D0 = .text:0x000002D0; // type:function size:0x8 -AcOmoleCover__draw = .text:0x000002E0; // type:function size:0x28 +createHeap__15dAcOmoleCover_cFv = .text:0x000000E0; // type:function size:0x110 +create__15dAcOmoleCover_cFv = .text:0x000001F0; // type:function size:0xD0 +doDelete__15dAcOmoleCover_cFv = .text:0x000002C0; // type:function size:0x8 +actorExecute__15dAcOmoleCover_cFv = .text:0x000002D0; // type:function size:0x8 +draw__15dAcOmoleCover_cFv = .text:0x000002E0; // type:function size:0x28 __dt__15dAcOmoleCover_cFv = .text:0x00000310; // type:function size:0x74 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_424_rodata_0 = .rodata:0x00000000; // type:object size:0x1C data:float +lbl_424_rodata_0 = .rodata:0x00000000; // type:object size:0x1C scope:local data:float g_profile_OBJ_MOLE_COVER = .data:0x00000000; // type:object size:0x6C -lbl_424_data_6C = .data:0x0000006C; // type:object size:0x24 -AcOmoleCover__vtable = .data:0x00000090; // type:object size:0x80 +lbl_424_data_6C = .data:0x0000006C; // type:object size:0x24 scope:local +__vt__15dAcOmoleCover_c = .data:0x00000090; // type:object size:0x80 diff --git a/include/d/a/obj/d_a_obj_mole_cover.h b/include/d/a/obj/d_a_obj_mole_cover.h index a03a8323..3c1216d8 100644 --- a/include/d/a/obj/d_a_obj_mole_cover.h +++ b/include/d/a/obj/d_a_obj_mole_cover.h @@ -2,13 +2,25 @@ #define D_A_OBJ_MOLE_COVER_H #include "d/a/obj/d_a_obj_base.h" +#include "d/col/bg/d_bg_w.h" +#include "m/m3d/m_smdl.h" +#include "nw4r/g3d/res/g3d_resfile.h" class dAcOmoleCover_c : public dAcObjBase_c { public: dAcOmoleCover_c() {} virtual ~dAcOmoleCover_c() {} + virtual bool createHeap() override; + virtual int create() override; + virtual int doDelete() override; + virtual int actorExecute() override; + virtual int draw() override; + private: + /* 0x330 */ nw4r::g3d::ResFile mResFile; + /* 0x334 */ m3d::smdl_c mMdl; + /* 0x350 */ dBgW mBgW; }; #endif diff --git a/src/REL/d/a/obj/d_a_obj_mole_cover.cpp b/src/REL/d/a/obj/d_a_obj_mole_cover.cpp index 6baa0ca1..adfea836 100644 --- a/src/REL/d/a/obj/d_a_obj_mole_cover.cpp +++ b/src/REL/d/a/obj/d_a_obj_mole_cover.cpp @@ -1,3 +1,51 @@ #include "d/a/obj/d_a_obj_mole_cover.h" +#include "common.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/col/bg/d_bg_s.h" +#include "d/d_stage.h" +#include "f/f_base.h" +#include "m/m_vec.h" +#include "nw4r/g3d/res/g3d_resfile.h" +#include "nw4r/g3d/res/g3d_resmdl.h" +#include "toBeSorted/arc_managers/current_stage_arc_manager.h" + SPECIAL_ACTOR_PROFILE(OBJ_MOLE_COVER, dAcOmoleCover_c, fProfile::OBJ_MOLE_COVER, 0x20F, 0, 3); + +bool dAcOmoleCover_c::createHeap() { + void *data = CurrentStageArcManager::GetInstance()->getData("g3d/stage.brres"); + mResFile = nw4r::g3d::ResFile(data); + dStage_c::bindStageResToFile(&mResFile); + dStage_c::bindSkyCmnToResFile(&mResFile); + nw4r::g3d::ResMdl mdl = mResFile.GetResMdl("StageF000MallCover"); + TRY_CREATE(mMdl.create(mdl, &heap_allocator, 0x120, 1, nullptr)); + void *dzb = CurrentStageArcManager::GetInstance()->getData("dzb/StageF000MallCover.dzb"); + void *plc = CurrentStageArcManager::GetInstance()->getData("dat/StageF000MallCover.plc"); + updateMatrix(); + mMdl.setLocalMtx(mWorldMtx); + TRY_CREATE(!mBgW.Set((cBgD_t *)dzb, (PLC *)plc, 1, &mWorldMtx, &mScale)); + mBgW.Lock(); + return true; +} + +int dAcOmoleCover_c::create() { + CREATE_ALLOCATOR(dAcOmoleCover_c); + dBgS::GetInstance()->Regist(&mBgW, this); + mMdl.setPriorityDraw(0x1C, 9); + boundingBox.Set(mVec3_c(-1900.0f, 1100.0f, -5500.0f), mVec3_c(100.0f, 1700.0f, -1800.0f)); + mCullingDistance = FLOAT_MAX; + return SUCCEEDED; +} + +int dAcOmoleCover_c::doDelete() { + return SUCCEEDED; +} + +int dAcOmoleCover_c::actorExecute() { + return SUCCEEDED; +} + +int dAcOmoleCover_c::draw() { + drawModelType1(&mMdl); + return SUCCEEDED; +} From 0b394bb2542be0a2b1afaf7f84168e8d4fc2857b Mon Sep 17 00:00:00 2001 From: Swekka Date: Sun, 1 Jun 2025 19:51:51 +0200 Subject: [PATCH 81/91] d_a_obj_rope_base OK --- .../rels/d_a_obj_rope_baseNP/symbols.txt | 16 +++---- include/d/a/obj/d_a_obj_rope_base.h | 13 ++++++ src/REL/d/a/obj/d_a_obj_rope_base.cpp | 46 +++++++++++++++++++ 3 files changed, 67 insertions(+), 8 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_rope_baseNP/symbols.txt b/config/SOUE01/rels/d_a_obj_rope_baseNP/symbols.txt index d9db9810..ec2cd910 100644 --- a/config/SOUE01/rels/d_a_obj_rope_baseNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_rope_baseNP/symbols.txt @@ -2,15 +2,15 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dAcOropeBase_c_classInit__Fv = .text:0x00000070; // type:function size:0x5C -fn_431_D0 = .text:0x000000D0; // type:function size:0xD0 -fn_431_1A0 = .text:0x000001A0; // type:function size:0xBC -fn_431_260 = .text:0x00000260; // type:function size:0x8 -fn_431_270 = .text:0x00000270; // type:function size:0x28 -fn_431_2A0 = .text:0x000002A0; // type:function size:0x28 +createHeap__14dAcOropeBase_cFv = .text:0x000000D0; // type:function size:0xD0 +create__14dAcOropeBase_cFv = .text:0x000001A0; // type:function size:0xBC +doDelete__14dAcOropeBase_cFv = .text:0x00000260; // type:function size:0x8 +actorExecute__14dAcOropeBase_cFv = .text:0x00000270; // type:function size:0x28 +draw__14dAcOropeBase_cFv = .text:0x000002A0; // type:function size:0x28 __dt__14dAcOropeBase_cFv = .text:0x000002D0; // type:function size:0x68 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_431_rodata_0 = .rodata:0x00000000; // type:object size:0x18 data:float +lbl_431_rodata_0 = .rodata:0x00000000; // type:object size:0x18 scope:local data:float g_profile_OBJ_ROPE_BASE = .data:0x00000000; // type:object size:0x38 -lbl_431_data_38 = .data:0x00000038; // type:object size:0x20 -lbl_431_data_58 = .data:0x00000058; // type:object size:0x80 +lbl_431_data_38 = .data:0x00000038; // type:object size:0x20 scope:local +__vt__14dAcOropeBase_c = .data:0x00000058; // type:object size:0x80 diff --git a/include/d/a/obj/d_a_obj_rope_base.h b/include/d/a/obj/d_a_obj_rope_base.h index 8c43a7c1..87b60f90 100644 --- a/include/d/a/obj/d_a_obj_rope_base.h +++ b/include/d/a/obj/d_a_obj_rope_base.h @@ -2,13 +2,26 @@ #define D_A_OBJ_ROPE_BASE_H #include "d/a/obj/d_a_obj_base.h" +#include "m/m3d/m_smdl.h" +#include "m/m_vec.h" +#include "nw4r/g3d/res/g3d_resfile.h" class dAcOropeBase_c : public dAcObjBase_c { public: dAcOropeBase_c() {} virtual ~dAcOropeBase_c() {} + virtual bool createHeap() override; + virtual int create() override; + virtual int doDelete() override; + virtual int actorExecute() override; + virtual int draw() override; + private: + /* 0x330 */ nw4r::g3d::ResFile mResFile; + /* 0x334 */ m3d::smdl_c mMdl; + /* 0x350 */ mVec3_c mVec; + /* 0x35C */ bool mBool; }; #endif diff --git a/src/REL/d/a/obj/d_a_obj_rope_base.cpp b/src/REL/d/a/obj/d_a_obj_rope_base.cpp index 9431e1cf..c6dee2e9 100644 --- a/src/REL/d/a/obj/d_a_obj_rope_base.cpp +++ b/src/REL/d/a/obj/d_a_obj_rope_base.cpp @@ -1,3 +1,49 @@ #include "d/a/obj/d_a_obj_rope_base.h" +#include "d/a/obj/d_a_obj_base.h" +#include "f/f_base.h" +#include "m/m_vec.h" +#include "nw4r/g3d/res/g3d_resfile.h" +#include "nw4r/g3d/res/g3d_resmdl.h" +#include "nw4r/g3d/res/g3d_resnode.h" + SPECIAL_ACTOR_PROFILE(OBJ_ROPE_BASE, dAcOropeBase_c, fProfile::OBJ_ROPE_BASE, 0x216, 0, 3); + +bool dAcOropeBase_c::createHeap() { + void *data = getOarcResFile("PracticeWood"); + mResFile = nw4r::g3d::ResFile(data); + nw4r::g3d::ResMdl mdl = mResFile.GetResMdl("RopeBase"); + TRY_CREATE(mMdl.create(mdl, &heap_allocator, 0x120, 1, nullptr)); + updateMatrix(); + mMdl.setLocalMtx(mWorldMtx); + mMdl.calc(true); + nw4r::g3d::ResNode resNode = mdl.GetResNode("rope_loc"); + mMdl.getNodeWorldMtxMultVecZero(resNode.GetID(), mVec); + return true; +} + +int dAcOropeBase_c::create() { + CREATE_ALLOCATOR(dAcOropeBase_c); + updateMatrix(); + mMdl.setLocalMtx(mWorldMtx); + boundingBox.Set(mVec3_c(-525.0f, -0.0f, -500.0f), mVec3_c(-325.0f, 700.0f, -300.0f)); + return SUCCEEDED; +} + +int dAcOropeBase_c::doDelete() { + return SUCCEEDED; +} + +int dAcOropeBase_c::actorExecute() { + if (checkObjectProperty(2)) { + mBool = true; + } else { + mBool = false; + } + return SUCCEEDED; +} + +int dAcOropeBase_c::draw() { + drawModelType1(&mMdl); + return SUCCEEDED; +} From 86b30f6e45c02d2d6d56109b49ffae5f7a3fa44e Mon Sep 17 00:00:00 2001 From: Swekka Date: Sun, 1 Jun 2025 19:53:45 +0200 Subject: [PATCH 82/91] mark file as matching --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index e01004f4..605c72ac 100644 --- a/configure.py +++ b/configure.py @@ -2190,7 +2190,7 @@ config.libs = [ Rel(NonMatching, "d_a_obj_rock_sky", "REL/d/a/obj/d_a_obj_rock_sky.cpp"), Rel(NonMatching, "d_a_obj_roll_pillar", "REL/d/a/obj/d_a_obj_roll_pillar.cpp"), Rel(NonMatching, "d_a_obj_roll_rock", "REL/d/a/obj/d_a_obj_roll_rock.cpp"), - Rel(NonMatching, "d_a_obj_rope_base", "REL/d/a/obj/d_a_obj_rope_base.cpp"), + Rel(Matching, "d_a_obj_rope_base", "REL/d/a/obj/d_a_obj_rope_base.cpp"), Rel(NonMatching, "d_a_obj_rope_igaiga", "REL/d/a/obj/d_a_obj_rope_igaiga.cpp"), Rel( NonMatching, "d_a_obj_rotation_light", "REL/d/a/obj/d_a_obj_rotation_light.cpp" From 156dfb741b17bb6a302eb9760bfcdc91745b55dc Mon Sep 17 00:00:00 2001 From: Swekka Date: Sun, 1 Jun 2025 19:54:27 +0200 Subject: [PATCH 83/91] mark file as matching --- configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.py b/configure.py index e01004f4..bffe0d04 100644 --- a/configure.py +++ b/configure.py @@ -2150,7 +2150,7 @@ config.libs = [ Rel(Matching, "d_a_obj_mapparts", "REL/d/a/obj/d_a_obj_mapparts.cpp"), Rel(Matching, "d_a_obj_megami_island", "REL/d/a/obj/d_a_obj_megami_island.cpp"), Rel(NonMatching, "d_a_obj_mg_pumpkin", "REL/d/a/obj/d_a_obj_mg_pumpkin.cpp"), - Rel(NonMatching, "d_a_obj_mole_cover", "REL/d/a/obj/d_a_obj_mole_cover.cpp"), + Rel(Matching, "d_a_obj_mole_cover", "REL/d/a/obj/d_a_obj_mole_cover.cpp"), Rel(Matching, "d_a_obj_mole_soil", "REL/d/a/obj/d_a_obj_mole_soil.cpp"), Rel(NonMatching, "d_a_obj_move_elec", "REL/d/a/obj/d_a_obj_move_elec.cpp"), Rel(NonMatching, "d_a_obj_move_lift_vol", "REL/d/a/obj/d_a_obj_move_lift_vol.cpp"), From d78c0bf0ae06b9127ef17f349d30d1dc39a68793 Mon Sep 17 00:00:00 2001 From: Swekka Date: Sun, 1 Jun 2025 20:27:29 +0200 Subject: [PATCH 84/91] improve variable naming --- include/d/a/obj/d_a_obj_rope_base.h | 4 ++-- src/REL/d/a/obj/d_a_obj_rope_base.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/d/a/obj/d_a_obj_rope_base.h b/include/d/a/obj/d_a_obj_rope_base.h index 87b60f90..53c232b0 100644 --- a/include/d/a/obj/d_a_obj_rope_base.h +++ b/include/d/a/obj/d_a_obj_rope_base.h @@ -20,8 +20,8 @@ public: private: /* 0x330 */ nw4r::g3d::ResFile mResFile; /* 0x334 */ m3d::smdl_c mMdl; - /* 0x350 */ mVec3_c mVec; - /* 0x35C */ bool mBool; + /* 0x350 */ mVec3_c mRopePos; + /* 0x35C */ bool field_0x35C; }; #endif diff --git a/src/REL/d/a/obj/d_a_obj_rope_base.cpp b/src/REL/d/a/obj/d_a_obj_rope_base.cpp index c6dee2e9..cbd1f0f5 100644 --- a/src/REL/d/a/obj/d_a_obj_rope_base.cpp +++ b/src/REL/d/a/obj/d_a_obj_rope_base.cpp @@ -18,7 +18,7 @@ bool dAcOropeBase_c::createHeap() { mMdl.setLocalMtx(mWorldMtx); mMdl.calc(true); nw4r::g3d::ResNode resNode = mdl.GetResNode("rope_loc"); - mMdl.getNodeWorldMtxMultVecZero(resNode.GetID(), mVec); + mMdl.getNodeWorldMtxMultVecZero(resNode.GetID(), mRopePos); return true; } @@ -36,9 +36,9 @@ int dAcOropeBase_c::doDelete() { int dAcOropeBase_c::actorExecute() { if (checkObjectProperty(2)) { - mBool = true; + field_0x35C = true; } else { - mBool = false; + field_0x35C = false; } return SUCCEEDED; } From 042f3b600f774a37d9750e49403239893425f3f2 Mon Sep 17 00:00:00 2001 From: Swekka Date: Tue, 3 Jun 2025 19:25:25 +0200 Subject: [PATCH 85/91] d_a_obj_impa_door OK --- .../rels/d_a_obj_impa_doorNP/symbols.txt | 10 ++--- configure.py | 2 +- include/d/a/obj/d_a_obj_impa_door.h | 13 ++++++- src/REL/d/a/obj/d_a_obj_impa_door.cpp | 39 +++++++++++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt b/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt index 2cf360f1..c26956ce 100644 --- a/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt @@ -8,13 +8,13 @@ __dt__27sFState_c<14dAcOimpaDoor_c>Fv = .text:0x000001B0; // type:function size: __dt__30sFStateFct_c<14dAcOimpaDoor_c>Fv = .text:0x00000210; // type:function size:0x6C __dt__83sStateMgr_c<14dAcOimpaDoor_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000280; // type:function size:0xA0 __dt__53sFStateMgr_c<14dAcOimpaDoor_c,20sStateMethodUsr_FI_c>Fv = .text:0x00000320; // type:function size:0xA4 -fn_421_3D0 = .text:0x000003D0; // type:function size:0x88 -fn_421_460 = .text:0x00000460; // type:function size:0xE8 +createHeap__14dAcOimpaDoor_cFv = .text:0x000003D0; // type:function size:0x88 +create__14dAcOimpaDoor_cFv = .text:0x00000460; // type:function size:0xE8 changeState__83sStateMgr_c<14dAcOimpaDoor_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x00000550; // type:function size:0x10 -fn_421_560 = .text:0x00000560; // type:function size:0x8 -fn_421_570 = .text:0x00000570; // type:function size:0x30 +doDelete__14dAcOimpaDoor_cFv = .text:0x00000560; // type:function size:0x8 +actorExecute__14dAcOimpaDoor_cFv = .text:0x00000570; // type:function size:0x30 executeState__83sStateMgr_c<14dAcOimpaDoor_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000005A0; // type:function size:0x10 -fn_421_5B0 = .text:0x000005B0; // type:function size:0x28 +draw__14dAcOimpaDoor_cFv = .text:0x000005B0; // type:function size:0x28 initializeState_Wait__14dAcOimpaDoor_cFv = .text:0x000005E0; // type:function size:0x4 executeState_Wait__14dAcOimpaDoor_cFv = .text:0x000005F0; // type:function size:0x4 finalizeState_Wait__14dAcOimpaDoor_cFv = .text:0x00000600; // type:function size:0x4 diff --git a/configure.py b/configure.py index e01004f4..47680760 100644 --- a/configure.py +++ b/configure.py @@ -2104,7 +2104,7 @@ config.libs = [ Rel(NonMatching, "d_a_obj_hit_lever_sw", "REL/d/a/obj/d_a_obj_hit_lever_sw.cpp"), Rel(NonMatching, "d_a_obj_hole", "REL/d/a/obj/d_a_obj_hole.cpp"), Rel(NonMatching, "d_a_obj_hole_minigame", "REL/d/a/obj/d_a_obj_hole_minigame.cpp"), - Rel(NonMatching, "d_a_obj_impa_door", "REL/d/a/obj/d_a_obj_impa_door.cpp"), + Rel(Matching, "d_a_obj_impa_door", "REL/d/a/obj/d_a_obj_impa_door.cpp"), Rel(NonMatching, "d_a_obj_insect_island", "REL/d/a/obj/d_a_obj_insect_island.cpp"), Rel(NonMatching, "d_a_obj_into_hole", "REL/d/a/obj/d_a_obj_into_hole.cpp"), Rel(Matching, "d_a_obj_iron_stage", "REL/d/a/obj/d_a_obj_iron_stage.cpp"), diff --git a/include/d/a/obj/d_a_obj_impa_door.h b/include/d/a/obj/d_a_obj_impa_door.h index c30c6606..2ba7f85f 100644 --- a/include/d/a/obj/d_a_obj_impa_door.h +++ b/include/d/a/obj/d_a_obj_impa_door.h @@ -2,8 +2,9 @@ #define D_A_OBJ_IMPA_DOOR_H #include "d/a/obj/d_a_obj_base.h" +#include "m/m3d/m_smdl.h" +#include "nw4r/g3d/res/g3d_resfile.h" #include "s/s_State.hpp" -#include "s/s_StateMgr.hpp" class dAcOimpaDoor_c : public dAcObjBase_c { public: @@ -12,8 +13,16 @@ public: STATE_FUNC_DECLARE(dAcOimpaDoor_c, Wait); + virtual bool createHeap() override; + virtual int create() override; + virtual int doDelete() override; + virtual int actorExecute() override; + virtual int draw() override; + private: - /* 0x??? */ STATE_MGR_DECLARE(dAcOimpaDoor_c); + /* 0x330 */ nw4r::g3d::ResFile mResFile; + /* 0x334 */ m3d::smdl_c mMdl; + /* 0x350 */ STATE_MGR_DECLARE(dAcOimpaDoor_c); }; #endif diff --git a/src/REL/d/a/obj/d_a_obj_impa_door.cpp b/src/REL/d/a/obj/d_a_obj_impa_door.cpp index ce75d5fd..5bd57c4f 100644 --- a/src/REL/d/a/obj/d_a_obj_impa_door.cpp +++ b/src/REL/d/a/obj/d_a_obj_impa_door.cpp @@ -1,9 +1,48 @@ #include "d/a/obj/d_a_obj_impa_door.h" +#include "common.h" +#include "d/a/obj/d_a_obj_base.h" +#include "f/f_base.h" +#include "m/m_vec.h" +#include "nw4r/g3d/res/g3d_resfile.h" +#include "nw4r/g3d/res/g3d_resmdl.h" + SPECIAL_ACTOR_PROFILE(OBJ_IMPA_DOOR, dAcOimpaDoor_c, fProfile::OBJ_IMPA_DOOR, 0x20C, 0, 3); STATE_DEFINE(dAcOimpaDoor_c, Wait); +bool dAcOimpaDoor_c::createHeap() { + void *data = getOarcFile("DoorG", "g3d/model.brres"); + mResFile = nw4r::g3d::ResFile(data); + nw4r::g3d::ResMdl mdl = mResFile.GetResMdl("DoorG"); + TRY_CREATE(mMdl.create(mdl, &heap_allocator, 0x120, 1, nullptr)); + return true; +} + +int dAcOimpaDoor_c::create() { + CREATE_ALLOCATOR(dAcOimpaDoor_c); + updateMatrix(); + mMdl.setLocalMtx(mWorldMtx); + mStateMgr.changeState(StateID_Wait); + mMdl.setPriorityDraw(0x1C, 9); + boundingBox.Set(mVec3_c(-250.0f, 0.0f, -30.0f), mVec3_c(250.0f, 940.0f, 30.0f)); + return SUCCEEDED; +} + +int dAcOimpaDoor_c::doDelete() { + return SUCCEEDED; +} + +int dAcOimpaDoor_c::actorExecute() { + mStateMgr.executeState(); + return SUCCEEDED; +} + +int dAcOimpaDoor_c::draw() { + drawModelType1(&mMdl); + return SUCCEEDED; +} + void dAcOimpaDoor_c::initializeState_Wait() {} void dAcOimpaDoor_c::executeState_Wait() {} void dAcOimpaDoor_c::finalizeState_Wait() {} From ad633ee581580154d9594da2ec1a28a96d0b3f11 Mon Sep 17 00:00:00 2001 From: Swekka Date: Wed, 4 Jun 2025 00:34:19 +0200 Subject: [PATCH 86/91] add scope:local where necessary --- config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt b/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt index c26956ce..8798ffa7 100644 --- a/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt @@ -40,11 +40,11 @@ isSameName__29sFStateID_c<14dAcOimpaDoor_c>CFPCc = .text:0x00000A20; // type:fun _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global -lbl_421_rodata_0 = .rodata:0x00000000; // type:object size:0x18 data:float +lbl_421_rodata_0 = .rodata:0x00000000; // type:object size:0x18 data:float scope:local g_profile_OBJ_IMPA_DOOR = .data:0x00000000; // type:object size:0x10 data:4byte -lbl_421_data_10 = .data:0x00000010; // type:object size:0x8 -lbl_421_data_18 = .data:0x00000018; // type:object size:0x10 data:string -lbl_421_data_28 = .data:0x00000028; // type:object size:0x20 +lbl_421_data_10 = .data:0x00000010; // type:object size:0x8 scope:local +lbl_421_data_18 = .data:0x00000018; // type:object size:0x10 data:string scope:local +lbl_421_data_28 = .data:0x00000028; // type:object size:0x20 scope:local lbl_421_data_48 = .data:0x00000048; // type:object size:0x80 lbl_421_data_C8 = .data:0x000000C8; // type:object size:0x30 lbl_421_data_F8 = .data:0x000000F8; // type:object size:0x30 @@ -52,5 +52,5 @@ lbl_421_data_128 = .data:0x00000128; // type:object size:0x18 lbl_421_data_140 = .data:0x00000140; // type:object size:0x5C lbl_421_data_19C = .data:0x0000019C; // type:object size:0x34 __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_421_bss_8 = .bss:0x00000008; // type:object size:0x10 -lbl_421_bss_18 = .bss:0x00000018; // type:object size:0x30 data:4byte +lbl_421_bss_8 = .bss:0x00000008; // type:object size:0x10 scope:local +lbl_421_bss_18 = .bss:0x00000018; // type:object size:0x30 data:4byte scope:local From b53bafeeb4471d7d1f62bbfc1936bdf8d52d6c1a Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 7 Jun 2025 14:06:23 +0200 Subject: [PATCH 87/91] actor_info OK --- .../rels/d_a_obj_impa_doorNP/symbols.txt | 6 +- config/SOUE01/splits.txt | 4 +- config/SOUE01/symbols.txt | 1576 ++++++++--------- configure.py | 2 +- include/UnknownTypeBelongings.h | 37 - include/d/a/d_a_base.h | 8 +- include/d/a/obj/d_a_obj_base.h | 2 +- include/toBeSorted/actor_info.h | 44 + src/d/a/d_a_base.cpp | 36 +- src/d/d_stage_parse.cpp | 7 +- src/toBeSorted/actor_info.cpp | 872 +++++++++ 11 files changed, 1736 insertions(+), 858 deletions(-) delete mode 100644 include/UnknownTypeBelongings.h create mode 100644 include/toBeSorted/actor_info.h create mode 100644 src/toBeSorted/actor_info.cpp diff --git a/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt b/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt index 8798ffa7..b7c88acc 100644 --- a/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_impa_doorNP/symbols.txt @@ -40,10 +40,10 @@ isSameName__29sFStateID_c<14dAcOimpaDoor_c>CFPCc = .text:0x00000A20; // type:fun _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global -lbl_421_rodata_0 = .rodata:0x00000000; // type:object size:0x18 data:float scope:local +lbl_421_rodata_0 = .rodata:0x00000000; // type:object size:0x18 scope:local data:float g_profile_OBJ_IMPA_DOOR = .data:0x00000000; // type:object size:0x10 data:4byte lbl_421_data_10 = .data:0x00000010; // type:object size:0x8 scope:local -lbl_421_data_18 = .data:0x00000018; // type:object size:0x10 data:string scope:local +lbl_421_data_18 = .data:0x00000018; // type:object size:0x10 scope:local data:string lbl_421_data_28 = .data:0x00000028; // type:object size:0x20 scope:local lbl_421_data_48 = .data:0x00000048; // type:object size:0x80 lbl_421_data_C8 = .data:0x000000C8; // type:object size:0x30 @@ -53,4 +53,4 @@ lbl_421_data_140 = .data:0x00000140; // type:object size:0x5C lbl_421_data_19C = .data:0x0000019C; // type:object size:0x34 __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global lbl_421_bss_8 = .bss:0x00000008; // type:object size:0x10 scope:local -lbl_421_bss_18 = .bss:0x00000018; // type:object size:0x30 data:4byte scope:local +lbl_421_bss_18 = .bss:0x00000018; // type:object size:0x30 scope:local data:4byte diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 773fb936..24260d1d 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -360,8 +360,10 @@ toBeSorted/arc_managers/layout_arc_manager.cpp: toBeSorted/arc_managers/layout_arc_control.cpp: .text start:0x8006A2E0 end:0x8006A544 align:16 -toBeSorted/base_tables.cpp: +toBeSorted/actor_info.cpp: .text start:0x8006A550 end:0x8006A8C8 align:16 + .rodata start:0x804E0FA8 end:0x804E3418 + .sdata2 start:0x805779F8 end:0x80579210 toBeSorted/unk_vec_math.cpp: .text start:0x8006A8D0 end:0x8006B3A4 align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index b51f8ce4..25e8c5c0 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -1030,7 +1030,7 @@ createHeap__9dAcBase_cFv = .text:0x8002C3A0; // type:function size:0x8 __ct__9dAcBase_cFv = .text:0x8002C3B0; // type:function size:0x178 __dt__7dBase_cFv = .text:0x8002C530; // type:function size:0x58 __dt__9dAcBase_cFv = .text:0x8002C590; // type:function size:0xB4 -setTempCreateParams__9dAcBase_cFP7mVec3_cP7mAng3_cP7mVec3_clUlP9dAcBase_cUcUsScP7ObjInfo = .text:0x8002C650; // type:function size:0x34 +setTempCreateParams__9dAcBase_cFP7mVec3_cP7mAng3_cP7mVec3_clUlP9dAcBase_cUcUsScPC9ActorInfo = .text:0x8002C650; // type:function size:0x34 FUN_8002c690__9dAcBase_cFv = .text:0x8002C690; // type:function size:0x78 initAllocatorWork1Heap__9dAcBase_cFiPci = .text:0x8002C710; // type:function size:0xC initAllocator__9dAcBase_cFiPcPQ23EGG4Heapi = .text:0x8002C720; // type:function size:0x8C @@ -3039,13 +3039,13 @@ set__16LayoutArcControlFPCPCcl = .text:0x8006A350; // type:function size:0xC load__16LayoutArcControlFPQ23EGG4Heap = .text:0x8006A360; // type:function size:0x88 fn_8006A3F0 = .text:0x8006A3F0; // type:function size:0x88 release__16LayoutArcControlFv = .text:0x8006A480; // type:function size:0xC4 -getObjByActorName_unkNamespace = .text:0x8006A550; // type:function size:0x98 -getActorIdForObjName = .text:0x8006A5F0; // type:function size:0x34 -getActorIdForObjName2 = .text:0x8006A630; // type:function size:0x34 -fn_8006A670 = .text:0x8006A670; // type:function size:0xB8 -getObjectName_8006a730 = .text:0x8006A730; // type:function size:0x18 -getObjByActorIdAndSubtype_unkNamespace = .text:0x8006A750; // type:function size:0x134 -fn_8006A890 = .text:0x8006A890; // type:function size:0x38 +getActorInfoByName__FPCc = .text:0x8006A550; // type:function size:0x98 +getProfileIdForName__FPCc = .text:0x8006A5F0; // type:function size:0x34 +getProfileId2ForName__FPCc = .text:0x8006A630; // type:function size:0x34 +getNameForProfileId__FUl = .text:0x8006A670; // type:function size:0xB8 +getActorName__FPC9ActorInfo = .text:0x8006A730; // type:function size:0x18 +getActorInfoByProfileAndSubtype__FUlUl = .text:0x8006A750; // type:function size:0x134 +getSoundSourceCategoryForName__FPCc = .text:0x8006A890; // type:function size:0x38 fn_8006A8D0 = .text:0x8006A8D0; // type:function size:0x1DC fn_8006AAB0 = .text:0x8006AAB0; // type:function size:0x85C fn_8006B310 = .text:0x8006B310; // type:function size:0x94 @@ -28215,7 +28215,7 @@ lbl_804E0EB4 = .rodata:0x804E0EB4; // type:object size:0x3C lbl_804E0EF0 = .rodata:0x804E0EF0; // type:object size:0x28 lbl_804E0F18 = .rodata:0x804E0F18; // type:object size:0x48 lbl_804E0F60 = .rodata:0x804E0F60; // type:object size:0x48 -OBJ_NAME_TO_ACTOR_ID = .rodata:0x804E0FA8; // type:object size:0x2470 data:4byte +sInfos = .rodata:0x804E0FA8; // type:object size:0x246C scope:local data:4byte lbl_804E3418 = .rodata:0x804E3418; // type:object size:0x40 data:4byte lbl_804E3458 = .rodata:0x804E3458; // type:object size:0x38 data:4byte lbl_804E3490 = .rodata:0x804E3490; // type:object size:0x3C data:4byte @@ -41240,7 +41240,7 @@ s_Create_Position__9dAcBase_c = .sbss:0x80575080; // type:object size:0x4 data:4 s_Create_Rotation__9dAcBase_c = .sbss:0x80575084; // type:object size:0x4 data:4byte s_Create_Scale__9dAcBase_c = .sbss:0x80575088; // type:object size:0x4 data:4byte s_Create_Parent__9dAcBase_c = .sbss:0x8057508C; // type:object size:0x4 data:4byte -s_Create_ObjInfo__9dAcBase_c = .sbss:0x80575090; // type:object size:0x4 data:4byte +s_Create_ActorInfo__9dAcBase_c = .sbss:0x80575090; // type:object size:0x4 data:4byte s_Create_Subtype__9dAcBase_c = .sbss:0x80575094; // type:object size:0x1 data:byte ENEMY_LIST = .sbss:0x80575098; // type:object size:0x8 data:4byte NPC_ACTOR_LIST = .sbss:0x805750A0; // type:object size:0x8 data:4byte @@ -43363,783 +43363,783 @@ lbl_805779D8 = .sdata2:0x805779D8; // type:object size:0x8 align:8 data:double lbl_805779E0 = .sdata2:0x805779E0; // type:object size:0x4 align:4 data:float lbl_805779E8 = .sdata2:0x805779E8; // type:object size:0x4 align:4 data:float lbl_805779F0 = .sdata2:0x805779F0; // type:object size:0x8 align:8 data:double -lbl_805779F8 = .sdata2:0x805779F8; // type:object size:0x8 -lbl_80577A00 = .sdata2:0x80577A00; // type:object size:0x8 -lbl_80577A08 = .sdata2:0x80577A08; // type:object size:0x8 -lbl_80577A10 = .sdata2:0x80577A10; // type:object size:0x8 -lbl_80577A18 = .sdata2:0x80577A18; // type:object size:0x8 -lbl_80577A20 = .sdata2:0x80577A20; // type:object size:0x8 -lbl_80577A28 = .sdata2:0x80577A28; // type:object size:0x8 -lbl_80577A30 = .sdata2:0x80577A30; // type:object size:0x8 -lbl_80577A38 = .sdata2:0x80577A38; // type:object size:0x8 -lbl_80577A40 = .sdata2:0x80577A40; // type:object size:0x8 -lbl_80577A48 = .sdata2:0x80577A48; // type:object size:0x8 -lbl_80577A50 = .sdata2:0x80577A50; // type:object size:0x8 -lbl_80577A58 = .sdata2:0x80577A58; // type:object size:0x8 -lbl_80577A60 = .sdata2:0x80577A60; // type:object size:0x8 -lbl_80577A68 = .sdata2:0x80577A68; // type:object size:0x8 -lbl_80577A70 = .sdata2:0x80577A70; // type:object size:0x8 -lbl_80577A78 = .sdata2:0x80577A78; // type:object size:0x8 -lbl_80577A80 = .sdata2:0x80577A80; // type:object size:0x8 -lbl_80577A88 = .sdata2:0x80577A88; // type:object size:0x8 -lbl_80577A90 = .sdata2:0x80577A90; // type:object size:0x8 -lbl_80577A98 = .sdata2:0x80577A98; // type:object size:0x8 -lbl_80577AA0 = .sdata2:0x80577AA0; // type:object size:0x8 -lbl_80577AA8 = .sdata2:0x80577AA8; // type:object size:0x8 -lbl_80577AB0 = .sdata2:0x80577AB0; // type:object size:0x8 -lbl_80577AB8 = .sdata2:0x80577AB8; // type:object size:0x8 -lbl_80577AC0 = .sdata2:0x80577AC0; // type:object size:0x8 -lbl_80577AC8 = .sdata2:0x80577AC8; // type:object size:0x8 -lbl_80577AD0 = .sdata2:0x80577AD0; // type:object size:0x8 -lbl_80577AD8 = .sdata2:0x80577AD8; // type:object size:0x8 -lbl_80577AE0 = .sdata2:0x80577AE0; // type:object size:0x8 -lbl_80577AE8 = .sdata2:0x80577AE8; // type:object size:0x8 -lbl_80577AF0 = .sdata2:0x80577AF0; // type:object size:0x8 -lbl_80577AF8 = .sdata2:0x80577AF8; // type:object size:0x8 -lbl_80577B00 = .sdata2:0x80577B00; // type:object size:0x8 -lbl_80577B08 = .sdata2:0x80577B08; // type:object size:0x8 -lbl_80577B10 = .sdata2:0x80577B10; // type:object size:0x8 -lbl_80577B18 = .sdata2:0x80577B18; // type:object size:0x8 -lbl_80577B20 = .sdata2:0x80577B20; // type:object size:0x8 -lbl_80577B28 = .sdata2:0x80577B28; // type:object size:0x8 -lbl_80577B30 = .sdata2:0x80577B30; // type:object size:0x8 -lbl_80577B38 = .sdata2:0x80577B38; // type:object size:0x8 -lbl_80577B40 = .sdata2:0x80577B40; // type:object size:0x8 -lbl_80577B48 = .sdata2:0x80577B48; // type:object size:0x8 -lbl_80577B50 = .sdata2:0x80577B50; // type:object size:0x8 -lbl_80577B58 = .sdata2:0x80577B58; // type:object size:0x8 -lbl_80577B60 = .sdata2:0x80577B60; // type:object size:0x8 -lbl_80577B68 = .sdata2:0x80577B68; // type:object size:0x8 -lbl_80577B70 = .sdata2:0x80577B70; // type:object size:0x8 -lbl_80577B78 = .sdata2:0x80577B78; // type:object size:0x8 -lbl_80577B80 = .sdata2:0x80577B80; // type:object size:0x8 -lbl_80577B88 = .sdata2:0x80577B88; // type:object size:0x8 -lbl_80577B90 = .sdata2:0x80577B90; // type:object size:0x8 -lbl_80577B98 = .sdata2:0x80577B98; // type:object size:0x8 -lbl_80577BA0 = .sdata2:0x80577BA0; // type:object size:0x8 -lbl_80577BA8 = .sdata2:0x80577BA8; // type:object size:0x8 -lbl_80577BB0 = .sdata2:0x80577BB0; // type:object size:0x8 -lbl_80577BB8 = .sdata2:0x80577BB8; // type:object size:0x8 -lbl_80577BC0 = .sdata2:0x80577BC0; // type:object size:0x8 -lbl_80577BC8 = .sdata2:0x80577BC8; // type:object size:0x8 -lbl_80577BD0 = .sdata2:0x80577BD0; // type:object size:0x8 -lbl_80577BD8 = .sdata2:0x80577BD8; // type:object size:0x8 -lbl_80577BE0 = .sdata2:0x80577BE0; // type:object size:0x8 -lbl_80577BE8 = .sdata2:0x80577BE8; // type:object size:0x8 -lbl_80577BF0 = .sdata2:0x80577BF0; // type:object size:0x8 -lbl_80577BF8 = .sdata2:0x80577BF8; // type:object size:0x8 -lbl_80577C00 = .sdata2:0x80577C00; // type:object size:0x8 -lbl_80577C08 = .sdata2:0x80577C08; // type:object size:0x8 -lbl_80577C10 = .sdata2:0x80577C10; // type:object size:0x8 -lbl_80577C18 = .sdata2:0x80577C18; // type:object size:0x8 data:string -lbl_80577C20 = .sdata2:0x80577C20; // type:object size:0x8 -lbl_80577C28 = .sdata2:0x80577C28; // type:object size:0x8 data:string -lbl_80577C30 = .sdata2:0x80577C30; // type:object size:0x8 -lbl_80577C38 = .sdata2:0x80577C38; // type:object size:0x8 data:string -lbl_80577C40 = .sdata2:0x80577C40; // type:object size:0x8 -lbl_80577C48 = .sdata2:0x80577C48; // type:object size:0x8 -lbl_80577C50 = .sdata2:0x80577C50; // type:object size:0x8 -lbl_80577C58 = .sdata2:0x80577C58; // type:object size:0x8 -lbl_80577C60 = .sdata2:0x80577C60; // type:object size:0x8 -lbl_80577C68 = .sdata2:0x80577C68; // type:object size:0x8 -lbl_80577C70 = .sdata2:0x80577C70; // type:object size:0x8 data:string -lbl_80577C78 = .sdata2:0x80577C78; // type:object size:0x8 data:string -lbl_80577C80 = .sdata2:0x80577C80; // type:object size:0x8 -lbl_80577C88 = .sdata2:0x80577C88; // type:object size:0x8 -lbl_80577C90 = .sdata2:0x80577C90; // type:object size:0x8 data:string -lbl_80577C98 = .sdata2:0x80577C98; // type:object size:0x8 data:string -lbl_80577CA0 = .sdata2:0x80577CA0; // type:object size:0x8 -lbl_80577CA8 = .sdata2:0x80577CA8; // type:object size:0x8 data:string -lbl_80577CB0 = .sdata2:0x80577CB0; // type:object size:0x8 data:string -lbl_80577CB8 = .sdata2:0x80577CB8; // type:object size:0x8 data:string -lbl_80577CC0 = .sdata2:0x80577CC0; // type:object size:0x8 data:string -lbl_80577CC8 = .sdata2:0x80577CC8; // type:object size:0x8 data:string -lbl_80577CD0 = .sdata2:0x80577CD0; // type:object size:0x8 -lbl_80577CD8 = .sdata2:0x80577CD8; // type:object size:0x8 data:string -lbl_80577CE0 = .sdata2:0x80577CE0; // type:object size:0x4 data:string -lbl_80577CE4 = .sdata2:0x80577CE4; // type:object size:0x8 -lbl_80577CEC = .sdata2:0x80577CEC; // type:object size:0xC -lbl_80577CF8 = .sdata2:0x80577CF8; // type:object size:0x8 data:string -lbl_80577D00 = .sdata2:0x80577D00; // type:object size:0x8 data:string -lbl_80577D08 = .sdata2:0x80577D08; // type:object size:0x8 data:string -lbl_80577D10 = .sdata2:0x80577D10; // type:object size:0x8 -lbl_80577D18 = .sdata2:0x80577D18; // type:object size:0x4 data:string -lbl_80577D1C = .sdata2:0x80577D1C; // type:object size:0x8 -lbl_80577D24 = .sdata2:0x80577D24; // type:object size:0xC -lbl_80577D30 = .sdata2:0x80577D30; // type:object size:0x8 data:string -lbl_80577D38 = .sdata2:0x80577D38; // type:object size:0x4 data:string -lbl_80577D3C = .sdata2:0x80577D3C; // type:object size:0x8 -lbl_80577D44 = .sdata2:0x80577D44; // type:object size:0xC -lbl_80577D50 = .sdata2:0x80577D50; // type:object size:0x8 data:string -lbl_80577D58 = .sdata2:0x80577D58; // type:object size:0x8 -lbl_80577D60 = .sdata2:0x80577D60; // type:object size:0x8 data:string -lbl_80577D68 = .sdata2:0x80577D68; // type:object size:0x8 data:string -lbl_80577D70 = .sdata2:0x80577D70; // type:object size:0x8 data:string -lbl_80577D78 = .sdata2:0x80577D78; // type:object size:0x8 -lbl_80577D80 = .sdata2:0x80577D80; // type:object size:0x4 data:string -lbl_80577D84 = .sdata2:0x80577D84; // type:object size:0x8 -lbl_80577D8C = .sdata2:0x80577D8C; // type:object size:0xC -lbl_80577D98 = .sdata2:0x80577D98; // type:object size:0x8 data:string -lbl_80577DA0 = .sdata2:0x80577DA0; // type:object size:0x8 data:string -lbl_80577DA8 = .sdata2:0x80577DA8; // type:object size:0x8 -lbl_80577DB0 = .sdata2:0x80577DB0; // type:object size:0x8 -lbl_80577DB8 = .sdata2:0x80577DB8; // type:object size:0x8 -lbl_80577DC0 = .sdata2:0x80577DC0; // type:object size:0x8 data:string -lbl_80577DC8 = .sdata2:0x80577DC8; // type:object size:0x8 -lbl_80577DD0 = .sdata2:0x80577DD0; // type:object size:0x8 data:string -lbl_80577DD8 = .sdata2:0x80577DD8; // type:object size:0x8 -lbl_80577DE0 = .sdata2:0x80577DE0; // type:object size:0x8 -lbl_80577DE8 = .sdata2:0x80577DE8; // type:object size:0x8 -lbl_80577DF0 = .sdata2:0x80577DF0; // type:object size:0x8 data:string -lbl_80577DF8 = .sdata2:0x80577DF8; // type:object size:0x8 data:string -lbl_80577E00 = .sdata2:0x80577E00; // type:object size:0x8 data:string -lbl_80577E08 = .sdata2:0x80577E08; // type:object size:0x8 -lbl_80577E10 = .sdata2:0x80577E10; // type:object size:0x8 -lbl_80577E18 = .sdata2:0x80577E18; // type:object size:0x8 -lbl_80577E20 = .sdata2:0x80577E20; // type:object size:0x8 data:string -lbl_80577E28 = .sdata2:0x80577E28; // type:object size:0x8 data:string -lbl_80577E30 = .sdata2:0x80577E30; // type:object size:0x8 -lbl_80577E38 = .sdata2:0x80577E38; // type:object size:0x8 -lbl_80577E40 = .sdata2:0x80577E40; // type:object size:0x8 -lbl_80577E48 = .sdata2:0x80577E48; // type:object size:0x8 -lbl_80577E50 = .sdata2:0x80577E50; // type:object size:0x8 data:string -lbl_80577E58 = .sdata2:0x80577E58; // type:object size:0x8 -lbl_80577E60 = .sdata2:0x80577E60; // type:object size:0x8 -lbl_80577E68 = .sdata2:0x80577E68; // type:object size:0x8 data:string -lbl_80577E70 = .sdata2:0x80577E70; // type:object size:0x8 -lbl_80577E78 = .sdata2:0x80577E78; // type:object size:0x8 -lbl_80577E80 = .sdata2:0x80577E80; // type:object size:0x8 data:string -lbl_80577E88 = .sdata2:0x80577E88; // type:object size:0x8 data:string -lbl_80577E90 = .sdata2:0x80577E90; // type:object size:0x8 -lbl_80577E98 = .sdata2:0x80577E98; // type:object size:0x8 -lbl_80577EA0 = .sdata2:0x80577EA0; // type:object size:0x8 -lbl_80577EA8 = .sdata2:0x80577EA8; // type:object size:0x8 -lbl_80577EB0 = .sdata2:0x80577EB0; // type:object size:0x8 -lbl_80577EB8 = .sdata2:0x80577EB8; // type:object size:0x8 -lbl_80577EC0 = .sdata2:0x80577EC0; // type:object size:0x8 -lbl_80577EC8 = .sdata2:0x80577EC8; // type:object size:0x8 -lbl_80577ED0 = .sdata2:0x80577ED0; // type:object size:0x8 data:string -lbl_80577ED8 = .sdata2:0x80577ED8; // type:object size:0x8 -lbl_80577EE0 = .sdata2:0x80577EE0; // type:object size:0x8 data:string -lbl_80577EE8 = .sdata2:0x80577EE8; // type:object size:0x8 data:string -lbl_80577EF0 = .sdata2:0x80577EF0; // type:object size:0x8 -lbl_80577EF8 = .sdata2:0x80577EF8; // type:object size:0x8 -lbl_80577F00 = .sdata2:0x80577F00; // type:object size:0x8 data:string -lbl_80577F08 = .sdata2:0x80577F08; // type:object size:0x8 data:string -lbl_80577F10 = .sdata2:0x80577F10; // type:object size:0x8 -lbl_80577F18 = .sdata2:0x80577F18; // type:object size:0x8 -lbl_80577F20 = .sdata2:0x80577F20; // type:object size:0x8 -lbl_80577F28 = .sdata2:0x80577F28; // type:object size:0x8 -lbl_80577F30 = .sdata2:0x80577F30; // type:object size:0x8 -lbl_80577F38 = .sdata2:0x80577F38; // type:object size:0x8 -lbl_80577F40 = .sdata2:0x80577F40; // type:object size:0x8 -lbl_80577F48 = .sdata2:0x80577F48; // type:object size:0x8 -lbl_80577F50 = .sdata2:0x80577F50; // type:object size:0x8 data:string -lbl_80577F58 = .sdata2:0x80577F58; // type:object size:0x8 data:string -lbl_80577F60 = .sdata2:0x80577F60; // type:object size:0x8 -lbl_80577F68 = .sdata2:0x80577F68; // type:object size:0x8 data:string -lbl_80577F70 = .sdata2:0x80577F70; // type:object size:0x8 data:string -lbl_80577F78 = .sdata2:0x80577F78; // type:object size:0x8 data:string -lbl_80577F80 = .sdata2:0x80577F80; // type:object size:0x8 -lbl_80577F88 = .sdata2:0x80577F88; // type:object size:0x4 data:string -lbl_80577F8C = .sdata2:0x80577F8C; // type:object size:0xC -lbl_80577F98 = .sdata2:0x80577F98; // type:object size:0x8 data:string -lbl_80577FA0 = .sdata2:0x80577FA0; // type:object size:0x8 -lbl_80577FA8 = .sdata2:0x80577FA8; // type:object size:0x8 -lbl_80577FB0 = .sdata2:0x80577FB0; // type:object size:0x8 -lbl_80577FB8 = .sdata2:0x80577FB8; // type:object size:0x8 -lbl_80577FC0 = .sdata2:0x80577FC0; // type:object size:0x8 -lbl_80577FC8 = .sdata2:0x80577FC8; // type:object size:0x8 -lbl_80577FD0 = .sdata2:0x80577FD0; // type:object size:0x8 data:string -lbl_80577FD8 = .sdata2:0x80577FD8; // type:object size:0x8 -lbl_80577FE0 = .sdata2:0x80577FE0; // type:object size:0x8 data:string -lbl_80577FE8 = .sdata2:0x80577FE8; // type:object size:0x8 data:string -lbl_80577FF0 = .sdata2:0x80577FF0; // type:object size:0x8 -lbl_80577FF8 = .sdata2:0x80577FF8; // type:object size:0x8 -lbl_80578000 = .sdata2:0x80578000; // type:object size:0x8 data:string -lbl_80578008 = .sdata2:0x80578008; // type:object size:0x8 data:string -lbl_80578010 = .sdata2:0x80578010; // type:object size:0x8 -lbl_80578018 = .sdata2:0x80578018; // type:object size:0x8 -lbl_80578020 = .sdata2:0x80578020; // type:object size:0x8 -lbl_80578028 = .sdata2:0x80578028; // type:object size:0x8 data:string -lbl_80578030 = .sdata2:0x80578030; // type:object size:0x8 data:string -lbl_80578038 = .sdata2:0x80578038; // type:object size:0x8 -lbl_80578040 = .sdata2:0x80578040; // type:object size:0x8 data:string -lbl_80578048 = .sdata2:0x80578048; // type:object size:0x8 data:string -lbl_80578050 = .sdata2:0x80578050; // type:object size:0x8 data:string -lbl_80578058 = .sdata2:0x80578058; // type:object size:0x8 -lbl_80578060 = .sdata2:0x80578060; // type:object size:0x8 data:string -lbl_80578068 = .sdata2:0x80578068; // type:object size:0x8 -lbl_80578070 = .sdata2:0x80578070; // type:object size:0x8 data:string -lbl_80578078 = .sdata2:0x80578078; // type:object size:0x8 data:string -lbl_80578080 = .sdata2:0x80578080; // type:object size:0x8 data:string -lbl_80578088 = .sdata2:0x80578088; // type:object size:0x8 -lbl_80578090 = .sdata2:0x80578090; // type:object size:0x8 data:string -lbl_80578098 = .sdata2:0x80578098; // type:object size:0x8 data:string -lbl_805780A0 = .sdata2:0x805780A0; // type:object size:0x8 data:string -lbl_805780A8 = .sdata2:0x805780A8; // type:object size:0x4 data:string -lbl_805780AC = .sdata2:0x805780AC; // type:object size:0x4 data:string -lbl_805780B0 = .sdata2:0x805780B0; // type:object size:0x8 -lbl_805780B8 = .sdata2:0x805780B8; // type:object size:0x8 -lbl_805780C0 = .sdata2:0x805780C0; // type:object size:0x8 -lbl_805780C8 = .sdata2:0x805780C8; // type:object size:0x8 data:string -lbl_805780D0 = .sdata2:0x805780D0; // type:object size:0x8 -lbl_805780D8 = .sdata2:0x805780D8; // type:object size:0x8 -lbl_805780E0 = .sdata2:0x805780E0; // type:object size:0x8 data:string -lbl_805780E8 = .sdata2:0x805780E8; // type:object size:0x8 data:string -lbl_805780F0 = .sdata2:0x805780F0; // type:object size:0x8 -lbl_805780F8 = .sdata2:0x805780F8; // type:object size:0x8 -lbl_80578100 = .sdata2:0x80578100; // type:object size:0x8 -lbl_80578108 = .sdata2:0x80578108; // type:object size:0x4 data:string -lbl_8057810C = .sdata2:0x8057810C; // type:object size:0xC -lbl_80578118 = .sdata2:0x80578118; // type:object size:0x8 data:string -lbl_80578120 = .sdata2:0x80578120; // type:object size:0x8 -lbl_80578128 = .sdata2:0x80578128; // type:object size:0x8 data:string -lbl_80578130 = .sdata2:0x80578130; // type:object size:0x8 -lbl_80578138 = .sdata2:0x80578138; // type:object size:0x8 data:string -lbl_80578140 = .sdata2:0x80578140; // type:object size:0x8 -lbl_80578148 = .sdata2:0x80578148; // type:object size:0x8 -lbl_80578150 = .sdata2:0x80578150; // type:object size:0x8 data:string -lbl_80578158 = .sdata2:0x80578158; // type:object size:0x8 -lbl_80578160 = .sdata2:0x80578160; // type:object size:0x4 data:string -lbl_80578164 = .sdata2:0x80578164; // type:object size:0x8 -lbl_8057816C = .sdata2:0x8057816C; // type:object size:0x8 -lbl_80578174 = .sdata2:0x80578174; // type:object size:0x4 data:string -lbl_80578178 = .sdata2:0x80578178; // type:object size:0x8 -lbl_80578180 = .sdata2:0x80578180; // type:object size:0x8 data:string -lbl_80578188 = .sdata2:0x80578188; // type:object size:0x8 data:string -lbl_80578190 = .sdata2:0x80578190; // type:object size:0x8 -lbl_80578198 = .sdata2:0x80578198; // type:object size:0x8 data:string -lbl_805781A0 = .sdata2:0x805781A0; // type:object size:0x8 -lbl_805781A8 = .sdata2:0x805781A8; // type:object size:0x8 data:string -lbl_805781B0 = .sdata2:0x805781B0; // type:object size:0x4 data:string -lbl_805781B4 = .sdata2:0x805781B4; // type:object size:0x4 data:string -lbl_805781B8 = .sdata2:0x805781B8; // type:object size:0x8 data:string -lbl_805781C0 = .sdata2:0x805781C0; // type:object size:0x4 data:string -lbl_805781C4 = .sdata2:0x805781C4; // type:object size:0x4 data:string -lbl_805781C8 = .sdata2:0x805781C8; // type:object size:0x8 -lbl_805781D0 = .sdata2:0x805781D0; // type:object size:0x8 data:string -lbl_805781D8 = .sdata2:0x805781D8; // type:object size:0x4 data:string -lbl_805781DC = .sdata2:0x805781DC; // type:object size:0x8 -lbl_805781E4 = .sdata2:0x805781E4; // type:object size:0x8 -lbl_805781EC = .sdata2:0x805781EC; // type:object size:0x8 -lbl_805781F4 = .sdata2:0x805781F4; // type:object size:0x4 data:string -lbl_805781F8 = .sdata2:0x805781F8; // type:object size:0x8 -lbl_80578200 = .sdata2:0x80578200; // type:object size:0x8 -lbl_80578208 = .sdata2:0x80578208; // type:object size:0x4 data:string -lbl_8057820C = .sdata2:0x8057820C; // type:object size:0x4 data:string -lbl_80578210 = .sdata2:0x80578210; // type:object size:0x8 -lbl_80578218 = .sdata2:0x80578218; // type:object size:0x8 -lbl_80578220 = .sdata2:0x80578220; // type:object size:0x8 data:string -lbl_80578228 = .sdata2:0x80578228; // type:object size:0x8 data:string -lbl_80578230 = .sdata2:0x80578230; // type:object size:0x8 -lbl_80578238 = .sdata2:0x80578238; // type:object size:0x8 -lbl_80578240 = .sdata2:0x80578240; // type:object size:0x8 data:string -lbl_80578248 = .sdata2:0x80578248; // type:object size:0x8 -lbl_80578250 = .sdata2:0x80578250; // type:object size:0x8 data:string -lbl_80578258 = .sdata2:0x80578258; // type:object size:0x8 data:string -lbl_80578260 = .sdata2:0x80578260; // type:object size:0x8 -lbl_80578268 = .sdata2:0x80578268; // type:object size:0x8 data:string -lbl_80578270 = .sdata2:0x80578270; // type:object size:0x8 data:string -lbl_80578278 = .sdata2:0x80578278; // type:object size:0x8 data:string -lbl_80578280 = .sdata2:0x80578280; // type:object size:0x8 -lbl_80578288 = .sdata2:0x80578288; // type:object size:0x8 -lbl_80578290 = .sdata2:0x80578290; // type:object size:0x8 data:string -lbl_80578298 = .sdata2:0x80578298; // type:object size:0x8 -lbl_805782A0 = .sdata2:0x805782A0; // type:object size:0x8 data:string -lbl_805782A8 = .sdata2:0x805782A8; // type:object size:0x8 data:string -lbl_805782B0 = .sdata2:0x805782B0; // type:object size:0x8 data:string -lbl_805782B8 = .sdata2:0x805782B8; // type:object size:0x8 data:string -lbl_805782C0 = .sdata2:0x805782C0; // type:object size:0x8 data:string -lbl_805782C8 = .sdata2:0x805782C8; // type:object size:0x8 data:string -lbl_805782D0 = .sdata2:0x805782D0; // type:object size:0x8 -lbl_805782D8 = .sdata2:0x805782D8; // type:object size:0x8 data:string -lbl_805782E0 = .sdata2:0x805782E0; // type:object size:0x8 data:string -lbl_805782E8 = .sdata2:0x805782E8; // type:object size:0x8 data:string -lbl_805782F0 = .sdata2:0x805782F0; // type:object size:0x8 -lbl_805782F8 = .sdata2:0x805782F8; // type:object size:0x8 -lbl_80578300 = .sdata2:0x80578300; // type:object size:0x8 -lbl_80578308 = .sdata2:0x80578308; // type:object size:0x8 -lbl_80578310 = .sdata2:0x80578310; // type:object size:0x8 -lbl_80578318 = .sdata2:0x80578318; // type:object size:0x8 data:string -lbl_80578320 = .sdata2:0x80578320; // type:object size:0x8 data:string -lbl_80578328 = .sdata2:0x80578328; // type:object size:0x8 -lbl_80578330 = .sdata2:0x80578330; // type:object size:0x8 data:string -lbl_80578338 = .sdata2:0x80578338; // type:object size:0x8 -lbl_80578340 = .sdata2:0x80578340; // type:object size:0x8 data:string -lbl_80578348 = .sdata2:0x80578348; // type:object size:0x8 data:string -lbl_80578350 = .sdata2:0x80578350; // type:object size:0x8 data:string -lbl_80578358 = .sdata2:0x80578358; // type:object size:0x8 -lbl_80578360 = .sdata2:0x80578360; // type:object size:0x8 -lbl_80578368 = .sdata2:0x80578368; // type:object size:0x8 data:string -lbl_80578370 = .sdata2:0x80578370; // type:object size:0x8 -lbl_80578378 = .sdata2:0x80578378; // type:object size:0x8 -lbl_80578380 = .sdata2:0x80578380; // type:object size:0x8 data:string -lbl_80578388 = .sdata2:0x80578388; // type:object size:0x8 data:string -lbl_80578390 = .sdata2:0x80578390; // type:object size:0x8 -lbl_80578398 = .sdata2:0x80578398; // type:object size:0x8 data:string -lbl_805783A0 = .sdata2:0x805783A0; // type:object size:0x8 data:string -lbl_805783A8 = .sdata2:0x805783A8; // type:object size:0x8 data:string -lbl_805783B0 = .sdata2:0x805783B0; // type:object size:0x8 data:string -lbl_805783B8 = .sdata2:0x805783B8; // type:object size:0x8 data:string -lbl_805783C0 = .sdata2:0x805783C0; // type:object size:0x8 data:string -lbl_805783C8 = .sdata2:0x805783C8; // type:object size:0x8 -lbl_805783D0 = .sdata2:0x805783D0; // type:object size:0x8 -lbl_805783D8 = .sdata2:0x805783D8; // type:object size:0x8 -lbl_805783E0 = .sdata2:0x805783E0; // type:object size:0x8 -lbl_805783E8 = .sdata2:0x805783E8; // type:object size:0x8 data:string -lbl_805783F0 = .sdata2:0x805783F0; // type:object size:0x8 -lbl_805783F8 = .sdata2:0x805783F8; // type:object size:0x8 data:string -lbl_80578400 = .sdata2:0x80578400; // type:object size:0x8 data:string -lbl_80578408 = .sdata2:0x80578408; // type:object size:0x8 -lbl_80578410 = .sdata2:0x80578410; // type:object size:0x8 data:string -lbl_80578418 = .sdata2:0x80578418; // type:object size:0x8 -lbl_80578420 = .sdata2:0x80578420; // type:object size:0x8 data:string -lbl_80578428 = .sdata2:0x80578428; // type:object size:0x8 -lbl_80578430 = .sdata2:0x80578430; // type:object size:0x8 data:string -lbl_80578438 = .sdata2:0x80578438; // type:object size:0x8 data:string -lbl_80578440 = .sdata2:0x80578440; // type:object size:0x8 data:string -lbl_80578448 = .sdata2:0x80578448; // type:object size:0x8 -lbl_80578450 = .sdata2:0x80578450; // type:object size:0x8 data:string -lbl_80578458 = .sdata2:0x80578458; // type:object size:0x8 -lbl_80578460 = .sdata2:0x80578460; // type:object size:0x8 data:string -lbl_80578468 = .sdata2:0x80578468; // type:object size:0x8 -lbl_80578470 = .sdata2:0x80578470; // type:object size:0x8 data:string -lbl_80578478 = .sdata2:0x80578478; // type:object size:0x8 data:string -lbl_80578480 = .sdata2:0x80578480; // type:object size:0x8 -lbl_80578488 = .sdata2:0x80578488; // type:object size:0x8 -lbl_80578490 = .sdata2:0x80578490; // type:object size:0x8 data:string -lbl_80578498 = .sdata2:0x80578498; // type:object size:0x8 data:string -lbl_805784A0 = .sdata2:0x805784A0; // type:object size:0x8 data:string -lbl_805784A8 = .sdata2:0x805784A8; // type:object size:0x8 data:string -lbl_805784B0 = .sdata2:0x805784B0; // type:object size:0x8 data:string -lbl_805784B8 = .sdata2:0x805784B8; // type:object size:0x8 -lbl_805784C0 = .sdata2:0x805784C0; // type:object size:0x8 data:string -lbl_805784C8 = .sdata2:0x805784C8; // type:object size:0x8 -lbl_805784D0 = .sdata2:0x805784D0; // type:object size:0x8 data:string -lbl_805784D8 = .sdata2:0x805784D8; // type:object size:0x8 -lbl_805784E0 = .sdata2:0x805784E0; // type:object size:0x8 data:string -lbl_805784E8 = .sdata2:0x805784E8; // type:object size:0x8 -lbl_805784F0 = .sdata2:0x805784F0; // type:object size:0x8 data:string -lbl_805784F8 = .sdata2:0x805784F8; // type:object size:0x8 -lbl_80578500 = .sdata2:0x80578500; // type:object size:0x8 data:string -lbl_80578508 = .sdata2:0x80578508; // type:object size:0x8 data:string -lbl_80578510 = .sdata2:0x80578510; // type:object size:0x8 data:string -lbl_80578518 = .sdata2:0x80578518; // type:object size:0x8 data:string -lbl_80578520 = .sdata2:0x80578520; // type:object size:0x8 data:string -lbl_80578528 = .sdata2:0x80578528; // type:object size:0x8 data:string -lbl_80578530 = .sdata2:0x80578530; // type:object size:0x8 data:string -lbl_80578538 = .sdata2:0x80578538; // type:object size:0x8 -lbl_80578540 = .sdata2:0x80578540; // type:object size:0x8 -lbl_80578548 = .sdata2:0x80578548; // type:object size:0x8 data:string -lbl_80578550 = .sdata2:0x80578550; // type:object size:0x8 -lbl_80578558 = .sdata2:0x80578558; // type:object size:0x8 data:string -lbl_80578560 = .sdata2:0x80578560; // type:object size:0x8 -lbl_80578568 = .sdata2:0x80578568; // type:object size:0x8 data:string -lbl_80578570 = .sdata2:0x80578570; // type:object size:0x8 -lbl_80578578 = .sdata2:0x80578578; // type:object size:0x8 -lbl_80578580 = .sdata2:0x80578580; // type:object size:0x8 -lbl_80578588 = .sdata2:0x80578588; // type:object size:0x8 -lbl_80578590 = .sdata2:0x80578590; // type:object size:0x8 -lbl_80578598 = .sdata2:0x80578598; // type:object size:0x8 -lbl_805785A0 = .sdata2:0x805785A0; // type:object size:0x8 data:string -lbl_805785A8 = .sdata2:0x805785A8; // type:object size:0x8 data:string -lbl_805785B0 = .sdata2:0x805785B0; // type:object size:0x8 data:string -lbl_805785B8 = .sdata2:0x805785B8; // type:object size:0x8 data:string -lbl_805785C0 = .sdata2:0x805785C0; // type:object size:0x8 data:string -lbl_805785C8 = .sdata2:0x805785C8; // type:object size:0x8 data:string -lbl_805785D0 = .sdata2:0x805785D0; // type:object size:0x8 -lbl_805785D8 = .sdata2:0x805785D8; // type:object size:0x4 data:string -lbl_805785DC = .sdata2:0x805785DC; // type:object size:0x8 -lbl_805785E4 = .sdata2:0x805785E4; // type:object size:0x8 -lbl_805785EC = .sdata2:0x805785EC; // type:object size:0xC -lbl_805785F8 = .sdata2:0x805785F8; // type:object size:0x8 data:string -lbl_80578600 = .sdata2:0x80578600; // type:object size:0x8 data:string -lbl_80578608 = .sdata2:0x80578608; // type:object size:0x8 -lbl_80578610 = .sdata2:0x80578610; // type:object size:0x8 -lbl_80578618 = .sdata2:0x80578618; // type:object size:0x8 -lbl_80578620 = .sdata2:0x80578620; // type:object size:0x8 data:string -lbl_80578628 = .sdata2:0x80578628; // type:object size:0x8 -lbl_80578630 = .sdata2:0x80578630; // type:object size:0x8 -lbl_80578638 = .sdata2:0x80578638; // type:object size:0x8 data:string -lbl_80578640 = .sdata2:0x80578640; // type:object size:0x8 data:string -lbl_80578648 = .sdata2:0x80578648; // type:object size:0x8 data:string -lbl_80578650 = .sdata2:0x80578650; // type:object size:0x8 data:string -lbl_80578658 = .sdata2:0x80578658; // type:object size:0x8 data:string -lbl_80578660 = .sdata2:0x80578660; // type:object size:0x8 data:string -lbl_80578668 = .sdata2:0x80578668; // type:object size:0x8 -lbl_80578670 = .sdata2:0x80578670; // type:object size:0x8 data:string -lbl_80578678 = .sdata2:0x80578678; // type:object size:0x8 -lbl_80578680 = .sdata2:0x80578680; // type:object size:0x8 data:string -lbl_80578688 = .sdata2:0x80578688; // type:object size:0x8 data:string -lbl_80578690 = .sdata2:0x80578690; // type:object size:0x8 data:string -lbl_80578698 = .sdata2:0x80578698; // type:object size:0x8 data:string -lbl_805786A0 = .sdata2:0x805786A0; // type:object size:0x8 data:string -lbl_805786A8 = .sdata2:0x805786A8; // type:object size:0x8 -lbl_805786B0 = .sdata2:0x805786B0; // type:object size:0x8 data:string -lbl_805786B8 = .sdata2:0x805786B8; // type:object size:0x8 -lbl_805786C0 = .sdata2:0x805786C0; // type:object size:0x8 data:string -lbl_805786C8 = .sdata2:0x805786C8; // type:object size:0x8 data:string -lbl_805786D0 = .sdata2:0x805786D0; // type:object size:0x8 data:string -lbl_805786D8 = .sdata2:0x805786D8; // type:object size:0x8 data:string -lbl_805786E0 = .sdata2:0x805786E0; // type:object size:0x8 data:string -lbl_805786E8 = .sdata2:0x805786E8; // type:object size:0x8 data:string -lbl_805786F0 = .sdata2:0x805786F0; // type:object size:0x8 -lbl_805786F8 = .sdata2:0x805786F8; // type:object size:0x8 -lbl_80578700 = .sdata2:0x80578700; // type:object size:0x8 data:string -lbl_80578708 = .sdata2:0x80578708; // type:object size:0x8 data:string -lbl_80578710 = .sdata2:0x80578710; // type:object size:0x8 data:string -lbl_80578718 = .sdata2:0x80578718; // type:object size:0x8 data:string -lbl_80578720 = .sdata2:0x80578720; // type:object size:0x8 data:string -lbl_80578728 = .sdata2:0x80578728; // type:object size:0x8 data:string -lbl_80578730 = .sdata2:0x80578730; // type:object size:0x8 data:string -lbl_80578738 = .sdata2:0x80578738; // type:object size:0x8 data:string -lbl_80578740 = .sdata2:0x80578740; // type:object size:0x8 -lbl_80578748 = .sdata2:0x80578748; // type:object size:0x8 data:string -lbl_80578750 = .sdata2:0x80578750; // type:object size:0x8 -lbl_80578758 = .sdata2:0x80578758; // type:object size:0x8 data:string -lbl_80578760 = .sdata2:0x80578760; // type:object size:0x8 -lbl_80578768 = .sdata2:0x80578768; // type:object size:0x8 -lbl_80578770 = .sdata2:0x80578770; // type:object size:0x8 data:string -lbl_80578778 = .sdata2:0x80578778; // type:object size:0x8 -lbl_80578780 = .sdata2:0x80578780; // type:object size:0x8 -lbl_80578788 = .sdata2:0x80578788; // type:object size:0x8 -lbl_80578790 = .sdata2:0x80578790; // type:object size:0x8 -lbl_80578798 = .sdata2:0x80578798; // type:object size:0x8 data:string -lbl_805787A0 = .sdata2:0x805787A0; // type:object size:0x8 -lbl_805787A8 = .sdata2:0x805787A8; // type:object size:0x8 data:string -lbl_805787B0 = .sdata2:0x805787B0; // type:object size:0x8 data:string -lbl_805787B8 = .sdata2:0x805787B8; // type:object size:0x8 data:string -lbl_805787C0 = .sdata2:0x805787C0; // type:object size:0x8 data:string -lbl_805787C8 = .sdata2:0x805787C8; // type:object size:0x8 -lbl_805787D0 = .sdata2:0x805787D0; // type:object size:0x8 data:string -lbl_805787D8 = .sdata2:0x805787D8; // type:object size:0x8 -lbl_805787E0 = .sdata2:0x805787E0; // type:object size:0x8 data:string -lbl_805787E8 = .sdata2:0x805787E8; // type:object size:0x8 data:string -lbl_805787F0 = .sdata2:0x805787F0; // type:object size:0x8 data:string -lbl_805787F8 = .sdata2:0x805787F8; // type:object size:0x8 data:string -lbl_80578800 = .sdata2:0x80578800; // type:object size:0x8 data:string -lbl_80578808 = .sdata2:0x80578808; // type:object size:0x8 data:string -lbl_80578810 = .sdata2:0x80578810; // type:object size:0x8 data:string -lbl_80578818 = .sdata2:0x80578818; // type:object size:0x8 data:string -lbl_80578820 = .sdata2:0x80578820; // type:object size:0x8 data:string -lbl_80578828 = .sdata2:0x80578828; // type:object size:0x8 -lbl_80578830 = .sdata2:0x80578830; // type:object size:0x8 data:string -lbl_80578838 = .sdata2:0x80578838; // type:object size:0x8 -lbl_80578840 = .sdata2:0x80578840; // type:object size:0x8 -lbl_80578848 = .sdata2:0x80578848; // type:object size:0x8 data:string -lbl_80578850 = .sdata2:0x80578850; // type:object size:0x8 data:string -lbl_80578858 = .sdata2:0x80578858; // type:object size:0x8 -lbl_80578860 = .sdata2:0x80578860; // type:object size:0x8 data:string -lbl_80578868 = .sdata2:0x80578868; // type:object size:0x8 -lbl_80578870 = .sdata2:0x80578870; // type:object size:0x8 -lbl_80578878 = .sdata2:0x80578878; // type:object size:0x8 -lbl_80578880 = .sdata2:0x80578880; // type:object size:0x8 data:string -lbl_80578888 = .sdata2:0x80578888; // type:object size:0x8 -lbl_80578890 = .sdata2:0x80578890; // type:object size:0x8 data:string -lbl_80578898 = .sdata2:0x80578898; // type:object size:0x8 data:string -lbl_805788A0 = .sdata2:0x805788A0; // type:object size:0x8 data:string -lbl_805788A8 = .sdata2:0x805788A8; // type:object size:0x8 data:string -lbl_805788B0 = .sdata2:0x805788B0; // type:object size:0x8 data:string -lbl_805788B8 = .sdata2:0x805788B8; // type:object size:0x8 data:string -lbl_805788C0 = .sdata2:0x805788C0; // type:object size:0x8 data:string -lbl_805788C8 = .sdata2:0x805788C8; // type:object size:0x8 data:string -lbl_805788D0 = .sdata2:0x805788D0; // type:object size:0x8 data:string -lbl_805788D8 = .sdata2:0x805788D8; // type:object size:0x8 -lbl_805788E0 = .sdata2:0x805788E0; // type:object size:0x8 -lbl_805788E8 = .sdata2:0x805788E8; // type:object size:0x8 data:string -lbl_805788F0 = .sdata2:0x805788F0; // type:object size:0x8 data:string -lbl_805788F8 = .sdata2:0x805788F8; // type:object size:0x8 data:string -lbl_80578900 = .sdata2:0x80578900; // type:object size:0x8 data:string -lbl_80578908 = .sdata2:0x80578908; // type:object size:0x8 data:string -lbl_80578910 = .sdata2:0x80578910; // type:object size:0x8 data:string -lbl_80578918 = .sdata2:0x80578918; // type:object size:0x8 data:string -lbl_80578920 = .sdata2:0x80578920; // type:object size:0x8 data:string -lbl_80578928 = .sdata2:0x80578928; // type:object size:0x8 data:string -lbl_80578930 = .sdata2:0x80578930; // type:object size:0x8 data:string -lbl_80578938 = .sdata2:0x80578938; // type:object size:0x8 data:string -lbl_80578940 = .sdata2:0x80578940; // type:object size:0x8 data:string -lbl_80578948 = .sdata2:0x80578948; // type:object size:0x8 -lbl_80578950 = .sdata2:0x80578950; // type:object size:0x8 data:string -lbl_80578958 = .sdata2:0x80578958; // type:object size:0x8 data:string -lbl_80578960 = .sdata2:0x80578960; // type:object size:0x8 data:string -lbl_80578968 = .sdata2:0x80578968; // type:object size:0x8 -lbl_80578970 = .sdata2:0x80578970; // type:object size:0x8 -lbl_80578978 = .sdata2:0x80578978; // type:object size:0x8 data:string -lbl_80578980 = .sdata2:0x80578980; // type:object size:0x8 data:string -lbl_80578988 = .sdata2:0x80578988; // type:object size:0x8 -lbl_80578990 = .sdata2:0x80578990; // type:object size:0x8 data:string -lbl_80578998 = .sdata2:0x80578998; // type:object size:0x8 -lbl_805789A0 = .sdata2:0x805789A0; // type:object size:0x8 -lbl_805789A8 = .sdata2:0x805789A8; // type:object size:0x8 -lbl_805789B0 = .sdata2:0x805789B0; // type:object size:0x8 -lbl_805789B8 = .sdata2:0x805789B8; // type:object size:0x8 -lbl_805789C0 = .sdata2:0x805789C0; // type:object size:0x8 -lbl_805789C8 = .sdata2:0x805789C8; // type:object size:0x8 data:string -lbl_805789D0 = .sdata2:0x805789D0; // type:object size:0x8 data:string -lbl_805789D8 = .sdata2:0x805789D8; // type:object size:0x8 data:string -lbl_805789E0 = .sdata2:0x805789E0; // type:object size:0x8 -lbl_805789E8 = .sdata2:0x805789E8; // type:object size:0x8 -lbl_805789F0 = .sdata2:0x805789F0; // type:object size:0x8 data:string -lbl_805789F8 = .sdata2:0x805789F8; // type:object size:0x8 -lbl_80578A00 = .sdata2:0x80578A00; // type:object size:0x8 -lbl_80578A08 = .sdata2:0x80578A08; // type:object size:0x8 data:string -lbl_80578A10 = .sdata2:0x80578A10; // type:object size:0x8 -lbl_80578A18 = .sdata2:0x80578A18; // type:object size:0x8 data:string -lbl_80578A20 = .sdata2:0x80578A20; // type:object size:0x8 -lbl_80578A28 = .sdata2:0x80578A28; // type:object size:0x8 -lbl_80578A30 = .sdata2:0x80578A30; // type:object size:0x8 -lbl_80578A38 = .sdata2:0x80578A38; // type:object size:0x8 -lbl_80578A40 = .sdata2:0x80578A40; // type:object size:0x8 -lbl_80578A48 = .sdata2:0x80578A48; // type:object size:0x8 -lbl_80578A50 = .sdata2:0x80578A50; // type:object size:0x8 -lbl_80578A58 = .sdata2:0x80578A58; // type:object size:0x8 data:string -lbl_80578A60 = .sdata2:0x80578A60; // type:object size:0x8 -lbl_80578A68 = .sdata2:0x80578A68; // type:object size:0x8 -lbl_80578A70 = .sdata2:0x80578A70; // type:object size:0x8 data:string -lbl_80578A78 = .sdata2:0x80578A78; // type:object size:0x8 -lbl_80578A80 = .sdata2:0x80578A80; // type:object size:0x8 data:string -lbl_80578A88 = .sdata2:0x80578A88; // type:object size:0x8 -lbl_80578A90 = .sdata2:0x80578A90; // type:object size:0x8 -lbl_80578A98 = .sdata2:0x80578A98; // type:object size:0x8 data:string -lbl_80578AA0 = .sdata2:0x80578AA0; // type:object size:0x8 -lbl_80578AA8 = .sdata2:0x80578AA8; // type:object size:0x8 data:string -lbl_80578AB0 = .sdata2:0x80578AB0; // type:object size:0x8 data:string -lbl_80578AB8 = .sdata2:0x80578AB8; // type:object size:0x8 -lbl_80578AC0 = .sdata2:0x80578AC0; // type:object size:0x8 data:string -lbl_80578AC8 = .sdata2:0x80578AC8; // type:object size:0x8 data:string -lbl_80578AD0 = .sdata2:0x80578AD0; // type:object size:0x8 -lbl_80578AD8 = .sdata2:0x80578AD8; // type:object size:0x8 -lbl_80578AE0 = .sdata2:0x80578AE0; // type:object size:0x8 -lbl_80578AE8 = .sdata2:0x80578AE8; // type:object size:0x8 -lbl_80578AF0 = .sdata2:0x80578AF0; // type:object size:0x8 -lbl_80578AF8 = .sdata2:0x80578AF8; // type:object size:0x8 -lbl_80578B00 = .sdata2:0x80578B00; // type:object size:0x8 -lbl_80578B08 = .sdata2:0x80578B08; // type:object size:0x8 data:string -lbl_80578B10 = .sdata2:0x80578B10; // type:object size:0x8 data:string -lbl_80578B18 = .sdata2:0x80578B18; // type:object size:0x8 data:string -lbl_80578B20 = .sdata2:0x80578B20; // type:object size:0x8 -lbl_80578B28 = .sdata2:0x80578B28; // type:object size:0x8 data:string -lbl_80578B30 = .sdata2:0x80578B30; // type:object size:0x8 data:string -lbl_80578B38 = .sdata2:0x80578B38; // type:object size:0x8 data:string -lbl_80578B40 = .sdata2:0x80578B40; // type:object size:0x8 data:string -lbl_80578B48 = .sdata2:0x80578B48; // type:object size:0x8 data:string -lbl_80578B50 = .sdata2:0x80578B50; // type:object size:0x8 -lbl_80578B58 = .sdata2:0x80578B58; // type:object size:0x8 data:string -lbl_80578B60 = .sdata2:0x80578B60; // type:object size:0x8 data:string -lbl_80578B68 = .sdata2:0x80578B68; // type:object size:0x8 -lbl_80578B70 = .sdata2:0x80578B70; // type:object size:0x8 data:string -lbl_80578B78 = .sdata2:0x80578B78; // type:object size:0x8 data:string -lbl_80578B80 = .sdata2:0x80578B80; // type:object size:0x8 data:string -lbl_80578B88 = .sdata2:0x80578B88; // type:object size:0x8 -lbl_80578B90 = .sdata2:0x80578B90; // type:object size:0x8 data:string -lbl_80578B98 = .sdata2:0x80578B98; // type:object size:0x8 data:string -lbl_80578BA0 = .sdata2:0x80578BA0; // type:object size:0x8 data:string -lbl_80578BA8 = .sdata2:0x80578BA8; // type:object size:0x8 data:string -lbl_80578BB0 = .sdata2:0x80578BB0; // type:object size:0x8 data:string -lbl_80578BB8 = .sdata2:0x80578BB8; // type:object size:0x8 data:string -lbl_80578BC0 = .sdata2:0x80578BC0; // type:object size:0x8 data:string -lbl_80578BC8 = .sdata2:0x80578BC8; // type:object size:0x8 data:string -lbl_80578BD0 = .sdata2:0x80578BD0; // type:object size:0x8 data:string -lbl_80578BD8 = .sdata2:0x80578BD8; // type:object size:0x8 data:string -lbl_80578BE0 = .sdata2:0x80578BE0; // type:object size:0x8 data:string -lbl_80578BE8 = .sdata2:0x80578BE8; // type:object size:0x8 data:string -lbl_80578BF0 = .sdata2:0x80578BF0; // type:object size:0x8 data:string -lbl_80578BF8 = .sdata2:0x80578BF8; // type:object size:0x8 data:string -lbl_80578C00 = .sdata2:0x80578C00; // type:object size:0x8 data:string -lbl_80578C08 = .sdata2:0x80578C08; // type:object size:0x8 data:string -lbl_80578C10 = .sdata2:0x80578C10; // type:object size:0x8 data:string -lbl_80578C18 = .sdata2:0x80578C18; // type:object size:0x8 data:string -lbl_80578C20 = .sdata2:0x80578C20; // type:object size:0x8 -lbl_80578C28 = .sdata2:0x80578C28; // type:object size:0x8 data:string -lbl_80578C30 = .sdata2:0x80578C30; // type:object size:0x8 -lbl_80578C38 = .sdata2:0x80578C38; // type:object size:0x8 data:string -lbl_80578C40 = .sdata2:0x80578C40; // type:object size:0x8 data:string -lbl_80578C48 = .sdata2:0x80578C48; // type:object size:0x8 -lbl_80578C50 = .sdata2:0x80578C50; // type:object size:0x8 -lbl_80578C58 = .sdata2:0x80578C58; // type:object size:0x8 data:string -lbl_80578C60 = .sdata2:0x80578C60; // type:object size:0x8 -lbl_80578C68 = .sdata2:0x80578C68; // type:object size:0x8 data:string -lbl_80578C70 = .sdata2:0x80578C70; // type:object size:0x8 data:string -lbl_80578C78 = .sdata2:0x80578C78; // type:object size:0x8 data:string -lbl_80578C80 = .sdata2:0x80578C80; // type:object size:0x8 data:string -lbl_80578C88 = .sdata2:0x80578C88; // type:object size:0x8 data:string -lbl_80578C90 = .sdata2:0x80578C90; // type:object size:0x8 data:string -lbl_80578C98 = .sdata2:0x80578C98; // type:object size:0x8 data:string -lbl_80578CA0 = .sdata2:0x80578CA0; // type:object size:0x8 -lbl_80578CA8 = .sdata2:0x80578CA8; // type:object size:0x8 data:string -lbl_80578CB0 = .sdata2:0x80578CB0; // type:object size:0x8 -lbl_80578CB8 = .sdata2:0x80578CB8; // type:object size:0x8 data:string -lbl_80578CC0 = .sdata2:0x80578CC0; // type:object size:0x8 data:string -lbl_80578CC8 = .sdata2:0x80578CC8; // type:object size:0x8 data:string -lbl_80578CD0 = .sdata2:0x80578CD0; // type:object size:0x8 data:string -lbl_80578CD8 = .sdata2:0x80578CD8; // type:object size:0x8 data:string -lbl_80578CE0 = .sdata2:0x80578CE0; // type:object size:0x8 data:string -lbl_80578CE8 = .sdata2:0x80578CE8; // type:object size:0x8 -lbl_80578CF0 = .sdata2:0x80578CF0; // type:object size:0x8 data:string -lbl_80578CF8 = .sdata2:0x80578CF8; // type:object size:0x8 data:string -lbl_80578D00 = .sdata2:0x80578D00; // type:object size:0x8 -lbl_80578D08 = .sdata2:0x80578D08; // type:object size:0x8 -lbl_80578D10 = .sdata2:0x80578D10; // type:object size:0x8 data:string -lbl_80578D18 = .sdata2:0x80578D18; // type:object size:0x8 -lbl_80578D20 = .sdata2:0x80578D20; // type:object size:0x8 data:string -lbl_80578D28 = .sdata2:0x80578D28; // type:object size:0x8 data:string -lbl_80578D30 = .sdata2:0x80578D30; // type:object size:0x8 data:string -lbl_80578D38 = .sdata2:0x80578D38; // type:object size:0x8 -lbl_80578D40 = .sdata2:0x80578D40; // type:object size:0x8 -lbl_80578D48 = .sdata2:0x80578D48; // type:object size:0x8 -lbl_80578D50 = .sdata2:0x80578D50; // type:object size:0x8 data:string -lbl_80578D58 = .sdata2:0x80578D58; // type:object size:0x8 -lbl_80578D60 = .sdata2:0x80578D60; // type:object size:0x8 -lbl_80578D68 = .sdata2:0x80578D68; // type:object size:0x8 data:string -lbl_80578D70 = .sdata2:0x80578D70; // type:object size:0x8 -lbl_80578D78 = .sdata2:0x80578D78; // type:object size:0x8 data:string -lbl_80578D80 = .sdata2:0x80578D80; // type:object size:0x8 -lbl_80578D88 = .sdata2:0x80578D88; // type:object size:0x8 data:string -lbl_80578D90 = .sdata2:0x80578D90; // type:object size:0x8 data:string -lbl_80578D98 = .sdata2:0x80578D98; // type:object size:0x8 -lbl_80578DA0 = .sdata2:0x80578DA0; // type:object size:0x8 data:string -lbl_80578DA8 = .sdata2:0x80578DA8; // type:object size:0x8 -lbl_80578DB0 = .sdata2:0x80578DB0; // type:object size:0x8 -lbl_80578DB8 = .sdata2:0x80578DB8; // type:object size:0x8 -lbl_80578DC0 = .sdata2:0x80578DC0; // type:object size:0x8 -lbl_80578DC8 = .sdata2:0x80578DC8; // type:object size:0x8 -lbl_80578DD0 = .sdata2:0x80578DD0; // type:object size:0x8 -lbl_80578DD8 = .sdata2:0x80578DD8; // type:object size:0x8 -lbl_80578DE0 = .sdata2:0x80578DE0; // type:object size:0x8 -lbl_80578DE8 = .sdata2:0x80578DE8; // type:object size:0x8 -lbl_80578DF0 = .sdata2:0x80578DF0; // type:object size:0x8 -lbl_80578DF8 = .sdata2:0x80578DF8; // type:object size:0x8 data:string -lbl_80578E00 = .sdata2:0x80578E00; // type:object size:0x8 -lbl_80578E08 = .sdata2:0x80578E08; // type:object size:0x8 -lbl_80578E10 = .sdata2:0x80578E10; // type:object size:0x8 -lbl_80578E18 = .sdata2:0x80578E18; // type:object size:0x8 -lbl_80578E20 = .sdata2:0x80578E20; // type:object size:0x8 -lbl_80578E28 = .sdata2:0x80578E28; // type:object size:0x8 -lbl_80578E30 = .sdata2:0x80578E30; // type:object size:0x8 -lbl_80578E38 = .sdata2:0x80578E38; // type:object size:0x8 -lbl_80578E40 = .sdata2:0x80578E40; // type:object size:0x8 -lbl_80578E48 = .sdata2:0x80578E48; // type:object size:0x8 data:string -lbl_80578E50 = .sdata2:0x80578E50; // type:object size:0x8 data:string -lbl_80578E58 = .sdata2:0x80578E58; // type:object size:0x8 -lbl_80578E60 = .sdata2:0x80578E60; // type:object size:0x8 -lbl_80578E68 = .sdata2:0x80578E68; // type:object size:0x8 data:string -lbl_80578E70 = .sdata2:0x80578E70; // type:object size:0x8 -lbl_80578E78 = .sdata2:0x80578E78; // type:object size:0x8 -lbl_80578E80 = .sdata2:0x80578E80; // type:object size:0x8 -lbl_80578E88 = .sdata2:0x80578E88; // type:object size:0x8 -lbl_80578E90 = .sdata2:0x80578E90; // type:object size:0x8 data:string -lbl_80578E98 = .sdata2:0x80578E98; // type:object size:0x8 data:string -lbl_80578EA0 = .sdata2:0x80578EA0; // type:object size:0x8 data:string -lbl_80578EA8 = .sdata2:0x80578EA8; // type:object size:0x8 -lbl_80578EB0 = .sdata2:0x80578EB0; // type:object size:0x8 -lbl_80578EB8 = .sdata2:0x80578EB8; // type:object size:0x8 data:string -lbl_80578EC0 = .sdata2:0x80578EC0; // type:object size:0x8 data:string -lbl_80578EC8 = .sdata2:0x80578EC8; // type:object size:0x8 data:string -lbl_80578ED0 = .sdata2:0x80578ED0; // type:object size:0x8 data:string -lbl_80578ED8 = .sdata2:0x80578ED8; // type:object size:0x8 data:string -lbl_80578EE0 = .sdata2:0x80578EE0; // type:object size:0x8 data:string -lbl_80578EE8 = .sdata2:0x80578EE8; // type:object size:0x8 -lbl_80578EF0 = .sdata2:0x80578EF0; // type:object size:0x8 data:string -lbl_80578EF8 = .sdata2:0x80578EF8; // type:object size:0x8 data:string -lbl_80578F00 = .sdata2:0x80578F00; // type:object size:0x8 data:string -lbl_80578F08 = .sdata2:0x80578F08; // type:object size:0x8 data:string -lbl_80578F10 = .sdata2:0x80578F10; // type:object size:0x8 -lbl_80578F18 = .sdata2:0x80578F18; // type:object size:0x8 -lbl_80578F20 = .sdata2:0x80578F20; // type:object size:0x8 data:string -lbl_80578F28 = .sdata2:0x80578F28; // type:object size:0x8 data:string -lbl_80578F30 = .sdata2:0x80578F30; // type:object size:0x8 data:string -lbl_80578F38 = .sdata2:0x80578F38; // type:object size:0x8 -lbl_80578F40 = .sdata2:0x80578F40; // type:object size:0x8 -lbl_80578F48 = .sdata2:0x80578F48; // type:object size:0x8 data:string -lbl_80578F50 = .sdata2:0x80578F50; // type:object size:0x8 -lbl_80578F58 = .sdata2:0x80578F58; // type:object size:0x8 -lbl_80578F60 = .sdata2:0x80578F60; // type:object size:0x8 -lbl_80578F68 = .sdata2:0x80578F68; // type:object size:0x8 data:string -lbl_80578F70 = .sdata2:0x80578F70; // type:object size:0x8 -lbl_80578F78 = .sdata2:0x80578F78; // type:object size:0x8 -lbl_80578F80 = .sdata2:0x80578F80; // type:object size:0x8 data:string -lbl_80578F88 = .sdata2:0x80578F88; // type:object size:0x8 data:string -lbl_80578F90 = .sdata2:0x80578F90; // type:object size:0x8 data:string -lbl_80578F98 = .sdata2:0x80578F98; // type:object size:0x8 -lbl_80578FA0 = .sdata2:0x80578FA0; // type:object size:0x8 data:string -lbl_80578FA8 = .sdata2:0x80578FA8; // type:object size:0x8 data:string -lbl_80578FB0 = .sdata2:0x80578FB0; // type:object size:0x8 data:string -lbl_80578FB8 = .sdata2:0x80578FB8; // type:object size:0x8 data:string -lbl_80578FC0 = .sdata2:0x80578FC0; // type:object size:0x8 data:string -lbl_80578FC8 = .sdata2:0x80578FC8; // type:object size:0x8 data:string -lbl_80578FD0 = .sdata2:0x80578FD0; // type:object size:0x8 data:string -lbl_80578FD8 = .sdata2:0x80578FD8; // type:object size:0x8 -lbl_80578FE0 = .sdata2:0x80578FE0; // type:object size:0x8 data:string -lbl_80578FE8 = .sdata2:0x80578FE8; // type:object size:0x8 -lbl_80578FF0 = .sdata2:0x80578FF0; // type:object size:0x8 data:string -lbl_80578FF8 = .sdata2:0x80578FF8; // type:object size:0x8 -lbl_80579000 = .sdata2:0x80579000; // type:object size:0x8 -lbl_80579008 = .sdata2:0x80579008; // type:object size:0x8 data:string -lbl_80579010 = .sdata2:0x80579010; // type:object size:0x8 data:string -lbl_80579018 = .sdata2:0x80579018; // type:object size:0x8 data:string -lbl_80579020 = .sdata2:0x80579020; // type:object size:0x8 data:string -lbl_80579028 = .sdata2:0x80579028; // type:object size:0x8 -lbl_80579030 = .sdata2:0x80579030; // type:object size:0x8 data:string -lbl_80579038 = .sdata2:0x80579038; // type:object size:0x8 data:string -lbl_80579040 = .sdata2:0x80579040; // type:object size:0x8 data:string -lbl_80579048 = .sdata2:0x80579048; // type:object size:0x8 data:string -lbl_80579050 = .sdata2:0x80579050; // type:object size:0x8 -lbl_80579058 = .sdata2:0x80579058; // type:object size:0x8 data:string -lbl_80579060 = .sdata2:0x80579060; // type:object size:0x8 data:string -lbl_80579068 = .sdata2:0x80579068; // type:object size:0x8 -lbl_80579070 = .sdata2:0x80579070; // type:object size:0x8 data:string -lbl_80579078 = .sdata2:0x80579078; // type:object size:0x8 -lbl_80579080 = .sdata2:0x80579080; // type:object size:0x8 -lbl_80579088 = .sdata2:0x80579088; // type:object size:0x8 -lbl_80579090 = .sdata2:0x80579090; // type:object size:0x8 -lbl_80579098 = .sdata2:0x80579098; // type:object size:0x8 -lbl_805790A0 = .sdata2:0x805790A0; // type:object size:0x8 data:string -lbl_805790A8 = .sdata2:0x805790A8; // type:object size:0x8 data:string -lbl_805790B0 = .sdata2:0x805790B0; // type:object size:0x8 data:string -lbl_805790B8 = .sdata2:0x805790B8; // type:object size:0x8 data:string -lbl_805790C0 = .sdata2:0x805790C0; // type:object size:0x8 data:string -lbl_805790C8 = .sdata2:0x805790C8; // type:object size:0x8 data:string -lbl_805790D0 = .sdata2:0x805790D0; // type:object size:0x8 -lbl_805790D8 = .sdata2:0x805790D8; // type:object size:0x8 -lbl_805790E0 = .sdata2:0x805790E0; // type:object size:0x8 -lbl_805790E8 = .sdata2:0x805790E8; // type:object size:0x8 -lbl_805790F0 = .sdata2:0x805790F0; // type:object size:0x8 data:string -lbl_805790F8 = .sdata2:0x805790F8; // type:object size:0x8 data:string -lbl_80579100 = .sdata2:0x80579100; // type:object size:0x8 data:string -lbl_80579108 = .sdata2:0x80579108; // type:object size:0x8 data:string -lbl_80579110 = .sdata2:0x80579110; // type:object size:0x8 data:string -lbl_80579118 = .sdata2:0x80579118; // type:object size:0x8 data:string -lbl_80579120 = .sdata2:0x80579120; // type:object size:0x8 data:string -lbl_80579128 = .sdata2:0x80579128; // type:object size:0x8 data:string -lbl_80579130 = .sdata2:0x80579130; // type:object size:0x8 data:string -lbl_80579138 = .sdata2:0x80579138; // type:object size:0x8 data:string -lbl_80579140 = .sdata2:0x80579140; // type:object size:0x8 -lbl_80579148 = .sdata2:0x80579148; // type:object size:0x8 -lbl_80579150 = .sdata2:0x80579150; // type:object size:0x8 data:string -lbl_80579158 = .sdata2:0x80579158; // type:object size:0x8 -lbl_80579160 = .sdata2:0x80579160; // type:object size:0x8 -lbl_80579168 = .sdata2:0x80579168; // type:object size:0x8 -lbl_80579170 = .sdata2:0x80579170; // type:object size:0x8 -lbl_80579178 = .sdata2:0x80579178; // type:object size:0x8 -lbl_80579180 = .sdata2:0x80579180; // type:object size:0x8 data:string -lbl_80579188 = .sdata2:0x80579188; // type:object size:0x8 data:string -lbl_80579190 = .sdata2:0x80579190; // type:object size:0x8 -lbl_80579198 = .sdata2:0x80579198; // type:object size:0x8 data:string -lbl_805791A0 = .sdata2:0x805791A0; // type:object size:0x8 data:string -lbl_805791A8 = .sdata2:0x805791A8; // type:object size:0x8 -lbl_805791B0 = .sdata2:0x805791B0; // type:object size:0x8 data:string -lbl_805791B8 = .sdata2:0x805791B8; // type:object size:0x8 -lbl_805791C0 = .sdata2:0x805791C0; // type:object size:0x8 data:string -lbl_805791C8 = .sdata2:0x805791C8; // type:object size:0x8 data:string -lbl_805791D0 = .sdata2:0x805791D0; // type:object size:0x8 data:string -lbl_805791D8 = .sdata2:0x805791D8; // type:object size:0x8 data:string -lbl_805791E0 = .sdata2:0x805791E0; // type:object size:0x8 -lbl_805791E8 = .sdata2:0x805791E8; // type:object size:0x8 -lbl_805791F0 = .sdata2:0x805791F0; // type:object size:0x8 data:string -lbl_805791F8 = .sdata2:0x805791F8; // type:object size:0x8 -lbl_80579200 = .sdata2:0x80579200; // type:object size:0x8 -lbl_80579208 = .sdata2:0x80579208; // type:object size:0x8 +@62 = .sdata2:0x805779F8; // type:object size:0x7 scope:local data:string +@63 = .sdata2:0x80577A00; // type:object size:0x7 scope:local data:string +@64 = .sdata2:0x80577A08; // type:object size:0x7 scope:local data:string +@65 = .sdata2:0x80577A10; // type:object size:0x7 scope:local data:string +@66 = .sdata2:0x80577A18; // type:object size:0x7 scope:local data:string +@67 = .sdata2:0x80577A20; // type:object size:0x7 scope:local data:string +@68 = .sdata2:0x80577A28; // type:object size:0x7 scope:local data:string +@69 = .sdata2:0x80577A30; // type:object size:0x7 scope:local data:string +@70 = .sdata2:0x80577A38; // type:object size:0x7 scope:local data:string +@71 = .sdata2:0x80577A40; // type:object size:0x7 scope:local data:string +@72 = .sdata2:0x80577A48; // type:object size:0x7 scope:local data:string +@73 = .sdata2:0x80577A50; // type:object size:0x7 scope:local data:string +@74 = .sdata2:0x80577A58; // type:object size:0x7 scope:local data:string +@75 = .sdata2:0x80577A60; // type:object size:0x7 scope:local data:string +@76 = .sdata2:0x80577A68; // type:object size:0x7 scope:local data:string +@77 = .sdata2:0x80577A70; // type:object size:0x7 scope:local data:string +@78 = .sdata2:0x80577A78; // type:object size:0x7 scope:local data:string +@79 = .sdata2:0x80577A80; // type:object size:0x7 scope:local data:string +@80 = .sdata2:0x80577A88; // type:object size:0x7 scope:local data:string +@81 = .sdata2:0x80577A90; // type:object size:0x7 scope:local data:string +@82 = .sdata2:0x80577A98; // type:object size:0x7 scope:local data:string +@83 = .sdata2:0x80577AA0; // type:object size:0x7 scope:local data:string +@84 = .sdata2:0x80577AA8; // type:object size:0x7 scope:local data:string +@85 = .sdata2:0x80577AB0; // type:object size:0x7 scope:local data:string +@86 = .sdata2:0x80577AB8; // type:object size:0x7 scope:local data:string +@87 = .sdata2:0x80577AC0; // type:object size:0x7 scope:local data:string +@88 = .sdata2:0x80577AC8; // type:object size:0x7 scope:local data:string +@89 = .sdata2:0x80577AD0; // type:object size:0x7 scope:local data:string +@90 = .sdata2:0x80577AD8; // type:object size:0x7 scope:local data:string +@91 = .sdata2:0x80577AE0; // type:object size:0x7 scope:local data:string +@92 = .sdata2:0x80577AE8; // type:object size:0x7 scope:local data:string +@93 = .sdata2:0x80577AF0; // type:object size:0x7 scope:local data:string +@94 = .sdata2:0x80577AF8; // type:object size:0x7 scope:local data:string +@95 = .sdata2:0x80577B00; // type:object size:0x7 scope:local data:string +@96 = .sdata2:0x80577B08; // type:object size:0x7 scope:local data:string +@97 = .sdata2:0x80577B10; // type:object size:0x7 scope:local data:string +@98 = .sdata2:0x80577B18; // type:object size:0x7 scope:local data:string +@99 = .sdata2:0x80577B20; // type:object size:0x7 scope:local data:string +@100 = .sdata2:0x80577B28; // type:object size:0x7 scope:local data:string +@101 = .sdata2:0x80577B30; // type:object size:0x7 scope:local data:string +@102 = .sdata2:0x80577B38; // type:object size:0x7 scope:local data:string +@103 = .sdata2:0x80577B40; // type:object size:0x7 scope:local data:string +@104 = .sdata2:0x80577B48; // type:object size:0x7 scope:local data:string +@105 = .sdata2:0x80577B50; // type:object size:0x7 scope:local data:string +@106 = .sdata2:0x80577B58; // type:object size:0x7 scope:local data:string +@107 = .sdata2:0x80577B60; // type:object size:0x7 scope:local data:string +@108 = .sdata2:0x80577B68; // type:object size:0x7 scope:local data:string +@109 = .sdata2:0x80577B70; // type:object size:0x7 scope:local data:string +@110 = .sdata2:0x80577B78; // type:object size:0x7 scope:local data:string +@111 = .sdata2:0x80577B80; // type:object size:0x7 scope:local data:string +@112 = .sdata2:0x80577B88; // type:object size:0x7 scope:local data:string +@113 = .sdata2:0x80577B90; // type:object size:0x7 scope:local data:string +@114 = .sdata2:0x80577B98; // type:object size:0x7 scope:local data:string +@115 = .sdata2:0x80577BA0; // type:object size:0x7 scope:local data:string +@116 = .sdata2:0x80577BA8; // type:object size:0x7 scope:local data:string +@117 = .sdata2:0x80577BB0; // type:object size:0x7 scope:local data:string +@118 = .sdata2:0x80577BB8; // type:object size:0x7 scope:local data:string +@119 = .sdata2:0x80577BC0; // type:object size:0x7 scope:local data:string +@120 = .sdata2:0x80577BC8; // type:object size:0x7 scope:local data:string +@121 = .sdata2:0x80577BD0; // type:object size:0x7 scope:local data:string +@122 = .sdata2:0x80577BD8; // type:object size:0x7 scope:local data:string +@123 = .sdata2:0x80577BE0; // type:object size:0x7 scope:local data:string +@124 = .sdata2:0x80577BE8; // type:object size:0x7 scope:local data:string +@125 = .sdata2:0x80577BF0; // type:object size:0x5 scope:local data:string +@126 = .sdata2:0x80577BF8; // type:object size:0x5 scope:local data:string +@127 = .sdata2:0x80577C00; // type:object size:0x5 scope:local data:string +@128 = .sdata2:0x80577C08; // type:object size:0x7 scope:local data:string +@129 = .sdata2:0x80577C10; // type:object size:0x6 scope:local data:string +@130 = .sdata2:0x80577C18; // type:object size:0x8 scope:local data:string +@131 = .sdata2:0x80577C20; // type:object size:0x4 scope:local data:string +@132 = .sdata2:0x80577C28; // type:object size:0x8 scope:local data:string +@133 = .sdata2:0x80577C30; // type:object size:0x6 scope:local data:string +@134 = .sdata2:0x80577C38; // type:object size:0x8 scope:local data:string +@135 = .sdata2:0x80577C40; // type:object size:0x7 scope:local data:string +@136 = .sdata2:0x80577C48; // type:object size:0x7 scope:local data:string +@137 = .sdata2:0x80577C50; // type:object size:0x7 scope:local data:string +@138 = .sdata2:0x80577C58; // type:object size:0x7 scope:local data:string +@139 = .sdata2:0x80577C60; // type:object size:0x7 scope:local data:string +@140 = .sdata2:0x80577C68; // type:object size:0x7 scope:local data:string +@141 = .sdata2:0x80577C70; // type:object size:0x8 scope:local data:string +@142 = .sdata2:0x80577C78; // type:object size:0x8 scope:local data:string +@143 = .sdata2:0x80577C80; // type:object size:0x7 scope:local data:string +@144 = .sdata2:0x80577C88; // type:object size:0x7 scope:local data:string +@145 = .sdata2:0x80577C90; // type:object size:0x8 scope:local data:string +@146 = .sdata2:0x80577C98; // type:object size:0x8 scope:local data:string +@147 = .sdata2:0x80577CA0; // type:object size:0x6 scope:local data:string +@148 = .sdata2:0x80577CA8; // type:object size:0x8 scope:local data:string +@149 = .sdata2:0x80577CB0; // type:object size:0x8 scope:local data:string +@150 = .sdata2:0x80577CB8; // type:object size:0x8 scope:local data:string +@151 = .sdata2:0x80577CC0; // type:object size:0x8 scope:local data:string +@152 = .sdata2:0x80577CC8; // type:object size:0x8 scope:local data:string +@153 = .sdata2:0x80577CD0; // type:object size:0x7 scope:local data:string +@154 = .sdata2:0x80577CD8; // type:object size:0x8 scope:local data:string +@155 = .sdata2:0x80577CE0; // type:object size:0x4 scope:local data:string +@156 = .sdata2:0x80577CE4; // type:object size:0x5 scope:local data:string +@157 = .sdata2:0x80577CEC; // type:object size:0x6 scope:local data:string +@158 = .sdata2:0x80577CF8; // type:object size:0x8 scope:local data:string +@159 = .sdata2:0x80577D00; // type:object size:0x8 scope:local data:string +@160 = .sdata2:0x80577D08; // type:object size:0x8 scope:local data:string +@161 = .sdata2:0x80577D10; // type:object size:0x5 scope:local data:string +@162 = .sdata2:0x80577D18; // type:object size:0x4 scope:local data:string +@163 = .sdata2:0x80577D1C; // type:object size:0x5 scope:local data:string +@164 = .sdata2:0x80577D24; // type:object size:0x5 scope:local data:string +@165 = .sdata2:0x80577D30; // type:object size:0x8 scope:local data:string +@166 = .sdata2:0x80577D38; // type:object size:0x4 scope:local data:string +@167 = .sdata2:0x80577D3C; // type:object size:0x6 scope:local data:string +@168 = .sdata2:0x80577D44; // type:object size:0x7 scope:local data:string +@169 = .sdata2:0x80577D50; // type:object size:0x8 scope:local data:string +@170 = .sdata2:0x80577D58; // type:object size:0x7 scope:local data:string +@171 = .sdata2:0x80577D60; // type:object size:0x8 scope:local data:string +@172 = .sdata2:0x80577D68; // type:object size:0x8 scope:local data:string +@173 = .sdata2:0x80577D70; // type:object size:0x8 scope:local data:string +@174 = .sdata2:0x80577D78; // type:object size:0x7 scope:local data:string +@175 = .sdata2:0x80577D80; // type:object size:0x4 scope:local data:string +@176 = .sdata2:0x80577D84; // type:object size:0x7 scope:local data:string +@177 = .sdata2:0x80577D8C; // type:object size:0x5 scope:local data:string +@178 = .sdata2:0x80577D98; // type:object size:0x8 scope:local data:string +@179 = .sdata2:0x80577DA0; // type:object size:0x8 scope:local data:string +@180 = .sdata2:0x80577DA8; // type:object size:0x6 scope:local data:string +@181 = .sdata2:0x80577DB0; // type:object size:0x7 scope:local data:string +@182 = .sdata2:0x80577DB8; // type:object size:0x7 scope:local data:string +@183 = .sdata2:0x80577DC0; // type:object size:0x8 scope:local data:string +@184 = .sdata2:0x80577DC8; // type:object size:0x6 scope:local data:string +@185 = .sdata2:0x80577DD0; // type:object size:0x8 scope:local data:string +@186 = .sdata2:0x80577DD8; // type:object size:0x6 scope:local data:string +@187 = .sdata2:0x80577DE0; // type:object size:0x7 scope:local data:string +@188 = .sdata2:0x80577DE8; // type:object size:0x6 scope:local data:string +@189 = .sdata2:0x80577DF0; // type:object size:0x8 scope:local data:string +@190 = .sdata2:0x80577DF8; // type:object size:0x8 scope:local data:string +@191 = .sdata2:0x80577E00; // type:object size:0x8 scope:local data:string +@192 = .sdata2:0x80577E08; // type:object size:0x5 scope:local data:string +@193 = .sdata2:0x80577E10; // type:object size:0x7 scope:local data:string +@194 = .sdata2:0x80577E18; // type:object size:0x6 scope:local data:string +@195 = .sdata2:0x80577E20; // type:object size:0x8 scope:local data:string +@196 = .sdata2:0x80577E28; // type:object size:0x8 scope:local data:string +@197 = .sdata2:0x80577E30; // type:object size:0x5 scope:local data:string +@198 = .sdata2:0x80577E38; // type:object size:0x5 scope:local data:string +@199 = .sdata2:0x80577E40; // type:object size:0x6 scope:local data:string +@200 = .sdata2:0x80577E48; // type:object size:0x5 scope:local data:string +@201 = .sdata2:0x80577E50; // type:object size:0x8 scope:local data:string +@202 = .sdata2:0x80577E58; // type:object size:0x7 scope:local data:string +@203 = .sdata2:0x80577E60; // type:object size:0x6 scope:local data:string +@204 = .sdata2:0x80577E68; // type:object size:0x8 scope:local data:string +@205 = .sdata2:0x80577E70; // type:object size:0x7 scope:local data:string +@206 = .sdata2:0x80577E78; // type:object size:0x6 scope:local data:string +@207 = .sdata2:0x80577E80; // type:object size:0x8 scope:local data:string +@208 = .sdata2:0x80577E88; // type:object size:0x8 scope:local data:string +@209 = .sdata2:0x80577E90; // type:object size:0x7 scope:local data:string +@210 = .sdata2:0x80577E98; // type:object size:0x6 scope:local data:string +@211 = .sdata2:0x80577EA0; // type:object size:0x7 scope:local data:string +@212 = .sdata2:0x80577EA8; // type:object size:0x7 scope:local data:string +@213 = .sdata2:0x80577EB0; // type:object size:0x7 scope:local data:string +@214 = .sdata2:0x80577EB8; // type:object size:0x7 scope:local data:string +@215 = .sdata2:0x80577EC0; // type:object size:0x7 scope:local data:string +@216 = .sdata2:0x80577EC8; // type:object size:0x7 scope:local data:string +@217 = .sdata2:0x80577ED0; // type:object size:0x8 scope:local data:string +@218 = .sdata2:0x80577ED8; // type:object size:0x4 scope:local data:string +@219 = .sdata2:0x80577EE0; // type:object size:0x8 scope:local data:string +@220 = .sdata2:0x80577EE8; // type:object size:0x8 scope:local data:string +@221 = .sdata2:0x80577EF0; // type:object size:0x7 scope:local data:string +@222 = .sdata2:0x80577EF8; // type:object size:0x7 scope:local data:string +@223 = .sdata2:0x80577F00; // type:object size:0x8 scope:local data:string +@224 = .sdata2:0x80577F08; // type:object size:0x8 scope:local data:string +@225 = .sdata2:0x80577F10; // type:object size:0x5 scope:local data:string +@226 = .sdata2:0x80577F18; // type:object size:0x6 scope:local data:string +@227 = .sdata2:0x80577F20; // type:object size:0x6 scope:local data:string +@228 = .sdata2:0x80577F28; // type:object size:0x6 scope:local data:string +@229 = .sdata2:0x80577F30; // type:object size:0x6 scope:local data:string +@230 = .sdata2:0x80577F38; // type:object size:0x6 scope:local data:string +@231 = .sdata2:0x80577F40; // type:object size:0x7 scope:local data:string +@232 = .sdata2:0x80577F48; // type:object size:0x5 scope:local data:string +@233 = .sdata2:0x80577F50; // type:object size:0x8 scope:local data:string +@234 = .sdata2:0x80577F58; // type:object size:0x8 scope:local data:string +@235 = .sdata2:0x80577F60; // type:object size:0x5 scope:local data:string +@236 = .sdata2:0x80577F68; // type:object size:0x8 scope:local data:string +@237 = .sdata2:0x80577F70; // type:object size:0x8 scope:local data:string +@238 = .sdata2:0x80577F78; // type:object size:0x8 scope:local data:string +@239 = .sdata2:0x80577F80; // type:object size:0x7 scope:local data:string +@240 = .sdata2:0x80577F88; // type:object size:0x4 scope:local data:string +@241 = .sdata2:0x80577F8C; // type:object size:0x7 scope:local data:string +@242 = .sdata2:0x80577F98; // type:object size:0x8 scope:local data:string +@243 = .sdata2:0x80577FA0; // type:object size:0x7 scope:local data:string +@244 = .sdata2:0x80577FA8; // type:object size:0x7 scope:local data:string +@245 = .sdata2:0x80577FB0; // type:object size:0x7 scope:local data:string +@246 = .sdata2:0x80577FB8; // type:object size:0x7 scope:local data:string +@247 = .sdata2:0x80577FC0; // type:object size:0x7 scope:local data:string +@248 = .sdata2:0x80577FC8; // type:object size:0x7 scope:local data:string +@249 = .sdata2:0x80577FD0; // type:object size:0x8 scope:local data:string +@250 = .sdata2:0x80577FD8; // type:object size:0x6 scope:local data:string +@251 = .sdata2:0x80577FE0; // type:object size:0x8 scope:local data:string +@252 = .sdata2:0x80577FE8; // type:object size:0x8 scope:local data:string +@253 = .sdata2:0x80577FF0; // type:object size:0x5 scope:local data:string +@254 = .sdata2:0x80577FF8; // type:object size:0x7 scope:local data:string +@255 = .sdata2:0x80578000; // type:object size:0x8 scope:local data:string +@256 = .sdata2:0x80578008; // type:object size:0x8 scope:local data:string +@257 = .sdata2:0x80578010; // type:object size:0x7 scope:local data:string +@258 = .sdata2:0x80578018; // type:object size:0x6 scope:local data:string +@259 = .sdata2:0x80578020; // type:object size:0x6 scope:local data:string +@260 = .sdata2:0x80578028; // type:object size:0x8 scope:local data:string +@261 = .sdata2:0x80578030; // type:object size:0x8 scope:local data:string +@262 = .sdata2:0x80578038; // type:object size:0x7 scope:local data:string +@263 = .sdata2:0x80578040; // type:object size:0x8 scope:local data:string +@264 = .sdata2:0x80578048; // type:object size:0x8 scope:local data:string +@265 = .sdata2:0x80578050; // type:object size:0x8 scope:local data:string +@266 = .sdata2:0x80578058; // type:object size:0x5 scope:local data:string +@267 = .sdata2:0x80578060; // type:object size:0x8 scope:local data:string +@268 = .sdata2:0x80578068; // type:object size:0x7 scope:local data:string +@269 = .sdata2:0x80578070; // type:object size:0x8 scope:local data:string +@270 = .sdata2:0x80578078; // type:object size:0x8 scope:local data:string +@271 = .sdata2:0x80578080; // type:object size:0x8 scope:local data:string +@272 = .sdata2:0x80578088; // type:object size:0x5 scope:local data:string +@273 = .sdata2:0x80578090; // type:object size:0x8 scope:local data:string +@274 = .sdata2:0x80578098; // type:object size:0x8 scope:local data:string +@275 = .sdata2:0x805780A0; // type:object size:0x8 scope:local data:string +@276 = .sdata2:0x805780A8; // type:object size:0x4 scope:local data:string +@277 = .sdata2:0x805780AC; // type:object size:0x4 scope:local data:string +@278 = .sdata2:0x805780B0; // type:object size:0x5 scope:local data:string +@279 = .sdata2:0x805780B8; // type:object size:0x6 scope:local data:string +@280 = .sdata2:0x805780C0; // type:object size:0x5 scope:local data:string +@281 = .sdata2:0x805780C8; // type:object size:0x8 scope:local data:string +@282 = .sdata2:0x805780D0; // type:object size:0x7 scope:local data:string +@283 = .sdata2:0x805780D8; // type:object size:0x4 scope:local data:string +@284 = .sdata2:0x805780E0; // type:object size:0x8 scope:local data:string +@285 = .sdata2:0x805780E8; // type:object size:0x8 scope:local data:string +@286 = .sdata2:0x805780F0; // type:object size:0x5 scope:local data:string +@287 = .sdata2:0x805780F8; // type:object size:0x6 scope:local data:string +@288 = .sdata2:0x80578100; // type:object size:0x5 scope:local data:string +@289 = .sdata2:0x80578108; // type:object size:0x4 scope:local data:string +@290 = .sdata2:0x8057810C; // type:object size:0x6 scope:local data:string +@291 = .sdata2:0x80578118; // type:object size:0x8 scope:local data:string +@292 = .sdata2:0x80578120; // type:object size:0x5 scope:local data:string +@293 = .sdata2:0x80578128; // type:object size:0x8 scope:local data:string +@294 = .sdata2:0x80578130; // type:object size:0x7 scope:local data:string +@295 = .sdata2:0x80578138; // type:object size:0x8 scope:local data:string +@296 = .sdata2:0x80578140; // type:object size:0x7 scope:local data:string +@297 = .sdata2:0x80578148; // type:object size:0x7 scope:local data:string +@298 = .sdata2:0x80578150; // type:object size:0x8 scope:local data:string +@299 = .sdata2:0x80578158; // type:object size:0x5 scope:local data:string +@300 = .sdata2:0x80578160; // type:object size:0x4 scope:local data:string +@301 = .sdata2:0x80578164; // type:object size:0x7 scope:local data:string +@302 = .sdata2:0x8057816C; // type:object size:0x7 scope:local data:string +@303 = .sdata2:0x80578174; // type:object size:0x4 scope:local data:string +@304 = .sdata2:0x80578178; // type:object size:0x4 scope:local data:string +@305 = .sdata2:0x80578180; // type:object size:0x8 scope:local data:string +@306 = .sdata2:0x80578188; // type:object size:0x8 scope:local data:string +@307 = .sdata2:0x80578190; // type:object size:0x7 scope:local data:string +@308 = .sdata2:0x80578198; // type:object size:0x8 scope:local data:string +@309 = .sdata2:0x805781A0; // type:object size:0x4 scope:local data:string +@310 = .sdata2:0x805781A8; // type:object size:0x8 scope:local data:string +@311 = .sdata2:0x805781B0; // type:object size:0x4 scope:local data:string +@312 = .sdata2:0x805781B4; // type:object size:0x4 scope:local data:string +@313 = .sdata2:0x805781B8; // type:object size:0x8 scope:local data:string +@314 = .sdata2:0x805781C0; // type:object size:0x4 scope:local data:string +@315 = .sdata2:0x805781C4; // type:object size:0x4 scope:local data:string +@316 = .sdata2:0x805781C8; // type:object size:0x7 scope:local data:string +@317 = .sdata2:0x805781D0; // type:object size:0x8 scope:local data:string +@318 = .sdata2:0x805781D8; // type:object size:0x4 scope:local data:string +@319 = .sdata2:0x805781DC; // type:object size:0x5 scope:local data:string +@320 = .sdata2:0x805781E4; // type:object size:0x7 scope:local data:string +@321 = .sdata2:0x805781EC; // type:object size:0x6 scope:local data:string +@322 = .sdata2:0x805781F4; // type:object size:0x4 scope:local data:string +@323 = .sdata2:0x805781F8; // type:object size:0x7 scope:local data:string +@324 = .sdata2:0x80578200; // type:object size:0x7 scope:local data:string +@325 = .sdata2:0x80578208; // type:object size:0x4 scope:local data:string +@326 = .sdata2:0x8057820C; // type:object size:0x4 scope:local data:string +@327 = .sdata2:0x80578210; // type:object size:0x7 scope:local data:string +@328 = .sdata2:0x80578218; // type:object size:0x4 scope:local data:string +@329 = .sdata2:0x80578220; // type:object size:0x8 scope:local data:string +@330 = .sdata2:0x80578228; // type:object size:0x8 scope:local data:string +@331 = .sdata2:0x80578230; // type:object size:0x5 scope:local data:string +@332 = .sdata2:0x80578238; // type:object size:0x4 scope:local data:string +@333 = .sdata2:0x80578240; // type:object size:0x8 scope:local data:string +@334 = .sdata2:0x80578248; // type:object size:0x7 scope:local data:string +@335 = .sdata2:0x80578250; // type:object size:0x8 scope:local data:string +@336 = .sdata2:0x80578258; // type:object size:0x8 scope:local data:string +@337 = .sdata2:0x80578260; // type:object size:0x7 scope:local data:string +@338 = .sdata2:0x80578268; // type:object size:0x8 scope:local data:string +@339 = .sdata2:0x80578270; // type:object size:0x8 scope:local data:string +@340 = .sdata2:0x80578278; // type:object size:0x8 scope:local data:string +@341 = .sdata2:0x80578280; // type:object size:0x6 scope:local data:string +@342 = .sdata2:0x80578288; // type:object size:0x6 scope:local data:string +@343 = .sdata2:0x80578290; // type:object size:0x8 scope:local data:string +@344 = .sdata2:0x80578298; // type:object size:0x6 scope:local data:string +@345 = .sdata2:0x805782A0; // type:object size:0x8 scope:local data:string +@346 = .sdata2:0x805782A8; // type:object size:0x8 scope:local data:string +@347 = .sdata2:0x805782B0; // type:object size:0x8 scope:local data:string +@348 = .sdata2:0x805782B8; // type:object size:0x8 scope:local data:string +@349 = .sdata2:0x805782C0; // type:object size:0x8 scope:local data:string +@350 = .sdata2:0x805782C8; // type:object size:0x8 scope:local data:string +@351 = .sdata2:0x805782D0; // type:object size:0x5 scope:local data:string +@352 = .sdata2:0x805782D8; // type:object size:0x8 scope:local data:string +@353 = .sdata2:0x805782E0; // type:object size:0x8 scope:local data:string +@354 = .sdata2:0x805782E8; // type:object size:0x8 scope:local data:string +@355 = .sdata2:0x805782F0; // type:object size:0x5 scope:local data:string +@356 = .sdata2:0x805782F8; // type:object size:0x5 scope:local data:string +@357 = .sdata2:0x80578300; // type:object size:0x6 scope:local data:string +@358 = .sdata2:0x80578308; // type:object size:0x6 scope:local data:string +@359 = .sdata2:0x80578310; // type:object size:0x6 scope:local data:string +@360 = .sdata2:0x80578318; // type:object size:0x8 scope:local data:string +@361 = .sdata2:0x80578320; // type:object size:0x8 scope:local data:string +@362 = .sdata2:0x80578328; // type:object size:0x7 scope:local data:string +@363 = .sdata2:0x80578330; // type:object size:0x8 scope:local data:string +@364 = .sdata2:0x80578338; // type:object size:0x7 scope:local data:string +@365 = .sdata2:0x80578340; // type:object size:0x8 scope:local data:string +@366 = .sdata2:0x80578348; // type:object size:0x8 scope:local data:string +@367 = .sdata2:0x80578350; // type:object size:0x8 scope:local data:string +@368 = .sdata2:0x80578358; // type:object size:0x7 scope:local data:string +@369 = .sdata2:0x80578360; // type:object size:0x7 scope:local data:string +@370 = .sdata2:0x80578368; // type:object size:0x8 scope:local data:string +@371 = .sdata2:0x80578370; // type:object size:0x6 scope:local data:string +@372 = .sdata2:0x80578378; // type:object size:0x5 scope:local data:string +@373 = .sdata2:0x80578380; // type:object size:0x8 scope:local data:string +@374 = .sdata2:0x80578388; // type:object size:0x8 scope:local data:string +@375 = .sdata2:0x80578390; // type:object size:0x6 scope:local data:string +@376 = .sdata2:0x80578398; // type:object size:0x8 scope:local data:string +@377 = .sdata2:0x805783A0; // type:object size:0x8 scope:local data:string +@378 = .sdata2:0x805783A8; // type:object size:0x8 scope:local data:string +@379 = .sdata2:0x805783B0; // type:object size:0x8 scope:local data:string +@380 = .sdata2:0x805783B8; // type:object size:0x8 scope:local data:string +@381 = .sdata2:0x805783C0; // type:object size:0x8 scope:local data:string +@382 = .sdata2:0x805783C8; // type:object size:0x6 scope:local data:string +@383 = .sdata2:0x805783D0; // type:object size:0x7 scope:local data:string +@384 = .sdata2:0x805783D8; // type:object size:0x7 scope:local data:string +@385 = .sdata2:0x805783E0; // type:object size:0x7 scope:local data:string +@386 = .sdata2:0x805783E8; // type:object size:0x8 scope:local data:string +@387 = .sdata2:0x805783F0; // type:object size:0x5 scope:local data:string +@388 = .sdata2:0x805783F8; // type:object size:0x8 scope:local data:string +@389 = .sdata2:0x80578400; // type:object size:0x8 scope:local data:string +@390 = .sdata2:0x80578408; // type:object size:0x7 scope:local data:string +@391 = .sdata2:0x80578410; // type:object size:0x8 scope:local data:string +@392 = .sdata2:0x80578418; // type:object size:0x5 scope:local data:string +@393 = .sdata2:0x80578420; // type:object size:0x8 scope:local data:string +@394 = .sdata2:0x80578428; // type:object size:0x7 scope:local data:string +@395 = .sdata2:0x80578430; // type:object size:0x8 scope:local data:string +@396 = .sdata2:0x80578438; // type:object size:0x8 scope:local data:string +@397 = .sdata2:0x80578440; // type:object size:0x8 scope:local data:string +@398 = .sdata2:0x80578448; // type:object size:0x6 scope:local data:string +@399 = .sdata2:0x80578450; // type:object size:0x8 scope:local data:string +@400 = .sdata2:0x80578458; // type:object size:0x7 scope:local data:string +@401 = .sdata2:0x80578460; // type:object size:0x8 scope:local data:string +@402 = .sdata2:0x80578468; // type:object size:0x7 scope:local data:string +@403 = .sdata2:0x80578470; // type:object size:0x8 scope:local data:string +@404 = .sdata2:0x80578478; // type:object size:0x8 scope:local data:string +@405 = .sdata2:0x80578480; // type:object size:0x7 scope:local data:string +@406 = .sdata2:0x80578488; // type:object size:0x7 scope:local data:string +@407 = .sdata2:0x80578490; // type:object size:0x8 scope:local data:string +@408 = .sdata2:0x80578498; // type:object size:0x8 scope:local data:string +@409 = .sdata2:0x805784A0; // type:object size:0x8 scope:local data:string +@410 = .sdata2:0x805784A8; // type:object size:0x8 scope:local data:string +@411 = .sdata2:0x805784B0; // type:object size:0x8 scope:local data:string +@412 = .sdata2:0x805784B8; // type:object size:0x5 scope:local data:string +@413 = .sdata2:0x805784C0; // type:object size:0x8 scope:local data:string +@414 = .sdata2:0x805784C8; // type:object size:0x7 scope:local data:string +@415 = .sdata2:0x805784D0; // type:object size:0x8 scope:local data:string +@416 = .sdata2:0x805784D8; // type:object size:0x7 scope:local data:string +@417 = .sdata2:0x805784E0; // type:object size:0x8 scope:local data:string +@418 = .sdata2:0x805784E8; // type:object size:0x7 scope:local data:string +@419 = .sdata2:0x805784F0; // type:object size:0x8 scope:local data:string +@420 = .sdata2:0x805784F8; // type:object size:0x7 scope:local data:string +@421 = .sdata2:0x80578500; // type:object size:0x8 scope:local data:string +@422 = .sdata2:0x80578508; // type:object size:0x8 scope:local data:string +@423 = .sdata2:0x80578510; // type:object size:0x8 scope:local data:string +@424 = .sdata2:0x80578518; // type:object size:0x8 scope:local data:string +@425 = .sdata2:0x80578520; // type:object size:0x8 scope:local data:string +@426 = .sdata2:0x80578528; // type:object size:0x8 scope:local data:string +@427 = .sdata2:0x80578530; // type:object size:0x8 scope:local data:string +@428 = .sdata2:0x80578538; // type:object size:0x6 scope:local data:string +@429 = .sdata2:0x80578540; // type:object size:0x6 scope:local data:string +@430 = .sdata2:0x80578548; // type:object size:0x8 scope:local data:string +@431 = .sdata2:0x80578550; // type:object size:0x7 scope:local data:string +@432 = .sdata2:0x80578558; // type:object size:0x8 scope:local data:string +@433 = .sdata2:0x80578560; // type:object size:0x6 scope:local data:string +@434 = .sdata2:0x80578568; // type:object size:0x8 scope:local data:string +@435 = .sdata2:0x80578570; // type:object size:0x6 scope:local data:string +@436 = .sdata2:0x80578578; // type:object size:0x6 scope:local data:string +@437 = .sdata2:0x80578580; // type:object size:0x6 scope:local data:string +@438 = .sdata2:0x80578588; // type:object size:0x6 scope:local data:string +@439 = .sdata2:0x80578590; // type:object size:0x6 scope:local data:string +@440 = .sdata2:0x80578598; // type:object size:0x6 scope:local data:string +@441 = .sdata2:0x805785A0; // type:object size:0x8 scope:local data:string +@442 = .sdata2:0x805785A8; // type:object size:0x8 scope:local data:string +@443 = .sdata2:0x805785B0; // type:object size:0x8 scope:local data:string +@444 = .sdata2:0x805785B8; // type:object size:0x8 scope:local data:string +@445 = .sdata2:0x805785C0; // type:object size:0x8 scope:local data:string +@446 = .sdata2:0x805785C8; // type:object size:0x8 scope:local data:string +@447 = .sdata2:0x805785D0; // type:object size:0x5 scope:local data:string +@448 = .sdata2:0x805785D8; // type:object size:0x4 scope:local data:string +@449 = .sdata2:0x805785DC; // type:object size:0x7 scope:local data:string +@450 = .sdata2:0x805785E4; // type:object size:0x6 scope:local data:string +@451 = .sdata2:0x805785EC; // type:object size:0x7 scope:local data:string +@452 = .sdata2:0x805785F8; // type:object size:0x8 scope:local data:string +@453 = .sdata2:0x80578600; // type:object size:0x8 scope:local data:string +@454 = .sdata2:0x80578608; // type:object size:0x7 scope:local data:string +@455 = .sdata2:0x80578610; // type:object size:0x6 scope:local data:string +@456 = .sdata2:0x80578618; // type:object size:0x6 scope:local data:string +@457 = .sdata2:0x80578620; // type:object size:0x8 scope:local data:string +@458 = .sdata2:0x80578628; // type:object size:0x6 scope:local data:string +@459 = .sdata2:0x80578630; // type:object size:0x7 scope:local data:string +@460 = .sdata2:0x80578638; // type:object size:0x8 scope:local data:string +@461 = .sdata2:0x80578640; // type:object size:0x8 scope:local data:string +@462 = .sdata2:0x80578648; // type:object size:0x8 scope:local data:string +@463 = .sdata2:0x80578650; // type:object size:0x8 scope:local data:string +@464 = .sdata2:0x80578658; // type:object size:0x8 scope:local data:string +@465 = .sdata2:0x80578660; // type:object size:0x8 scope:local data:string +@466 = .sdata2:0x80578668; // type:object size:0x7 scope:local data:string +@467 = .sdata2:0x80578670; // type:object size:0x8 scope:local data:string +@468 = .sdata2:0x80578678; // type:object size:0x7 scope:local data:string +@469 = .sdata2:0x80578680; // type:object size:0x8 scope:local data:string +@470 = .sdata2:0x80578688; // type:object size:0x8 scope:local data:string +@471 = .sdata2:0x80578690; // type:object size:0x8 scope:local data:string +@472 = .sdata2:0x80578698; // type:object size:0x8 scope:local data:string +@473 = .sdata2:0x805786A0; // type:object size:0x8 scope:local data:string +@474 = .sdata2:0x805786A8; // type:object size:0x6 scope:local data:string +@475 = .sdata2:0x805786B0; // type:object size:0x8 scope:local data:string +@476 = .sdata2:0x805786B8; // type:object size:0x7 scope:local data:string +@477 = .sdata2:0x805786C0; // type:object size:0x8 scope:local data:string +@478 = .sdata2:0x805786C8; // type:object size:0x8 scope:local data:string +@479 = .sdata2:0x805786D0; // type:object size:0x8 scope:local data:string +@480 = .sdata2:0x805786D8; // type:object size:0x8 scope:local data:string +@481 = .sdata2:0x805786E0; // type:object size:0x8 scope:local data:string +@482 = .sdata2:0x805786E8; // type:object size:0x8 scope:local data:string +@483 = .sdata2:0x805786F0; // type:object size:0x7 scope:local data:string +@484 = .sdata2:0x805786F8; // type:object size:0x7 scope:local data:string +@485 = .sdata2:0x80578700; // type:object size:0x8 scope:local data:string +@486 = .sdata2:0x80578708; // type:object size:0x8 scope:local data:string +@487 = .sdata2:0x80578710; // type:object size:0x8 scope:local data:string +@488 = .sdata2:0x80578718; // type:object size:0x8 scope:local data:string +@489 = .sdata2:0x80578720; // type:object size:0x8 scope:local data:string +@490 = .sdata2:0x80578728; // type:object size:0x8 scope:local data:string +@491 = .sdata2:0x80578730; // type:object size:0x8 scope:local data:string +@492 = .sdata2:0x80578738; // type:object size:0x8 scope:local data:string +@493 = .sdata2:0x80578740; // type:object size:0x7 scope:local data:string +@494 = .sdata2:0x80578748; // type:object size:0x8 scope:local data:string +@495 = .sdata2:0x80578750; // type:object size:0x7 scope:local data:string +@496 = .sdata2:0x80578758; // type:object size:0x8 scope:local data:string +@497 = .sdata2:0x80578760; // type:object size:0x7 scope:local data:string +@498 = .sdata2:0x80578768; // type:object size:0x7 scope:local data:string +@499 = .sdata2:0x80578770; // type:object size:0x8 scope:local data:string +@500 = .sdata2:0x80578778; // type:object size:0x7 scope:local data:string +@501 = .sdata2:0x80578780; // type:object size:0x7 scope:local data:string +@502 = .sdata2:0x80578788; // type:object size:0x7 scope:local data:string +@503 = .sdata2:0x80578790; // type:object size:0x7 scope:local data:string +@504 = .sdata2:0x80578798; // type:object size:0x8 scope:local data:string +@505 = .sdata2:0x805787A0; // type:object size:0x7 scope:local data:string +@506 = .sdata2:0x805787A8; // type:object size:0x8 scope:local data:string +@507 = .sdata2:0x805787B0; // type:object size:0x8 scope:local data:string +@508 = .sdata2:0x805787B8; // type:object size:0x8 scope:local data:string +@509 = .sdata2:0x805787C0; // type:object size:0x8 scope:local data:string +@510 = .sdata2:0x805787C8; // type:object size:0x7 scope:local data:string +@511 = .sdata2:0x805787D0; // type:object size:0x8 scope:local data:string +@512 = .sdata2:0x805787D8; // type:object size:0x7 scope:local data:string +@513 = .sdata2:0x805787E0; // type:object size:0x8 scope:local data:string +@514 = .sdata2:0x805787E8; // type:object size:0x8 scope:local data:string +@515 = .sdata2:0x805787F0; // type:object size:0x8 scope:local data:string +@516 = .sdata2:0x805787F8; // type:object size:0x8 scope:local data:string +@517 = .sdata2:0x80578800; // type:object size:0x8 scope:local data:string +@518 = .sdata2:0x80578808; // type:object size:0x8 scope:local data:string +@519 = .sdata2:0x80578810; // type:object size:0x8 scope:local data:string +@520 = .sdata2:0x80578818; // type:object size:0x8 scope:local data:string +@521 = .sdata2:0x80578820; // type:object size:0x8 scope:local data:string +@522 = .sdata2:0x80578828; // type:object size:0x7 scope:local data:string +@523 = .sdata2:0x80578830; // type:object size:0x8 scope:local data:string +@524 = .sdata2:0x80578838; // type:object size:0x7 scope:local data:string +@525 = .sdata2:0x80578840; // type:object size:0x7 scope:local data:string +@526 = .sdata2:0x80578848; // type:object size:0x8 scope:local data:string +@527 = .sdata2:0x80578850; // type:object size:0x8 scope:local data:string +@528 = .sdata2:0x80578858; // type:object size:0x7 scope:local data:string +@529 = .sdata2:0x80578860; // type:object size:0x8 scope:local data:string +@530 = .sdata2:0x80578868; // type:object size:0x7 scope:local data:string +@531 = .sdata2:0x80578870; // type:object size:0x7 scope:local data:string +@532 = .sdata2:0x80578878; // type:object size:0x7 scope:local data:string +@533 = .sdata2:0x80578880; // type:object size:0x8 scope:local data:string +@534 = .sdata2:0x80578888; // type:object size:0x7 scope:local data:string +@535 = .sdata2:0x80578890; // type:object size:0x8 scope:local data:string +@536 = .sdata2:0x80578898; // type:object size:0x8 scope:local data:string +@537 = .sdata2:0x805788A0; // type:object size:0x8 scope:local data:string +@538 = .sdata2:0x805788A8; // type:object size:0x8 scope:local data:string +@539 = .sdata2:0x805788B0; // type:object size:0x8 scope:local data:string +@540 = .sdata2:0x805788B8; // type:object size:0x8 scope:local data:string +@541 = .sdata2:0x805788C0; // type:object size:0x8 scope:local data:string +@542 = .sdata2:0x805788C8; // type:object size:0x8 scope:local data:string +@543 = .sdata2:0x805788D0; // type:object size:0x8 scope:local data:string +@544 = .sdata2:0x805788D8; // type:object size:0x7 scope:local data:string +@545 = .sdata2:0x805788E0; // type:object size:0x7 scope:local data:string +@546 = .sdata2:0x805788E8; // type:object size:0x8 scope:local data:string +@547 = .sdata2:0x805788F0; // type:object size:0x8 scope:local data:string +@548 = .sdata2:0x805788F8; // type:object size:0x8 scope:local data:string +@549 = .sdata2:0x80578900; // type:object size:0x8 scope:local data:string +@550 = .sdata2:0x80578908; // type:object size:0x8 scope:local data:string +@551 = .sdata2:0x80578910; // type:object size:0x8 scope:local data:string +@552 = .sdata2:0x80578918; // type:object size:0x8 scope:local data:string +@553 = .sdata2:0x80578920; // type:object size:0x8 scope:local data:string +@554 = .sdata2:0x80578928; // type:object size:0x8 scope:local data:string +@555 = .sdata2:0x80578930; // type:object size:0x8 scope:local data:string +@556 = .sdata2:0x80578938; // type:object size:0x8 scope:local data:string +@557 = .sdata2:0x80578940; // type:object size:0x8 scope:local data:string +@558 = .sdata2:0x80578948; // type:object size:0x7 scope:local data:string +@559 = .sdata2:0x80578950; // type:object size:0x8 scope:local data:string +@560 = .sdata2:0x80578958; // type:object size:0x8 scope:local data:string +@561 = .sdata2:0x80578960; // type:object size:0x8 scope:local data:string +@562 = .sdata2:0x80578968; // type:object size:0x7 scope:local data:string +@563 = .sdata2:0x80578970; // type:object size:0x7 scope:local data:string +@564 = .sdata2:0x80578978; // type:object size:0x8 scope:local data:string +@565 = .sdata2:0x80578980; // type:object size:0x8 scope:local data:string +@566 = .sdata2:0x80578988; // type:object size:0x7 scope:local data:string +@567 = .sdata2:0x80578990; // type:object size:0x8 scope:local data:string +@568 = .sdata2:0x80578998; // type:object size:0x7 scope:local data:string +@569 = .sdata2:0x805789A0; // type:object size:0x7 scope:local data:string +@570 = .sdata2:0x805789A8; // type:object size:0x7 scope:local data:string +@571 = .sdata2:0x805789B0; // type:object size:0x7 scope:local data:string +@572 = .sdata2:0x805789B8; // type:object size:0x7 scope:local data:string +@573 = .sdata2:0x805789C0; // type:object size:0x7 scope:local data:string +@574 = .sdata2:0x805789C8; // type:object size:0x8 scope:local data:string +@575 = .sdata2:0x805789D0; // type:object size:0x8 scope:local data:string +@576 = .sdata2:0x805789D8; // type:object size:0x8 scope:local data:string +@577 = .sdata2:0x805789E0; // type:object size:0x6 scope:local data:string +@578 = .sdata2:0x805789E8; // type:object size:0x7 scope:local data:string +@579 = .sdata2:0x805789F0; // type:object size:0x8 scope:local data:string +@580 = .sdata2:0x805789F8; // type:object size:0x6 scope:local data:string +@581 = .sdata2:0x80578A00; // type:object size:0x6 scope:local data:string +@582 = .sdata2:0x80578A08; // type:object size:0x8 scope:local data:string +@583 = .sdata2:0x80578A10; // type:object size:0x7 scope:local data:string +@584 = .sdata2:0x80578A18; // type:object size:0x8 scope:local data:string +@585 = .sdata2:0x80578A20; // type:object size:0x6 scope:local data:string +@586 = .sdata2:0x80578A28; // type:object size:0x7 scope:local data:string +@587 = .sdata2:0x80578A30; // type:object size:0x6 scope:local data:string +@588 = .sdata2:0x80578A38; // type:object size:0x6 scope:local data:string +@589 = .sdata2:0x80578A40; // type:object size:0x6 scope:local data:string +@590 = .sdata2:0x80578A48; // type:object size:0x6 scope:local data:string +@591 = .sdata2:0x80578A50; // type:object size:0x7 scope:local data:string +@592 = .sdata2:0x80578A58; // type:object size:0x8 scope:local data:string +@593 = .sdata2:0x80578A60; // type:object size:0x6 scope:local data:string +@594 = .sdata2:0x80578A68; // type:object size:0x7 scope:local data:string +@595 = .sdata2:0x80578A70; // type:object size:0x8 scope:local data:string +@596 = .sdata2:0x80578A78; // type:object size:0x6 scope:local data:string +@597 = .sdata2:0x80578A80; // type:object size:0x8 scope:local data:string +@598 = .sdata2:0x80578A88; // type:object size:0x7 scope:local data:string +@599 = .sdata2:0x80578A90; // type:object size:0x7 scope:local data:string +@600 = .sdata2:0x80578A98; // type:object size:0x8 scope:local data:string +@601 = .sdata2:0x80578AA0; // type:object size:0x7 scope:local data:string +@602 = .sdata2:0x80578AA8; // type:object size:0x8 scope:local data:string +@603 = .sdata2:0x80578AB0; // type:object size:0x8 scope:local data:string +@604 = .sdata2:0x80578AB8; // type:object size:0x6 scope:local data:string +@605 = .sdata2:0x80578AC0; // type:object size:0x8 scope:local data:string +@606 = .sdata2:0x80578AC8; // type:object size:0x8 scope:local data:string +@607 = .sdata2:0x80578AD0; // type:object size:0x7 scope:local data:string +@608 = .sdata2:0x80578AD8; // type:object size:0x7 scope:local data:string +@609 = .sdata2:0x80578AE0; // type:object size:0x7 scope:local data:string +@610 = .sdata2:0x80578AE8; // type:object size:0x7 scope:local data:string +@611 = .sdata2:0x80578AF0; // type:object size:0x7 scope:local data:string +@612 = .sdata2:0x80578AF8; // type:object size:0x7 scope:local data:string +@613 = .sdata2:0x80578B00; // type:object size:0x7 scope:local data:string +@614 = .sdata2:0x80578B08; // type:object size:0x8 scope:local data:string +@615 = .sdata2:0x80578B10; // type:object size:0x8 scope:local data:string +@616 = .sdata2:0x80578B18; // type:object size:0x8 scope:local data:string +@617 = .sdata2:0x80578B20; // type:object size:0x7 scope:local data:string +@618 = .sdata2:0x80578B28; // type:object size:0x8 scope:local data:string +@619 = .sdata2:0x80578B30; // type:object size:0x8 scope:local data:string +@620 = .sdata2:0x80578B38; // type:object size:0x8 scope:local data:string +@621 = .sdata2:0x80578B40; // type:object size:0x8 scope:local data:string +@622 = .sdata2:0x80578B48; // type:object size:0x8 scope:local data:string +@623 = .sdata2:0x80578B50; // type:object size:0x7 scope:local data:string +@624 = .sdata2:0x80578B58; // type:object size:0x8 scope:local data:string +@625 = .sdata2:0x80578B60; // type:object size:0x8 scope:local data:string +@626 = .sdata2:0x80578B68; // type:object size:0x6 scope:local data:string +@627 = .sdata2:0x80578B70; // type:object size:0x8 scope:local data:string +@628 = .sdata2:0x80578B78; // type:object size:0x8 scope:local data:string +@629 = .sdata2:0x80578B80; // type:object size:0x8 scope:local data:string +@630 = .sdata2:0x80578B88; // type:object size:0x7 scope:local data:string +@631 = .sdata2:0x80578B90; // type:object size:0x8 scope:local data:string +@632 = .sdata2:0x80578B98; // type:object size:0x8 scope:local data:string +@633 = .sdata2:0x80578BA0; // type:object size:0x8 scope:local data:string +@634 = .sdata2:0x80578BA8; // type:object size:0x8 scope:local data:string +@635 = .sdata2:0x80578BB0; // type:object size:0x8 scope:local data:string +@636 = .sdata2:0x80578BB8; // type:object size:0x8 scope:local data:string +@637 = .sdata2:0x80578BC0; // type:object size:0x8 scope:local data:string +@638 = .sdata2:0x80578BC8; // type:object size:0x8 scope:local data:string +@639 = .sdata2:0x80578BD0; // type:object size:0x8 scope:local data:string +@640 = .sdata2:0x80578BD8; // type:object size:0x8 scope:local data:string +@641 = .sdata2:0x80578BE0; // type:object size:0x8 scope:local data:string +@642 = .sdata2:0x80578BE8; // type:object size:0x8 scope:local data:string +@643 = .sdata2:0x80578BF0; // type:object size:0x8 scope:local data:string +@644 = .sdata2:0x80578BF8; // type:object size:0x8 scope:local data:string +@645 = .sdata2:0x80578C00; // type:object size:0x8 scope:local data:string +@646 = .sdata2:0x80578C08; // type:object size:0x8 scope:local data:string +@647 = .sdata2:0x80578C10; // type:object size:0x8 scope:local data:string +@648 = .sdata2:0x80578C18; // type:object size:0x8 scope:local data:string +@649 = .sdata2:0x80578C20; // type:object size:0x7 scope:local data:string +@650 = .sdata2:0x80578C28; // type:object size:0x8 scope:local data:string +@651 = .sdata2:0x80578C30; // type:object size:0x5 scope:local data:string +@652 = .sdata2:0x80578C38; // type:object size:0x8 scope:local data:string +@653 = .sdata2:0x80578C40; // type:object size:0x8 scope:local data:string +@654 = .sdata2:0x80578C48; // type:object size:0x7 scope:local data:string +@655 = .sdata2:0x80578C50; // type:object size:0x6 scope:local data:string +@656 = .sdata2:0x80578C58; // type:object size:0x8 scope:local data:string +@657 = .sdata2:0x80578C60; // type:object size:0x5 scope:local data:string +@658 = .sdata2:0x80578C68; // type:object size:0x8 scope:local data:string +@659 = .sdata2:0x80578C70; // type:object size:0x8 scope:local data:string +@660 = .sdata2:0x80578C78; // type:object size:0x8 scope:local data:string +@661 = .sdata2:0x80578C80; // type:object size:0x8 scope:local data:string +@662 = .sdata2:0x80578C88; // type:object size:0x8 scope:local data:string +@663 = .sdata2:0x80578C90; // type:object size:0x8 scope:local data:string +@664 = .sdata2:0x80578C98; // type:object size:0x8 scope:local data:string +@665 = .sdata2:0x80578CA0; // type:object size:0x6 scope:local data:string +@666 = .sdata2:0x80578CA8; // type:object size:0x8 scope:local data:string +@667 = .sdata2:0x80578CB0; // type:object size:0x7 scope:local data:string +@668 = .sdata2:0x80578CB8; // type:object size:0x8 scope:local data:string +@669 = .sdata2:0x80578CC0; // type:object size:0x8 scope:local data:string +@670 = .sdata2:0x80578CC8; // type:object size:0x8 scope:local data:string +@671 = .sdata2:0x80578CD0; // type:object size:0x8 scope:local data:string +@672 = .sdata2:0x80578CD8; // type:object size:0x8 scope:local data:string +@673 = .sdata2:0x80578CE0; // type:object size:0x8 scope:local data:string +@674 = .sdata2:0x80578CE8; // type:object size:0x6 scope:local data:string +@675 = .sdata2:0x80578CF0; // type:object size:0x8 scope:local data:string +@676 = .sdata2:0x80578CF8; // type:object size:0x8 scope:local data:string +@677 = .sdata2:0x80578D00; // type:object size:0x7 scope:local data:string +@678 = .sdata2:0x80578D08; // type:object size:0x6 scope:local data:string +@679 = .sdata2:0x80578D10; // type:object size:0x8 scope:local data:string +@680 = .sdata2:0x80578D18; // type:object size:0x5 scope:local data:string +@681 = .sdata2:0x80578D20; // type:object size:0x8 scope:local data:string +@682 = .sdata2:0x80578D28; // type:object size:0x8 scope:local data:string +@683 = .sdata2:0x80578D30; // type:object size:0x8 scope:local data:string +@684 = .sdata2:0x80578D38; // type:object size:0x6 scope:local data:string +@685 = .sdata2:0x80578D40; // type:object size:0x7 scope:local data:string +@686 = .sdata2:0x80578D48; // type:object size:0x6 scope:local data:string +@687 = .sdata2:0x80578D50; // type:object size:0x8 scope:local data:string +@688 = .sdata2:0x80578D58; // type:object size:0x6 scope:local data:string +@689 = .sdata2:0x80578D60; // type:object size:0x7 scope:local data:string +@690 = .sdata2:0x80578D68; // type:object size:0x8 scope:local data:string +@691 = .sdata2:0x80578D70; // type:object size:0x6 scope:local data:string +@692 = .sdata2:0x80578D78; // type:object size:0x8 scope:local data:string +@693 = .sdata2:0x80578D80; // type:object size:0x7 scope:local data:string +@694 = .sdata2:0x80578D88; // type:object size:0x8 scope:local data:string +@695 = .sdata2:0x80578D90; // type:object size:0x8 scope:local data:string +@696 = .sdata2:0x80578D98; // type:object size:0x3 scope:local data:string +@697 = .sdata2:0x80578DA0; // type:object size:0x8 scope:local data:string +@698 = .sdata2:0x80578DA8; // type:object size:0x6 scope:local data:string +@699 = .sdata2:0x80578DB0; // type:object size:0x7 scope:local data:string +@700 = .sdata2:0x80578DB8; // type:object size:0x6 scope:local data:string +@701 = .sdata2:0x80578DC0; // type:object size:0x7 scope:local data:string +@702 = .sdata2:0x80578DC8; // type:object size:0x6 scope:local data:string +@703 = .sdata2:0x80578DD0; // type:object size:0x5 scope:local data:string +@704 = .sdata2:0x80578DD8; // type:object size:0x6 scope:local data:string +@705 = .sdata2:0x80578DE0; // type:object size:0x7 scope:local data:string +@706 = .sdata2:0x80578DE8; // type:object size:0x7 scope:local data:string +@707 = .sdata2:0x80578DF0; // type:object size:0x6 scope:local data:string +@708 = .sdata2:0x80578DF8; // type:object size:0x8 scope:local data:string +@709 = .sdata2:0x80578E00; // type:object size:0x7 scope:local data:string +@710 = .sdata2:0x80578E08; // type:object size:0x5 scope:local data:string +@711 = .sdata2:0x80578E10; // type:object size:0x6 scope:local data:string +@712 = .sdata2:0x80578E18; // type:object size:0x6 scope:local data:string +@713 = .sdata2:0x80578E20; // type:object size:0x7 scope:local data:string +@714 = .sdata2:0x80578E28; // type:object size:0x5 scope:local data:string +@715 = .sdata2:0x80578E30; // type:object size:0x5 scope:local data:string +@716 = .sdata2:0x80578E38; // type:object size:0x6 scope:local data:string +@717 = .sdata2:0x80578E40; // type:object size:0x7 scope:local data:string +@718 = .sdata2:0x80578E48; // type:object size:0x8 scope:local data:string +@719 = .sdata2:0x80578E50; // type:object size:0x8 scope:local data:string +@720 = .sdata2:0x80578E58; // type:object size:0x6 scope:local data:string +@721 = .sdata2:0x80578E60; // type:object size:0x6 scope:local data:string +@722 = .sdata2:0x80578E68; // type:object size:0x8 scope:local data:string +@723 = .sdata2:0x80578E70; // type:object size:0x7 scope:local data:string +@724 = .sdata2:0x80578E78; // type:object size:0x6 scope:local data:string +@725 = .sdata2:0x80578E80; // type:object size:0x6 scope:local data:string +@726 = .sdata2:0x80578E88; // type:object size:0x5 scope:local data:string +@727 = .sdata2:0x80578E90; // type:object size:0x8 scope:local data:string +@728 = .sdata2:0x80578E98; // type:object size:0x8 scope:local data:string +@729 = .sdata2:0x80578EA0; // type:object size:0x8 scope:local data:string +@730 = .sdata2:0x80578EA8; // type:object size:0x7 scope:local data:string +@731 = .sdata2:0x80578EB0; // type:object size:0x7 scope:local data:string +@732 = .sdata2:0x80578EB8; // type:object size:0x8 scope:local data:string +@733 = .sdata2:0x80578EC0; // type:object size:0x8 scope:local data:string +@734 = .sdata2:0x80578EC8; // type:object size:0x8 scope:local data:string +@735 = .sdata2:0x80578ED0; // type:object size:0x8 scope:local data:string +@736 = .sdata2:0x80578ED8; // type:object size:0x8 scope:local data:string +@737 = .sdata2:0x80578EE0; // type:object size:0x8 scope:local data:string +@738 = .sdata2:0x80578EE8; // type:object size:0x7 scope:local data:string +@739 = .sdata2:0x80578EF0; // type:object size:0x8 scope:local data:string +@740 = .sdata2:0x80578EF8; // type:object size:0x8 scope:local data:string +@741 = .sdata2:0x80578F00; // type:object size:0x8 scope:local data:string +@742 = .sdata2:0x80578F08; // type:object size:0x8 scope:local data:string +@743 = .sdata2:0x80578F10; // type:object size:0x6 scope:local data:string +@744 = .sdata2:0x80578F18; // type:object size:0x6 scope:local data:string +@745 = .sdata2:0x80578F20; // type:object size:0x8 scope:local data:string +@746 = .sdata2:0x80578F28; // type:object size:0x8 scope:local data:string +@747 = .sdata2:0x80578F30; // type:object size:0x8 scope:local data:string +@748 = .sdata2:0x80578F38; // type:object size:0x6 scope:local data:string +@749 = .sdata2:0x80578F40; // type:object size:0x7 scope:local data:string +@750 = .sdata2:0x80578F48; // type:object size:0x8 scope:local data:string +@751 = .sdata2:0x80578F50; // type:object size:0x7 scope:local data:string +@752 = .sdata2:0x80578F58; // type:object size:0x5 scope:local data:string +@753 = .sdata2:0x80578F60; // type:object size:0x7 scope:local data:string +@754 = .sdata2:0x80578F68; // type:object size:0x8 scope:local data:string +@755 = .sdata2:0x80578F70; // type:object size:0x7 scope:local data:string +@756 = .sdata2:0x80578F78; // type:object size:0x7 scope:local data:string +@757 = .sdata2:0x80578F80; // type:object size:0x8 scope:local data:string +@758 = .sdata2:0x80578F88; // type:object size:0x8 scope:local data:string +@759 = .sdata2:0x80578F90; // type:object size:0x8 scope:local data:string +@760 = .sdata2:0x80578F98; // type:object size:0x7 scope:local data:string +@761 = .sdata2:0x80578FA0; // type:object size:0x8 scope:local data:string +@762 = .sdata2:0x80578FA8; // type:object size:0x8 scope:local data:string +@763 = .sdata2:0x80578FB0; // type:object size:0x8 scope:local data:string +@764 = .sdata2:0x80578FB8; // type:object size:0x8 scope:local data:string +@765 = .sdata2:0x80578FC0; // type:object size:0x8 scope:local data:string +@766 = .sdata2:0x80578FC8; // type:object size:0x8 scope:local data:string +@767 = .sdata2:0x80578FD0; // type:object size:0x8 scope:local data:string +@768 = .sdata2:0x80578FD8; // type:object size:0x6 scope:local data:string +@769 = .sdata2:0x80578FE0; // type:object size:0x8 scope:local data:string +@770 = .sdata2:0x80578FE8; // type:object size:0x6 scope:local data:string +@771 = .sdata2:0x80578FF0; // type:object size:0x8 scope:local data:string +@772 = .sdata2:0x80578FF8; // type:object size:0x5 scope:local data:string +@773 = .sdata2:0x80579000; // type:object size:0x7 scope:local data:string +@774 = .sdata2:0x80579008; // type:object size:0x8 scope:local data:string +@775 = .sdata2:0x80579010; // type:object size:0x8 scope:local data:string +@776 = .sdata2:0x80579018; // type:object size:0x8 scope:local data:string +@777 = .sdata2:0x80579020; // type:object size:0x8 scope:local data:string +@778 = .sdata2:0x80579028; // type:object size:0x7 scope:local data:string +@779 = .sdata2:0x80579030; // type:object size:0x8 scope:local data:string +@780 = .sdata2:0x80579038; // type:object size:0x8 scope:local data:string +@781 = .sdata2:0x80579040; // type:object size:0x8 scope:local data:string +@782 = .sdata2:0x80579048; // type:object size:0x8 scope:local data:string +@783 = .sdata2:0x80579050; // type:object size:0x7 scope:local data:string +@784 = .sdata2:0x80579058; // type:object size:0x8 scope:local data:string +@785 = .sdata2:0x80579060; // type:object size:0x8 scope:local data:string +@786 = .sdata2:0x80579068; // type:object size:0x4 scope:local data:string +@787 = .sdata2:0x80579070; // type:object size:0x8 scope:local data:string +@788 = .sdata2:0x80579078; // type:object size:0x7 scope:local data:string +@789 = .sdata2:0x80579080; // type:object size:0x6 scope:local data:string +@790 = .sdata2:0x80579088; // type:object size:0x7 scope:local data:string +@791 = .sdata2:0x80579090; // type:object size:0x5 scope:local data:string +@792 = .sdata2:0x80579098; // type:object size:0x6 scope:local data:string +@793 = .sdata2:0x805790A0; // type:object size:0x8 scope:local data:string +@794 = .sdata2:0x805790A8; // type:object size:0x8 scope:local data:string +@795 = .sdata2:0x805790B0; // type:object size:0x8 scope:local data:string +@796 = .sdata2:0x805790B8; // type:object size:0x8 scope:local data:string +@797 = .sdata2:0x805790C0; // type:object size:0x8 scope:local data:string +@798 = .sdata2:0x805790C8; // type:object size:0x8 scope:local data:string +@799 = .sdata2:0x805790D0; // type:object size:0x5 scope:local data:string +@800 = .sdata2:0x805790D8; // type:object size:0x7 scope:local data:string +@801 = .sdata2:0x805790E0; // type:object size:0x7 scope:local data:string +@802 = .sdata2:0x805790E8; // type:object size:0x7 scope:local data:string +@803 = .sdata2:0x805790F0; // type:object size:0x8 scope:local data:string +@804 = .sdata2:0x805790F8; // type:object size:0x8 scope:local data:string +@805 = .sdata2:0x80579100; // type:object size:0x8 scope:local data:string +@806 = .sdata2:0x80579108; // type:object size:0x8 scope:local data:string +@807 = .sdata2:0x80579110; // type:object size:0x8 scope:local data:string +@808 = .sdata2:0x80579118; // type:object size:0x8 scope:local data:string +@809 = .sdata2:0x80579120; // type:object size:0x8 scope:local data:string +@810 = .sdata2:0x80579128; // type:object size:0x8 scope:local data:string +@811 = .sdata2:0x80579130; // type:object size:0x8 scope:local data:string +@812 = .sdata2:0x80579138; // type:object size:0x8 scope:local data:string +@813 = .sdata2:0x80579140; // type:object size:0x7 scope:local data:string +@814 = .sdata2:0x80579148; // type:object size:0x7 scope:local data:string +@815 = .sdata2:0x80579150; // type:object size:0x8 scope:local data:string +@816 = .sdata2:0x80579158; // type:object size:0x6 scope:local data:string +@817 = .sdata2:0x80579160; // type:object size:0x7 scope:local data:string +@818 = .sdata2:0x80579168; // type:object size:0x6 scope:local data:string +@819 = .sdata2:0x80579170; // type:object size:0x7 scope:local data:string +@820 = .sdata2:0x80579178; // type:object size:0x5 scope:local data:string +@821 = .sdata2:0x80579180; // type:object size:0x8 scope:local data:string +@822 = .sdata2:0x80579188; // type:object size:0x8 scope:local data:string +@823 = .sdata2:0x80579190; // type:object size:0x7 scope:local data:string +@824 = .sdata2:0x80579198; // type:object size:0x8 scope:local data:string +@825 = .sdata2:0x805791A0; // type:object size:0x8 scope:local data:string +@826 = .sdata2:0x805791A8; // type:object size:0x6 scope:local data:string +@827 = .sdata2:0x805791B0; // type:object size:0x8 scope:local data:string +@828 = .sdata2:0x805791B8; // type:object size:0x6 scope:local data:string +@829 = .sdata2:0x805791C0; // type:object size:0x8 scope:local data:string +@830 = .sdata2:0x805791C8; // type:object size:0x8 scope:local data:string +@831 = .sdata2:0x805791D0; // type:object size:0x8 scope:local data:string +@832 = .sdata2:0x805791D8; // type:object size:0x8 scope:local data:string +@833 = .sdata2:0x805791E0; // type:object size:0x6 scope:local data:string +@834 = .sdata2:0x805791E8; // type:object size:0x7 scope:local data:string +@835 = .sdata2:0x805791F0; // type:object size:0x8 scope:local data:string +@836 = .sdata2:0x805791F8; // type:object size:0x6 scope:local data:string +@837 = .sdata2:0x80579200; // type:object size:0x7 scope:local data:string +@838 = .sdata2:0x80579208; // type:object size:0x5 scope:local data:string lbl_80579210 = .sdata2:0x80579210; // type:object size:0x4 align:4 data:float lbl_80579214 = .sdata2:0x80579214; // type:object size:0x4 align:4 data:float lbl_80579218 = .sdata2:0x80579218; // type:object size:0x4 align:4 data:float @@ -50394,7 +50394,7 @@ sRumblePreset7__9dRumble_c = .bss:0x805A07CC; // type:object size:0xC data:4byte sRumblePreset8__9dRumble_c = .bss:0x805A07D8; // type:object size:0xC data:4byte sRumblePreset9__9dRumble_c = .bss:0x805A07E4; // type:object size:0xC data:4byte sRumblePreset10__9dRumble_c = .bss:0x805A07F0; // type:object size:0xC data:4byte -@LOCAL@play__9dRumble_cFv@rumble_strings = .bss:0x805A07FC; // type:object size:0x42 scope:local data:byte +@LOCAL@execute__9dRumble_cFv@rumble_strings = .bss:0x805A07FC; // type:object size:0x42 scope:local data:byte @LOCAL@start__9dRumble_cFRC14dRumbleEntry_cUl@rumble_string = .bss:0x805A0840; // type:object size:0x21 scope:local data:byte @LOCAL@getCurrentStageDirectory__22CurrentStageArcManagerFv@sStageDirTmp = .bss:0x805A0868; // type:object size:0x40 scope:local data:byte s_roomArcTmp = .bss:0x805A08A8; // type:object size:0x20 scope:local data:byte diff --git a/configure.py b/configure.py index 71c72273..9215ffa1 100644 --- a/configure.py +++ b/configure.py @@ -435,7 +435,7 @@ config.libs = [ Object(NonMatching, "toBeSorted/arc_managers/oarc_control.cpp"), Object(Matching, "toBeSorted/arc_managers/layout_arc_manager.cpp"), Object(NonMatching, "toBeSorted/arc_managers/layout_arc_control.cpp"), - Object(NonMatching, "toBeSorted/base_tables.cpp"), + Object(Matching, "toBeSorted/actor_info.cpp"), Object(NonMatching, "toBeSorted/unk_vec_math.cpp"), Object(NonMatching, "toBeSorted/unk_mdl_cc.cpp"), Object(NonMatching, "toBeSorted/d_camera.cpp"), diff --git a/include/UnknownTypeBelongings.h b/include/UnknownTypeBelongings.h deleted file mode 100644 index b34592e5..00000000 --- a/include/UnknownTypeBelongings.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef DECOMP_UNKNOWN_TYPES_H -#define DECOMP_UNKNOWN_TYPES_H - -#include "common.h" - -// MOST LIKELY mVEC -struct Vec3f { - f32 x, y, z; -}; - -struct Vec2f { - f32 x, y; -}; - -struct Vec3s { - s16 x, y, z; -}; - -struct ObjInfo { - /* 0x00 */ char *name; - /* 0x04 */ u16 obj_id; - /* 0x06 */ u16 obj_id2; - /* 0x08 */ u16 fiTextEntryId; - /* 0x0A */ s8 unk_0xA; - /* 0x0B */ u8 subtype; -}; - -// is now fLiNdBa_c -// struct ActorReference { -// ActorReference* prev; -// ActorReference* next; -// fBase_c* link; -// }; - -class UnkCollider {}; - -#endif diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index e293b927..06868d39 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -1,12 +1,12 @@ #ifndef D_A_BASE_H #define D_A_BASE_H -#include "UnknownTypeBelongings.h" #include "common.h" #include "d/d_base.h" #include "m/m_allocator.h" #include "m/m_angle.h" #include "m/m_vec.h" +#include "toBeSorted/actor_info.h" #include "toBeSorted/raii_ptr.h" #include "toBeSorted/tlist.h" @@ -141,7 +141,7 @@ public: class dAcBase_c : public dBase_c { public: /* 0x68 */ mHeapAllocator_c heap_allocator; - /* 0x84 */ ObjInfo *obj_info; + /* 0x84 */ const ActorInfo *mpActorInfo; /* 0x88 */ TList sound_list; /* 0x94 */ RaiiPtr sound_source; /* 0x98 */ mVec3_c *obj_pos; @@ -249,7 +249,7 @@ public: // funcs found in TU /* 8002c650 */ static void setTempCreateParams( mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, u16 unkFlag, - s8 viewClipIdx, ObjInfo *objInfo + s8 viewClipIdx, const ActorInfo *actorInfo ); /* 8002c690 */ SoundSource *FUN_8002c690(); @@ -339,7 +339,7 @@ public: /* 80575084 */ static mAng3_c *s_Create_Rotation; /* 80575088 */ static mVec3_c *s_Create_Scale; /* 8057508C */ static dAcBase_c *s_Create_Parent; - /* 80575090 */ static ObjInfo *s_Create_ObjInfo; + /* 80575090 */ static const ActorInfo *s_Create_ActorInfo; /* 80575094 */ static u8 s_Create_Subtype; }; diff --git a/include/d/a/obj/d_a_obj_base.h b/include/d/a/obj/d_a_obj_base.h index c8e1cd80..d22cb8fd 100644 --- a/include/d/a/obj/d_a_obj_base.h +++ b/include/d/a/obj/d_a_obj_base.h @@ -195,7 +195,7 @@ public: u32 roomId ); /* 8002efa0 */ void fn_8002efa0(); - /* 8002eff0 */ bool fn_8002eff0(f32 *, s16 *, UnkCollider *, f32 *, f32 *); + /* 8002eff0 */ bool fn_8002eff0(f32 *, s16 *, f32 *, f32 *, f32 *); /* 8002f190 */ void createChildAttached2( fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, u32 roomId diff --git a/include/toBeSorted/actor_info.h b/include/toBeSorted/actor_info.h new file mode 100644 index 00000000..e48fcd2c --- /dev/null +++ b/include/toBeSorted/actor_info.h @@ -0,0 +1,44 @@ +#ifndef D_ACTOR_INFO_H +#define D_ACTOR_INFO_H + +#include "common.h" + +// TODO: Expand when we figure out what the other entries have in common +enum SoundSourceCategory_e { + SND_SOURCE_PLAYER = 0, + SND_SOURCE_ARROW = 7, + SND_SOURCE_BULLET = 29, + SND_SOURCE_OBJECT = 32, + SND_SOURCE_ITEM = 35, + SND_SOURCE_TERRY_SHOP = 36, + SND_SOURCE_TIME_STONE = 37, + SND_SOURCE_CLEF = 38, + SND_SOURCE_SHUTTER = 39, + SND_SOURCE_KENSEI = 44, + SND_SOURCE_PLAYER_BIRD = 45, + SND_SOURCE_INSECT = 49, + SND_SOURCE_NPC_NRM = 51, + SND_SOURCE_SW_HARP = 56, +}; + +/** + * profileId and profileId2 are always the same. + */ +struct ActorInfo { + /* 0x00 */ const char *name; + /* 0x04 */ u16 profileId; + /* 0x06 */ u16 profileId2; + /* 0x08 */ u16 fiTextEntryId; // also used for kill counters + /* 0x0A */ s8 soundSourceCategory; + /* 0x0B */ u8 subtype; +}; + +const ActorInfo *getActorInfoByName(const char *name); +u16 getProfileIdForName(const char *name); +u16 getProfileId2ForName(const char *name); +const char *getNameForProfileId(u32 profileId); +const char *getActorName(const ActorInfo *actorInfo); +const ActorInfo *getActorInfoByProfileAndSubtype(u32 profileId, u32 subtype); +s32 getSoundSourceCategoryForName(const char *name); + +#endif diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index ff47e669..87386d46 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -17,6 +17,7 @@ #include "f/f_list_nd.h" #include "m/m_angle.h" #include "m/m_vec.h" +#include "toBeSorted/actor_info.h" #include "toBeSorted/event.h" #include "toBeSorted/event_manager.h" #include "toBeSorted/file_manager.h" @@ -33,13 +34,10 @@ mVec3_c *dAcBase_c::s_Create_Position; mAng3_c *dAcBase_c::s_Create_Rotation; mVec3_c *dAcBase_c::s_Create_Scale; dAcBase_c *dAcBase_c::s_Create_Parent; -ObjInfo *dAcBase_c::s_Create_ObjInfo; +const ActorInfo *dAcBase_c::s_Create_ActorInfo; u8 dAcBase_c::s_Create_Subtype; -extern "C" ObjInfo *getObjByActorIdAndSubtype_unkNamespace(ProfileName, u8); -extern "C" ObjInfo *getObjByActorName_unkNamespace(char *name); -extern "C" char *getObjectName_8006a730(ObjInfo *); -extern "C" SoundSource *soundForActorInitRelated_803889c0(s8, fBase_c *, char *, u8); +extern "C" SoundSource *soundForActorInitRelated_803889c0(s8, fBase_c *, const char *, u8); bool dAcBase_c::createHeap() { return true; @@ -50,7 +48,7 @@ bool dAcBase_c::createHeap() { // 8002c3b0 dAcBase_c::dAcBase_c() : heap_allocator(), - obj_info(s_Create_ObjInfo), + mpActorInfo(s_Create_ActorInfo), sound_list(), obj_pos(&position), params2(s_Create_Params2), @@ -82,8 +80,8 @@ dAcBase_c::dAcBase_c() fProfile::fActorProfile_c *profile = (fProfile::fActorProfile_c *)((*fProfile::sProfileList)[profile_name]); actor_properties = profile->mActorProperties; - if (obj_info == nullptr) { - obj_info = getObjByActorIdAndSubtype_unkNamespace(profile_name, actor_subtype); + if (mpActorInfo == nullptr) { + mpActorInfo = getActorInfoByProfileAndSubtype(profile_name, actor_subtype); } someStr[0] = '\0'; } @@ -98,7 +96,7 @@ dAcBase_c::~dAcBase_c() {} void dAcBase_c::setTempCreateParams( mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, u16 unkFlag, - s8 viewClipIdx, ObjInfo *objInfo + s8 viewClipIdx, const ActorInfo *actorInfo ) { s_Create_Position = pos; s_Create_Rotation = rot; @@ -109,22 +107,22 @@ void dAcBase_c::setTempCreateParams( s_Create_Subtype = subtype; s_Create_UnkFlags = unkFlag; s_Create_ViewClipIdx = viewClipIdx; - s_Create_ObjInfo = objInfo; + s_Create_ActorInfo = actorInfo; } // has regswap SoundSource *dAcBase_c::FUN_8002c690() { - if (obj_info == nullptr) { + if (mpActorInfo == nullptr) { return nullptr; } - s32 unk_val = obj_info->unk_0xA; - if (unk_val == -1) { + s32 soundSourceCategory = mpActorInfo->soundSourceCategory; + if (soundSourceCategory == -1) { return nullptr; } - char *objName = getObjectName_8006a730(obj_info); - return soundForActorInitRelated_803889c0(unk_val, this, objName, subtype); + const char *objName = getActorName(mpActorInfo); + return soundForActorInitRelated_803889c0(soundSourceCategory, this, objName, subtype); } int dAcBase_c::initAllocatorWork1Heap(int size, char *name, int align) { @@ -344,16 +342,16 @@ u32 dAcBase_c::getParams2Lower() const { // 8002d020 dAcBase_c *dAcBase_c::findActor(char *objName, dAcBase_c *parent) { - ObjInfo *objInfo = getObjByActorName_unkNamespace(objName); - if (objInfo == nullptr) { + const ActorInfo *actorInfo = getActorInfoByName(objName); + if (actorInfo == nullptr) { return nullptr; } else { do { - parent = (dAcBase_c *)fManager_c::searchBaseByProfName(objInfo->obj_id, parent); + parent = (dAcBase_c *)fManager_c::searchBaseByProfName(actorInfo->profileId, parent); if (parent == nullptr) { break; } - } while (parent->actor_subtype != objInfo->subtype); + } while (parent->actor_subtype != actorInfo->subtype); } return parent; } diff --git a/src/d/d_stage_parse.cpp b/src/d/d_stage_parse.cpp index 81104567..73b6dd13 100644 --- a/src/d/d_stage_parse.cpp +++ b/src/d/d_stage_parse.cpp @@ -15,6 +15,7 @@ #include "m/m_angle.h" #include "m/m_vec.h" #include "sized_string.h" +#include "toBeSorted/actor_info.h" #include "toBeSorted/file_manager.h" struct BzsHeader { @@ -242,13 +243,11 @@ static void handleBzsPly(int roomid, const BzsSectionHead *section) { } } -extern "C" u16 getActorIdForObjName2(const char *objname); - static void handleBzsObjn(int roomid, const BzsSectionHead *section) { const OBJN *objn = OFS_TO_PTR(OBJN, section); const char *buf = reinterpret_cast(objn); for (s32 i = 0; i < section->mCount; i++) { - dStageMgr_c::GetInstance()->addObjId(getActorIdForObjName2(buf + objn->offset)); + dStageMgr_c::GetInstance()->addObjId(getProfileId2ForName(buf + objn->offset)); objn++; } } @@ -266,7 +265,7 @@ static void handleBzsLayerObjn(int roomid, const BzsSectionHead *section) { const OBJN *objn = OFS_TO_PTR(OBJN, section); const char *buf = reinterpret_cast(objn); for (s32 i = 0; i < section->mCount; i++) { - u16 id = getActorIdForObjName2(buf + objn->offset); + u16 id = getProfileId2ForName(buf + objn->offset); dStageMgr_c::GetInstance()->addActorId(id); objn++; } diff --git a/src/toBeSorted/actor_info.cpp b/src/toBeSorted/actor_info.cpp new file mode 100644 index 00000000..b4868b0d --- /dev/null +++ b/src/toBeSorted/actor_info.cpp @@ -0,0 +1,872 @@ +#include "toBeSorted/actor_info.h" + +#include "common.h" +#include "f/f_profile_name.h" + +#include + + +#pragma push +#pragma readonly_strings on +// sorted alphabetically to facilitate binary search +static const ActorInfo sInfos[] = { + { "$act01", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 1}, + { "$act02", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 2}, + { "$act03", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 3}, + { "$act04", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 4}, + { "$act05", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 5}, + { "$act06", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 6}, + { "$act07", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 7}, + { "$act08", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 8}, + { "$act09", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 9}, + { "$act10", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 10}, + { "$act11", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 11}, + { "$act12", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 12}, + { "$act13", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 13}, + { "$act14", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 14}, + { "$act15", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 15}, + { "$act16", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 16}, + { "$act17", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 17}, + { "$act18", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 18}, + { "$act19", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 19}, + { "$act20", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 20}, + { "$act21", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 21}, + { "$act22", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 22}, + { "$act23", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 23}, + { "$act24", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 24}, + { "$act25", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 25}, + { "$act26", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 26}, + { "$act27", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 27}, + { "$act28", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 28}, + { "$act29", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 29}, + { "$act30", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 30}, + { "$act31", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 31}, + { "$act32", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 32}, + { "$act33", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 33}, + { "$act34", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 34}, + { "$act35", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 35}, + { "$act36", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 36}, + { "$act37", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 37}, + { "$act38", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 38}, + { "$act39", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 39}, + { "$act40", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 40}, + { "$act41", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 41}, + { "$act42", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 42}, + { "$act43", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 43}, + { "$act44", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 44}, + { "$act45", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 45}, + { "$act46", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 46}, + { "$act47", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 47}, + { "$act48", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 48}, + { "$act49", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 49}, + { "$act50", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 50}, + { "$act51", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 51}, + { "$act52", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 52}, + { "$act53", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 53}, + { "$act54", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 54}, + { "$act55", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 55}, + { "$act56", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 56}, + { "$act57", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 57}, + { "$act58", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 58}, + { "$act59", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 59}, + { "$act60", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 60}, + { "$act61", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 61}, + { "$act62", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 62}, + { "$act63", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 63}, + { "$snd", fProfile::JSTUDIO_SYSOBJ, fProfile::JSTUDIO_SYSOBJ, 0xFFFF, 0xFF, 1}, + { "$sys", fProfile::JSTUDIO_SYSOBJ, fProfile::JSTUDIO_SYSOBJ, 0xFFFF, 0xFF, 0}, + { "AFlw", fProfile::OBJ_FLOWER_ANCIENT, fProfile::OBJ_FLOWER_ANCIENT, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "ActTag", fProfile::ACTION_TAG, fProfile::ACTION_TAG, 0xFFFF, 0xFF, 0}, + { "Amber", fProfile::OBJ_AMBER, fProfile::OBJ_AMBER, 0xFFFF, 0xFF, 0}, + {"AncJwls", fProfile::OBJ_ANCIENT_JEWELS, fProfile::OBJ_ANCIENT_JEWELS, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "Ant", fProfile::INSECT_ANT, fProfile::INSECT_ANT, 774, SND_SOURCE_INSECT, 0}, + {"ApBridg", fProfile::OBJ_APPEAR_BRIDGE, fProfile::OBJ_APPEAR_BRIDGE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Arrow", fProfile::ARROW, fProfile::ARROW, 0xFFFF, SND_SOURCE_ARROW, 0}, + {"ArrowSW", fProfile::OBJ_ARROW_SWITCH, fProfile::OBJ_ARROW_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "AsuArm", fProfile::ASURA_ARM, fProfile::ASURA_ARM, 0xFFFF, 15, 0}, + { "AsuFoo", fProfile::ASURA_FOOT, fProfile::ASURA_FOOT, 0xFFFF, 15, 0}, + { "AsuraB", fProfile::ASURA_BULLET, fProfile::ASURA_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + { "AsuraP", fProfile::ASURA_PILLAR, fProfile::ASURA_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "AsuraS", fProfile::ASURA_SWORD, fProfile::ASURA_SWORD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "AttTag", fProfile::ATT_TAG, fProfile::ATT_TAG, 0xFFFF, 0xFF, 0}, + {"AutoMes", fProfile::TAG_AUTO_MESSAGE, fProfile::TAG_AUTO_MESSAGE, 0xFFFF, 0xFF, 0}, + {"B300Snd", fProfile::OBJ_B300_SAND, fProfile::OBJ_B300_SAND, 0xFFFF, 0xFF, 0}, + { "BAsura", fProfile::B_ASURA, fProfile::B_ASURA, 48, 19, 0}, + { "BBObjs", fProfile::OBJ_BB_OBJECTS, fProfile::OBJ_BB_OBJECTS, 0xFFFF, 0xFF, 0}, + {"BBParts", fProfile::OBJ_BB_BROKEN_PARTS, fProfile::OBJ_BB_BROKEN_PARTS, 0xFFFF, 0xFF, 0}, + {"BBQuake", fProfile::T_QUAKE, fProfile::T_QUAKE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BBbrg", fProfile::OBJ_BB_BRIDGE, fProfile::OBJ_BB_BRIDGE, 0xFFFF, 0xFF, 0}, + {"BBigBo2", fProfile::B_BIGBOSS2, fProfile::B_BIGBOSS2, 53, 20, 0}, + {"BBigBo3", fProfile::B_BIGBOSS3, fProfile::B_BIGBOSS3, 54, 20, 0}, + {"BBigBoB", fProfile::B_BIGBOSS_BASE, fProfile::B_BIGBOSS_BASE, 0xFFFF, 0xFF, 0}, + {"BBigBos", fProfile::B_BIGBOSS, fProfile::B_BIGBOSS, 52, 20, 0}, + {"BBigShc", fProfile::B_BBSHWV, fProfile::B_BBSHWV, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BBombf", fProfile::OBJ_BIGBOMB_FLOWER, fProfile::OBJ_BIGBOMB_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BDrD101", fProfile::OBJ_DOOR_BOSSD101, fProfile::OBJ_DOOR_BOSSD101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BGh", fProfile::B_GIRAHIMU, fProfile::B_GIRAHIMU, 49, 19, 0}, + { "BGh2", fProfile::B_GIRAHIMU2, fProfile::B_GIRAHIMU2, 50, 19, 0}, + { "BGh3B", fProfile::B_GIRAHIMU3_BASE, fProfile::B_GIRAHIMU3_BASE, 0xFFFF, 0xFF, 0}, + {"BGh3Fst", fProfile::B_GIRAHIMU3_FIRST, fProfile::B_GIRAHIMU3_FIRST, 51, 24, 0}, + {"BGh3Snd", fProfile::B_GIRAHIMU3_SECOND, fProfile::B_GIRAHIMU3_SECOND, 89, 24, 0}, + {"BGh3Trd", fProfile::B_GIRAHIMU3_THIRD, fProfile::B_GIRAHIMU3_THIRD, 90, 24, 0}, + { "BGhB", fProfile::B_GIRAHIMU_BASE, fProfile::B_GIRAHIMU_BASE, 0xFFFF, 0xFF, 0}, + { "BKr", fProfile::B_KR, fProfile::B_KR, 77, 22, 0}, + { "BKrA", fProfile::B_KRA, fProfile::B_KRA, 77, 15, 0}, + { "BKrH", fProfile::B_KRH, fProfile::B_KRH, 77, 15, 0}, + {"BLasBos", fProfile::B_LASTBOSS, fProfile::B_LASTBOSS, 0xFFFF, 19, 0}, + { "BMg", fProfile::B_MG, fProfile::B_MG, 10, 21, 0}, + { "BSpUp", fProfile::OBJ_BIRD_SP_UP, fProfile::OBJ_BIRD_SP_UP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Bamboo", fProfile::OBJ_BAMBOO, fProfile::OBJ_BAMBOO, 533, 34, 0}, + {"BarPsTg", fProfile::TAG_BARREL_POS, fProfile::TAG_BARREL_POS, 0xFFFF, 0xFF, 0}, + { "Barrel", fProfile::OBJ_BARREL, fProfile::OBJ_BARREL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BarrlTg", fProfile::TAG_BARREL, fProfile::TAG_BARREL, 0xFFFF, 0xFF, 0}, + {"BcAlArr", fProfile::E_BCALARROW, fProfile::E_BCALARROW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BcArrow", fProfile::E_BCARROW, fProfile::E_BCARROW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BcZTag", fProfile::BCZ_TAG, fProfile::BCZ_TAG, 0xFFFF, 0xFF, 0}, + { "Bee", fProfile::NPC_BEE, fProfile::NPC_BEE, 776, 15, 0}, + { "Beetle", fProfile::INSECT_BEETLE, fProfile::INSECT_BEETLE, 768, SND_SOURCE_INSECT, 0}, + { "Bell", fProfile::OBJ_BELL, fProfile::OBJ_BELL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BeltCvr", fProfile::OBJ_BELT_CVR, fProfile::OBJ_BELT_CVR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BigTubo", fProfile::OBJ_TUBO_BIG, fProfile::OBJ_TUBO_BIG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BirdB", fProfile::AVATER_BULLET, fProfile::AVATER_BULLET, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BirdKA", fProfile::BIRD_KOBUNA, fProfile::BIRD_KOBUNA, 0xFFFF, 43, 0}, + { "BirdKB", fProfile::BIRD_KOBUNB, fProfile::BIRD_KOBUNB, 0xFFFF, 43, 0}, + {"BirdNpc", fProfile::BIRD_NPC, fProfile::BIRD_NPC, 0xFFFF, 43, 0}, + { "BirdR", fProfile::BIRD_RIVAL, fProfile::BIRD_RIVAL, 0xFFFF, 43, 0}, + {"BirdSta", fProfile::OBJ_BIRD_STATUE, fProfile::OBJ_BIRD_STATUE, 0xFFFF, 0xFF, 0}, + { "BirdT", fProfile::BIRD_TARGET, fProfile::BIRD_TARGET, 0xFFFF, 43, 0}, + { "BirdZT", fProfile::BIRD_ZELDA_TRAINING, fProfile::BIRD_ZELDA_TRAINING, 0xFFFF, 43, 0}, + { "Blade", fProfile::OBJ_BLADE, fProfile::OBJ_BLADE, 0xFFFF, 0xFF, 0}, + {"BlkRope", fProfile::OBJ_BLOCK_ROPE, fProfile::OBJ_BLOCK_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BlockUg", fProfile::OBJ_BLOCK_UNDERGROUND, fProfile::OBJ_BLOCK_UNDERGROUND, 0xFFFF, 0xFF, 0}, + {"BlsRock", fProfile::OBJ_BLAST_ROCK, fProfile::OBJ_BLAST_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Blst", fProfile::OBJ_BALLISTA, fProfile::OBJ_BALLISTA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BlstF3", fProfile::OBJ_BALLISTA_F3, fProfile::OBJ_BALLISTA_F3, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BlstH", fProfile::OBJ_BALLISTA_HANDLE, fProfile::OBJ_BALLISTA_HANDLE, 0xFFFF, 0xFF, 0}, + {"BltObsT", fProfile::TAG_BELT_OBSTACLE, fProfile::TAG_BELT_OBSTACLE, 0xFFFF, 59, 0}, + {"BlwCoal", fProfile::OBJ_BLOW_COAL, fProfile::OBJ_BLOW_COAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Boat", fProfile::OBJ_BOAT, fProfile::OBJ_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Bomb", fProfile::BOMB, fProfile::BOMB, 0xFFFF, 8, 0}, + { "Bombf", fProfile::BOMBF, fProfile::BOMBF, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Boom", fProfile::BOOMERANG, fProfile::BOOMERANG, 0xFFFF, 6, 0}, + {"BoxCage", fProfile::OBJ_BOXCAGE_F300, fProfile::OBJ_BOXCAGE_F300, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BrdMob", fProfile::BIRD_MOB, fProfile::BIRD_MOB, 0xFFFF, 0xFF, 0}, + { "BrgBn", fProfile::OBJ_BRIDGE_BONE, fProfile::OBJ_BRIDGE_BONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BrgFall", fProfile::OBJ_BRIDGE_FALL, fProfile::OBJ_BRIDGE_FALL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BrgStp", fProfile::OBJ_BRIDGE_STEP, fProfile::OBJ_BRIDGE_STEP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BrgTs", fProfile::OBJ_BRIDGE_TIME, fProfile::OBJ_BRIDGE_TIME, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BridgeB", fProfile::OBJ_BRIDGE_BUILDING, fProfile::OBJ_BRIDGE_BUILDING, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BridgeS", fProfile::OBJ_BRIDGE_STRETCH, fProfile::OBJ_BRIDGE_STRETCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Bstone", fProfile::OBJ_BSTONE, fProfile::OBJ_BSTONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BtlTg", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 0}, + { "BtlTgA", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 1}, + { "BtlTgB", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 2}, + { "BtlTgC", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 3}, + { "Bubble", fProfile::OBJ_BUBBLE, fProfile::OBJ_BUBBLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BulbSW", fProfile::OBJ_BULB_SWITCH, fProfile::OBJ_BULB_SWITCH, 524, SND_SOURCE_OBJECT, 0}, + { "Bullet", fProfile::COMMON_BULLET, fProfile::COMMON_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"Butrfly", fProfile::INSECT_BUTTERFLY, fProfile::INSECT_BUTTERFLY, 777, SND_SOURCE_INSECT, 0}, + { "Bvd", fProfile::B_VD, fProfile::B_VD, 65, 19, 0}, + {"CBomSld", fProfile::COL_BOMSLD, fProfile::COL_BOMSLD, 0xFFFF, 0xFF, 0}, + {"Cam2Tag", fProfile::CAMERA2_TAG, fProfile::CAMERA2_TAG, 0xFFFF, 0xFF, 0}, + { "CamTag", fProfile::CAMERA_TAG, fProfile::CAMERA_TAG, 0xFFFF, 0xFF, 0}, + { "Cannon", fProfile::OBJ_CANNON, fProfile::OBJ_CANNON, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"CannonC", fProfile::OBJ_CANNON_COVER, fProfile::OBJ_CANNON_COVER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Chandel", fProfile::OBJ_CHANDELIER, fProfile::OBJ_CHANDELIER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Char", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 5}, + { "CharA", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "CharB", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 1}, + { "CharC", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 2}, + { "CharD", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 3}, + { "CharE", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 4}, + { "Cicada", fProfile::INSECT_CICADA, fProfile::INSECT_CICADA, 770, SND_SOURCE_INSECT, 0}, + { "City", fProfile::OBJ_CITY, fProfile::OBJ_CITY, 0xFFFF, 0xFF, 0}, + {"CityWtr", fProfile::OBJ_CITY_WATER, fProfile::OBJ_CITY_WATER, 0xFFFF, 0xFF, 0}, + {"ClawSTg", fProfile::OBJ_CLAW_SHOT_TG, fProfile::OBJ_CLAW_SHOT_TG, 0xFFFF, 33, 0}, + { "Clef", fProfile::OBJ_CLEF, fProfile::OBJ_CLEF, 0xFFFF, SND_SOURCE_CLEF, 0}, + {"CloudSD", fProfile::OBJ_CLOUD_DIVE, fProfile::OBJ_CLOUD_DIVE, 0xFFFF, 0xFF, 0}, + {"ClrWall", fProfile::OBJ_CLEARNESS_WALL, fProfile::OBJ_CLEARNESS_WALL, 0xFFFF, 0xFF, 0}, + {"CmCloud", fProfile::OBJ_CUMUL_CLOUD, fProfile::OBJ_CUMUL_CLOUD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "CoTest", fProfile::CO_TEST, fProfile::CO_TEST, 0xFFFF, 0xFF, 0}, + { "Col", fProfile::OBJ_COL, fProfile::OBJ_COL, 0xFFFF, 0xFF, 0}, + { "ColStp", fProfile::COL_STP, fProfile::COL_STP, 0xFFFF, 0xFF, 0}, + {"CtrlPnl", fProfile::OBJ_CONTROL_PANEL, fProfile::OBJ_CONTROL_PANEL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "CupA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 1}, + { "CupA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 2}, + { "CupA02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 3}, + { "CupB00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 4}, + { "CupB01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 5}, + { "CupB02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 6}, + {"CyStone", fProfile::OBJ_CARRY_STONE, fProfile::OBJ_CARRY_STONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "D2Mtr", fProfile::OBJ_DESERT_METER, fProfile::OBJ_DESERT_METER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"D300Obj", fProfile::OBJ_D300, fProfile::OBJ_D300, 0xFFFF, 0xFF, 0}, + {"D3Dummy", fProfile::OBJ_D3_DUMMY, fProfile::OBJ_D3_DUMMY, 0xFFFF, 0xFF, 0}, + { "DNdl", fProfile::OBJ_NEEDLE_DESERT, fProfile::OBJ_NEEDLE_DESERT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "DNight", fProfile::OBJ_DAYNIGHT, fProfile::OBJ_DAYNIGHT, 0xFFFF, 0xFF, 0}, + {"DStartT", fProfile::START_TAG, fProfile::START_TAG, 0xFFFF, 0xFF, 0}, + {"DbidNpc", fProfile::DEMO_NPC_BIRD, fProfile::DEMO_NPC_BIRD, 0xFFFF, 43, 0}, + { "Debris", fProfile::OBJ_STAGE_DEBRIS, fProfile::OBJ_STAGE_DEBRIS, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "DecoA", fProfile::OBJ_DECOA, fProfile::OBJ_DECOA, 0xFFFF, 0xFF, 0}, + { "DecoB", fProfile::OBJ_DECOB, fProfile::OBJ_DECOB, 0xFFFF, 0xFF, 0}, + {"DemoPds", fProfile::OBJ_UTA_DEMO_PEDEST, fProfile::OBJ_UTA_DEMO_PEDEST, 0xFFFF, 0xFF, 0}, + {"DiOnNbs", fProfile::OBJ_DISPLAY_ONLY_NBS, fProfile::OBJ_DISPLAY_ONLY_NBS, 0xFFFF, 0xFF, 0}, + { "DieTag", fProfile::ALLDIE_TAG, fProfile::ALLDIE_TAG, 0xFFFF, 0xFF, 0}, + {"DisShip", fProfile::OBJ_DIS_SHIP, fProfile::OBJ_DIS_SHIP, 0xFFFF, 0xFF, 0}, + {"DivCrst", fProfile::OBJ_DIVINER_CRYSTAL, fProfile::OBJ_DIVINER_CRYSTAL, 551, SND_SOURCE_OBJECT, 0}, + {"DmtGate", fProfile::OBJ_DORMITORY_GATE, fProfile::OBJ_DORMITORY_GATE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Door", fProfile::OBJ_DOOR, fProfile::OBJ_DOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Door200", fProfile::OBJ_DOOR_DUNGEON_D200, fProfile::OBJ_DOOR_DUNGEON_D200, 0xFFFF, 42, 0}, + { "DoorBs", fProfile::OBJ_DOOR_BOSS, fProfile::OBJ_DOOR_BOSS, 0xFFFF, 42, 0}, + {"DoorDun", fProfile::OBJ_DOOR_DUNGEON, fProfile::OBJ_DOOR_DUNGEON, 0xFFFF, 42, 0}, + {"Dowsing", fProfile::T_DOWSING, fProfile::T_DOWSING, 0xFFFF, 0xFF, 0}, + {"Drgnfly", fProfile::INSECT_DRAGONFLY, fProfile::INSECT_DRAGONFLY, 778, SND_SOURCE_INSECT, 0}, + { "Drum", fProfile::OBJ_DRUM, fProfile::OBJ_DRUM, 0xFFFF, 0xFF, 0}, + {"DrumTag", fProfile::TAG_DRUM, fProfile::TAG_DRUM, 0xFFFF, 0xFF, 0}, + {"DstDbrs", fProfile::OBJ_DESERT_DEBRIS, fProfile::OBJ_DESERT_DEBRIS, 0xFFFF, 0xFF, 0}, + {"DwnLava", fProfile::OBJ_DOWN_LAVA, fProfile::OBJ_DOWN_LAVA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "EAm", fProfile::E_AM, fProfile::E_AM, 69, 10, 0}, + { "EBc", fProfile::E_BC, fProfile::E_BC, 18, 10, 0}, + { "EBcZ", fProfile::E_BCZ, fProfile::E_BCZ, 43, 16, 0}, + { "EBcaL", fProfile::E_BCAL, fProfile::E_BCAL, 29, 10, 0}, + { "EBce", fProfile::E_BCE, fProfile::E_BCE, 18, 10, 0}, + {"EBeamos", fProfile::E_BEAMOS, fProfile::E_BEAMOS, 70, 10, 0}, + { "EBfish", fProfile::E_BFISH, fProfile::E_BFISH, 73, 10, 0}, + { "EBs", fProfile::E_BS, fProfile::E_BS, 0xFFFF, 10, 0}, + {"ECactus", fProfile::E_CACTUS, fProfile::E_CACTUS, 531, 40, 0}, + {"EChaser", fProfile::E_TN2, fProfile::E_TN2, 0xFFFF, 18, 0}, + { "EChb", fProfile::E_CHB, fProfile::E_CHB, 0xFFFF, 18, 0}, + { "ECptn", fProfile::E_CAPTAIN, fProfile::E_CAPTAIN, 47, 19, 0}, + { "EEye", fProfile::E_EYE, fProfile::E_EYE, 517, 15, 0}, + { "EGe", fProfile::E_GE, fProfile::E_GE, 0xFFFF, 10, 0}, + { "EGeko", fProfile::E_GEKO, fProfile::E_GEKO, 72, 15, 0}, + {"EGerock", fProfile::E_GEROCK, fProfile::E_GEROCK, 17, 10, 0}, + { "EGue", fProfile::E_GUE, fProfile::E_GUE, 15, 10, 0}, + {"EGumarm", fProfile::E_GUMARM, fProfile::E_GUMARM, 66, 10, 0}, + { "EGunho", fProfile::E_GUNHO, fProfile::E_GUNHO, 71, 10, 0}, + {"EGunhob", fProfile::E_GUNHOB, fProfile::E_GUNHOB, 87, 15, 0}, + { "EHidoK", fProfile::E_HIDOKARI, fProfile::E_HIDOKARI, 63, 10, 0}, + { "EHidoS", fProfile::E_HIDOKARIS, fProfile::E_HIDOKARIS, 63, SND_SOURCE_OBJECT, 0}, + {"EHidory", fProfile::E_HIDORY, fProfile::E_HIDORY, 16, 10, 0}, + { "EHoc", fProfile::E_HOC, fProfile::E_HOC, 20, 10, 0}, + { "EHp", fProfile::E_HP, fProfile::E_HP, 0xFFFF, 10, 0}, + { "EHydra", fProfile::E_HYDRA, fProfile::E_HYDRA, 44, 10, 0}, + { "EKGira", fProfile::E_KGIRA, fProfile::E_KGIRA, 0xFFFF, 19, 0}, + { "EKg", fProfile::E_KG, fProfile::E_KG, 8, 15, 0}, + { "EKs", fProfile::E_KS, fProfile::E_KS, 11, 10, 0}, + {"ELiTail", fProfile::E_LIZA_TAIL, fProfile::E_LIZA_TAIL, 0xFFFF, SND_SOURCE_ITEM, 0}, + {"ELizaru", fProfile::E_LIZARUFOS, fProfile::E_LIZARUFOS, 41, 13, 0}, + { "EMagma", fProfile::E_MAGMA, fProfile::E_MAGMA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"EMagupp", fProfile::E_MAGUPPO, fProfile::E_MAGUPPO, 74, 12, 0}, + { "EMr", fProfile::E_MR, fProfile::E_MR, 36, 10, 0}, + {"EMrTate", fProfile::E_MR_SHIELD, fProfile::E_MR_SHIELD, 0xFFFF, 15, 0}, + { "EOc", fProfile::E_OC, fProfile::E_OC, 18, 10, 0}, + { "EOr", fProfile::E_OR, fProfile::E_OR, 57, 10, 0}, + {"EOrCann", fProfile::E_OR_CANNON, fProfile::E_OR_CANNON, 3, 10, 0}, + { "EPh", fProfile::E_PH, fProfile::E_PH, 81, 15, 0}, + { "EPo", fProfile::E_PO, fProfile::E_PO, 0xFFFF, 18, 0}, + { "ERemly", fProfile::E_REMLY, fProfile::E_REMLY, 0, 15, 0}, + {"ERupGue", fProfile::E_RUPEE_GUE, fProfile::E_RUPEE_GUE, 4, 10, 0}, + { "ESf", fProfile::E_SF, fProfile::E_SF, 45, 19, 0}, + { "ESf4", fProfile::E_SF4, fProfile::E_SF4, 46, 19, 0}, + { "ESiren", fProfile::E_SIREN, fProfile::E_SIREN, 0xFFFF, 18, 0}, + { "ESktl", fProfile::E_SKYTAIL, fProfile::E_SKYTAIL, 2, 10, 0}, + { "ESm", fProfile::E_SM, fProfile::E_SM, 59, 11, 0}, + { "ESpark", fProfile::E_SPARK, fProfile::E_SPARK, 67, 17, 0}, + { "ESyako", fProfile::E_SYAKOMAITO, fProfile::E_SYAKOMAITO, 68, 10, 0}, + { "EWs", fProfile::E_WS, fProfile::E_WS, 6, 15, 0}, + { "Eel", fProfile::EEL, fProfile::EEL, 0xFFFF, 0xFF, 0}, + { "EffGnT", fProfile::EFFECT_GEN_TAG, fProfile::EFFECT_GEN_TAG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Ehb", fProfile::E_HB, fProfile::E_HB, 78, 10, 0}, + {"EhbLeaf", fProfile::E_HB_LEAF, fProfile::E_HB_LEAF, 0xFFFF, 0xFF, 0}, + {"ElLight", fProfile::OBJ_ELECTRIC_LIGHT, fProfile::OBJ_ELECTRIC_LIGHT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "EnCl", fProfile::ENEMY_CONTROL, fProfile::ENEMY_CONTROL, 0xFFFF, 0xFF, 0}, + { "Est", fProfile::E_ST, fProfile::E_ST, 7, 10, 0}, + {"Estwire", fProfile::E_ST_WIRE, fProfile::E_ST_WIRE, 0xFFFF, 0xFF, 0}, + { "EvfTag", fProfile::EVENTF_TAG, fProfile::EVENTF_TAG, 0xFFFF, 0xFF, 0}, + {"EvilFld", fProfile::OBJ_EVIL_FIELD, fProfile::OBJ_EVIL_FIELD, 0xFFFF, 0xFF, 0}, + {"EvntTag", fProfile::EVENT_TAG, fProfile::EVENT_TAG, 0xFFFF, 0xFF, 0}, + { "F302Lt", fProfile::OBJ_F302_LIGHT, fProfile::OBJ_F302_LIGHT, 0xFFFF, 0xFF, 0}, + {"F400GaS", fProfile::OBJ_F400_GATE_SEAL, fProfile::OBJ_F400_GATE_SEAL, 0xFFFF, 0xFF, 0}, + {"F400Gat", fProfile::OBJ_F400_GATE_LEAF, fProfile::OBJ_F400_GATE_LEAF, 0xFFFF, 0xFF, 0}, + {"FShutte", fProfile::OBJ_SHUTTER_FENCE, fProfile::OBJ_SHUTTER_FENCE, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + { "FWall", fProfile::OBJ_FIREWALL, fProfile::OBJ_FIREWALL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Fairy", fProfile::OBJ_FAIRY, fProfile::OBJ_FAIRY, 546, SND_SOURCE_OBJECT, 0}, + {"FairyTa", fProfile::T_FAIRY, fProfile::T_FAIRY, 0xFFFF, 0xFF, 0}, + { "Fence", fProfile::OBJ_FENCE, fProfile::OBJ_FENCE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FenceB2", fProfile::OBJ_FENCE_BOKO2, fProfile::OBJ_FENCE_BOKO2, 0xFFFF, 0xFF, 0}, + {"FenceBk", fProfile::OBJ_FENCE_BOKO, fProfile::OBJ_FENCE_BOKO, 0xFFFF, 0xFF, 0}, + {"FenceFo", fProfile::TAG_SHUTTER_FENCE_FORBIDDANCE, fProfile::TAG_SHUTTER_FENCE_FORBIDDANCE, 0xFFFF, 0xFF, 0}, + {"FenceIr", fProfile::OBJ_FENCE_IRON, fProfile::OBJ_FENCE_IRON, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FenceKs", fProfile::OBJ_FENCE_KONSAI, fProfile::OBJ_FENCE_KONSAI, 0xFFFF, 0xFF, 0}, + {"FencePe", fProfile::TAG_SHUTTER_FENCE_PERMISSION, fProfile::TAG_SHUTTER_FENCE_PERMISSION, 0xFFFF, 0xFF, 0}, + { "Fire", fProfile::OBJ_FIRE, fProfile::OBJ_FIRE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FireObs", fProfile::OBJ_FIRE_OBSTACLE, fProfile::OBJ_FIRE_OBSTACLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FirePil", fProfile::OBJ_FIRE_PILLAR, fProfile::OBJ_FIRE_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Firefly", fProfile::INSECT_FIREFLY, fProfile::INSECT_FIREFLY, 779, SND_SOURCE_INSECT, 0}, + { "Fish", fProfile::FISH, fProfile::FISH, 0xFFFF, 0xFF, 0}, + { "Flag", fProfile::OBJ_FLAG, fProfile::OBJ_FLAG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "FlvsA", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 13}, + { "FlvsB", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 14}, + { "FlvsC", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 15}, + {"FlySlrb", fProfile::FLY_SLB, fProfile::FLY_SLB, 0xFFFF, 43, 0}, + {"FlyingC", fProfile::OBJ_FLYING_CLAWSHOT_TARGET, fProfile::OBJ_FLYING_CLAWSHOT_TARGET, 0xFFFF, 0xFF, 0}, + { "Fmaker", fProfile::FISH_MGR, fProfile::FISH_MGR, 0xFFFF, 0xFF, 0}, + {"ForceGT", fProfile::TAG_FORCE_GET_FLAG, fProfile::TAG_FORCE_GET_FLAG, 0xFFFF, 0xFF, 0}, + { "ForceS", fProfile::OBJ_FORCE_SIGN, fProfile::OBJ_FORCE_SIGN, 0xFFFF, 0xFF, 0}, + {"Fortune", fProfile::OBJ_FORTUNE_RING, fProfile::OBJ_FORTUNE_RING, 0xFFFF, 0xFF, 0}, + {"FrmLand", fProfile::OBJ_FARMLAND, fProfile::OBJ_FARMLAND, 0xFFFF, 0xFF, 0}, + {"FrtTree", fProfile::OBJ_FRUIT_TREE, fProfile::OBJ_FRUIT_TREE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "FruitA", fProfile::OBJ_FRUIT, fProfile::OBJ_FRUIT, 0xFFFF, SND_SOURCE_OBJECT, 1}, + { "FruitB", fProfile::OBJ_FRUIT_B, fProfile::OBJ_FRUIT_B, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"GateGnd", fProfile::GATE2GND_TAG, fProfile::GATE2GND_TAG, 0xFFFF, 0xFF, 0}, + { "Gcoil", fProfile::OBJ_GRASS_COIL, fProfile::OBJ_GRASS_COIL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Gear", fProfile::OBJ_GEAR, fProfile::OBJ_GEAR, 525, SND_SOURCE_OBJECT, 0}, + {"GekoTag", fProfile::GEKO_TAG, fProfile::GEKO_TAG, 0xFFFF, 0xFF, 0}, + {"GenkiDT", fProfile::TAG_GENKI_DOWSING_TARGET, fProfile::TAG_GENKI_DOWSING_TARGET, 0xFFFF, 0xFF, 0}, + { "GhFlr", fProfile::OBJ_GIRAHIMU_FLOOR, fProfile::OBJ_GIRAHIMU_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"GhSBeam", fProfile::GH_SWORD_BEAM, fProfile::GH_SWORD_BEAM, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"GiraFot", fProfile::OBJ_GIRAHIM_FOOT, fProfile::OBJ_GIRAHIM_FOOT, 0xFFFF, 0xFF, 0}, + {"GkMgTag", fProfile::GENKI_MGR_TAG, fProfile::GENKI_MGR_TAG, 0xFFFF, 0xFF, 0}, + {"GodCube", fProfile::OBJ_GODDESS_CUBE, fProfile::OBJ_GODDESS_CUBE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"GodMark", fProfile::OBJ_GOD_MARK, fProfile::OBJ_GOD_MARK, 0xFFFF, 0xFF, 0}, + {"GrCover", fProfile::OBJ_GROUND_COVER, fProfile::OBJ_GROUND_COVER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Grave", fProfile::OBJ_GRAVE, fProfile::OBJ_GRAVE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "GroupS", fProfile::GROUP_SUMMON, fProfile::GROUP_SUMMON, 0xFFFF, 0xFF, 0}, + { "GroupT", fProfile::GROUP_TEST, fProfile::GROUP_TEST, 0xFFFF, 0xFF, 0}, + { "Grshpr", fProfile::INSECT_GRASSHOPPER, fProfile::INSECT_GRASSHOPPER, 772, SND_SOURCE_INSECT, 0}, + {"GuardLg", fProfile::OBJ_GUARD_LOG, fProfile::OBJ_GUARD_LOG, 544, SND_SOURCE_OBJECT, 0}, + { "GueB", fProfile::GUE_BULLET, fProfile::GUE_BULLET, 0xFFFF, 42, 0}, + {"HdrFire", fProfile::HIDORY_FIRE, fProfile::HIDORY_FIRE, 16, SND_SOURCE_OBJECT, 0}, + {"HeartCo", fProfile::OBJ_ITEM_HEART_CONTAINER, fProfile::OBJ_ITEM_HEART_CONTAINER, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "Heartf", fProfile::HEART_FLOWER, fProfile::HEART_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"HeatRst", fProfile::TAG_HEAT_RESIST, fProfile::TAG_HEAT_RESIST, 0xFFFF, 0xFF, 0}, + { "Himo", fProfile::OBJ_HIMO, fProfile::OBJ_HIMO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"HitLVSW", fProfile::OBJ_HIT_LEVER_SW, fProfile::OBJ_HIT_LEVER_SW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "HnComb", fProfile::NPC_HONEYCOMB, fProfile::NPC_HONEYCOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"HoleMNG", fProfile::OBJ_HOLE_MINIGAME, fProfile::OBJ_HOLE_MINIGAME, 0xFFFF, 0xFF, 0}, + {"HolyWtr", fProfile::TAG_HOLY_WATER, fProfile::TAG_HOLY_WATER, 0xFFFF, 0xFF, 0}, + {"HrpHint", fProfile::OBJ_HARP_HINT, fProfile::OBJ_HARP_HINT, 555, SND_SOURCE_OBJECT, 0}, + { "HrpTg", fProfile::HARP_TAG, fProfile::HARP_TAG, 0xFFFF, 57, 0}, + {"ImpaDor", fProfile::OBJ_IMPA_DOOR, fProfile::OBJ_IMPA_DOOR, 0xFFFF, 0xFF, 0}, + { "InHole", fProfile::OBJ_INTO_HOLE, fProfile::OBJ_INTO_HOLE, 0xFFFF, 33, 0}, + {"InsctTg", fProfile::TAG_INSECT, fProfile::TAG_INSECT, 0xFFFF, 0xFF, 0}, + { "Invisi", fProfile::INVISIBLE, fProfile::INVISIBLE, 0xFFFF, 0xFF, 0}, + {"IronStg", fProfile::OBJ_IRON_STAGE, fProfile::OBJ_IRON_STAGE, 0xFFFF, 0xFF, 0}, + {"IslBamb", fProfile::OBJ_BAMBOO_ISLAND, fProfile::OBJ_BAMBOO_ISLAND, 0xFFFF, 0xFF, 0}, + { "IslIns", fProfile::OBJ_INSECT_ISLAND, fProfile::OBJ_INSECT_ISLAND, 0xFFFF, 0xFF, 0}, + { "IslLOD", fProfile::OBJ_ISLAND_LOD, fProfile::OBJ_ISLAND_LOD, 0xFFFF, 0xFF, 0}, + {"IslMegm", fProfile::OBJ_MEGAMI_ISLAND, fProfile::OBJ_MEGAMI_ISLAND, 0xFFFF, 0xFF, 0}, + {"IslNusi", fProfile::OBJ_ISLAND_NUSI, fProfile::OBJ_ISLAND_NUSI, 0xFFFF, 0xFF, 0}, + {"IslTery", fProfile::OBJ_TERRY_ISLAND, fProfile::OBJ_TERRY_ISLAND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"IslTreB", fProfile::OBJ_TREASURE_ISLAND_B, fProfile::OBJ_TREASURE_ISLAND_B, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"IslTrea", fProfile::OBJ_TREASURE_ISLAND, fProfile::OBJ_TREASURE_ISLAND, 0xFFFF, 0xFF, 0}, + { "Item", fProfile::ITEM, fProfile::ITEM, 0xFFFF, SND_SOURCE_ITEM, 0}, + {"IvyRope", fProfile::OBJ_IVY_ROPE, fProfile::OBJ_IVY_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "J_Test", fProfile::J_TEST, fProfile::J_TEST, 0xFFFF, 0xFF, 0}, + {"JunkRep", fProfile::OBJ_JUNK_REPAIR, fProfile::OBJ_JUNK_REPAIR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Kanban", fProfile::KANBAN, fProfile::KANBAN, 513, SND_SOURCE_OBJECT, 0}, + {"KanbanS", fProfile::OBJ_KANBAN_STONE, fProfile::OBJ_KANBAN_STONE, 514, 0xFF, 0}, + { "Kibako", fProfile::OBJ_KIBAKO, fProfile::OBJ_KIBAKO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"KiesuTa", fProfile::KIESU_TAG, fProfile::KIESU_TAG, 0xFFFF, 15, 0}, + { "Kinoko", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"KinokoA", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 1}, + {"KinokoB", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 2}, + {"KinokoC", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 3}, + {"KinokoD", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 4}, + {"KmtWall", fProfile::OBJ_KUMITE_WALL, fProfile::OBJ_KUMITE_WALL, 0xFFFF, 0xFF, 0}, + {"KndBird", fProfile::KNIGHT_LEADER_BIRD, fProfile::KNIGHT_LEADER_BIRD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Kuwagat", fProfile::INSECT_BEETLE, fProfile::INSECT_BEETLE, 771, SND_SOURCE_INSECT, 1}, + { "Kytag", fProfile::KYTAG_TAG, fProfile::KYTAG_TAG, 0xFFFF, 0xFF, 0}, + { "LBird", fProfile::LITTLE_BIRD, fProfile::LITTLE_BIRD, 479, 43, 0}, + {"LBmaker", fProfile::LITTLE_BIRD_MGR, fProfile::LITTLE_BIRD_MGR, 0xFFFF, 59, 0}, + { "LHHarp", fProfile::OBJ_LIGHTHOUSE_HARP, fProfile::OBJ_LIGHTHOUSE_HARP, 0xFFFF, 0xFF, 0}, + {"LHLight", fProfile::OBJ_LIGHTHOUSE_LIGHT, fProfile::OBJ_LIGHTHOUSE_LIGHT, 0xFFFF, 0xFF, 0}, + { "LSEff", fProfile::TAG_LIGHT_SHAFT_EFF, fProfile::TAG_LIGHT_SHAFT_EFF, 0xFFFF, 0xFF, 0}, + {"Ladybug", fProfile::INSECT_LADYBUG, fProfile::INSECT_LADYBUG, 769, SND_SOURCE_INSECT, 0}, + { "LampA", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 1}, + { "LampB", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 2}, + { "LampC", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 3}, + { "LampD", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 6}, + { "LampE", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 4}, + { "LampF", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 5}, + {"LavF200", fProfile::OBJ_LAVA_F200, fProfile::OBJ_LAVA_F200, 0xFFFF, 0xFF, 0}, + {"LbTnder", fProfile::LBTHUNDER_TAG, fProfile::LBTHUNDER_TAG, 0xFFFF, 0xFF, 0}, + {"LeafGut", fProfile::OBJ_FRUIT_GUTS_LEAF, fProfile::OBJ_FRUIT_GUTS_LEAF, 0xFFFF, 0xFF, 0}, + {"LeafSwg", fProfile::OBJ_LEAF_SWING, fProfile::OBJ_LEAF_SWING, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Light00", fProfile::OBJ_BUILDING, fProfile::OBJ_BUILDING, 0xFFFF, 0xFF, 1}, + {"LightLi", fProfile::OBJ_LIGHT_LINE, fProfile::OBJ_LIGHT_LINE, 0xFFFF, 41, 0}, + { "Link", fProfile::PLAYER, fProfile::PLAYER, 0xFFFF, SND_SOURCE_PLAYER, 0}, + { "Log", fProfile::OBJ_LOG, fProfile::OBJ_LOG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "LogWtr", fProfile::OBJ_LOG_WATER, fProfile::OBJ_LOG_WATER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Lotus", fProfile::OBJ_LOTUS, fProfile::OBJ_LOTUS, 521, SND_SOURCE_OBJECT, 0}, + { "LtSftS", fProfile::OBJ_LIGHT_SHAFT_SMALL, fProfile::OBJ_LIGHT_SHAFT_SMALL, 0xFFFF, 41, 0}, + {"LtsFlwr", fProfile::OBJ_LOTUS_FLOWER, fProfile::OBJ_LOTUS_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"LtsSeed", fProfile::OBJ_LOTUS_SEED, fProfile::OBJ_LOTUS_SEED, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "LvD201", fProfile::OBJ_LAVA_D201, fProfile::OBJ_LAVA_D201, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "LvPlt", fProfile::OBJ_LAVA_PLATE, fProfile::OBJ_LAVA_PLATE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "MDvTg", fProfile::MEGAMI_DIVING_TAG, fProfile::MEGAMI_DIVING_TAG, 0xFFFF, 0xFF, 0}, + {"MagBoat", fProfile::OBJ_ROCK_BOAT, fProfile::OBJ_ROCK_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "MagpB", fProfile::MAGUPPO_BULLET, fProfile::MAGUPPO_BULLET, 0xFFFF, 30, 0}, + { "Mantis", fProfile::INSECT_GRASSHOPPER, fProfile::INSECT_GRASSHOPPER, 773, SND_SOURCE_INSECT, 1}, + {"MapArea", fProfile::MAP_AREA_TAG, fProfile::MAP_AREA_TAG, 0xFFFF, 0xFF, 0}, + {"MapInst", fProfile::TAG_MAP_INST, fProfile::TAG_MAP_INST, 0xFFFF, 0xFF, 0}, + {"MapMark", fProfile::T_MAP_MARK, fProfile::T_MAP_MARK, 0xFFFF, 0xFF, 0}, + {"MassTag", fProfile::MASS_OBJ_TAG, fProfile::MASS_OBJ_TAG, 0xFFFF, 0xFF, 0}, + {"Message", fProfile::MESSAGE_ACTOR, fProfile::MESSAGE_ACTOR, 0xFFFF, 0xFF, 0}, + {"MgPmpkn", fProfile::OBJ_MG_PUMPKIN, fProfile::OBJ_MG_PUMPKIN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "MistTg", fProfile::MIST_TAG, fProfile::MIST_TAG, 0xFFFF, 0xFF, 0}, + {"MoMgTag", fProfile::MOLE_MGR_TAG, fProfile::MOLE_MGR_TAG, 0xFFFF, 0xFF, 0}, + { "MoSoil", fProfile::OBJ_MOLE_SOIL, fProfile::OBJ_MOLE_SOIL, 0xFFFF, 0xFF, 0}, + {"MoleCvr", fProfile::OBJ_MOLE_COVER, fProfile::OBJ_MOLE_COVER, 0xFFFF, 0xFF, 0}, + {"MoleTag", fProfile::MOLE_PROHIBIT_TAG, fProfile::MOLE_PROHIBIT_TAG, 0xFFFF, 0xFF, 0}, + {"MpParts", fProfile::OBJ_MAPPARTS, fProfile::OBJ_MAPPARTS, 0xFFFF, 0xFF, 0}, + {"MssbTag", fProfile::TAG_MUSASABI, fProfile::TAG_MUSASABI, 0xFFFF, 0xFF, 0}, + {"Musasab", fProfile::OBJ_MUSASABI, fProfile::OBJ_MUSASABI, 321, SND_SOURCE_OBJECT, 0}, + { "MvElc", fProfile::OBJ_MOVE_ELEC, fProfile::OBJ_MOVE_ELEC, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"MvLiftV", fProfile::OBJ_MOVE_LIFT_VOL, fProfile::OBJ_MOVE_LIFT_VOL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "NpcAdr", fProfile::NPC_ADR, fProfile::NPC_ADR, 310, 52, 0}, + {"NpcAkuH", fProfile::NPC_AKU_HUMAN, fProfile::NPC_AKU_HUMAN, 346, SND_SOURCE_NPC_NRM, 0}, + {"NpcAkum", fProfile::NPC_AKUMAKUN, fProfile::NPC_AKUMAKUN, 279, SND_SOURCE_NPC_NRM, 0}, + {"NpcAzFa", fProfile::NPC_AZUKARIYA_FATHER, fProfile::NPC_AZUKARIYA_FATHER, 298, SND_SOURCE_NPC_NRM, 0}, + {"NpcAzNi", fProfile::NPC_AZUKARIYA_NIGHT, fProfile::NPC_AZUKARIYA_NIGHT, 464, SND_SOURCE_NPC_NRM, 0}, + {"NpcBRvl", fProfile::NPC_BBRVL, fProfile::NPC_BBRVL, 261, 50, 0}, + {"NpcBdsw", fProfile::NPC_BDSW, fProfile::NPC_BDSW, 0xFFFF, 50, 0}, + { "NpcBdz", fProfile::NPC_BDZ, fProfile::NPC_BDZ, 0xFFFF, 43, 0}, + { "NpcBgr", fProfile::NPC_BGR, fProfile::NPC_BGR, 298, SND_SOURCE_NPC_NRM, 0}, + {"NpcBird", fProfile::NPC_BIRD, fProfile::NPC_BIRD, 0xFFFF, 43, 0}, + {"NpcCbFd", fProfile::NPC_CE_FRIEND, fProfile::NPC_CE_FRIEND, 278, SND_SOURCE_NPC_NRM, 0}, + {"NpcCbLd", fProfile::NPC_CE_LADY, fProfile::NPC_CE_LADY, 285, SND_SOURCE_NPC_NRM, 0}, + {"NpcChef", fProfile::NPC_CHEF, fProfile::NPC_CHEF, 299, SND_SOURCE_NPC_NRM, 0}, + {"NpcDgJg", fProfile::NPC_DIVE_GAME_JUDGE, fProfile::NPC_DIVE_GAME_JUDGE, 272, SND_SOURCE_NPC_NRM, 0}, + {"NpcDoML", fProfile::NPC_DOUGUYA_MOTHER_LOD, fProfile::NPC_DOUGUYA_MOTHER_LOD, 294, SND_SOURCE_NPC_NRM, 0}, + {"NpcDoMo", fProfile::NPC_DOUGUYA_MOTHER, fProfile::NPC_DOUGUYA_MOTHER, 294, SND_SOURCE_NPC_NRM, 0}, + {"NpcDoNi", fProfile::NPC_DOUGUYA_NIGHT, fProfile::NPC_DOUGUYA_NIGHT, 462, SND_SOURCE_NPC_NRM, 0}, + { "NpcDrb", fProfile::NPC_DRB, fProfile::NPC_DRB, 319, 43, 0}, + {"NpcDrbC", fProfile::NPC_DRBC, fProfile::NPC_DRBC, 320, 43, 0}, + { "NpcDsk", fProfile::NPC_DSK, fProfile::NPC_DSK, 258, SND_SOURCE_NPC_NRM, 0}, + {"NpcDskN", fProfile::NPC_DAISHINKAN_N, fProfile::NPC_DAISHINKAN_N, 340, SND_SOURCE_NPC_NRM, 0}, + { "NpcFdr", fProfile::NPC_FDR, fProfile::NPC_FDR, 318, 52, 0}, + { "NpcGhm", fProfile::NPC_GHM, fProfile::NPC_GHM, 323, 50, 0}, + {"NpcGost", fProfile::NPC_TOILET_GHOST, fProfile::NPC_TOILET_GHOST, 300, SND_SOURCE_NPC_NRM, 0}, + { "NpcGra", fProfile::NPC_GRA, fProfile::NPC_GRA, 302, SND_SOURCE_NPC_NRM, 0}, + { "NpcGrc", fProfile::NPC_GRC, fProfile::NPC_GRC, 330, SND_SOURCE_NPC_NRM, 0}, + { "NpcGrd", fProfile::NPC_GRD, fProfile::NPC_GRD, 331, 50, 0}, + { "NpcGzl", fProfile::NPC_GZL, fProfile::NPC_GZL, 257, SND_SOURCE_NPC_NRM, 0}, + {"NpcIcgK", fProfile::NPC_ICGK, fProfile::NPC_ICGK, 460, SND_SOURCE_NPC_NRM, 0}, + { "NpcInv", fProfile::NPC_INV, fProfile::NPC_INV, 0xFFFF, 0xFF, 0}, + {"NpcJkML", fProfile::NPC_JUNK_MOTHER_LOD, fProfile::NPC_JUNK_MOTHER_LOD, 295, SND_SOURCE_NPC_NRM, 0}, + {"NpcJkMo", fProfile::NPC_JUNK_MOTHER, fProfile::NPC_JUNK_MOTHER, 295, SND_SOURCE_NPC_NRM, 0}, + {"NpcJkNi", fProfile::NPC_JUNK_NIGHT, fProfile::NPC_JUNK_NIGHT, 463, SND_SOURCE_NPC_NRM, 0}, + {"NpcKb2N", fProfile::NPC_KOBUN_B_NIGHT, fProfile::NPC_KOBUN_B_NIGHT, 459, SND_SOURCE_NPC_NRM, 0}, + { "NpcKbn", fProfile::NPC_KBN, fProfile::NPC_KBN, 262, SND_SOURCE_NPC_NRM, 0}, + {"NpcKbn2", fProfile::NPC_KBN2, fProfile::NPC_KBN2, 263, SND_SOURCE_NPC_NRM, 0}, + { "NpcKen", fProfile::NPC_KENSEI, fProfile::NPC_KENSEI, 0xFFFF, SND_SOURCE_KENSEI, 0}, + {"NpcKenT", fProfile::NPC_TALK_KENSEI, fProfile::NPC_TALK_KENSEI, 0xFFFF, SND_SOURCE_KENSEI, 0}, + {"NpcKnld", fProfile::NPC_KNIGHT_LEADER, fProfile::NPC_KNIGHT_LEADER, 271, SND_SOURCE_NPC_NRM, 0}, + {"NpcKyuE", fProfile::NPC_KYUI_ELDER, fProfile::NPC_KYUI_ELDER, 307, SND_SOURCE_NPC_NRM, 0}, + {"NpcKyuW", fProfile::NPC_KYUI_WIZARD, fProfile::NPC_KYUI_WIZARD, 308, SND_SOURCE_NPC_NRM, 0}, + {"NpcMHNi", fProfile::NPC_MED_HUS_NIGHT, fProfile::NPC_MED_HUS_NIGHT, 466, SND_SOURCE_NPC_NRM, 0}, + {"NpcMWNi", fProfile::NPC_MED_WIFE_NIGHT, fProfile::NPC_MED_WIFE_NIGHT, 465, SND_SOURCE_NPC_NRM, 0}, + {"NpcMlMg", fProfile::NPC_MOLE_MG, fProfile::NPC_MOLE_MG, 313, 50, 0}, + {"NpcMoEN", fProfile::NPC_MOLE_ES_NML, fProfile::NPC_MOLE_ES_NML, 345, 50, 0}, + {"NpcMoEl", fProfile::NPC_MOLE_ELDER, fProfile::NPC_MOLE_ELDER, 317, 50, 0}, + { "NpcMoN", fProfile::NPC_MOLE_NORMAL, fProfile::NPC_MOLE_NORMAL, 312, 50, 0}, + {"NpcMoN2", fProfile::NPC_MOLE_NORMAL2, fProfile::NPC_MOLE_NORMAL2, 312, 50, 0}, + { "NpcMoS", fProfile::NPC_MOLE_SAL, fProfile::NPC_MOLE_SAL, 474, 50, 0}, + { "NpcMoT", fProfile::NPC_MOLE_TACKLE, fProfile::NPC_MOLE_TACKLE, 315, 50, 0}, + {"NpcMoT2", fProfile::NPC_MOLE_TACKLE2, fProfile::NPC_MOLE_TACKLE2, 316, 50, 0}, + {"NpcMole", fProfile::NPC_MOLE, fProfile::NPC_MOLE, 345, 50, 0}, + { "NpcOim", fProfile::NPC_OIM, fProfile::NPC_OIM, 301, SND_SOURCE_NPC_NRM, 0}, + {"NpcOkyu", fProfile::NPC_ORD_KYUI, fProfile::NPC_ORD_KYUI, 304, SND_SOURCE_NPC_NRM, 0}, + { "NpcPcs", fProfile::NPC_PCS, fProfile::NPC_PCS, 469, SND_SOURCE_NPC_NRM, 0}, + { "NpcPdu", fProfile::NPC_PDU, fProfile::NPC_PDU, 274, SND_SOURCE_NPC_NRM, 0}, + { "NpcPma", fProfile::NPC_PMA, fProfile::NPC_PMA, 273, SND_SOURCE_NPC_NRM, 0}, + {"NpcResc", fProfile::NPC_RESCUE, fProfile::NPC_RESCUE, 291, SND_SOURCE_NPC_NRM, 0}, + { "NpcRvl", fProfile::NPC_RVL, fProfile::NPC_RVL, 261, SND_SOURCE_NPC_NRM, 0}, + {"NpcRvlL", fProfile::NPC_RIVAL_LOD, fProfile::NPC_RIVAL_LOD, 261, SND_SOURCE_NPC_NRM, 0}, + {"NpcRvlR", fProfile::NPC_REGRET_RIVAL, fProfile::NPC_REGRET_RIVAL, 261, SND_SOURCE_NPC_NRM, 0}, + {"NpcSAML", fProfile::NPC_SENPAIA_MOTHER_LOD, fProfile::NPC_SENPAIA_MOTHER_LOD, 296, SND_SOURCE_NPC_NRM, 0}, + {"NpcSAMo", fProfile::NPC_SENPAIA_MOTHER, fProfile::NPC_SENPAIA_MOTHER, 296, SND_SOURCE_NPC_NRM, 0}, + {"NpcSMnD", fProfile::NPC_SORAJIMA_MAN_D, fProfile::NPC_SORAJIMA_MAN_D, 297, SND_SOURCE_NPC_NRM, 0}, + {"NpcSMnE", fProfile::NPC_SORAJIMA_MAN_E, fProfile::NPC_SORAJIMA_MAN_E, 336, SND_SOURCE_NPC_NRM, 0}, + {"NpcSalS", fProfile::NPC_SALESMAN_S, fProfile::NPC_SALESMAN_S, 265, SND_SOURCE_NPC_NRM, 0}, + {"NpcSenb", fProfile::NPC_SENPAI_B, fProfile::NPC_SENPAI_B, 277, SND_SOURCE_NPC_NRM, 0}, + {"NpcSenp", fProfile::NPC_SENPAI, fProfile::NPC_SENPAI, 276, SND_SOURCE_NPC_NRM, 0}, + { "NpcSha", fProfile::NPC_SHA, fProfile::NPC_SHA, 275, SND_SOURCE_NPC_NRM, 0}, + { "NpcSkn", fProfile::NPC_SKN, fProfile::NPC_SKN, 259, SND_SOURCE_NPC_NRM, 0}, + {"NpcSkn2", fProfile::NPC_SKN2, fProfile::NPC_SKN2, 260, SND_SOURCE_NPC_NRM, 0}, + {"NpcSlFB", fProfile::NPC_SLFB, fProfile::NPC_SLFB, 0xFFFF, 43, 0}, + {"NpcSlFl", fProfile::NPC_SLFL, fProfile::NPC_SLFL, 0xFFFF, 43, 0}, + {"NpcSlKy", fProfile::NPC_SALBAGE_MORRY, fProfile::NPC_SALBAGE_MORRY, 304, SND_SOURCE_NPC_NRM, 0}, + {"NpcSlRp", fProfile::NPC_SLRP, fProfile::NPC_SLRP, 477, 43, 0}, + {"NpcSlb2", fProfile::NPC_SLB2, fProfile::NPC_SLB2, 354, 43, 0}, + {"NpcSlrb", fProfile::NPC_SLB, fProfile::NPC_SLB, 0xFFFF, 43, 0}, + {"NpcSltk", fProfile::NPC_SLTK, fProfile::NPC_SLTK, 0xFFFF, 0xFF, 0}, + {"NpcSma2", fProfile::NPC_SMA2, fProfile::NPC_SMA2, 286, SND_SOURCE_NPC_NRM, 0}, + {"NpcSma3", fProfile::NPC_SMA3, fProfile::NPC_SMA3, 287, SND_SOURCE_NPC_NRM, 0}, + {"NpcSoBo", fProfile::NPC_SORAJIMA_BOY, fProfile::NPC_SORAJIMA_BOY, 284, SND_SOURCE_NPC_NRM, 0}, + {"NpcSoFa", fProfile::NPC_SORAJIMA_FATHER, fProfile::NPC_SORAJIMA_FATHER, 282, SND_SOURCE_NPC_NRM, 0}, + { "NpcSoG", fProfile::NPC_SORAJIMA_GIRL, fProfile::NPC_SORAJIMA_GIRL, 288, SND_SOURCE_NPC_NRM, 0}, + {"NpcSoMo", fProfile::NPC_SORAJIMA_MOTHER, fProfile::NPC_SORAJIMA_MOTHER, 283, SND_SOURCE_NPC_NRM, 0}, + {"NpcSoma", fProfile::NPC_SORAJIMA_MALE, fProfile::NPC_SORAJIMA_MALE, 281, SND_SOURCE_NPC_NRM, 0}, + {"NpcSowo", fProfile::NPC_SORAJIMA_FEMALE, fProfile::NPC_SORAJIMA_FEMALE, 280, SND_SOURCE_NPC_NRM, 0}, + { "NpcStr", fProfile::NPC_STR, fProfile::NPC_STR, 0xFFFF, 0xFF, 0}, + { "NpcSui", fProfile::NPC_SUISEI, fProfile::NPC_SUISEI, 344, 43, 0}, + {"NpcSuiN", fProfile::NPC_SUISEI_NORMAL, fProfile::NPC_SUISEI_NORMAL, 309, 50, 0}, + {"NpcSuiS", fProfile::NPC_SUISEI_SUB, fProfile::NPC_SUISEI_SUB, 309, 43, 0}, + { "NpcTdr", fProfile::NPC_TDR, fProfile::NPC_TDR, 322, 52, 0}, + {"NpcTdrB", fProfile::NPC_TDRB, fProfile::NPC_TDRB, 322, SND_SOURCE_OBJECT, 0}, + { "NpcTds", fProfile::NPC_TDS, fProfile::NPC_TDS, 478, 0xFF, 0}, + { "NpcTer", fProfile::NPC_TERRY, fProfile::NPC_TERRY, 264, SND_SOURCE_NPC_NRM, 0}, + { "NpcTke", fProfile::NPC_TKE, fProfile::NPC_TKE, 0xFFFF, 0xFF, 0}, + { "NpcTmn", fProfile::NPC_TMN, fProfile::NPC_TMN, 0xFFFF, 0xFF, 0}, + { "NpcYim", fProfile::NPC_YIM, fProfile::NPC_YIM, 311, SND_SOURCE_NPC_NRM, 0}, + { "NpcZld", fProfile::NPC_ZLD, fProfile::NPC_ZLD, 256, SND_SOURCE_NPC_NRM, 0}, + {"Npckyu1", fProfile::NPC_KYUI_FIRST, fProfile::NPC_KYUI_FIRST, 303, SND_SOURCE_NPC_NRM, 0}, + {"Npckyu3", fProfile::NPC_KYUI_THIRD, fProfile::NPC_KYUI_THIRD, 305, SND_SOURCE_NPC_NRM, 0}, + {"Npckyu4", fProfile::NPC_KYUI4, fProfile::NPC_KYUI4, 306, SND_SOURCE_NPC_NRM, 0}, + { "NusiB", fProfile::B_NUSI, fProfile::B_NUSI, 0xFFFF, 23, 0}, + { "NusiBt", fProfile::B_NUSI_BULLET, fProfile::B_NUSI_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"NusiNpc", fProfile::NUSI_NPC, fProfile::NUSI_NPC, 0xFFFF, 46, 0}, + { "NusiS", fProfile::NUSI_BASE, fProfile::NUSI_BASE, 0xFFFF, 0xFF, 0}, + { "NusiT", fProfile::B_NUSI_TENTAKLE, fProfile::B_NUSI_TENTAKLE, 5, 19, 0}, + {"OBBLBom", fProfile::OBJ_BBLARGEBOMB, fProfile::OBJ_BBLARGEBOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "OBBStn", fProfile::OBJ_BSTN, fProfile::OBJ_BSTN, 557, 0xFF, 0}, + {"ODesert", fProfile::OBJ_DESERT, fProfile::OBJ_DESERT, 0xFFFF, 0xFF, 0}, + { "OGhKf", fProfile::OBJ_GH_KNIFE, fProfile::OBJ_GH_KNIFE, 0xFFFF, SND_SOURCE_BULLET, 0}, + { "OGhSwL", fProfile::OBJ_GH_SW_L, fProfile::OBJ_GH_SW_L, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "OHole", fProfile::OBJ_HOLE, fProfile::OBJ_HOLE, 0xFFFF, 0xFF, 0}, + { "OPipe", fProfile::OBJ_PIPE, fProfile::OBJ_PIPE, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "ORing", fProfile::OBJ_RING, fProfile::OBJ_RING, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "ObjBg", fProfile::OBJ_BG, fProfile::OBJ_BG, 0xFFFF, 0xFF, 0}, + { "ObjBld", fProfile::OBJ_BUILDING, fProfile::OBJ_BUILDING, 0xFFFF, 0xFF, 0}, + {"Obstacl", fProfile::OBJ_BELT_OBSTACLE, fProfile::OBJ_BELT_OBSTACLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "OcGrs", fProfile::OBJ_OCT_GRASS, fProfile::OBJ_OCT_GRASS, 0xFFFF, 0xFF, 0}, + { "OcGrsL", fProfile::OBJ_OCT_GRASS_LEAF, fProfile::OBJ_OCT_GRASS_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"OrCaBul", fProfile::OR_CANN_BULLET, fProfile::OR_CANN_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + { "Paint", fProfile::OBJ_PAINT, fProfile::OBJ_PAINT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Pinwhel", fProfile::OBJ_PINWHEEL, fProfile::OBJ_PINWHEEL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Piston", fProfile::OBJ_PISTON, fProfile::OBJ_PISTON, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "PlCock", fProfile::OBJ_POOL_COCK, fProfile::OBJ_POOL_COCK, 0xFFFF, 0xFF, 0}, + {"PlRsTag", fProfile::PL_RESTART, fProfile::PL_RESTART, 0xFFFF, 0xFF, 0}, + { "Plight", fProfile::PLIGHT_TAG, fProfile::PLIGHT_TAG, 0xFFFF, 0xFF, 0}, + {"PlntA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 16}, + {"PlntA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 17}, + { "PlntB", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 18}, + {"PlntC00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 19}, + {"PlntC01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 20}, + { "PltA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 7}, + { "PltA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 8}, + { "PltA02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 9}, + { "PltB00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 10}, + { "PltB01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 11}, + { "PltB02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 12}, + { "PltChg", fProfile::PLTCHG_TAG, fProfile::PLTCHG_TAG, 0xFFFF, 0xFF, 0}, + {"PmpknBd", fProfile::PUMPKIN, fProfile::PUMPKIN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"PmpknDe", fProfile::PUMPKIN, fProfile::PUMPKIN, 0xFFFF, 0xFF, 0}, + {"PoleStn", fProfile::OBJ_POLE_STONY, fProfile::OBJ_POLE_STONY, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "PotSal", fProfile::OBJ_POT_SAL, fProfile::OBJ_POT_SAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Propera", fProfile::OBJ_PROPERA, fProfile::OBJ_PROPERA, 539, SND_SOURCE_OBJECT, 0}, + {"PrpLift", fProfile::OBJ_PROPELLER_LIFT, fProfile::OBJ_PROPELLER_LIFT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"PumpBar", fProfile::OBJ_PUMPKIN_BAR, fProfile::OBJ_PUMPKIN_BAR, 0xFFFF, 0xFF, 0}, + {"Pumpkin", fProfile::OBJ_PUMPKIN_LEAF, fProfile::OBJ_PUMPKIN_LEAF, 0xFFFF, 0xFF, 0}, + {"PushBlk", fProfile::OBJ_PUSH_BLOCK, fProfile::OBJ_PUSH_BLOCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "PyBird", fProfile::BIRD, fProfile::BIRD, 0xFFFF, SND_SOURCE_PLAYER_BIRD, 0}, + {"PzlLand", fProfile::OBJ_PUZZLE_ISLAND, fProfile::OBJ_PUZZLE_ISLAND, 0xFFFF, 0xFF, 0}, + {"RRckTag", fProfile::RIDE_ROCK_SET_TAG, fProfile::RIDE_ROCK_SET_TAG, 0xFFFF, 0xFF, 0}, + { "RaceM", fProfile::AVATER_RACE_MNG, fProfile::AVATER_RACE_MNG, 0xFFFF, 0xFF, 0}, + {"RailEnd", fProfile::OBJ_RAIL_END, fProfile::OBJ_RAIL_END, 0xFFFF, 0xFF, 0}, + {"RailPst", fProfile::OBJ_RAIL_POST, fProfile::OBJ_RAIL_POST, 0xFFFF, 0xFF, 0}, + {"RidRock", fProfile::OBJ_RIDE_ROCK, fProfile::OBJ_RIDE_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "RkDrgn", fProfile::OBJ_ROCK_DRAGON, fProfile::OBJ_ROCK_DRAGON, 0xFFFF, 42, 0}, + {"RoAtLog", fProfile::TAG_ROLL_ATTACK_LOG, fProfile::TAG_ROLL_ATTACK_LOG, 0xFFFF, 0xFF, 0}, + {"RoAtTag", fProfile::RO_AT_TAR_MANAGER_TAG, fProfile::RO_AT_TAR_MANAGER_TAG, 0xFFFF, 0xFF, 0}, + {"RoAtTar", fProfile::OBJ_RO_AT_TARGET, fProfile::OBJ_RO_AT_TARGET, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RoLight", fProfile::OBJ_ROTATION_LIGHT, fProfile::OBJ_ROTATION_LIGHT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RockSky", fProfile::OBJ_ROCK_SKY, fProfile::OBJ_ROCK_SKY, 0xFFFF, 0xFF, 0}, + {"RolRock", fProfile::OBJ_ROLL_ROCK, fProfile::OBJ_ROLL_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RopeBas", fProfile::OBJ_ROPE_BASE, fProfile::OBJ_ROPE_BASE, 0xFFFF, 0xFF, 0}, + {"RopeIga", fProfile::OBJ_ROPE_IGAIGA, fProfile::OBJ_ROPE_IGAIGA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RouletC", fProfile::OBJ_ROULETTE_ISLAND_C, fProfile::OBJ_ROULETTE_ISLAND_C, 0xFFFF, 0xFF, 0}, + {"RouletR", fProfile::OBJ_ROULETTE_ISLAND_R, fProfile::OBJ_ROULETTE_ISLAND_R, 0xFFFF, 0xFF, 0}, + {"Roulete", fProfile::OBJ_ROULETTE, fProfile::OBJ_ROULETTE, 540, SND_SOURCE_OBJECT, 0}, + {"RuinSav", fProfile::OBJ_RUINED_SAVE, fProfile::OBJ_RUINED_SAVE, 0xFFFF, 0xFF, 0}, + {"SKinoko", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SStatue", fProfile::OBJ_STEP_STATUE, fProfile::OBJ_STEP_STATUE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STCover", fProfile::OBJ_STAGE_COVER, fProfile::OBJ_STAGE_COVER, 0xFFFF, 0xFF, 0}, + {"STCrack", fProfile::OBJ_STAGE_CRACK, fProfile::OBJ_STAGE_CRACK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STKraPt", fProfile::OBJ_STAGE_KRAKEN_PARTS, fProfile::OBJ_STAGE_KRAKEN_PARTS, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STKrake", fProfile::OBJ_STAGE_KRAKEN, fProfile::OBJ_STAGE_KRAKEN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "STSink", fProfile::OBJ_STAGE_SINK, fProfile::OBJ_STAGE_SINK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STWater", fProfile::OBJ_STAGE_WATER, fProfile::OBJ_STAGE_WATER, 0xFFFF, 0xFF, 0}, + { "Sail", fProfile::OBJ_SAIL, fProfile::OBJ_SAIL, 0xFFFF, 0xFF, 0}, + {"Sandbag", fProfile::OBJ_SANDBAG, fProfile::OBJ_SANDBAG, 0xFFFF, 0xFF, 0}, + {"ScChang", fProfile::SC_CHANGE_TAG, fProfile::SC_CHANGE_TAG, 0xFFFF, 0xFF, 0}, + { "Scarab", fProfile::INSECT_SCARAB, fProfile::INSECT_SCARAB, 775, SND_SOURCE_INSECT, 0}, + { "SdCdl", fProfile::OBJ_SWORD_CANDLE, fProfile::OBJ_SWORD_CANDLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SeaF301", fProfile::OBJ_SEA_F301, fProfile::OBJ_SEA_F301, 0xFFFF, 0xFF, 0}, + { "Shed", fProfile::OBJ_SHED, fProfile::OBJ_SHED, 0xFFFF, 0xFF, 0}, + {"ShipFld", fProfile::TAG_SHIP_FLOOD, fProfile::TAG_SHIP_FLOOD, 0xFFFF, 0xFF, 0}, + {"ShipSlp", fProfile::TAG_SHIP_SLOPE, fProfile::TAG_SHIP_SLOPE, 0xFFFF, 0xFF, 0}, + {"ShipWin", fProfile::OBJ_SHIP_WINDOW, fProfile::OBJ_SHIP_WINDOW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"ShpSmpl", fProfile::SHOP_SAMPLE, fProfile::SHOP_SAMPLE, 553, 0xFF, 0}, + {"ShriAft", fProfile::OBJ_SHRINE_AFTER, fProfile::OBJ_SHRINE_AFTER, 0xFFFF, 0xFF, 0}, + {"ShriBef", fProfile::OBJ_SHRINE_BEFORE, fProfile::OBJ_SHRINE_BEFORE, 0xFFFF, 0xFF, 0}, + {"ShriIns", fProfile::OBJ_SHRINE_BEF_INSIDE, fProfile::OBJ_SHRINE_BEF_INSIDE, 0xFFFF, 0xFF, 0}, + { "ShtCS", fProfile::OBJ_SHUTTER_CHANGE_SCENE, fProfile::OBJ_SHUTTER_CHANGE_SCENE, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"ShtrWtr", fProfile::OBJ_SHUTTER_WATER_D101, fProfile::OBJ_SHUTTER_WATER_D101, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + { "SideST", fProfile::OBJ_SIDE_SHUTTER, fProfile::OBJ_SIDE_SHUTTER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Siren2D", fProfile::OBJ_SIREN_2DMAP, fProfile::OBJ_SIREN_2DMAP, 0xFFFF, 0xFF, 0}, + {"SirenTg", fProfile::SIREN_TAG, fProfile::SIREN_TAG, 0xFFFF, 0xFF, 0}, + {"SkEnmyT", fProfile::SKYENEMY_T, fProfile::SKYENEMY_T, 0xFFFF, 59, 0}, + {"SldDoor", fProfile::OBJ_SEALED_DOOR, fProfile::OBJ_SEALED_DOOR, 0xFFFF, 0xFF, 0}, + {"SliceLg", fProfile::OBJ_SLICE_LOG, fProfile::OBJ_SLICE_LOG, 543, SND_SOURCE_OBJECT, 0}, + {"SlicePt", fProfile::OBJ_SLICE_LOG_PARTS, fProfile::OBJ_SLICE_LOG_PARTS, 543, SND_SOURCE_OBJECT, 0}, + { "Smoke", fProfile::OBJ_SMOKE, fProfile::OBJ_SMOKE, 0xFFFF, 0xFF, 0}, + {"SnLight", fProfile::OBJ_SUN_LIGHT, fProfile::OBJ_SUN_LIGHT, 0xFFFF, 0xFF, 0}, + {"SndD301", fProfile::OBJ_SAND_D301, fProfile::OBJ_SAND_D301, 0xFFFF, 0xFF, 0}, + { "SndStn", fProfile::OBJ_STONE_STAND, fProfile::OBJ_STONE_STAND, 558, SND_SOURCE_OBJECT, 0}, + { "SngGS", fProfile::OBJ_GODDESS_STATUE, fProfile::OBJ_GODDESS_STATUE, 0xFFFF, 0xFF, 0}, + {"SnkFlrF", fProfile::OBJ_SINK_FLOOR_F, fProfile::OBJ_SINK_FLOOR_F, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Soil", fProfile::OBJ_SOIL, fProfile::OBJ_SOIL, 0xFFFF, 33, 0}, + {"SpWinTg", fProfile::TAG_SHIP_WINDOW, fProfile::TAG_SHIP_WINDOW, 0xFFFF, 0xFF, 0}, + {"SparkTg", fProfile::SPARKS_TAG, fProfile::SPARKS_TAG, 0xFFFF, 0xFF, 0}, + {"SpiderL", fProfile::OBJ_SPIDER_LINE, fProfile::OBJ_SPIDER_LINE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Spike", fProfile::OBJ_SPIKE, fProfile::OBJ_SPIKE, 0xFFFF, 0xFF, 0}, + { "SpkTg2", fProfile::SPARKS2_TAG, fProfile::SPARKS2_TAG, 0xFFFF, 0xFF, 0}, + { "Spore", fProfile::OBJ_SPORE, fProfile::OBJ_SPORE, 0xFFFF, 0xFF, 0}, + {"SporeTg", fProfile::SPORE_TAG, fProfile::SPORE_TAG, 0xFFFF, 0xFF, 0}, + { "SrnSk", fProfile::OBJ_SIREN_BARRIER, fProfile::OBJ_SIREN_BARRIER, 0xFFFF, 0xFF, 0}, + { "StepTS", fProfile::OBJ_STEP_TIME_SLIP, fProfile::OBJ_STEP_TIME_SLIP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"StgBgTs", fProfile::OBJ_TIME_STAGE_BG, fProfile::OBJ_TIME_STAGE_BG, 0xFFFF, 0xFF, 0}, + { "StpGm", fProfile::OBJ_STEP_GUMARM, fProfile::OBJ_STEP_GUMARM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"StpRope", fProfile::OBJ_STOPPING_ROPE, fProfile::OBJ_STOPPING_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "StprRc", fProfile::OBJ_STOPPER_ROCK, fProfile::OBJ_STOPPER_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"StrLava", fProfile::OBJ_STREAM_LAVA, fProfile::OBJ_STREAM_LAVA, 0xFFFF, 0xFF, 0}, + {"StreamT", fProfile::TAG_STREAM, fProfile::TAG_STREAM, 0xFFFF, 0xFF, 0}, + { "Sw", fProfile::OBJ_SW, fProfile::OBJ_SW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SwAreaT", fProfile::SW_AREA_TAG, fProfile::SW_AREA_TAG, 0xFFFF, 0xFF, 0}, + { "SwBnk", fProfile::OBJ_SW_BANK, fProfile::OBJ_SW_BANK, 527, SND_SOURCE_OBJECT, 0}, + { "SwBnkS", fProfile::OBJ_SW_BANK_SMALL, fProfile::OBJ_SW_BANK_SMALL, 528, SND_SOURCE_OBJECT, 0}, + { "SwDir", fProfile::OBJ_SW_DIR, fProfile::OBJ_SW_DIR, 536, SND_SOURCE_OBJECT, 0}, + { "SwDir2", fProfile::OBJ_SW_DIR_DOOR, fProfile::OBJ_SW_DIR_DOOR, 516, SND_SOURCE_OBJECT, 0}, + { "SwHrp", fProfile::OBJ_SW_HARP, fProfile::OBJ_SW_HARP, 548, SND_SOURCE_SW_HARP, 0}, + { "SwSB", fProfile::OBJ_SW_SWORD_BEAM, fProfile::OBJ_SW_SWORD_BEAM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "SwTag", fProfile::SW_TAG, fProfile::SW_TAG, 0xFFFF, 0xFF, 0}, + { "SwWall", fProfile::OBJ_SWITCH_WALL, fProfile::OBJ_SWITCH_WALL, 519, SND_SOURCE_OBJECT, 0}, + { "SwdStb", fProfile::OBJ_SWORD_STAB, fProfile::OBJ_SWORD_STAB, 0xFFFF, 0xFF, 0}, + { "Swhit", fProfile::OBJ_SWHIT, fProfile::OBJ_SWHIT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SwrdPrj", fProfile::OBJ_SWRD_PRJ, fProfile::OBJ_SWRD_PRJ, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "SwrdSt", fProfile::OBJ_SEAT_SWORD, fProfile::OBJ_SEAT_SWORD, 0xFFFF, 0xFF, 0}, + { "TAgo", fProfile::OBJ_DESERT_AGO, fProfile::OBJ_DESERT_AGO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TBcal", fProfile::T_BCAL, fProfile::T_BCAL, 0xFFFF, 0xFF, 0}, + { "TBoat", fProfile::OBJ_TIME_BOAT, fProfile::OBJ_TIME_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TBoatB", fProfile::OBJ_TIME_BOAT_BULLET, fProfile::OBJ_TIME_BOAT_BULLET, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TBox", fProfile::TBOX, fProfile::TBOX, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TChk", fProfile::TAG_TIME_AREA_CHECK, fProfile::TAG_TIME_AREA_CHECK, 0xFFFF, 0xFF, 0}, + { "TDoor", fProfile::OBJ_TIME_DOOR, fProfile::OBJ_TIME_DOOR, 0xFFFF, 42, 0}, + { "TDoorB", fProfile::OBJ_TIME_DOOR_BEFORE, fProfile::OBJ_TIME_DOOR_BEFORE, 556, 0xFF, 0}, + {"TGrD101", fProfile::OBJ_TOWER_GEAR_D101, fProfile::OBJ_TOWER_GEAR_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TKumite", fProfile::T_KUMITE, fProfile::T_KUMITE, 0xFFFF, 0xFF, 0}, + { "TPole", fProfile::OBJ_TARZAN_POLE, fProfile::OBJ_TARZAN_POLE, 523, SND_SOURCE_OBJECT, 0}, + { "TRail", fProfile::OBJ_TENI_RAIL, fProfile::OBJ_TENI_RAIL, 0xFFFF, 0xFF, 0}, + {"TRalPst", fProfile::OBJ_TENI_RAIL_POST, fProfile::OBJ_TENI_RAIL_POST, 0xFFFF, 0xFF, 0}, + { "TSBase", fProfile::OBJ_TIME_BASE, fProfile::OBJ_TIME_BASE, 0xFFFF, 0xFF, 0}, + { "TSBlk", fProfile::OBJ_TIME_BLOCK, fProfile::OBJ_TIME_BLOCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TWeed", fProfile::OBJ_TUMBLE_WEED, fProfile::OBJ_TUMBLE_WEED, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Tckl", fProfile::OBJ_TACKLE, fProfile::OBJ_TACKLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TerBike", fProfile::OBJ_TERRY_BIKE, fProfile::OBJ_TERRY_BIKE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TerrGmk", fProfile::OBJ_TERRY_GIMMICK, fProfile::OBJ_TERRY_GIMMICK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TerrHol", fProfile::OBJ_TERRY_HOLE, fProfile::OBJ_TERRY_HOLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TerrSw", fProfile::OBJ_TERRY_SWITCH, fProfile::OBJ_TERRY_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TgClay", fProfile::TAG_PUMPKIN_CLAY, fProfile::TAG_PUMPKIN_CLAY, 0xFFFF, 0xFF, 0}, + {"TgClefG", fProfile::TAG_CLEF_GAME, fProfile::TAG_CLEF_GAME, 0xFFFF, 0xFF, 0}, + {"TgClefM", fProfile::TAG_CLEF_MANAGER, fProfile::TAG_CLEF_MANAGER, 0xFFFF, 0xFF, 0}, + {"TgD3Chg", fProfile::TAG_D3_SCENE_CHANGE, fProfile::TAG_D3_SCENE_CHANGE, 0xFFFF, 0xFF, 0}, + {"TgDefea", fProfile::TAG_DEFEAT_BOSS, fProfile::TAG_DEFEAT_BOSS, 0xFFFF, 0xFF, 0}, + {"TgFence", fProfile::TAG_FENCE_SYNCHRONIZER, fProfile::TAG_FENCE_SYNCHRONIZER, 0xFFFF, 0xFF, 0}, + {"TgMICap", fProfile::TAG_MINIGAME_INSECT_CAPTURE, fProfile::TAG_MINIGAME_INSECT_CAPTURE, 0xFFFF, 0xFF, 0}, + { "TgMien", fProfile::TAG_MIECHAN, fProfile::TAG_MIECHAN, 0xFFFF, 0xFF, 0}, + {"TgNoEff", fProfile::TAG_NOEFFECT_AREA, fProfile::TAG_NOEFFECT_AREA, 0xFFFF, 0xFF, 0}, + {"TgRBoat", fProfile::TAG_ROCK_BOAT, fProfile::TAG_ROCK_BOAT, 0xFFFF, 0xFF, 0}, + {"TgReact", fProfile::TAG_REACTION, fProfile::TAG_REACTION, 0xFFFF, 0xFF, 0}, + {"TgRstTs", fProfile::TAG_RESTART_TIME_STONE, fProfile::TAG_RESTART_TIME_STONE, 0xFFFF, 0xFF, 0}, + { "TgSBG", fProfile::TAG_SWORD_BATTLE_GAME, fProfile::TAG_SWORD_BATTLE_GAME, 0xFFFF, 0xFF, 0}, + { "TgSTA", fProfile::TAG_SIREN_TIME_ATTACK, fProfile::TAG_SIREN_TIME_ATTACK, 0xFFFF, 0xFF, 0}, + {"TgSndAr", fProfile::TAG_SOUND_AREA, fProfile::TAG_SOUND_AREA, 0xFFFF, 0xFF, 0}, + {"TgSndMg", fProfile::SOUND_AREA_MGR, fProfile::SOUND_AREA_MGR, 0xFFFF, 0xFF, 0}, + {"TgSound", fProfile::SOUND_TAG, fProfile::SOUND_TAG, 0xFFFF, 0xFF, 0}, + { "TgTDB", fProfile::TAG_TIME_DOOR_BEAM, fProfile::TAG_TIME_DOOR_BEAM, 0xFFFF, 0xFF, 0}, + { "TgTckl", fProfile::TACKLE_TAG, fProfile::TACKLE_TAG, 0xFFFF, 0xFF, 0}, + {"TgTimer", fProfile::TAG_TIMER, fProfile::TAG_TIMER, 0xFFFF, 0xFF, 0}, + { "TgTrap", fProfile::OBJ_TOGE_TRAP, fProfile::OBJ_TOGE_TRAP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TgTw", fProfile::TUMBLE_WEED_TAG, fProfile::TUMBLE_WEED_TAG, 0xFFFF, 59, 0}, + { "TimeIs", fProfile::OBJ_TENIJIMA, fProfile::OBJ_TENIJIMA, 0xFFFF, 0xFF, 0}, + {"TimeStn", fProfile::OBJ_TIME_STONE, fProfile::OBJ_TIME_STONE, 0xFFFF, SND_SOURCE_TIME_STONE, 0}, + { "TkEvnt", fProfile::TAG_TKEVNT, fProfile::TAG_TKEVNT, 0xFFFF, 0xFF, 0}, + { "TlpTag", fProfile::TLP_TAG, fProfile::TLP_TAG, 0xFFFF, 0xFF, 0}, + {"ToD3Stn", fProfile::OBJ_TOD3_STONE, fProfile::OBJ_TOD3_STONE, 537, 0xFF, 0}, + {"Tornado", fProfile::OBJ_TORNADO, fProfile::OBJ_TORNADO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TouchTa", fProfile::TOUCH_TAG, fProfile::TOUCH_TAG, 0xFFFF, 0xFF, 0}, + { "TowerB", fProfile::OBJ_TOWER_BOMB, fProfile::OBJ_TOWER_BOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TowerHa", fProfile::OBJ_TOWER_HAND_D101, fProfile::OBJ_TOWER_HAND_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TrRaiCo", fProfile::OBJ_TRUCK_RAIL_COL, fProfile::OBJ_TRUCK_RAIL_COL, 0xFFFF, 0xFF, 0}, + {"TrShtCs", fProfile::OBJ_TR_SHUTTER_CS, fProfile::OBJ_TR_SHUTTER_CS, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"TrapRc1", fProfile::OBJ_TRAP_ROCK_1, fProfile::OBJ_TRAP_ROCK_1, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TriForc", fProfile::OBJ_TRIFORCE, fProfile::OBJ_TRIFORCE, 0xFFFF, 0xFF, 0}, + {"TrpBrdW", fProfile::OBJ_TRAP_BIRD_WOOD, fProfile::OBJ_TRAP_BIRD_WOOD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TruRail", fProfile::TRUCK_RAIL, fProfile::TRUCK_RAIL, 0xFFFF, 0xFF, 0}, + { "Truck", fProfile::OBJ_TRUCK, fProfile::OBJ_TRUCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TrukStp", fProfile::OBJ_TRUCK_STOPPER, fProfile::OBJ_TRUCK_STOPPER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Tshop", fProfile::OBJ_TERRY_SHOP, fProfile::OBJ_TERRY_SHOP, 0xFFFF, SND_SOURCE_TERRY_SHOP, 0}, + {"TstShtr", fProfile::SHUTTER, fProfile::SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + { "Tubo", fProfile::OBJ_TUBO, fProfile::OBJ_TUBO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "UDLava", fProfile::OBJ_UPDOWN_LAVA, fProfile::OBJ_UPDOWN_LAVA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"UdCloud", fProfile::OBJ_UNDER_CLOUD, fProfile::OBJ_UNDER_CLOUD, 0xFFFF, 0xFF, 0}, + {"UgSwitc", fProfile::OBJ_UG_SWITCH, fProfile::OBJ_UG_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Uground", fProfile::OBJ_UNDERGROUND, fProfile::OBJ_UNDERGROUND, 0xFFFF, 59, 0}, + {"UtaLand", fProfile::OBJ_UTAJIMA_ISLAND, fProfile::OBJ_UTAJIMA_ISLAND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "UtaLv2", fProfile::OBJ_UTAJIMA_LV2, fProfile::OBJ_UTAJIMA_LV2, 0xFFFF, 0xFF, 0}, + {"UtaMain", fProfile::OBJ_UTAJIMA_MAIN_MECHA, fProfile::OBJ_UTAJIMA_MAIN_MECHA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"UtaPeds", fProfile::OBJ_UTAJIMA_PEDESTAL, fProfile::OBJ_UTAJIMA_PEDESTAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"UtaStop", fProfile::OBJ_UTAJIMA_STOPPER, fProfile::OBJ_UTAJIMA_STOPPER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Utajima", fProfile::OBJ_UTAJIMA, fProfile::OBJ_UTAJIMA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "V_Clip", fProfile::VIEW_CLIP_TAG, fProfile::VIEW_CLIP_TAG, 0xFFFF, 0xFF, 0}, + {"VacuDsP", fProfile::OBJ_VACU_DUST_PARTS, fProfile::OBJ_VACU_DUST_PARTS, 0xFFFF, 0xFF, 0}, + {"VacuDst", fProfile::OBJ_VACU_DUST, fProfile::OBJ_VACU_DUST, 0xFFFF, 0xFF, 0}, + { "Vdb", fProfile::OBJ_VDB, fProfile::OBJ_VDB, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"VentFan", fProfile::OBJ_VENT_FAN, fProfile::OBJ_VENT_FAN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Vortex", fProfile::OBJ_VORTEX, fProfile::OBJ_VORTEX, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Vrbox", fProfile::VRBOX_TAG, fProfile::VRBOX_TAG, 0xFFFF, 0xFF, 0}, + { "WFF102", fProfile::OBJ_WATERFALL_F102, fProfile::OBJ_WATERFALL_F102, 0xFFFF, 0xFF, 0}, + { "Warp", fProfile::TIME_AREA, fProfile::TIME_AREA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "WarpH", fProfile::OBJ_WARP_HOLE, fProfile::OBJ_WARP_HOLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WarpObj", fProfile::OBJ_WARP, fProfile::OBJ_WARP, 547, 55, 0}, + {"WaterSW", fProfile::OBJ_WATER_SWITCH, fProfile::OBJ_WATER_SWITCH, 526, SND_SOURCE_OBJECT, 0}, + {"WaterSf", fProfile::OBJ_WATER_SURFACE, fProfile::OBJ_WATER_SURFACE, 0xFFFF, 0xFF, 0}, + {"WaterSp", fProfile::OBJ_WATER_SPOUT, fProfile::OBJ_WATER_SPOUT, 0xFFFF, 0xFF, 0}, + {"WatrIga", fProfile::OBJ_WATER_IGAIGA, fProfile::OBJ_WATER_IGAIGA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WdBoard", fProfile::OBJ_WOOD_BOARD, fProfile::OBJ_WOOD_BOARD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Wind", fProfile::OBJ_WIND, fProfile::OBJ_WIND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Wind02", fProfile::OBJ_WIND02, fProfile::OBJ_WIND02, 0xFFFF, 0xFF, 0}, + { "Wind03", fProfile::OBJ_WIND03, fProfile::OBJ_WIND03, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Wind04", fProfile::OBJ_WIND04, fProfile::OBJ_WIND04, 0xFFFF, 0xFF, 0}, + {"Windmil", fProfile::OBJ_WINDMILL, fProfile::OBJ_WINDMILL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WnLeafA", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 542, SND_SOURCE_OBJECT, 1}, + {"WnLeafB", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 2}, + {"WnLeafC", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 542, SND_SOURCE_OBJECT, 3}, + {"WnLeafD", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 4}, + {"WndMilD", fProfile::OBJ_WINDMILL_DESERT, fProfile::OBJ_WINDMILL_DESERT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WoodTag", fProfile::WOODAREA_TAG, fProfile::WOODAREA_TAG, 0xFFFF, 0xFF, 1}, + {"WoodTg2", fProfile::WOODAREA_TAG, fProfile::WOODAREA_TAG, 0xFFFF, 0xFF, 2}, + {"WtFD100", fProfile::OBJ_WATERFALL_D100, fProfile::OBJ_WATERFALL_D100, 0xFFFF, 0xFF, 0}, + {"WtrF100", fProfile::OBJ_WATER_F100, fProfile::OBJ_WATER_F100, 0xFFFF, 0xFF, 0}, + { "WtrJar", fProfile::OBJ_WATER_JAR, fProfile::OBJ_WATER_JAR, 552, 0xFF, 0}, + { "WtrMrk", fProfile::OBJ_WATER_MARK, fProfile::OBJ_WATER_MARK, 0xFFFF, 0xFF, 0}, + {"WtrShld", fProfile::OBJ_WATER_SHIELD, fProfile::OBJ_WATER_SHIELD, 0xFFFF, 0xFF, 0}, + { "chest", fProfile::OBJ_CHEST, fProfile::OBJ_CHEST, 0xFFFF, 42, 0}, + { "d2ship", fProfile::OBJ_DUNGEON_SHIP, fProfile::OBJ_DUNGEON_SHIP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "fruit", fProfile::OBJ_FRUIT, fProfile::OBJ_FRUIT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "ftower", fProfile::OBJ_TOWER_D101, fProfile::OBJ_TOWER_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "lock", fProfile::OBJ_SHUTTER_LOCK, fProfile::OBJ_SHUTTER_LOCK, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"needleU", fProfile::OBJ_NEEDLE_UNDERGROUND, fProfile::OBJ_NEEDLE_UNDERGROUND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"rpiller", fProfile::OBJ_ROLL_PILLAR, fProfile::OBJ_ROLL_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "sandD1", fProfile::OBJ_SAND_FLOOR, fProfile::OBJ_SAND_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"sandflr", fProfile::OBJ_SAND_FLOOR, fProfile::OBJ_SAND_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"saveObj", fProfile::OBJ_SAVE, fProfile::OBJ_SAVE, 515, 0xFF, 0}, + { "skull", fProfile::OBJ_SKULL, fProfile::OBJ_SKULL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"sw_whip", fProfile::OBJ_SW_WHIPLEVER, fProfile::OBJ_SW_WHIPLEVER, 522, SND_SOURCE_OBJECT, 0}, + { "swsht", fProfile::OBJ_SWITCH_SHUTTER, fProfile::OBJ_SWITCH_SHUTTER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"swsyako", fProfile::OBJ_SW_SYAKO, fProfile::OBJ_SW_SYAKO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"syashtr", fProfile::OBJ_SYAKO_SHUTTER, fProfile::OBJ_SYAKO_SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"trlshut", fProfile::OBJ_TROLLEY_SHUTTER, fProfile::OBJ_TROLLEY_SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"trolley", fProfile::OBJ_TROLLEY, fProfile::OBJ_TROLLEY, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "tware", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "vmSand", fProfile::OBJ_VSD, fProfile::OBJ_VSD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"weather", fProfile::WEATHER_TAG, fProfile::WEATHER_TAG, 0xFFFF, 0xFF, 0}, + { "wfall", fProfile::OBJ_WATERFALL_D101, fProfile::OBJ_WATERFALL_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "wnleaf", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "wnut", fProfile::OBJ_WATER_NUT, fProfile::OBJ_WATER_NUT, 0xFFFF, SND_SOURCE_OBJECT, 0}, +}; + +#pragma pop + +const ActorInfo *getActorInfoByName(const char *name) { + // binary search + int left = 0; + int right = ARRAY_LENGTH(sInfos) - 1; + do { + int mid = (right + left) / 2; + const ActorInfo *info = &sInfos[mid]; + int res = std::strncmp(name, info->name, 7); + if (res == 0) { + return info; + } + if (res < 0) { + right = mid - 1; + } + if (res >= 0) { + left = mid + 1; + } + } while (left <= right); + return nullptr; +} + +u16 getProfileIdForName(const char *name) { + const ActorInfo *info = getActorInfoByName(name); + if (info == nullptr) { + return fProfile::PROFILE_MAX; + } + return info->profileId; +} + +u16 getProfileId2ForName(const char *name) { + const ActorInfo *info = getActorInfoByName(name); + if (info == nullptr) { + return fProfile::PROFILE_MAX; + } + return info->profileId2; +} + +const char *getNameForProfileId(u32 profileId) { + const ActorInfo *info = &sInfos[0]; + for (int i = 0; i < ARRAY_LENGTH(sInfos); i++) { + if (profileId == info->profileId) { + return info->name; + } + info++; + } + + return nullptr; +} + +const char *getActorName(const ActorInfo *actorInfo) { + if (actorInfo != nullptr) { + return actorInfo->name; + } + return nullptr; +} + +const ActorInfo *getActorInfoByProfileAndSubtype(u32 profileId, u32 subtype) { + if (profileId == fProfile::PROFILE_MAX) { + return nullptr; + } + + const ActorInfo *info = &sInfos[0]; + for (int i = 0; i < ARRAY_LENGTH(sInfos); i++) { + if (profileId == info->profileId && subtype == info->subtype) { + return info; + } + info++; + } + + return nullptr; +} + +s32 getSoundSourceCategoryForName(const char *name) { + const ActorInfo *info = getActorInfoByName(name); + if (info != nullptr) { + return info->soundSourceCategory; + } + return -1; +} From 5b896bb471765ced514a8f9f188775749cb974d5 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 7 Jun 2025 15:30:24 +0200 Subject: [PATCH 88/91] A few more --- config/SOUE01/symbols.txt | 2 +- include/d/a/d_a_base.h | 2 +- include/toBeSorted/actor_info.h | 11 +++++++++++ src/d/a/d_a_base.cpp | 9 ++++----- src/toBeSorted/actor_info.cpp | 6 +++--- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 25e8c5c0..cc91afff 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -1031,7 +1031,7 @@ __ct__9dAcBase_cFv = .text:0x8002C3B0; // type:function size:0x178 __dt__7dBase_cFv = .text:0x8002C530; // type:function size:0x58 __dt__9dAcBase_cFv = .text:0x8002C590; // type:function size:0xB4 setTempCreateParams__9dAcBase_cFP7mVec3_cP7mAng3_cP7mVec3_clUlP9dAcBase_cUcUsScPC9ActorInfo = .text:0x8002C650; // type:function size:0x34 -FUN_8002c690__9dAcBase_cFv = .text:0x8002C690; // type:function size:0x78 +createSoundSource__9dAcBase_cFv = .text:0x8002C690; // type:function size:0x78 initAllocatorWork1Heap__9dAcBase_cFiPci = .text:0x8002C710; // type:function size:0xC initAllocator__9dAcBase_cFiPcPQ23EGG4Heapi = .text:0x8002C720; // type:function size:0x8C addActorToRoom__9dAcBase_cFl = .text:0x8002C7B0; // type:function size:0x88 diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index 06868d39..546967d9 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -252,7 +252,7 @@ public: s8 viewClipIdx, const ActorInfo *actorInfo ); - /* 8002c690 */ SoundSource *FUN_8002c690(); + /* 8002c690 */ SoundSource *createSoundSource(); /* 8002c710 */ int initAllocatorWork1Heap(int size, char *name, int align); /* 8002c720 */ int initAllocator(int size, char *name, EGG::Heap *heap, int align); /* 8002c7b0 */ bool addActorToRoom(s32 roomId); diff --git a/include/toBeSorted/actor_info.h b/include/toBeSorted/actor_info.h index e48fcd2c..d6843009 100644 --- a/include/toBeSorted/actor_info.h +++ b/include/toBeSorted/actor_info.h @@ -6,7 +6,16 @@ // TODO: Expand when we figure out what the other entries have in common enum SoundSourceCategory_e { SND_SOURCE_PLAYER = 0, + SND_SOURCE_PLAYER_HEAD = 1, + SND_SOURCE_NET = 2, + SND_SOURCE_BLADE = 3, + SND_SOURCE_SHIELD = 4, + SND_SOURCE_WHIP = 5, + SND_SOURCE_ARROW = 7, + + SND_SOURCE_HOOKSHOT = 9, + SND_SOURCE_BULLET = 29, SND_SOURCE_OBJECT = 32, SND_SOURCE_ITEM = 35, @@ -18,6 +27,8 @@ enum SoundSourceCategory_e { SND_SOURCE_PLAYER_BIRD = 45, SND_SOURCE_INSECT = 49, SND_SOURCE_NPC_NRM = 51, + SND_SOURCE_NPC_DRAGON = 52, + SND_SOURCE_TG_SOUND = 53, SND_SOURCE_SW_HARP = 56, }; diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index 87386d46..3d89800d 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -110,8 +110,7 @@ void dAcBase_c::setTempCreateParams( s_Create_ActorInfo = actorInfo; } -// has regswap -SoundSource *dAcBase_c::FUN_8002c690() { +SoundSource *dAcBase_c::createSoundSource() { if (mpActorInfo == nullptr) { return nullptr; } @@ -121,8 +120,8 @@ SoundSource *dAcBase_c::FUN_8002c690() { return nullptr; } - const char *objName = getActorName(mpActorInfo); - return soundForActorInitRelated_803889c0(soundSourceCategory, this, objName, subtype); + const char *actorName = getActorName(mpActorInfo); + return soundForActorInitRelated_803889c0(soundSourceCategory, this, actorName, subtype); } int dAcBase_c::initAllocatorWork1Heap(int size, char *name, int align) { @@ -133,7 +132,7 @@ int dAcBase_c::initAllocator(int size, char *name, EGG::Heap *heap, int align) { if (!heap_allocator.createNewTempFrmHeap(size, heap, name, 0x20, 0)) { return 0; } - sound_source = FUN_8002c690(); + sound_source = createSoundSource(); int success = createHeap(); heap_allocator.adjustFrmHeapRestoreCurrent(); return success; diff --git a/src/toBeSorted/actor_info.cpp b/src/toBeSorted/actor_info.cpp index b4868b0d..e3228135 100644 --- a/src/toBeSorted/actor_info.cpp +++ b/src/toBeSorted/actor_info.cpp @@ -424,7 +424,7 @@ static const ActorInfo sInfos[] = { {"Musasab", fProfile::OBJ_MUSASABI, fProfile::OBJ_MUSASABI, 321, SND_SOURCE_OBJECT, 0}, { "MvElc", fProfile::OBJ_MOVE_ELEC, fProfile::OBJ_MOVE_ELEC, 0xFFFF, SND_SOURCE_OBJECT, 0}, {"MvLiftV", fProfile::OBJ_MOVE_LIFT_VOL, fProfile::OBJ_MOVE_LIFT_VOL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "NpcAdr", fProfile::NPC_ADR, fProfile::NPC_ADR, 310, 52, 0}, + { "NpcAdr", fProfile::NPC_ADR, fProfile::NPC_ADR, 310, SND_SOURCE_NPC_DRAGON, 0}, {"NpcAkuH", fProfile::NPC_AKU_HUMAN, fProfile::NPC_AKU_HUMAN, 346, SND_SOURCE_NPC_NRM, 0}, {"NpcAkum", fProfile::NPC_AKUMAKUN, fProfile::NPC_AKUMAKUN, 279, SND_SOURCE_NPC_NRM, 0}, {"NpcAzFa", fProfile::NPC_AZUKARIYA_FATHER, fProfile::NPC_AZUKARIYA_FATHER, 298, SND_SOURCE_NPC_NRM, 0}, @@ -445,7 +445,7 @@ static const ActorInfo sInfos[] = { {"NpcDrbC", fProfile::NPC_DRBC, fProfile::NPC_DRBC, 320, 43, 0}, { "NpcDsk", fProfile::NPC_DSK, fProfile::NPC_DSK, 258, SND_SOURCE_NPC_NRM, 0}, {"NpcDskN", fProfile::NPC_DAISHINKAN_N, fProfile::NPC_DAISHINKAN_N, 340, SND_SOURCE_NPC_NRM, 0}, - { "NpcFdr", fProfile::NPC_FDR, fProfile::NPC_FDR, 318, 52, 0}, + { "NpcFdr", fProfile::NPC_FDR, fProfile::NPC_FDR, 318, SND_SOURCE_NPC_DRAGON, 0}, { "NpcGhm", fProfile::NPC_GHM, fProfile::NPC_GHM, 323, 50, 0}, {"NpcGost", fProfile::NPC_TOILET_GHOST, fProfile::NPC_TOILET_GHOST, 300, SND_SOURCE_NPC_NRM, 0}, { "NpcGra", fProfile::NPC_GRA, fProfile::NPC_GRA, 302, SND_SOURCE_NPC_NRM, 0}, @@ -514,7 +514,7 @@ static const ActorInfo sInfos[] = { { "NpcSui", fProfile::NPC_SUISEI, fProfile::NPC_SUISEI, 344, 43, 0}, {"NpcSuiN", fProfile::NPC_SUISEI_NORMAL, fProfile::NPC_SUISEI_NORMAL, 309, 50, 0}, {"NpcSuiS", fProfile::NPC_SUISEI_SUB, fProfile::NPC_SUISEI_SUB, 309, 43, 0}, - { "NpcTdr", fProfile::NPC_TDR, fProfile::NPC_TDR, 322, 52, 0}, + { "NpcTdr", fProfile::NPC_TDR, fProfile::NPC_TDR, 322, SND_SOURCE_NPC_DRAGON, 0}, {"NpcTdrB", fProfile::NPC_TDRB, fProfile::NPC_TDRB, 322, SND_SOURCE_OBJECT, 0}, { "NpcTds", fProfile::NPC_TDS, fProfile::NPC_TDS, 478, 0xFF, 0}, { "NpcTer", fProfile::NPC_TERRY, fProfile::NPC_TERRY, 264, SND_SOURCE_NPC_NRM, 0}, From e78895aa3597cd7bdb77534c07a8cac63fbbba57 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 7 Jun 2025 16:38:16 +0200 Subject: [PATCH 89/91] rename --- config/SOUE01/symbols.txt | 2 +- include/toBeSorted/actor_info.h | 6 +++--- src/d/a/d_a_base.cpp | 6 +++--- src/toBeSorted/actor_info.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index cc91afff..c8116a8c 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -3045,7 +3045,7 @@ getProfileId2ForName__FPCc = .text:0x8006A630; // type:function size:0x34 getNameForProfileId__FUl = .text:0x8006A670; // type:function size:0xB8 getActorName__FPC9ActorInfo = .text:0x8006A730; // type:function size:0x18 getActorInfoByProfileAndSubtype__FUlUl = .text:0x8006A750; // type:function size:0x134 -getSoundSourceCategoryForName__FPCc = .text:0x8006A890; // type:function size:0x38 +getSoundSourceTypeForName__FPCc = .text:0x8006A890; // type:function size:0x38 fn_8006A8D0 = .text:0x8006A8D0; // type:function size:0x1DC fn_8006AAB0 = .text:0x8006AAB0; // type:function size:0x85C fn_8006B310 = .text:0x8006B310; // type:function size:0x94 diff --git a/include/toBeSorted/actor_info.h b/include/toBeSorted/actor_info.h index d6843009..053a400c 100644 --- a/include/toBeSorted/actor_info.h +++ b/include/toBeSorted/actor_info.h @@ -4,7 +4,7 @@ #include "common.h" // TODO: Expand when we figure out what the other entries have in common -enum SoundSourceCategory_e { +enum SoundSourceType_e { SND_SOURCE_PLAYER = 0, SND_SOURCE_PLAYER_HEAD = 1, SND_SOURCE_NET = 2, @@ -40,7 +40,7 @@ struct ActorInfo { /* 0x04 */ u16 profileId; /* 0x06 */ u16 profileId2; /* 0x08 */ u16 fiTextEntryId; // also used for kill counters - /* 0x0A */ s8 soundSourceCategory; + /* 0x0A */ s8 soundSourceType; /* 0x0B */ u8 subtype; }; @@ -50,6 +50,6 @@ u16 getProfileId2ForName(const char *name); const char *getNameForProfileId(u32 profileId); const char *getActorName(const ActorInfo *actorInfo); const ActorInfo *getActorInfoByProfileAndSubtype(u32 profileId, u32 subtype); -s32 getSoundSourceCategoryForName(const char *name); +s32 getSoundSourceTypeForName(const char *name); #endif diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index 3d89800d..381245d2 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -115,13 +115,13 @@ SoundSource *dAcBase_c::createSoundSource() { return nullptr; } - s32 soundSourceCategory = mpActorInfo->soundSourceCategory; - if (soundSourceCategory == -1) { + s32 soundSourceType = mpActorInfo->soundSourceType; + if (soundSourceType == -1) { return nullptr; } const char *actorName = getActorName(mpActorInfo); - return soundForActorInitRelated_803889c0(soundSourceCategory, this, actorName, subtype); + return soundForActorInitRelated_803889c0(soundSourceType, this, actorName, subtype); } int dAcBase_c::initAllocatorWork1Heap(int size, char *name, int align) { diff --git a/src/toBeSorted/actor_info.cpp b/src/toBeSorted/actor_info.cpp index e3228135..3d45f9d6 100644 --- a/src/toBeSorted/actor_info.cpp +++ b/src/toBeSorted/actor_info.cpp @@ -863,10 +863,10 @@ const ActorInfo *getActorInfoByProfileAndSubtype(u32 profileId, u32 subtype) { return nullptr; } -s32 getSoundSourceCategoryForName(const char *name) { +s32 getSoundSourceTypeForName(const char *name) { const ActorInfo *info = getActorInfoByName(name); if (info != nullptr) { - return info->soundSourceCategory; + return info->soundSourceType; } return -1; } From b38fd62a1e30eb3a3b16c563ff39caf483a1202c Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 7 Jun 2025 16:48:22 +0200 Subject: [PATCH 90/91] Two more --- include/toBeSorted/actor_info.h | 4 ++-- src/toBeSorted/actor_info.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/toBeSorted/actor_info.h b/include/toBeSorted/actor_info.h index 053a400c..415a7303 100644 --- a/include/toBeSorted/actor_info.h +++ b/include/toBeSorted/actor_info.h @@ -11,9 +11,9 @@ enum SoundSourceType_e { SND_SOURCE_BLADE = 3, SND_SOURCE_SHIELD = 4, SND_SOURCE_WHIP = 5, - + SND_SOURCE_BOOMERANG = 6, SND_SOURCE_ARROW = 7, - + SND_SOURCE_BOMB = 8, SND_SOURCE_HOOKSHOT = 9, SND_SOURCE_BULLET = 29, diff --git a/src/toBeSorted/actor_info.cpp b/src/toBeSorted/actor_info.cpp index 3d45f9d6..961d30ba 100644 --- a/src/toBeSorted/actor_info.cpp +++ b/src/toBeSorted/actor_info.cpp @@ -5,7 +5,6 @@ #include - #pragma push #pragma readonly_strings on // sorted alphabetically to facilitate binary search @@ -146,9 +145,9 @@ static const ActorInfo sInfos[] = { {"BltObsT", fProfile::TAG_BELT_OBSTACLE, fProfile::TAG_BELT_OBSTACLE, 0xFFFF, 59, 0}, {"BlwCoal", fProfile::OBJ_BLOW_COAL, fProfile::OBJ_BLOW_COAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, { "Boat", fProfile::OBJ_BOAT, fProfile::OBJ_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Bomb", fProfile::BOMB, fProfile::BOMB, 0xFFFF, 8, 0}, + { "Bomb", fProfile::BOMB, fProfile::BOMB, 0xFFFF, SND_SOURCE_BOMB, 0}, { "Bombf", fProfile::BOMBF, fProfile::BOMBF, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Boom", fProfile::BOOMERANG, fProfile::BOOMERANG, 0xFFFF, 6, 0}, + { "Boom", fProfile::BOOMERANG, fProfile::BOOMERANG, 0xFFFF, SND_SOURCE_BOOMERANG, 0}, {"BoxCage", fProfile::OBJ_BOXCAGE_F300, fProfile::OBJ_BOXCAGE_F300, 0xFFFF, SND_SOURCE_OBJECT, 0}, { "BrdMob", fProfile::BIRD_MOB, fProfile::BIRD_MOB, 0xFFFF, 0xFF, 0}, { "BrgBn", fProfile::OBJ_BRIDGE_BONE, fProfile::OBJ_BRIDGE_BONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, From 031102f74fd3bbef6c46c0f6e742881abdf3acd1 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 7 Jun 2025 19:21:10 +0200 Subject: [PATCH 91/91] I guess? --- include/toBeSorted/actor_info.h | 20 ++++++++++++++++++++ src/toBeSorted/actor_info.cpp | 16 ++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/include/toBeSorted/actor_info.h b/include/toBeSorted/actor_info.h index 415a7303..6ae21f31 100644 --- a/include/toBeSorted/actor_info.h +++ b/include/toBeSorted/actor_info.h @@ -5,8 +5,11 @@ // TODO: Expand when we figure out what the other entries have in common enum SoundSourceType_e { + // 0-1: Player (0) SND_SOURCE_PLAYER = 0, SND_SOURCE_PLAYER_HEAD = 1, + + // 2-9: Equipment (1) SND_SOURCE_NET = 2, SND_SOURCE_BLADE = 3, SND_SOURCE_SHIELD = 4, @@ -16,20 +19,37 @@ enum SoundSourceType_e { SND_SOURCE_BOMB = 8, SND_SOURCE_HOOKSHOT = 9, + // 10-31: Enemy? (2) + SND_SOURCE_BIGBOSS = 20, + SND_SOURCE_GIRAHUMU_3 = 24, SND_SOURCE_BULLET = 29, + + // 32-42: Object? (3) SND_SOURCE_OBJECT = 32, + SND_SOURCE_BAMBOO = 34, SND_SOURCE_ITEM = 35, SND_SOURCE_TERRY_SHOP = 36, SND_SOURCE_TIME_STONE = 37, SND_SOURCE_CLEF = 38, SND_SOURCE_SHUTTER = 39, + + // 43-52: Npc (4) SND_SOURCE_KENSEI = 44, SND_SOURCE_PLAYER_BIRD = 45, SND_SOURCE_INSECT = 49, SND_SOURCE_NPC_NRM = 51, SND_SOURCE_NPC_DRAGON = 52, + + // 53: TagSound (5) SND_SOURCE_TG_SOUND = 53, + + // 54-57: Harp Related (6) + SND_SOURCE_OBJECT_WARP = 55, SND_SOURCE_SW_HARP = 56, + + // 58: ? (7) + + // 59: ? (9) }; /** diff --git a/src/toBeSorted/actor_info.cpp b/src/toBeSorted/actor_info.cpp index 961d30ba..830497ff 100644 --- a/src/toBeSorted/actor_info.cpp +++ b/src/toBeSorted/actor_info.cpp @@ -95,19 +95,19 @@ static const ActorInfo sInfos[] = { {"BBParts", fProfile::OBJ_BB_BROKEN_PARTS, fProfile::OBJ_BB_BROKEN_PARTS, 0xFFFF, 0xFF, 0}, {"BBQuake", fProfile::T_QUAKE, fProfile::T_QUAKE, 0xFFFF, SND_SOURCE_OBJECT, 0}, { "BBbrg", fProfile::OBJ_BB_BRIDGE, fProfile::OBJ_BB_BRIDGE, 0xFFFF, 0xFF, 0}, - {"BBigBo2", fProfile::B_BIGBOSS2, fProfile::B_BIGBOSS2, 53, 20, 0}, - {"BBigBo3", fProfile::B_BIGBOSS3, fProfile::B_BIGBOSS3, 54, 20, 0}, + {"BBigBo2", fProfile::B_BIGBOSS2, fProfile::B_BIGBOSS2, 53, SND_SOURCE_BIGBOSS, 0}, + {"BBigBo3", fProfile::B_BIGBOSS3, fProfile::B_BIGBOSS3, 54, SND_SOURCE_BIGBOSS, 0}, {"BBigBoB", fProfile::B_BIGBOSS_BASE, fProfile::B_BIGBOSS_BASE, 0xFFFF, 0xFF, 0}, - {"BBigBos", fProfile::B_BIGBOSS, fProfile::B_BIGBOSS, 52, 20, 0}, + {"BBigBos", fProfile::B_BIGBOSS, fProfile::B_BIGBOSS, 52, SND_SOURCE_BIGBOSS, 0}, {"BBigShc", fProfile::B_BBSHWV, fProfile::B_BBSHWV, 0xFFFF, SND_SOURCE_OBJECT, 0}, { "BBombf", fProfile::OBJ_BIGBOMB_FLOWER, fProfile::OBJ_BIGBOMB_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, {"BDrD101", fProfile::OBJ_DOOR_BOSSD101, fProfile::OBJ_DOOR_BOSSD101, 0xFFFF, SND_SOURCE_OBJECT, 0}, { "BGh", fProfile::B_GIRAHIMU, fProfile::B_GIRAHIMU, 49, 19, 0}, { "BGh2", fProfile::B_GIRAHIMU2, fProfile::B_GIRAHIMU2, 50, 19, 0}, { "BGh3B", fProfile::B_GIRAHIMU3_BASE, fProfile::B_GIRAHIMU3_BASE, 0xFFFF, 0xFF, 0}, - {"BGh3Fst", fProfile::B_GIRAHIMU3_FIRST, fProfile::B_GIRAHIMU3_FIRST, 51, 24, 0}, - {"BGh3Snd", fProfile::B_GIRAHIMU3_SECOND, fProfile::B_GIRAHIMU3_SECOND, 89, 24, 0}, - {"BGh3Trd", fProfile::B_GIRAHIMU3_THIRD, fProfile::B_GIRAHIMU3_THIRD, 90, 24, 0}, + {"BGh3Fst", fProfile::B_GIRAHIMU3_FIRST, fProfile::B_GIRAHIMU3_FIRST, 51, SND_SOURCE_GIRAHUMU_3, 0}, + {"BGh3Snd", fProfile::B_GIRAHIMU3_SECOND, fProfile::B_GIRAHIMU3_SECOND, 89, SND_SOURCE_GIRAHUMU_3, 0}, + {"BGh3Trd", fProfile::B_GIRAHIMU3_THIRD, fProfile::B_GIRAHIMU3_THIRD, 90, SND_SOURCE_GIRAHUMU_3, 0}, { "BGhB", fProfile::B_GIRAHIMU_BASE, fProfile::B_GIRAHIMU_BASE, 0xFFFF, 0xFF, 0}, { "BKr", fProfile::B_KR, fProfile::B_KR, 77, 22, 0}, { "BKrA", fProfile::B_KRA, fProfile::B_KRA, 77, 15, 0}, @@ -115,7 +115,7 @@ static const ActorInfo sInfos[] = { {"BLasBos", fProfile::B_LASTBOSS, fProfile::B_LASTBOSS, 0xFFFF, 19, 0}, { "BMg", fProfile::B_MG, fProfile::B_MG, 10, 21, 0}, { "BSpUp", fProfile::OBJ_BIRD_SP_UP, fProfile::OBJ_BIRD_SP_UP, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Bamboo", fProfile::OBJ_BAMBOO, fProfile::OBJ_BAMBOO, 533, 34, 0}, + { "Bamboo", fProfile::OBJ_BAMBOO, fProfile::OBJ_BAMBOO, 533, SND_SOURCE_BAMBOO, 0}, {"BarPsTg", fProfile::TAG_BARREL_POS, fProfile::TAG_BARREL_POS, 0xFFFF, 0xFF, 0}, { "Barrel", fProfile::OBJ_BARREL, fProfile::OBJ_BARREL, 0xFFFF, SND_SOURCE_OBJECT, 0}, {"BarrlTg", fProfile::TAG_BARREL, fProfile::TAG_BARREL, 0xFFFF, 0xFF, 0}, @@ -740,7 +740,7 @@ static const ActorInfo sInfos[] = { { "WFF102", fProfile::OBJ_WATERFALL_F102, fProfile::OBJ_WATERFALL_F102, 0xFFFF, 0xFF, 0}, { "Warp", fProfile::TIME_AREA, fProfile::TIME_AREA, 0xFFFF, SND_SOURCE_OBJECT, 0}, { "WarpH", fProfile::OBJ_WARP_HOLE, fProfile::OBJ_WARP_HOLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"WarpObj", fProfile::OBJ_WARP, fProfile::OBJ_WARP, 547, 55, 0}, + {"WarpObj", fProfile::OBJ_WARP, fProfile::OBJ_WARP, 547, SND_SOURCE_OBJECT_WARP, 0}, {"WaterSW", fProfile::OBJ_WATER_SWITCH, fProfile::OBJ_WATER_SWITCH, 526, SND_SOURCE_OBJECT, 0}, {"WaterSf", fProfile::OBJ_WATER_SURFACE, fProfile::OBJ_WATER_SURFACE, 0xFFFF, 0xFF, 0}, {"WaterSp", fProfile::OBJ_WATER_SPOUT, fProfile::OBJ_WATER_SPOUT, 0xFFFF, 0xFF, 0},