From d63c21cbef934131a76a9e56a29c45651bfb83c5 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 15 Oct 2024 16:45:15 -0700 Subject: [PATCH] Update MusyX initial CScriptSound work --- config/GM8E01_00/symbols.txt | 8 ++++---- config/GM8E01_01/symbols.txt | 6 +++--- configure.py | 5 +++-- extern/musyx | 2 +- include/Kyoto/Audio/CSfxManager.hpp | 2 ++ include/MetroidPrime/CWorld.hpp | 1 + 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/config/GM8E01_00/symbols.txt b/config/GM8E01_00/symbols.txt index 2eed28ae..b011ce3d 100644 --- a/config/GM8E01_00/symbols.txt +++ b/config/GM8E01_00/symbols.txt @@ -1323,7 +1323,7 @@ __ct__6CActorF9TUniqueIdbRCQ24rstl66basic_string,Q24rs MakeActorMaterialList__FRC13CMaterialListRC16CActorParameters = .text:0x80055D28; // type:function size:0x38 scope:global CyclePauseState__6CWorldFv = .text:0x80055D60; // type:function size:0x48 scope:global StopSounds__6CWorldFv = .text:0x80055DA8; // type:function size:0xBC scope:global -StopSound__6CWorldFs = .text:0x80055E64; // type:function size:0xD8 scope:global +StopGlobalSound__6CWorldFUs = .text:0x80055E64; // type:function size:0xD8 scope:global AddGlobalSound__6CWorldFUs10CSfxHandle = .text:0x80055F3C; // type:function size:0x3C scope:global IsPlayingSound__6CWorldCFUi = .text:0x80055F78; // type:function size:0x40 scope:global MoveAreaToChain3__6CWorldF7TAreaId = .text:0x80055FB8; // type:function size:0x3C scope:global @@ -5499,13 +5499,13 @@ __ct__19TCastToPtr<6CActor>FR7CEntity = .text:0x800AFCFC; // type:function size: GetOccludedVolumeAmount__12CScriptSoundFRC9CVector3fRC13CStateManager = .text:0x800AFD60; // type:function size:0x390 scope:global Accept__12CScriptSoundFR8IVisitor = .text:0x800B00F0; // type:function size:0x38 scope:global AddToRenderer__12CScriptSoundCFRC14CFrustumPlanesRC13CStateManager = .text:0x800B0128; // type:function size:0x4 scope:global -StopSound__12CScriptSoundFv = .text:0x800B012C; // type:function size:0x8C scope:global +StopSound__12CScriptSoundFR13CStateManager = .text:0x800B012C; // type:function size:0x8C scope:global PlaySound__12CScriptSoundFR13CStateManager = .text:0x800B01B8; // type:function size:0x268 scope:global AcceptScriptMsg__12CScriptSoundF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800B0420; // type:function size:0x124 scope:global Think__12CScriptSoundFfR13CStateManager = .text:0x800B0544; // type:function size:0x3BC scope:global __dt__12CScriptSoundFv = .text:0x800B0900; // type:function size:0x60 scope:global PreThink__12CScriptSoundFfR13CStateManager = .text:0x800B0960; // type:function size:0x44 scope:global -__ct__12CScriptSoundF9TUniqueIdRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>RC11CEntityInfoRC12CTransform4fUsbfffiiiibbbbbb = .text:0x800B09A4; // type:function size:0x270 scope:global +__ct__12CScriptSoundF9TUniqueIdRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>RC11CEntityInfoRC12CTransform4fUsbfffUiUiUiUiUiUibbbbbbbi = .text:0x800B09A4; // type:function size:0x270 scope:global Render__15CScriptPlatformCFRC13CStateManager = .text:0x800B0C14; // type:function size:0xC8 scope:global GetSortingBounds__15CScriptPlatformCFRC13CStateManager = .text:0x800B0CDC; // type:function size:0x84 scope:global GetAimPosition__15CScriptPlatformCFRC13CStateManagerf = .text:0x800B0D60; // type:function size:0xB8 scope:global @@ -21617,7 +21617,7 @@ lbl_805A8E7C = .sbss:0x805A8E7C; // type:object size:0x1 data:byte lbl_805A8E80 = .sbss:0x805A8E80; // type:object size:0x1 data:byte lbl_805A8E84 = .sbss:0x805A8E84; // type:object size:0x1 data:byte lbl_805A8E88 = .sbss:0x805A8E88; // type:object size:0x8 data:byte -lbl_805A8E90 = .sbss:0x805A8E90; // type:object size:0x1 data:byte +sFirstInFrame__12CScriptSound = .sbss:0x805A8E90; // type:object size:0x1 data:byte lbl_805A8E94 = .sbss:0x805A8E94; // type:object size:0x4 data:float lbl_805A8E98 = .sbss:0x805A8E98; // type:object size:0x1 data:byte lbl_805A8E9C = .sbss:0x805A8E9C; // type:object size:0x4 data:float diff --git a/config/GM8E01_01/symbols.txt b/config/GM8E01_01/symbols.txt index fe020edf..76751fb9 100644 --- a/config/GM8E01_01/symbols.txt +++ b/config/GM8E01_01/symbols.txt @@ -1323,7 +1323,7 @@ __ct__6CActorF9TUniqueIdbRCQ24rstl66basic_string,Q24rs MakeActorMaterialList__FRC13CMaterialListRC16CActorParameters = .text:0x80055DA4; // type:function size:0x38 scope:global CyclePauseState__6CWorldFv = .text:0x80055DDC; // type:function size:0x48 scope:global StopSounds__6CWorldFv = .text:0x80055E24; // type:function size:0xBC scope:global -StopSound__6CWorldFs = .text:0x80055EE0; // type:function size:0xD8 scope:global +StopGlobalSound__6CWorldFUs = .text:0x80055EE0; // type:function size:0xD8 scope:global AddGlobalSound__6CWorldFUs10CSfxHandle = .text:0x80055FB8; // type:function size:0x3C scope:global IsPlayingSound__6CWorldCFUi = .text:0x80055FF4; // type:function size:0x40 scope:global MoveAreaToChain3__6CWorldF7TAreaId = .text:0x80056034; // type:function size:0x3C scope:global @@ -5501,7 +5501,7 @@ __ct__19TCastToPtr<6CActor>FR7CEntity = .text:0x800AFD78; // type:function size: GetOccludedVolumeAmount__12CScriptSoundFRC9CVector3fRC13CStateManager = .text:0x800AFDDC; // type:function size:0x390 scope:global Accept__12CScriptSoundFR8IVisitor = .text:0x800B016C; // type:function size:0x38 scope:global AddToRenderer__12CScriptSoundCFRC14CFrustumPlanesRC13CStateManager = .text:0x800B01A4; // type:function size:0x4 scope:global -StopSound__12CScriptSoundFv = .text:0x800B01A8; // type:function size:0x8C scope:global +StopSound__12CScriptSoundFR13CStateManager = .text:0x800B01A8; // type:function size:0x8C scope:global PlaySound__12CScriptSoundFR13CStateManager = .text:0x800B0234; // type:function size:0x268 scope:global AcceptScriptMsg__12CScriptSoundF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800B049C; // type:function size:0x124 scope:global Think__12CScriptSoundFfR13CStateManager = .text:0x800B05C0; // type:function size:0x3BC scope:global @@ -21657,7 +21657,7 @@ lbl_805A8E7C = .sbss:0x805A905C; // type:object size:0x1 scope:global data:byte lbl_805A8E80 = .sbss:0x805A9060; // type:object size:0x1 scope:global data:byte lbl_805A8E84 = .sbss:0x805A9064; // type:object size:0x1 scope:global data:byte lbl_805A8E88 = .sbss:0x805A9068; // type:object size:0x8 scope:global data:byte -lbl_805A8E90 = .sbss:0x805A9070; // type:object size:0x1 scope:global data:byte +sFirstInFrame__12CScriptSound = .sbss:0x805A9070; // type:object size:0x1 scope:global data:byte lbl_805A8E94 = .sbss:0x805A9074; // type:object size:0x4 scope:global data:float lbl_805A8E98 = .sbss:0x805A9078; // type:object size:0x1 scope:global data:byte lbl_805A8E9C = .sbss:0x805A907C; // type:object size:0x4 scope:global data:float diff --git a/configure.py b/configure.py index c67f81cb..8e311174 100755 --- a/configure.py +++ b/configure.py @@ -239,7 +239,7 @@ cflags_musyx = [ "-i include", "-i extern/musyx/include", "-i libc", - "-inline auto", + "-inline auto,depth=4", "-O4,p", "-fp hard", "-enum int", @@ -260,6 +260,7 @@ cflags_musyx_debug = [ "-g", "-sym on", "-D_DEBUG=1", + "-fp hard", "-enum int", "-Cpp_exceptions off", "-DMUSY_TARGET=MUSY_TARGET_DOLPHIN", @@ -1256,7 +1257,7 @@ config.libs = [ Object(Matching, "musyx/runtime/synth.c"), Object(Matching, "musyx/runtime/seq_api.c"), Object(Matching, "musyx/runtime/snd_synthapi.c"), - Object(NonMatching, "musyx/runtime/stream.c"), + Object(Matching, "musyx/runtime/stream.c"), Object(Matching, "musyx/runtime/synthdata.c"), Object(Matching, "musyx/runtime/synthmacros.c"), Object(Matching, "musyx/runtime/synthvoice.c"), diff --git a/extern/musyx b/extern/musyx index 4e362fd9..3fa3b480 160000 --- a/extern/musyx +++ b/extern/musyx @@ -1 +1 @@ -Subproject commit 4e362fd97967dcd5bb70a0bbc630f3a7756631f1 +Subproject commit 3fa3b480dff34a70c9bac5d0bc7b2e8c5c7a21ba diff --git a/include/Kyoto/Audio/CSfxManager.hpp b/include/Kyoto/Audio/CSfxManager.hpp index b492081f..a5eaac60 100644 --- a/include/Kyoto/Audio/CSfxManager.hpp +++ b/include/Kyoto/Audio/CSfxManager.hpp @@ -239,6 +239,8 @@ public: static rstl::auto_ptr< CToken > mTranslationTableTok; static rstl::reserved_vector< CSfxEmitterWrapper, 64 > mEmitterWrapperPool; static rstl::reserved_vector< CSfxWrapper, 64 > mWrapperPool; + + static bool IsValidHandle(CSfxHandle handle); }; #endif // _CSFXMANAGER diff --git a/include/MetroidPrime/CWorld.hpp b/include/MetroidPrime/CWorld.hpp index 0af54df0..e56e3ad4 100644 --- a/include/MetroidPrime/CWorld.hpp +++ b/include/MetroidPrime/CWorld.hpp @@ -96,6 +96,7 @@ public: return CGameArea::CConstChainIterator(x4c_chainHeads[size_t(chain)]); } static CGameArea::CConstChainIterator GetAliveAreasEnd(); + void StopGlobalSound(ushort soundId); private: enum Phase {