diff --git a/DataSpec/DNACommon/PART.cpp b/DataSpec/DNACommon/PART.cpp index efdc36b9e..2e511d1e3 100644 --- a/DataSpec/DNACommon/PART.cpp +++ b/DataSpec/DNACommon/PART.cpp @@ -362,7 +362,7 @@ void GPSM::_write(typename WriteYaml::StreamT& w) const if (x30_31_RSOP) w.writeBool("RSOP", true); if (x48_MBSP) - if (auto rec = w.enterSubRecord("MPSB")) + if (auto rec = w.enterSubRecord("MBSP")) x48_MBSP.write(w); if (x4c_SIZE) if (auto rec = w.enterSubRecord("SIZE")) diff --git a/Runtime/CGameOptions.cpp b/Runtime/CGameOptions.cpp index 307bdbd5d..36cd8b033 100644 --- a/Runtime/CGameOptions.cpp +++ b/Runtime/CGameOptions.cpp @@ -62,7 +62,7 @@ const std::pair GameOptionsRegistry[] = CPersistentOptions::CPersistentOptions(CBitStreamReader& stream) { for (int b=0 ; b<98 ; ++b) - x0_[b] = stream.ReadEncoded(8); + x0_nesState[b] = stream.ReadEncoded(8); for (int b=0 ; b<64 ; ++b) x68_[b] = stream.ReadEncoded(8); @@ -108,7 +108,7 @@ CPersistentOptions::CPersistentOptions(CBitStreamReader& stream) void CPersistentOptions::PutTo(CBitStreamWriter& w) const { for (int b=0 ; b<98 ; ++b) - w.WriteEncoded(x0_[b], 8); + w.WriteEncoded(x0_nesState[b], 8); for (int b=0 ; b<64 ; ++b) w.WriteEncoded(x68_[b], 8); diff --git a/Runtime/CGameOptions.hpp b/Runtime/CGameOptions.hpp index c80f46555..68c8d6fdf 100644 --- a/Runtime/CGameOptions.hpp +++ b/Runtime/CGameOptions.hpp @@ -55,7 +55,7 @@ extern const std::pair GameOptionsRegistry[]; class CPersistentOptions { friend class CGameState; - u8 x0_[98] = {}; + u8 x0_nesState[98] = {}; bool x68_[64] = {}; std::vector> xac_cinematicStates; /* (MLVL, Cinematic) */ u32 xbc_autoMapperKeyState = 0; @@ -112,7 +112,7 @@ public: void PutTo(CBitStreamWriter& w) const; - u8* GetNESState() { return x0_; } + u8* GetNESState() { return x0_nesState; } }; /** Options tracked per game session */ diff --git a/Runtime/CGameState.cpp b/Runtime/CGameState.cpp index 7672e13ec..19cf3662a 100644 --- a/Runtime/CGameState.cpp +++ b/Runtime/CGameState.cpp @@ -147,7 +147,7 @@ CGameState::CGameState() { x98_playerState = std::make_shared(); x9c_transManager = std::make_shared(); - x228_25_deferPowerupInit = true; + x228_25_initPowerupsAtFirstSpawn = true; if (g_MemoryCardSys) InitializeMemoryStates(); } @@ -156,14 +156,14 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx(saveIdx) { x9c_transManager = std::make_shared(); - x228_25_deferPowerupInit = true; + x228_25_initPowerupsAtFirstSpawn = true; for (u32 i = 0; i < 128; i++) x0_[i] = stream.ReadEncoded(8); u32 tsSeconds = stream.ReadEncoded(32); x228_24_hardMode = stream.ReadEncoded(1); - x228_25_deferPowerupInit = stream.ReadEncoded(1); + x228_25_initPowerupsAtFirstSpawn = stream.ReadEncoded(1); x84_mlvlId = g_ResFactory->TranslateOriginalToNew(stream.ReadEncoded(32)); MP1::CMain::EnsureWorldPakReady(x84_mlvlId); @@ -203,7 +203,7 @@ void CGameState::ImportPersistentOptions(const CPersistentOptions& opts) if (opts.xd0_27_fusionBeat) xa8_systemOptions.xd0_27_fusionBeat = true; if (&opts != &xa8_systemOptions) - memcpy(xa8_systemOptions.x0_, opts.x0_, 98); + memcpy(xa8_systemOptions.x0_nesState, opts.x0_nesState, 98); xa8_systemOptions.SetLogScanPercent(opts.GetLogScanPercent()); xa8_systemOptions.SetAllItemsCollected(opts.GetAllItemsCollected()); xa8_systemOptions.SetPlayerBeatNormalMode(opts.GetPlayerBeatNormalMode()); @@ -217,7 +217,7 @@ void CGameState::ExportPersistentOptions(CPersistentOptions& opts) const if (xa8_systemOptions.xd0_27_fusionBeat) opts.xd0_27_fusionBeat = true; if (&opts != &xa8_systemOptions) - memcpy(opts.x0_, xa8_systemOptions.x0_, 98); + memcpy(opts.x0_nesState, xa8_systemOptions.x0_nesState, 98); opts.SetPlayerFusionSuitActive(xa8_systemOptions.GetPlayerFusionSuitActive()); } @@ -235,7 +235,7 @@ void CGameState::PutTo(CBitStreamWriter& writer) const writer.WriteEncoded(CBasics::ToWiiTime(std::chrono::system_clock::now()) / CBasics::TICKS_PER_SECOND, 32); writer.WriteEncoded(x228_24_hardMode, 1); - writer.WriteEncoded(x228_25_deferPowerupInit, 1); + writer.WriteEncoded(x228_25_initPowerupsAtFirstSpawn, 1); writer.WriteEncoded(g_ResFactory->TranslateNewToOriginal(x84_mlvlId).Value(), 32); BitsToDouble conv; diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index 0acecc7be..fc49a4813 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -88,7 +88,7 @@ class CGameState struct { bool x228_24_hardMode : 1; - bool x228_25_deferPowerupInit : 1; + bool x228_25_initPowerupsAtFirstSpawn : 1; }; u8 _dummy = 0; }; diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp index 3eba07191..57b795e02 100644 --- a/Runtime/CPlayerState.cpp +++ b/Runtime/CPlayerState.cpp @@ -86,6 +86,7 @@ CPlayerState::CPlayerState(CBitStreamReader& stream) } const auto& scanStates = g_MemoryCardSys->GetScanStates(); + x170_scanTimes.reserve(scanStates.size()); for (const auto& state : scanStates) { float time = stream.ReadEncoded(1) ? 1.f : 0.f; @@ -435,6 +436,7 @@ void CPlayerState::InitializeScanTimes() return; const auto& scanStates = g_MemoryCardSys->GetScanStates(); + x170_scanTimes.reserve(scanStates.size()); for (const auto& state : scanStates) x170_scanTimes.emplace_back(state.first, 0.f); } diff --git a/Runtime/CPlayerState.hpp b/Runtime/CPlayerState.hpp index 1c63d9208..5ebd471f4 100644 --- a/Runtime/CPlayerState.hpp +++ b/Runtime/CPlayerState.hpp @@ -123,7 +123,7 @@ private: float x1c_visorTransitionFactor = 0.2f; EPlayerSuit x20_currentSuit = EPlayerSuit::Power; rstl::reserved_vector x24_powerups; - rstl::reserved_vector, 846> x170_scanTimes; + std::vector> x170_scanTimes; std::pair x180_scanCompletionRate = {}; CStaticInterference x188_staticIntf; public: @@ -178,7 +178,7 @@ public: void SetFiringComboBeam(bool f) { x0_25_firingComboBeam = f; } void InitializeScanTimes(); CStaticInterference& GetStaticInterference() { return x188_staticIntf; } - const rstl::reserved_vector, 846>& GetScanTimes() const { return x170_scanTimes; } + const std::vector>& GetScanTimes() const { return x170_scanTimes; } CPlayerState(); CPlayerState(CBitStreamReader& stream); void PutTo(CBitStreamWriter& stream); diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index eec2092ed..15b25d993 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -2254,10 +2254,10 @@ void CStateManager::InitializeState(CAssetId mlvlId, TAreaId aid, CAssetId mreaI x84c_player->Teleport(lookXf, *this, true); } - if (!g_GameState->x228_25_deferPowerupInit) + if (!g_GameState->x228_25_initPowerupsAtFirstSpawn) break; - g_GameState->x228_25_deferPowerupInit = false; + g_GameState->x228_25_initPowerupsAtFirstSpawn = false; for (int i = 0; i < int(CPlayerState::EItemType::Max); ++i) { CPlayerState::EItemType iType = CPlayerState::EItemType(i); diff --git a/visigen/VISIBuilder.cpp b/visigen/VISIBuilder.cpp index 5648418d0..69d83520f 100644 --- a/visigen/VISIBuilder.cpp +++ b/visigen/VISIBuilder.cpp @@ -316,7 +316,7 @@ std::vector VISIBuilder::build(const zeus::CAABox& fullAabb, FPercent updatePercent, ProcessType parentPid) { - Log.report(logvisor::Info, "Started!"); + //Log.report(logvisor::Info, "Started!"); size_t featureCount = modelCount + entities.size(); renderCache.m_lightMetaBit = featureCount; @@ -385,6 +385,6 @@ std::vector VISIBuilder::build(const zeus::CAABox& fullAabb, w.seekAlign32(); - Log.report(logvisor::Info, "Finished!"); + //Log.report(logvisor::Info, "Finished!"); return dataOut; }