Repository: RetroAchievements/RAIntegration
Pull request #1158 (2025-04-04 16:10:51)

update rcheevos


Patch:
diff --git a/rcheevos b/rcheevos
index 4697f97f..76c16a2d 160000
--- a/rcheevos
+++ b/rcheevos
@@ -1,1 +1,1 @@
-Subproject commit 4697f97f3dd355ececf4066acd7a51e121a6bf1a
+Subproject commit 76c16a2d2e8ddd1245fccaa5d76d8452caaea011
diff --git a/src/data/models/AchievementModel.cpp b/src/data/models/AchievementModel.cpp
index a029cb69..b214107b 100644
--- a/src/data/models/AchievementModel.cpp
+++ b/src/data/models/AchievementModel.cpp
@@ -419,7 +419,7 @@ void AchievementModel::SyncTrigger()
         Expects(pGame != nullptr);
 
         rc_preparse_state_t preparse;
-        rc_init_preparse_state(&preparse, nullptr, 0);
+        rc_init_preparse_state(&preparse);
         preparse.parse.existing_memrefs = pGame->runtime.memrefs;
 
         rc_trigger_with_memrefs_t* trigger = RC_ALLOC(rc_trigger_with_memrefs_t, &preparse.parse);
@@ -434,7 +434,7 @@ void AchievementModel::SyncTrigger()
             if (trigger_buffer)
             {
                 // populate the item, using the communal memrefs pool
-                rc_reset_parse_state(&preparse.parse, trigger_buffer, nullptr, 0);
+                rc_reset_parse_state(&preparse.parse, trigger_buffer);
                 trigger = RC_ALLOC(rc_trigger_with_memrefs_t, &preparse.parse);
                 rc_preparse_alloc_memrefs(&trigger->memrefs, &preparse);
                 Expects(preparse.parse.memrefs == &trigger->memrefs);
diff --git a/src/data/models/LeaderboardModel.cpp b/src/data/models/LeaderboardModel.cpp
index e6dab73d..e2ca31fb 100644
--- a/src/data/models/LeaderboardModel.cpp
+++ b/src/data/models/LeaderboardModel.cpp
@@ -339,7 +339,7 @@ void LeaderboardModel::SyncDefinition()
         Expects(pGame != nullptr);
 
         rc_preparse_state_t preparse;
-        rc_init_preparse_state(&preparse, nullptr, 0);
+        rc_init_preparse_state(&preparse);
         preparse.parse.existing_memrefs = pGame->runtime.memrefs;
 
         rc_lboard_with_memrefs_t* lboard = RC_ALLOC(rc_lboard_with_memrefs_t, &preparse.parse);
@@ -353,7 +353,7 @@ void LeaderboardModel::SyncDefinition()
             if (lboard_buffer)
             {
                 // populate the item, using the communal memrefs pool
-                rc_reset_parse_state(&preparse.parse, lboard_buffer, nullptr, 0);
+                rc_reset_parse_state(&preparse.parse, lboard_buffer);
                 lboard = RC_ALLOC(rc_lboard_with_memrefs_t, &preparse.parse);
                 rc_preparse_alloc_memrefs(&lboard->memrefs, &preparse);
 
diff --git a/src/rcheevos.vcxproj b/src/rcheevos.vcxproj
index 7be25b80..cba79a7b 100644
--- a/src/rcheevos.vcxproj
+++ b/src/rcheevos.vcxproj
@@ -205,6 +205,9 @@
     <ClCompile Include="..\rcheevos\src\rhash\hash.c">
       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
+    <ClCompile Include="..\rcheevos\src\rhash\hash_encrypted.c" />
+    <ClCompile Include="..\rcheevos\src\rhash\hash_rom.c" />
+    <ClCompile Include="..\rcheevos\src\rhash\hash_zip.c" />
     <ClCompile Include="..\rcheevos\src\rhash\md5.c" />
   </ItemGroup>
   <ItemGroup>
diff --git a/src/rcheevos.vcxproj.filters b/src/rcheevos.vcxproj.filters
index 654c3780..ca57c8d7 100644
--- a/src/rcheevos.vcxproj.filters
+++ b/src/rcheevos.vcxproj.filters
@@ -139,6 +139,15 @@
     <ClCompile Include="..\rcheevos\src\rhash\cdreader.c">
       <Filter>rhash</Filter>
     </ClCompile>
+    <ClCompile Include="..\rcheevos\src\rhash\hash_encrypted.c">
+      <Filter>rhash</Filter>
+    </ClCompile>
+    <ClCompile Include="..\rcheevos\src\rhash\hash_zip.c">
+      <Filter>rhash</Filter>
+    </ClCompile>
+    <ClCompile Include="..\rcheevos\src\rhash\hash_rom.c">
+      <Filter>rhash</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Filter Include="lua">
diff --git a/src/services/AchievementRuntime.cpp b/src/services/AchievementRuntime.cpp
index 1896c96f..574f285b 100644
--- a/src/services/AchievementRuntime.cpp
+++ b/src/services/AchievementRuntime.cpp
@@ -202,6 +202,9 @@ AchievementRuntime::AchievementRuntime()
 
     const auto bHardcore = pConfiguration.IsFeatureEnabled(ra::services::Feature::Hardcore);
     rc_client_set_hardcore_enabled(m_pClient.get(), bHardcore ? 1 : 0);
+
+    if (pConfiguration.IsCustomHost())
+        rc_client_set_host(m_pClient.get(), pConfiguration.GetHostUrl().c_str());
 #endif
 
     rc_client_set_event_handler(m_pClient.get(), EventHandler);
@@ -2393,7 +2396,7 @@ static bool LoadProgressV2(rc_client_t* pClient, ra::services::TextReader& pFile
 {
     auto& pRuntime = pClient->game->runtime;
     rc_preparse_state_t pParseState;
-    rc_init_preparse_state(&pParseState, nullptr, 0);
+    rc_init_preparse_state(&pParseState);
     pParseState.parse.existing_memrefs = pRuntime.memrefs;
 
     std::string sLine;
diff --git a/src/ui/viewmodels/MemoryBookmarksViewModel.cpp b/src/ui/viewmodels/MemoryBookmarksViewModel.cpp
index 6ace9f86..dcc52625 100644
--- a/src/ui/viewmodels/MemoryBookmarksViewModel.cpp
+++ b/src/ui/viewmodels/MemoryBookmarksViewModel.cpp
@@ -212,7 +212,7 @@ unsigned MemoryBookmarksViewModel::MemoryBookmarkViewModel::ReadValue() const
     if (m_pValue)
     {
         rc_typed_value_t value;
-        rc_evaluate_value_typed(m_pValue, &value, rc_peek_callback, nullptr, nullptr);
+        rc_evaluate_value_typed(m_pValue, &value, rc_peek_callback, nullptr);
         rc_typed_value_convert(&value, RC_VALUE_TYPE_UNSIGNED);
         return value.value.u32;
     }
@@ -394,7 +394,7 @@ void MemoryBookmarksViewModel::MemoryBookmarkViewModel::SetIndirectAddress(const
     auto* pGame = pRuntime.GetClient()->game;
 
     rc_preparse_state_t preparse;
-    rc_init_preparse_state(&preparse, nullptr, 0);
+    rc_init_preparse_state(&preparse);
     preparse.parse.existing_memrefs = pGame ? pGame->runtime.memrefs : nullptr;
 
     rc_value_with_memrefs_t* value = RC_ALLOC(rc_value_with_memrefs_t, &preparse.parse);
@@ -410,7 +410,7 @@ void MemoryBookmarksViewModel::MemoryBookmarkViewModel::SetIndirectAddress(const
     if (!m_pBuffer)
         return;
 
-    rc_reset_parse_state(&preparse.parse, m_pBuffer.get(), nullptr, 0);
+    rc_reset_parse_state(&preparse.parse, m_pBuffer.get());
     value = RC_ALLOC(rc_value_with_memrefs_t, &preparse.parse);
     rc_preparse_alloc_memrefs(&value->memrefs, &preparse);
     Expects(preparse.parse.memrefs == &value->memrefs);
diff --git a/src/ui/viewmodels/TriggerViewModel.cpp b/src/ui/viewmodels/TriggerViewModel.cpp
index a00a6622..5bc45517 100644
--- a/src/ui/viewmodels/TriggerViewModel.cpp
+++ b/src/ui/viewmodels/TriggerViewModel.cpp
@@ -243,7 +243,7 @@ void TriggerViewModel::PasteFromClipboard()
     // have to use internal parsing functions to decode conditions without full trigger/value
     // restriction validation (full validation will occur after new conditions are added)
     rc_preparse_state_t preparse;
-    rc_init_preparse_state(&preparse, nullptr, 0);
+    rc_init_preparse_state(&preparse);
     preparse.parse.is_value = IsValue();
     std::string sTrigger = ra::Narrow(sClipboardText);
     const char* memaddr = sTrigger.c_str();
@@ -267,7 +267,7 @@ void TriggerViewModel::PasteFromClipboard()
 
     std::string sTriggerBuffer;
     sTriggerBuffer.resize(nSize);
-    rc_reset_parse_state(&preparse.parse, sTriggerBuffer.data(), nullptr, 0);
+    rc_reset_parse_state(&preparse.parse, sTriggerBuffer.data());
     preparse.parse.is_value = IsValue();
 
     if (ra::services::ServiceLocator::Exists<ra::services::AchievementRuntime>())


Test patch:
diff --git a/tests/services/AchievementRuntime_Tests.cpp b/tests/services/AchievementRuntime_Tests.cpp
index bf09f1b7..9fd7dcf9 100644
--- a/tests/services/AchievementRuntime_Tests.cpp
+++ b/tests/services/AchievementRuntime_Tests.cpp
@@ -300,7 +300,7 @@ public:
         // MockAchievement generates triggers with their own memrefs - promote to common memref pool
         auto& runtime = GetClient()->game->runtime;
         rc_parse_state_t parse;
-        rc_init_parse_state(&parse, nullptr, nullptr, 0);
+        rc_init_parse_state(&parse, nullptr);
         parse.memrefs = runtime.memrefs;
 
         for (unsigned i = 0; i < runtime.trigger_count; ++i)