From 87d13aa2772c2d9e349ae3b366b77a035b70d698 Mon Sep 17 00:00:00 2001 From: jonschz <17198703+jonschz@users.noreply.github.com> Date: Sun, 2 Mar 2025 19:59:03 +0100 Subject: [PATCH] Add various BETA10 references and fixes (#1398) Co-authored-by: jonschz --- LEGO1/lego/legoomni/include/legoanimactor.h | 3 +++ LEGO1/lego/legoomni/include/legosoundmanager.h | 2 ++ LEGO1/lego/legoomni/src/actors/act2actor.cpp | 7 +++++++ LEGO1/lego/legoomni/src/audio/lego3dsound.cpp | 1 + LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp | 3 +++ LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp | 6 ++++++ LEGO1/library_msvc.h | 7 +++++++ LEGO1/omni/include/mxsoundmanager.h | 1 + LEGO1/omni/include/mxticklemanager.h | 8 ++++++++ LEGO1/omni/src/audio/mxsoundmanager.cpp | 1 + LEGO1/omni/src/common/mxticklemanager.cpp | 7 +++++++ reccmp-project.yml | 1 + 12 files changed, 47 insertions(+) diff --git a/LEGO1/lego/legoomni/include/legoanimactor.h b/LEGO1/lego/legoomni/include/legoanimactor.h index 112f215c..5b752586 100644 --- a/LEGO1/lego/legoomni/include/legoanimactor.h +++ b/LEGO1/lego/legoomni/include/legoanimactor.h @@ -105,6 +105,9 @@ protected: // TEMPLATE: LEGO1 0x1001c7e0 // vector >::_Destroy +// TEMPLATE: BETA10 0x1000fbc0 +// vector >::begin + // TEMPLATE: LEGO1 0x1001c9e0 // uninitialized_fill_n diff --git a/LEGO1/lego/legoomni/include/legosoundmanager.h b/LEGO1/lego/legoomni/include/legosoundmanager.h index 696eaf1c..d0320320 100644 --- a/LEGO1/lego/legoomni/include/legosoundmanager.h +++ b/LEGO1/lego/legoomni/include/legosoundmanager.h @@ -6,6 +6,7 @@ class LegoCacheSoundManager; // VTABLE: LEGO1 0x100d6b10 +// VTABLE: BETA10 0x101bec30 // SIZE 0x44 class LegoSoundManager : public MxSoundManager { public: @@ -17,6 +18,7 @@ public: MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread) override; // vtable+0x30 // SYNTHETIC: LEGO1 0x10029920 + // SYNTHETIC: BETA10 0x100d0660 // LegoSoundManager::`scalar deleting destructor' void UpdateListener(const float* p_position, const float* p_direction, const float* p_up, const float* p_velocity); diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp index 014f03a0..d810c975 100644 --- a/LEGO1/lego/legoomni/src/actors/act2actor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -153,8 +153,15 @@ void Act2Actor::FUN_10018980() assert(m_shootAnim); m_unk0x38 = SoundManager()->GetCacheSoundManager()->FindSoundByKey("xarrow"); +#ifdef BETA10 + // actually 0x2c and 0x30 + m_unk0x38 = SoundManager()->GetCacheSoundManager()->FindSoundByKey("bcrash"); + m_unk0x38->SetDistance(35, 60); + m_unk0x38->SetDistance(35, 60); +#else m_unk0x38->SetDistance(45, 55); m_roi->SetVisibility(TRUE); +#endif } // FUNCTION: LEGO1 0x100189f0 diff --git a/LEGO1/lego/legoomni/src/audio/lego3dsound.cpp b/LEGO1/lego/legoomni/src/audio/lego3dsound.cpp index 508cd395..81112ea8 100644 --- a/LEGO1/lego/legoomni/src/audio/lego3dsound.cpp +++ b/LEGO1/lego/legoomni/src/audio/lego3dsound.cpp @@ -296,6 +296,7 @@ void Lego3DSound::Reset() } // FUNCTION: LEGO1 0x10011cf0 +// FUNCTION: BETA10 0x10039fe0 MxS32 Lego3DSound::SetDistance(MxS32 p_min, MxS32 p_max) { if (MxOmni::IsSound3D()) { diff --git a/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp b/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp index 289e4ea3..34be4519 100644 --- a/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp +++ b/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp @@ -61,8 +61,11 @@ MxResult LegoCacheSoundManager::Tickle() } // FUNCTION: LEGO1 0x1003d170 +// FUNCTION: BETA10 0x1006539d LegoCacheSound* LegoCacheSoundManager::FindSoundByKey(const char* p_key) { + // This function has changed completely since BETA10, but its calls suggest the match is correct + char* key = new char[strlen(p_key) + 1]; strcpy(key, p_key); diff --git a/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp b/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp index 2832d825..c92f2bea 100644 --- a/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp +++ b/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp @@ -4,6 +4,8 @@ #include "mxautolock.h" #include "mxomni.h" +#include + DECOMP_SIZE_ASSERT(LegoSoundManager, 0x44) // FUNCTION: LEGO1 0x100298a0 @@ -37,6 +39,7 @@ void LegoSoundManager::Destroy(MxBool p_fromDestructor) } // FUNCTION: LEGO1 0x100299f0 +// FUNCTION: BETA10 0x100d0129 MxResult LegoSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread) { MxBool locked = FALSE; @@ -67,6 +70,7 @@ MxResult LegoSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread) } m_cacheSoundManager = new LegoCacheSoundManager; + assert(m_cacheSoundManager); result = SUCCESS; } @@ -83,12 +87,14 @@ done: } // FUNCTION: LEGO1 0x1002a390 +// FUNCTION: BETA10 0x100d02ed void LegoSoundManager::Destroy() { Destroy(FALSE); } // FUNCTION: LEGO1 0x1002a3a0 +// FUNCTION: BETA10 0x100d030d MxResult LegoSoundManager::Tickle() { MxSoundManager::Tickle(); diff --git a/LEGO1/library_msvc.h b/LEGO1/library_msvc.h index 2ae816e7..51d0cba1 100644 --- a/LEGO1/library_msvc.h +++ b/LEGO1/library_msvc.h @@ -783,4 +783,11 @@ // GLOBAL: BETA10 0x101faf78 // __app_type +// GLOBAL: LEGO1 0x100db6e0 +// GUID_SysKeyboard + +// Cannot be handled right now due to anonymous pointer in struct +// // GLOBAL: LEGO1 0x10098f80 +// c_dfDIKeyboard + #endif diff --git a/LEGO1/omni/include/mxsoundmanager.h b/LEGO1/omni/include/mxsoundmanager.h index 3d7c35c7..36568ef3 100644 --- a/LEGO1/omni/include/mxsoundmanager.h +++ b/LEGO1/omni/include/mxsoundmanager.h @@ -8,6 +8,7 @@ #include // VTABLE: LEGO1 0x100dc128 +// VTABLE: BETA10 0x101c1ce8 // SIZE 0x3c class MxSoundManager : public MxAudioManager { public: diff --git a/LEGO1/omni/include/mxticklemanager.h b/LEGO1/omni/include/mxticklemanager.h index 17837479..1fae7a43 100644 --- a/LEGO1/omni/include/mxticklemanager.h +++ b/LEGO1/omni/include/mxticklemanager.h @@ -34,10 +34,13 @@ private: typedef list MxTickleClientPtrList; // VTABLE: LEGO1 0x100d86d8 +// VTABLE: BETA10 0x101bc9d0 // SIZE 0x14 class MxTickleManager : public MxCore { public: + // FUNCTION: BETA10 0x100937c0 MxTickleManager() {} + ~MxTickleManager() override; MxResult Tickle() override; // vtable+0x08 @@ -47,6 +50,7 @@ public: virtual MxTime GetClientTickleInterval(MxCore* p_client); // vtable+0x20 // SYNTHETIC: LEGO1 0x1005a510 + // SYNTHETIC: BETA10 0x100962f0 // MxTickleManager::`scalar deleting destructor' private: @@ -58,7 +62,11 @@ private: // TEMPLATE: LEGO1 0x1005a4a0 // list >::~list > +// TEMPLATE: BETA10 0x10093870 +// List::List + // TEMPLATE: LEGO1 0x1005a530 +// TEMPLATE: BETA10 0x10096340 // List::~List #endif // MXTICKLEMANAGER_H diff --git a/LEGO1/omni/src/audio/mxsoundmanager.cpp b/LEGO1/omni/src/audio/mxsoundmanager.cpp index e97f7f29..ccfe2dc2 100644 --- a/LEGO1/omni/src/audio/mxsoundmanager.cpp +++ b/LEGO1/omni/src/audio/mxsoundmanager.cpp @@ -67,6 +67,7 @@ void MxSoundManager::Destroy(MxBool p_fromDestructor) } // FUNCTION: LEGO1 0x100ae8b0 +// FUNCTION: BETA10 0x10132e94 MxResult MxSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread) { MxResult status = FAILURE; diff --git a/LEGO1/omni/src/common/mxticklemanager.cpp b/LEGO1/omni/src/common/mxticklemanager.cpp index 59fae3f3..64933fb7 100644 --- a/LEGO1/omni/src/common/mxticklemanager.cpp +++ b/LEGO1/omni/src/common/mxticklemanager.cpp @@ -5,6 +5,8 @@ #include "mxtimer.h" #include "mxtypes.h" +#include + #define TICKLE_MANAGER_FLAG_DESTROY 0x01 DECOMP_SIZE_ASSERT(MxTickleClient, 0x10); @@ -30,6 +32,7 @@ MxTickleManager::~MxTickleManager() } // FUNCTION: LEGO1 0x100bdde0 +// FUNCTION: BETA10 0x1013eb1f MxResult MxTickleManager::Tickle() { MxTime time = Timer()->GetTime(); @@ -60,6 +63,7 @@ MxResult MxTickleManager::Tickle() } // FUNCTION: LEGO1 0x100bde80 +// FUNCTION: BETA10 0x1013ec5f void MxTickleManager::RegisterClient(MxCore* p_client, MxTime p_interval) { MxTime interval = GetClientTickleInterval(p_client); @@ -72,6 +76,7 @@ void MxTickleManager::RegisterClient(MxCore* p_client, MxTime p_interval) } // FUNCTION: LEGO1 0x100bdf60 +// FUNCTION: BETA10 0x1013edd0 void MxTickleManager::UnregisterClient(MxCore* p_client) { MxTickleClientPtrList::iterator it = m_clients.begin(); @@ -87,6 +92,7 @@ void MxTickleManager::UnregisterClient(MxCore* p_client) } // FUNCTION: LEGO1 0x100bdfa0 +// FUNCTION: BETA10 0x1013ee6d void MxTickleManager::SetClientTickleInterval(MxCore* p_client, MxTime p_interval) { for (MxTickleClientPtrList::iterator it = m_clients.begin(); it != m_clients.end(); it++) { @@ -99,6 +105,7 @@ void MxTickleManager::SetClientTickleInterval(MxCore* p_client, MxTime p_interva } // FUNCTION: LEGO1 0x100be000 +// FUNCTION: BETA10 0x1013ef2d MxTime MxTickleManager::GetClientTickleInterval(MxCore* p_client) { MxTickleClientPtrList::iterator it = m_clients.begin(); diff --git a/reccmp-project.yml b/reccmp-project.yml index 009c737f..b433ce46 100644 --- a/reccmp-project.yml +++ b/reccmp-project.yml @@ -35,5 +35,6 @@ targets: - 0x100f8ad0 - 0x100fa200 - 0x100f9780 + - 0x100fb080 # memset etc. - 0x100f9570