From 10962a298c16192625a19fcbbd53307ff1687e59 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:44 +0200 Subject: [PATCH 01/94] reimplement: SHC_3BB0A8C1_0x00480640 100.0% Reimplemented InitialAnnounceReply, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit b19c2c6afc ("reimplement: SHC_3BB0A8C1_0x00480640 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Opus 5.5 --- .../Commands/InitialAnnounceReply.cpp | 38 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp diff --git a/src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp b/src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp new file mode 100644 index 0000000000..a10c33e4dc --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp @@ -0,0 +1,38 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00480640 + void Commands::InitialAnnounceReply() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_HostAnnounced = 1; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b62540e14f..ae445e4166 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22431,7 +22431,7 @@ SHC_3BB0A8C1_0x00480580 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004805D0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00480640 | 0.0% | Pending +SHC_3BB0A8C1_0x00480640 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00480680 | 0.0% | Pending From ab1c93660c589aa23294e5f7cc325d504000405c Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 00:41:11 +0100 Subject: [PATCH 02/94] style: InitialAnnounceReply (0x00480640) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../Synchrony/Commands/InitialAnnounceReply.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp b/src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp index a10c33e4dc..09f70c3723 100644 --- a/src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp +++ b/src/OpenSHC/Synchrony/Commands/InitialAnnounceReply.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" @@ -8,17 +7,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00480640 void Commands::InitialAnnounceReply() { @@ -29,9 +17,10 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_HostAnnounced = 1; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_HostAnnounced = 1; } } From eccf8711b478bb8905d2cd98de3dde07a45eb095 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:46 +0200 Subject: [PATCH 03/94] reimplement: SHC_3BB0A8C1_0x00484450 100.0% Reimplemented ResetSyncStatusUnk, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 83ab8d678d ("reimplement: SHC_3BB0A8C1_0x00484450 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Opus 5.5 --- .../Synchrony/Commands/ResetSyncStatusUnk.cpp | 44 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp b/src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp new file mode 100644 index 0000000000..4ce3be4ad6 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp @@ -0,0 +1,44 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::UI::Enums::DisplayElementID; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00484450 + void Commands::ResetSyncStatusUnk() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.syncStatus = 0; + DAT_GameSynchronyState::instance.flag_0xbec = 0; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_19, 0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ae445e4166..53d4581446 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22701,7 +22701,7 @@ SHC_3BB0A8C1_0x004843EC | 0.0% | Pending SHC_3BB0A8C1_0x004843F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00484450 | 0.0% | Pending +SHC_3BB0A8C1_0x00484450 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004844A0 | 0.0% | Pending From f0f1ff14e35cf66d669e5c67510daca041fee02b Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 00:41:12 +0100 Subject: [PATCH 04/94] style: ResetSyncStatusUnk (0x00484450) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../Synchrony/Commands/ResetSyncStatusUnk.cpp | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp b/src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp index 4ce3be4ad6..cd45dabfdb 100644 --- a/src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResetSyncStatusUnk.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/UI/DisplayElements.func.hpp" @@ -10,18 +9,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::UI::Enums::DisplayElementID; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00484450 void Commands::ResetSyncStatusUnk() { @@ -32,12 +19,13 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.syncStatus = 0; - DAT_GameSynchronyState::instance.flag_0xbec = 0; - MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( - OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_19, 0); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.syncStatus = 0; + DAT_GameSynchronyState::instance.flag_0xbec = 0; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_19, 0); } } From 1a1e55c7feededcfa4094208ac1a83df8761d640 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:42 +0200 Subject: [PATCH 05/94] reimplement: SHC_3BB0A8C1_0x00485330 100.0% Reimplemented CloseModalDialogForEveryone, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit faf55c3441 ("reimplement: SHC_3BB0A8C1_0x00485330 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Opus 5.5 --- .../Commands/CloseModalDialogForEveryone.cpp | 46 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp diff --git a/src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp b/src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp new file mode 100644 index 0000000000..8cd817f163 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp @@ -0,0 +1,46 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00485330 + void Commands::CloseModalDialogForEveryone() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.saveRelated = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 53d4581446..f5e8b4663f 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22739,7 +22739,7 @@ SHC_3BB0A8C1_0x00485210 | 0.0% | Pending SHC_3BB0A8C1_0x004852D0 | 0.0% | Pending -SHC_3BB0A8C1_0x00485330 | 0.0% | Pending +SHC_3BB0A8C1_0x00485330 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485380 | 0.0% | Pending From f74ec9cddda0cfbf1d661cd895a7f547948ca451 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 00:41:13 +0100 Subject: [PATCH 06/94] style: CloseModalDialogForEveryone (0x00485330) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The BOOLEnum include goes: BOOLEnum is never named here. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../Commands/CloseModalDialogForEveryone.cpp | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp b/src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp index 8cd817f163..8c08f2dfa1 100644 --- a/src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp +++ b/src/OpenSHC/Synchrony/Commands/CloseModalDialogForEveryone.cpp @@ -1,10 +1,8 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/UI/MenuModalComposition.func.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" @@ -12,19 +10,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::UI::Enums::MenuModalType; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00485330 void Commands::CloseModalDialogForEveryone() { @@ -35,11 +20,12 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.saveRelated = 0; - MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, - DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.saveRelated = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition1::ptr)( + OpenSHC::UI::Enums::MMT_NONE, FALSE); } } From 892464fb3db1b78049e0439dccdfb3b67077cf6d Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:45 +0200 Subject: [PATCH 07/94] reimplement: SHC_3BB0A8C1_0x004893C0 100.0% Reimplemented InitialAnnounceToHost, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit dc6352fea6 ("reimplement: SHC_3BB0A8C1_0x004893C0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Opus 5.5 --- .../Commands/InitialAnnounceToHost.cpp | 45 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp diff --git a/src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp b/src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp new file mode 100644 index 0000000000..63fb741099 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp @@ -0,0 +1,45 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::Commands::GameCommandType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004893C0 + void Commands::InitialAnnounceToHost() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_MULTIPLAYER_ANNOUNCE_HOST); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f5e8b4663f..fcd91e17f4 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23091,7 +23091,7 @@ SHC_3BB0A8C1_0x00489100 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004892F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004893C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004893C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00489410 | 0.0% | Pending From a718757e6cf6fe24d43348ff6dcf698371b06f2a Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 00:41:13 +0100 Subject: [PATCH 08/94] style: InitialAnnounceToHost (0x004893C0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../Commands/InitialAnnounceToHost.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp b/src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp index 63fb741099..6f37f91619 100644 --- a/src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp +++ b/src/OpenSHC/Synchrony/Commands/InitialAnnounceToHost.cpp @@ -1,29 +1,14 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" #include "OpenSHC/Commands/GameCommandType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::Commands::GameCommandType; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004893C0 void Commands::InitialAnnounceToHost() { @@ -35,7 +20,7 @@ namespace Synchrony { return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + && (DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( OpenSHC::Commands::GCT_MULTIPLAYER_ANNOUNCE_HOST); } From 8c9f91289bf7c0b43c088148132ed67f5c8b08b8 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:36 +0200 Subject: [PATCH 09/94] reimplement: SHC_3BB0A8C1_0x00482360 100.0% Reimplemented ClickChangeTaxes, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 6c33d8cd1d ("reimplement: SHC_3BB0A8C1_0x00482360 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Opus 5.5 --- .../Synchrony/Commands/ClickChangeTaxes.cpp | 51 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp b/src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp new file mode 100644 index 0000000000..10b1ca2497 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp @@ -0,0 +1,51 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00482360 + void Commands::ClickChangeTaxes() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 1; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ChangeTaxes)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index fcd91e17f4..29d8a0f436 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22551,7 +22551,7 @@ SHC_3BB0A8C1_0x00482280 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00482290 | 0.0% | Pending -SHC_3BB0A8C1_0x00482360 | 0.0% | Pending +SHC_3BB0A8C1_0x00482360 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004823C0 | 0.0% | Pending From 17b4ba767bf48d1e0592ce84862966eeea4d4785 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:41 +0100 Subject: [PATCH 10/94] style: ClickChangeTaxes (0x00482360) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - Param0 is cleared with 0 before its low bytes are read, where the draft assigns DAT_CommandActionPlan, which is GCS_EXECUTE (0) on that path; the code is the same. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickChangeTaxes.cpp | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp b/src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp index 10b1ca2497..62cd8c01ab 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickChangeTaxes.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -12,19 +11,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00482360 void Commands::ClickChangeTaxes() { @@ -35,16 +21,16 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 - = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ChangeTaxes)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ChangeTaxes)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From b697da5c79e88230eb4634a873dff5d87b287efb Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:36 +0200 Subject: [PATCH 11/94] reimplement: SHC_3BB0A8C1_0x004823C0 100.0% Reimplemented ClickChangeRations, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 6481c09f16 ("reimplement: SHC_3BB0A8C1_0x004823C0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickChangeRations.cpp | 51 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp b/src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp new file mode 100644 index 0000000000..7d6b1576f0 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp @@ -0,0 +1,51 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004823C0 + void Commands::ClickChangeRations() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 1; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ChangeRations)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 29d8a0f436..d35bf7b928 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22553,7 +22553,7 @@ SHC_3BB0A8C1_0x00482290 | 0.0% | Pending SHC_3BB0A8C1_0x00482360 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004823C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004823C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00482420 | 0.0% | Pending From 159f8b9b746dd348510f62a4efc30311f36efd56 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:42 +0100 Subject: [PATCH 12/94] style: ClickChangeRations (0x004823C0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - Param0 is cleared with 0 before its low bytes are read, where the draft assigns DAT_CommandActionPlan, which is GCS_EXECUTE (0) on that path; the code is the same. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickChangeRations.cpp | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp b/src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp index 7d6b1576f0..aaf65384fc 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickChangeRations.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -12,19 +11,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004823C0 void Commands::ClickChangeRations() { @@ -35,16 +21,16 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 - = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ChangeRations)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ChangeRations)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From eabc7e6645765d925662519dcb90beb150c45bc6 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:36 +0200 Subject: [PATCH 13/94] reimplement: SHC_3BB0A8C1_0x00482A40 100.0% Reimplemented ClickBuildingSleep, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit fa6467117d ("reimplement: SHC_3BB0A8C1_0x00482A40 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickBuildingSleep.cpp | 51 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp b/src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp new file mode 100644 index 0000000000..4ded883727 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp @@ -0,0 +1,51 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00482A40 + void Commands::ClickBuildingSleep() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 2; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessBuildingSleepUpdate)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index d35bf7b928..3ad046b19a 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22565,7 +22565,7 @@ SHC_3BB0A8C1_0x004826C0 | 0.0% | Pending SHC_3BB0A8C1_0x004827E0 | 0.0% | Pending -SHC_3BB0A8C1_0x00482A40 | 0.0% | Pending +SHC_3BB0A8C1_0x00482A40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00482AA0 | 0.0% | Pending From 43a51876f6dc26631c919696bd2a38dd1ec14f88 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:43 +0100 Subject: [PATCH 14/94] style: ClickBuildingSleep (0x00482A40) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - Param0 is cleared with 0 before its low bytes are read, where the draft assigns DAT_CommandActionPlan, which is GCS_EXECUTE (0) on that path; the code is the same. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickBuildingSleep.cpp | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp b/src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp index 4ded883727..d4e3aef3f0 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickBuildingSleep.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -12,19 +11,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00482A40 void Commands::ClickBuildingSleep() { @@ -35,16 +21,16 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 - = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessBuildingSleepUpdate)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessBuildingSleepUpdate)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From b526eb040149b6fd6535a22d0ab373fbfde71b67 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:48 +0200 Subject: [PATCH 15/94] reimplement: SHC_3BB0A8C1_0x004843F0 100.0% Reimplemented ResyncStatus2, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 8fc563bf89 ("reimplement: SHC_3BB0A8C1_0x004843F0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncStatus2.cpp | 44 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp b/src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp new file mode 100644 index 0000000000..2f0382c491 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp @@ -0,0 +1,44 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004843F0 + void Commands::ResyncStatus2() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + DAT_GameSynchronyState::instance + .receivedSyncStatusByPlayerUnk[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 2; + DAT_GameSynchronyState::instance.announcementReceiveTime = timeGetTime(); + DAT_GameSynchronyState::instance.announcementReceivedBool = TRUE; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 3ad046b19a..0f21e5db20 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22699,7 +22699,7 @@ SHC_3BB0A8C1_0x004843E8 | 0.0% | Pending SHC_3BB0A8C1_0x004843EC | 0.0% | Pending -SHC_3BB0A8C1_0x004843F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004843F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484450 | 100.0% | Reimplemented From 3d348f5d8d401c7e11372c41e5ce1082717c3f62 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:44 +0100 Subject: [PATCH 16/94] style: ResyncStatus2 (0x004843F0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp b/src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp index 2f0382c491..fd55a30398 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncStatus2.cpp @@ -1,26 +1,12 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004843F0 void Commands::ResyncStatus2() { @@ -32,7 +18,7 @@ namespace Synchrony { return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + && (DAT_GameSynchronyState::instance.isHost)) { DAT_GameSynchronyState::instance .receivedSyncStatusByPlayerUnk[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 2; DAT_GameSynchronyState::instance.announcementReceiveTime = timeGetTime(); From 2bfbf1d4af4c0b5842d0efb730c2ecd0a4ce1377 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:56 +0200 Subject: [PATCH 17/94] reimplement: SHC_3BB0A8C1_0x00484E10 100.0% Reimplemented TriggerRecalculationOfUnitSameTileLinkage, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 24c849e69a ("reimplement: SHC_3BB0A8C1_0x00484E10 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- ...ggerRecalculationOfUnitSameTileLinkage.cpp | 51 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp diff --git a/src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp b/src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp new file mode 100644 index 0000000000..c99fdee446 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp @@ -0,0 +1,51 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + Command handler in OpenSHC::Commands. Serializes one byte parameter on GCS_SCHEDULE_AND_SEND. On GCS_EXECUTE + sets mapAndTime.field45_0xf8 to 100. The purpose of field45_0xf8 is not yet known; likely a game pace or event + trigger field. renamed by: Claude Sonnet 4.6 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00484E10 + void Commands::TriggerRecalculationOfUnitSameTileLinkage() + { + char local_1; + DAT_GameSynchronyState::instance.DAT_CommandSize = 1; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_1, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_1; + DAT_GameState::instance.mapAndTime.multiplayerUnitSameTileLinkageTimeWindow = 100; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 0f21e5db20..238e3ab08d 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22723,7 +22723,7 @@ SHC_3BB0A8C1_0x00484C40 | 0.0% | Pending SHC_3BB0A8C1_0x00484DA0 | 0.0% | Pending -SHC_3BB0A8C1_0x00484E10 | 0.0% | Pending +SHC_3BB0A8C1_0x00484E10 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484E70 | 0.0% | Pending From 90059f8ee6daee53a16901091c3911dfecfae4ab Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:46 +0100 Subject: [PATCH 18/94] style: TriggerRecalculationOfUnitSameTileLinkage (0x00484E10) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- ...ggerRecalculationOfUnitSameTileLinkage.cpp | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp b/src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp index c99fdee446..2d9d0af3ca 100644 --- a/src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp +++ b/src/OpenSHC/Synchrony/Commands/TriggerRecalculationOfUnitSameTileLinkage.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" @@ -12,25 +11,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - Command handler in OpenSHC::Commands. Serializes one byte parameter on GCS_SCHEDULE_AND_SEND. On GCS_EXECUTE - sets mapAndTime.field45_0xf8 to 100. The purpose of field45_0xf8 is not yet known; likely a game pace or event - trigger field. renamed by: Claude Sonnet 4.6 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00484E10 void Commands::TriggerRecalculationOfUnitSameTileLinkage() { - char local_1; DAT_GameSynchronyState::instance.DAT_CommandSize = 1; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -38,13 +21,15 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_1, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_1; - DAT_GameState::instance.mapAndTime.multiplayerUnitSameTileLinkageTimeWindow = 100; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + char readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = readBuffer; + DAT_GameState::instance.mapAndTime.multiplayerUnitSameTileLinkageTimeWindow = 100; } } From e890a87946271a10294fb02cf6ae7298a3c43774 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:35 +0200 Subject: [PATCH 19/94] reimplement: SHC_3BB0A8C1_0x004850E0 100.0% Reimplemented BroadCastSyncRelatedStatus, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 35368abc42 ("reimplement: SHC_3BB0A8C1_0x004850E0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/BroadCastSyncRelatedStatus.cpp | 44 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp diff --git a/src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp b/src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp new file mode 100644 index 0000000000..3db8acb953 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp @@ -0,0 +1,44 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004850E0 + void Commands::BroadCastSyncRelatedStatus() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance + .syncRelatedStatusArray[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 1, + DAT_GameSynchronyState::instance.isHost != FALSE)) { + DAT_GameSynchronyState::instance.announcementReceiveTime = timeGetTime(); + DAT_GameSynchronyState::instance.announcementReceivedBool = TRUE; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 238e3ab08d..51516e0b84 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22731,7 +22731,7 @@ SHC_3BB0A8C1_0x00484F30 | 0.0% | Pending SHC_3BB0A8C1_0x00485020 | 0.0% | Pending -SHC_3BB0A8C1_0x004850E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004850E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485140 | 0.0% | Pending From 8e1f66d69ea437cccc92ba1d350581d32e0f3ae1 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:51 +0100 Subject: [PATCH 20/94] style: BroadCastSyncRelatedStatus (0x004850E0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. - The comma expression in the execute test is a statement of its own after an early return. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/BroadCastSyncRelatedStatus.cpp | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp b/src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp index 3db8acb953..0039b91dcd 100644 --- a/src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp +++ b/src/OpenSHC/Synchrony/Commands/BroadCastSyncRelatedStatus.cpp @@ -1,26 +1,12 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004850E0 void Commands::BroadCastSyncRelatedStatus() { @@ -31,10 +17,12 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance - .syncRelatedStatusArray[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 1, - DAT_GameSynchronyState::instance.isHost != FALSE)) { + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + DAT_GameSynchronyState::instance + .syncRelatedStatusArray[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 1; + if (DAT_GameSynchronyState::instance.isHost) { DAT_GameSynchronyState::instance.announcementReceiveTime = timeGetTime(); DAT_GameSynchronyState::instance.announcementReceivedBool = TRUE; } From 37e36e338b695df3e23b6756058d6feb69ed2b41 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:52 +0200 Subject: [PATCH 21/94] reimplement: SHC_3BB0A8C1_0x004852D0 100.0% Reimplemented ShareAnnouncementWithHost, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 19129db85b ("reimplement: SHC_3BB0A8C1_0x004852D0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/ShareAnnouncementWithHost.cpp | 44 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp b/src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp new file mode 100644 index 0000000000..a9b8bb46ee --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp @@ -0,0 +1,44 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004852D0 + void Commands::ShareAnnouncementWithHost() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + DAT_GameSynchronyState::instance + .announcementReceivedByPlayer[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 1; + DAT_GameSynchronyState::instance.announcementReceiveTime = timeGetTime(); + DAT_GameSynchronyState::instance.announcementReceivedBool = TRUE; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 51516e0b84..44039d5a16 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22737,7 +22737,7 @@ SHC_3BB0A8C1_0x00485140 | 0.0% | Pending SHC_3BB0A8C1_0x00485210 | 0.0% | Pending -SHC_3BB0A8C1_0x004852D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004852D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485330 | 100.0% | Reimplemented From 871a07d8196636e7d88e2c83025e08cfed2efb0d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:55 +0100 Subject: [PATCH 22/94] style: ShareAnnouncementWithHost (0x004852D0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/ShareAnnouncementWithHost.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp b/src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp index a9b8bb46ee..0edf7ea572 100644 --- a/src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp +++ b/src/OpenSHC/Synchrony/Commands/ShareAnnouncementWithHost.cpp @@ -1,26 +1,12 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004852D0 void Commands::ShareAnnouncementWithHost() { @@ -32,7 +18,7 @@ namespace Synchrony { return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + && (DAT_GameSynchronyState::instance.isHost)) { DAT_GameSynchronyState::instance .announcementReceivedByPlayer[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 1; DAT_GameSynchronyState::instance.announcementReceiveTime = timeGetTime(); From 1677d890741d103832fa057173ea223647f5df0f Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:55 +0200 Subject: [PATCH 23/94] reimplement: SHC_3BB0A8C1_0x00484A00 100.0% Reimplemented TribeRelated1, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 78b3c13828 ("reimplement: SHC_3BB0A8C1_0x00484A00 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/TribeRelated1.cpp | 54 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp diff --git a/src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp b/src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp new file mode 100644 index 0000000000..dd27c7c7a0 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp @@ -0,0 +1,54 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + Command handler in OpenSHC::Commands. Serializes one short parameter (DAT_GameCommandParam0) on + GCS_SCHEDULE_AND_SEND, then on GCS_EXECUTE deserializes and calls Map::Units::UnitsState::tribeRelated1 with the + invoking player ID and the param. renamed by: Claude Sonnet 4.6 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00484A00 + void Commands::TribeRelated1() + { + short local_4[2]; + DAT_GameSynchronyState::instance.DAT_CommandSize = 2; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_4[0]; + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectTribeUnitsForPlayer, DAT_UnitsState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 44039d5a16..f6c5171bd7 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22713,7 +22713,7 @@ SHC_3BB0A8C1_0x00484850 | 0.0% | Pending SHC_3BB0A8C1_0x00484960 | 0.0% | Pending -SHC_3BB0A8C1_0x00484A00 | 0.0% | Pending +SHC_3BB0A8C1_0x00484A00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484A70 | 0.0% | Pending From 65e77453691e06664ab004ecfd2ba08adec5a06c Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:17:58 +0100 Subject: [PATCH 24/94] style: TribeRelated1 (0x00484A00) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/TribeRelated1.cpp | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp b/src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp index dd27c7c7a0..ed501a018c 100644 --- a/src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp +++ b/src/OpenSHC/Synchrony/Commands/TribeRelated1.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/Units/UnitsState.func.hpp" @@ -13,25 +12,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - Command handler in OpenSHC::Commands. Serializes one short parameter (DAT_GameCommandParam0) on - GCS_SCHEDULE_AND_SEND, then on GCS_EXECUTE deserializes and calls Map::Units::UnitsState::tribeRelated1 with the - invoking player ID and the param. renamed by: Claude Sonnet 4.6 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00484A00 void Commands::TribeRelated1() { - short local_4[2]; DAT_GameSynchronyState::instance.DAT_CommandSize = 2; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -39,15 +22,17 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_4[0]; - MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectTribeUnitsForPlayer, DAT_UnitsState::ptr)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + short readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectTribeUnitsForPlayer, DAT_UnitsState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From b4f3ee73953f82d7cfd79f805467516479c223da Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:43 +0200 Subject: [PATCH 25/94] reimplement: SHC_3BB0A8C1_0x00484DA0 100.0% Reimplemented DeselectUnit, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit c0d6a7b203 ("reimplement: SHC_3BB0A8C1_0x00484DA0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/DeselectUnit.cpp | 53 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp diff --git a/src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp b/src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp new file mode 100644 index 0000000000..f4f6dcdca3 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp @@ -0,0 +1,53 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00484DA0 + void Commands::DeselectUnit() + { + short local_4[2]; + DAT_GameSynchronyState::instance.DAT_CommandSize = 2; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (uint)local_4[0]; + MACRO_CALL_MEMBER( + OpenSHC::Map::Units::UnitsState_Func::clearOrDeselectUnitFromSelection, DAT_UnitsState::ptr)( + (int)DAT_UnitsState::instance.units[DAT_GameSynchronyState::instance.DAT_GameCommandParam0].owner, + (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), 0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f6c5171bd7..e1c9c0fde4 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22721,7 +22721,7 @@ SHC_3BB0A8C1_0x00484B10 | 0.0% | Pending SHC_3BB0A8C1_0x00484C40 | 0.0% | Pending -SHC_3BB0A8C1_0x00484DA0 | 0.0% | Pending +SHC_3BB0A8C1_0x00484DA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484E10 | 100.0% | Reimplemented From 2a880e535edacd111e617a7e76efe5a392722482 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:02 +0100 Subject: [PATCH 26/94] style: DeselectUnit (0x00484DA0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/DeselectUnit.cpp | 34 ++++++------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp b/src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp index f4f6dcdca3..99de3ccbc0 100644 --- a/src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp +++ b/src/OpenSHC/Synchrony/Commands/DeselectUnit.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/Units/UnitsState.func.hpp" @@ -13,23 +12,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00484DA0 void Commands::DeselectUnit() { - short local_4[2]; DAT_GameSynchronyState::instance.DAT_CommandSize = 2; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -37,16 +22,17 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (uint)local_4[0]; - MACRO_CALL_MEMBER( - OpenSHC::Map::Units::UnitsState_Func::clearOrDeselectUnitFromSelection, DAT_UnitsState::ptr)( - (int)DAT_UnitsState::instance.units[DAT_GameSynchronyState::instance.DAT_GameCommandParam0].owner, - (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), 0); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + short readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::clearOrDeselectUnitFromSelection, DAT_UnitsState::ptr)( + DAT_UnitsState::instance.units[DAT_GameSynchronyState::instance.DAT_GameCommandParam0].owner, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0); } } From 175e2967860e08e90ea9207cfe9a3928b47cfcd1 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 16:47:46 +0200 Subject: [PATCH 27/94] reimplement: SHC_3BB0A8C1_0x00486320 100.0% Reimplemented ShareAIVHash, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit cd50aa82c9 ("reimplement: SHC_3BB0A8C1_0x00486320 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ShareAIVHash.cpp | 55 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp b/src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp new file mode 100644 index 0000000000..43b67d1674 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp @@ -0,0 +1,55 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_AIVState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + WARNING: Enum "MappersEnumShort": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00486320 + void Commands::ShareAIVHash() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x200; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(DAT_AIVState::instance.aivFileHash, 0x200, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.protocolInvokerPlayerID - 1U <= 7)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_AIVState::instance.receivedAIVFileHash + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + 0x200, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index e1c9c0fde4..949c2175b2 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22991,7 +22991,7 @@ SHC_3BB0A8C1_0x00486314 | 0.0% | Pending SHC_3BB0A8C1_0x00486318 | 0.0% | Pending -SHC_3BB0A8C1_0x00486320 | 0.0% | Pending +SHC_3BB0A8C1_0x00486320 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004863A0 | 0.0% | Pending From 2302a2bcde3c0a5ccd8b82e4eb7fca99e2c6df2a Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:05 +0100 Subject: [PATCH 28/94] style: ShareAIVHash (0x00486320) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - Numbers are decimal. - x - 1U <= 7 is x >= 1 && x <= 8. - Both sizes are sizeof(aivFileHash) (512 bytes). The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ShareAIVHash.cpp | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp b/src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp index 43b67d1674..8d037e9267 100644 --- a/src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp +++ b/src/OpenSHC/Synchrony/Commands/ShareAIVHash.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" @@ -12,41 +11,27 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - WARNING: Enum "MappersEnumShort": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00486320 void Commands::ShareAIVHash() { - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x200; + DAT_GameSynchronyState::instance.DAT_CommandSize = 512; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(DAT_AIVState::instance.aivFileHash, 0x200, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::ptr)(DAT_AIVState::instance.aivFileHash, + sizeof(DAT_AIVState::instance.aivFileHash), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.protocolInvokerPlayerID - 1U <= 7)) { + && (DAT_GameSynchronyState::instance.protocolInvokerPlayerID >= 1 + && DAT_GameSynchronyState::instance.protocolInvokerPlayerID <= 8)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( DAT_AIVState::instance.receivedAIVFileHash + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - 0x200, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + sizeof(DAT_AIVState::instance.aivFileHash), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); } } From d099caac537ae996d2a51a5e34f25252d21c2dbf Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 16:47:45 +0200 Subject: [PATCH 29/94] reimplement: SHC_3BB0A8C1_0x00480680 100.0% Reimplemented AnnounceGameVersion, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit acd48921ad ("reimplement: SHC_3BB0A8C1_0x00480680 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/AnnounceGameVersion.cpp | 54 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp diff --git a/src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp b/src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp new file mode 100644 index 0000000000..8b517a0125 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp @@ -0,0 +1,54 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00480680 + void Commands::AnnounceGameVersion() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 4; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 2752588; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if (DAT_GameSynchronyState::instance.protocolInvokerPlayerID - 1U <= 7) { + DAT_GameSynchronyState::instance + .DAT_MultiplayerGameVersions[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + = DAT_GameSynchronyState::instance.DAT_GameCommandParam0; + } + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 949c2175b2..ab7da1d795 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22433,7 +22433,7 @@ SHC_3BB0A8C1_0x004805D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00480640 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00480680 | 0.0% | Pending +SHC_3BB0A8C1_0x00480680 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00480710 | 0.0% | Pending From 620b7772a6b0fd16e24aeb8f7d27c6cd175f11a3 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:09 +0100 Subject: [PATCH 30/94] style: AnnounceGameVersion (0x00480680) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - x - 1U <= 7 is x >= 1 && x <= 8. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/AnnounceGameVersion.cpp | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp b/src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp index 8b517a0125..b99fa58a05 100644 --- a/src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp +++ b/src/OpenSHC/Synchrony/Commands/AnnounceGameVersion.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" @@ -11,19 +10,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00480680 void Commands::AnnounceGameVersion() { @@ -38,15 +24,17 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - if (DAT_GameSynchronyState::instance.protocolInvokerPlayerID - 1U <= 7) { - DAT_GameSynchronyState::instance - .DAT_MultiplayerGameVersions[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] - = DAT_GameSynchronyState::instance.DAT_GameCommandParam0; - } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if (DAT_GameSynchronyState::instance.protocolInvokerPlayerID >= 1 + && DAT_GameSynchronyState::instance.protocolInvokerPlayerID <= 8) { + DAT_GameSynchronyState::instance + .DAT_MultiplayerGameVersions[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + = DAT_GameSynchronyState::instance.DAT_GameCommandParam0; } } From 69a29adfd53cc26a74f6336e3ca2bea7113755aa Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:45 +0200 Subject: [PATCH 31/94] reimplement: SHC_3BB0A8C1_0x004855C0 100.0% Reimplemented NotifyLaggingPlayer, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 8511c194ef ("reimplement: SHC_3BB0A8C1_0x004855C0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/NotifyLaggingPlayer.cpp | 59 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp diff --git a/src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp b/src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp new file mode 100644 index 0000000000..22687ea7aa --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp @@ -0,0 +1,59 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::UI::Enums::DisplayElementID; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + Command handler in OpenSHC::Commands. On GCS_SCHEDULE_AND_SEND serializes DAT_GameCommandParam0 (the lagging + player ID) then executes immediately. On GCS_EXECUTE stores the value in laggingPlayerIDUnk, shows multiplayer + info display element DEID_SOME_MULTIPLAYER_INFO_Unk_28, and resets field131_0xcd4 to 0. Notifies all clients + which player is currently lagging. renamed by: Claude Sonnet 4.6 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004855C0 + void Commands::NotifyLaggingPlayer() + { + short local_4[2]; + DAT_GameSynchronyState::instance.DAT_CommandSize = 2; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.laggingPlayerIDUnk = (int)local_4[0]; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_28, 1); + DAT_GameSynchronyState::instance.field131_0xcd4 = 0; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ab7da1d795..de8cab1ba4 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22745,7 +22745,7 @@ SHC_3BB0A8C1_0x00485380 | 0.0% | Pending SHC_3BB0A8C1_0x00485520 | 0.0% | Pending -SHC_3BB0A8C1_0x004855C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004855C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485650 | 0.0% | Pending From a22e2e9269b1df3cca2de0efb1585a6643d68e46 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:13 +0100 Subject: [PATCH 32/94] style: NotifyLaggingPlayer (0x004855C0) follows the style guide On top of gynt's version in the commit before, which does not build on main as it is (below). reccmp reads 100.0 (normalized 100.0), with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The buffer the received values are read into is readBuffer, declared at its first use. - It builds on main with main's field names: GameSynchronyState::field131_0xcd4 is lagNotificationCode. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/NotifyLaggingPlayer.cpp | 37 +++++-------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp b/src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp index 22687ea7aa..084ccbf039 100644 --- a/src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp +++ b/src/OpenSHC/Synchrony/Commands/NotifyLaggingPlayer.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" @@ -13,27 +12,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::UI::Enums::DisplayElementID; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - Command handler in OpenSHC::Commands. On GCS_SCHEDULE_AND_SEND serializes DAT_GameCommandParam0 (the lagging - player ID) then executes immediately. On GCS_EXECUTE stores the value in laggingPlayerIDUnk, shows multiplayer - info display element DEID_SOME_MULTIPLAYER_INFO_Unk_28, and resets field131_0xcd4 to 0. Notifies all clients - which player is currently lagging. renamed by: Claude Sonnet 4.6 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004855C0 void Commands::NotifyLaggingPlayer() { - short local_4[2]; DAT_GameSynchronyState::instance.DAT_CommandSize = 2; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; @@ -44,15 +25,17 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.laggingPlayerIDUnk = (int)local_4[0]; - MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( - OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_28, 1); - DAT_GameSynchronyState::instance.field131_0xcd4 = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + short readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.laggingPlayerIDUnk = readBuffer; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_28, 1); + DAT_GameSynchronyState::instance.lagNotificationCode = 0; } } From ef4622c3f5b1cbcc382f33ebe296f39ceab71b97 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:54 +0200 Subject: [PATCH 33/94] reimplement: SHC_3BB0A8C1_0x00485650 100.0% Reimplemented SomeKindOfMultiplayerPingUnk, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit d2e9a70af1 ("reimplement: SHC_3BB0A8C1_0x00485650 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/SomeKindOfMultiplayerPingUnk.cpp | 54 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp b/src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp new file mode 100644 index 0000000000..2237ac8369 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp @@ -0,0 +1,54 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00485650 + void Commands::SomeKindOfMultiplayerPingUnk() + { + short local_4[2]; + DAT_GameSynchronyState::instance.DAT_CommandSize = 2; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field131_0xcd4, 2, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.field131_0xcd4 = (int)local_4[0]; + DAT_GameSynchronyState::instance.DAT_SomeTime = timeGetTime(); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index de8cab1ba4..c952eb87df 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22747,7 +22747,7 @@ SHC_3BB0A8C1_0x00485520 | 0.0% | Pending SHC_3BB0A8C1_0x004855C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00485650 | 0.0% | Pending +SHC_3BB0A8C1_0x00485650 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004856E0 | 0.0% | Pending From 3825c132d45b22197706daece54852cdc5d91db8 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:17 +0100 Subject: [PATCH 34/94] style: SomeKindOfMultiplayerPingUnk (0x00485650) follows the style guide On top of gynt's version in the commit before, which does not build on main as it is (below). reccmp reads 100.0 (normalized 100.0), with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The buffer the received values are read into is readBuffer, declared at its first use. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. - It builds on main with main's field names: GameSynchronyState::field131_0xcd4 is lagNotificationCode. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/SomeKindOfMultiplayerPingUnk.cpp | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp b/src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp index 2237ac8369..98e1535c47 100644 --- a/src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp +++ b/src/OpenSHC/Synchrony/Commands/SomeKindOfMultiplayerPingUnk.cpp @@ -1,51 +1,35 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00485650 void Commands::SomeKindOfMultiplayerPingUnk() { - short local_4[2]; DAT_GameSynchronyState::instance.DAT_CommandSize = 2; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field131_0xcd4, 2, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.lagNotificationCode, 2, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { + short readBuffer; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.field131_0xcd4 = (int)local_4[0]; + DAT_GameSynchronyState::instance.lagNotificationCode = readBuffer; DAT_GameSynchronyState::instance.DAT_SomeTime = timeGetTime(); } } From f06a08e68538da1c45058e99adfd87b0bb086847 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:48 +0200 Subject: [PATCH 35/94] reimplement: SHC_3BB0A8C1_0x0048FC20 100.0% Reimplemented ResyncStartCS_CS_Sub, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 4c178c8ce5 ("reimplement: SHC_3BB0A8C1_0x0048FC20 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/ResyncStartCS_CS_Sub.cpp | 58 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp b/src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp new file mode 100644 index 0000000000..112b79f18c --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp @@ -0,0 +1,58 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::UI::Enums::DisplayElementID; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048FC20 + void Commands::ResyncStartCS_CS_Sub() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 8; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance + .DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = DAT_GameSynchronyState::instance + .DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time + + 30; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.syncStatus = 10; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::recomputeHashesAndSendResync, + DAT_GameSynchronyState::ptr)(1); + DAT_GameSynchronyState::instance.field259_0x109290 = timeGetTime(); + DAT_GameSynchronyState::instance.currentPacketTotalSize = 0; + DAT_GameSynchronyState::instance.field267_0x1092b0 = 0; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_19, 1); + DAT_GameSynchronyState::instance.field76_0xbe8 = DAT_GameSynchronyState::instance.field259_0x109290; + DAT_GameSynchronyState::instance.announcementReceiveTime + = DAT_GameSynchronyState::instance.field259_0x109290; + DAT_GameSynchronyState::instance.announcementReceivedBool = FALSE; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index c952eb87df..e2909d3afa 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23363,7 +23363,7 @@ SHC_3BB0A8C1_0x0048F870 | 0.0% | Pending SHC_3BB0A8C1_0x0048FAA0 | 0.0% | Pending -SHC_3BB0A8C1_0x0048FC20 | 0.0% | Pending +SHC_3BB0A8C1_0x0048FC20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048FCB0 | 0.0% | Pending From 1b5d05244bba61fb8eda3bf8baad47ba9bf6e78d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:19 +0100 Subject: [PATCH 36/94] style: ResyncStartCS_CS_Sub (0x0048FC20) follows the style guide On top of gynt's version in the commit before, which does not build on main as it is (below). reccmp reads 100.0 (normalized 100.0), with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The BOOLEnum include goes: BOOLEnum is never named here. - It builds on main with main's field names: GameSynchronyState::field259_0x109290 is resyncStartTime; GameSynchronyState::field267_0x1092b0 is connectionInfoExpanded; GameSynchronyState::field76_0xbe8 is field_0xbe8. - connectionInfoExpanded is a BOOLEnum: it is set to FALSE. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/ResyncStartCS_CS_Sub.cpp | 46 ++++++------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp b/src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp index 112b79f18c..dc2b0b68a0 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncStartCS_CS_Sub.cpp @@ -1,30 +1,15 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/UI/DisplayElements.func.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" #include "OpenSHC/UI/Enums/DisplayElementID.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::UI::Enums::DisplayElementID; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048FC20 void Commands::ResyncStartCS_CS_Sub() { @@ -32,26 +17,23 @@ namespace Synchrony { if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance .DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] - .time = DAT_GameSynchronyState::instance - .DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] - .time - + 30; + .time += 30; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.syncStatus = 10; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::recomputeHashesAndSendResync, - DAT_GameSynchronyState::ptr)(1); - DAT_GameSynchronyState::instance.field259_0x109290 = timeGetTime(); - DAT_GameSynchronyState::instance.currentPacketTotalSize = 0; - DAT_GameSynchronyState::instance.field267_0x1092b0 = 0; - MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( - OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_19, 1); - DAT_GameSynchronyState::instance.field76_0xbe8 = DAT_GameSynchronyState::instance.field259_0x109290; - DAT_GameSynchronyState::instance.announcementReceiveTime - = DAT_GameSynchronyState::instance.field259_0x109290; - DAT_GameSynchronyState::instance.announcementReceivedBool = FALSE; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.syncStatus = 10; + MACRO_CALL_MEMBER( + OpenSHC::Synchrony::GameSynchronyState_Func::recomputeHashesAndSendResync, DAT_GameSynchronyState::ptr)(1); + DAT_GameSynchronyState::instance.resyncStartTime = timeGetTime(); + DAT_GameSynchronyState::instance.currentPacketTotalSize = 0; + DAT_GameSynchronyState::instance.connectionInfoExpanded = FALSE; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_SOME_MULTIPLAYER_INFO_Unk_19, 1); + DAT_GameSynchronyState::instance.field_0xbe8 = DAT_GameSynchronyState::instance.resyncStartTime; + DAT_GameSynchronyState::instance.announcementReceiveTime = DAT_GameSynchronyState::instance.resyncStartTime; + DAT_GameSynchronyState::instance.announcementReceivedBool = FALSE; } } From 5e8293d5d0994c4f4700c0db271dfb2dfa9ae9d2 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:44 +0200 Subject: [PATCH 37/94] reimplement: SHC_3BB0A8C1_0x0048FFD0 100.0% Reimplemented HostRemoveAIPlayerBySlotID, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 13918ee6eb ("reimplement: SHC_3BB0A8C1_0x0048FFD0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/HostRemoveAIPlayerBySlotID.cpp | 57 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp diff --git a/src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp b/src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp new file mode 100644 index 0000000000..818f4ed5c8 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp @@ -0,0 +1,57 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048FFD0 + void Commands::HostRemoveAIPlayerBySlotID() + { + int local_4; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 4; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.currentAIArray[local_4] = 0; + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::RemovePositionOfPlayer)(local_4); + MACRO_CALL_MEMBER( + OpenSHC::Synchrony::GameSynchronyState_Func::reorderTeamsAndPositions, DAT_GameSynchronyState::ptr)(); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index e2909d3afa..de387f4482 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23367,7 +23367,7 @@ SHC_3BB0A8C1_0x0048FC20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048FCB0 | 0.0% | Pending -SHC_3BB0A8C1_0x0048FFD0 | 0.0% | Pending +SHC_3BB0A8C1_0x0048FFD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00490060 | 0.0% | Pending From 17795046ac7c32b7a5d95d7a745c26ccfd09f725 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:23 +0100 Subject: [PATCH 38/94] style: HostRemoveAIPlayerBySlotID (0x0048FFD0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The buffer the received values are read into is readBuffer, declared at its first use. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/HostRemoveAIPlayerBySlotID.cpp | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp b/src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp index 818f4ed5c8..5310694efc 100644 --- a/src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp +++ b/src/OpenSHC/Synchrony/Commands/HostRemoveAIPlayerBySlotID.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -6,31 +5,15 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048FFD0 void Commands::HostRemoveAIPlayerBySlotID() { - int local_4; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; DAT_GameSynchronyState::instance.DAT_CommandSize = 4; @@ -42,12 +25,13 @@ namespace Synchrony { return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { + int readBuffer; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + DAT_GameSynchronyState::ptr)(&readBuffer, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.currentAIArray[local_4] = 0; - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::RemovePositionOfPlayer)(local_4); + DAT_GameSynchronyState::instance.currentAIArray[readBuffer] = 0; + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::RemovePositionOfPlayer)(readBuffer); MACRO_CALL_MEMBER( OpenSHC::Synchrony::GameSynchronyState_Func::reorderTeamsAndPositions, DAT_GameSynchronyState::ptr)(); } From a6258273b4f50aa30d748b6293b37fc682dea691 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:45 +0200 Subject: [PATCH 39/94] reimplement: SHC_3BB0A8C1_0x00480E60 100.0% Reimplemented MakeUnitSelection, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 469b0b2f5d ("reimplement: SHC_3BB0A8C1_0x00480E60 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/MakeUnitSelection.cpp | 57 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp diff --git a/src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp b/src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp new file mode 100644 index 0000000000..ef137226a0 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp @@ -0,0 +1,57 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00480E60 + void Commands::MakeUnitSelection() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 402; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(DAT_UnitsState::instance.selectedUnitsBitFlags, 400, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(DAT_UnitsState::instance.selectedUnitsBitFlags, 400, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::playerMakeUnitSelection, DAT_UnitsState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index de387f4482..ed2e338731 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22445,7 +22445,7 @@ SHC_3BB0A8C1_0x00480BE0 | 0.0% | Pending SHC_3BB0A8C1_0x00480DB0 | 0.0% | Pending -SHC_3BB0A8C1_0x00480E60 | 0.0% | Pending +SHC_3BB0A8C1_0x00480E60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00480F00 | 0.0% | Pending From 1596f7f248b7e26cf753e8f95743c1202e92e4b2 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:27 +0100 Subject: [PATCH 40/94] style: MakeUnitSelection (0x00480E60) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - Both sizes are sizeof(selectedUnitsBitFlags) (400 bytes). The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/MakeUnitSelection.cpp | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp b/src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp index ef137226a0..3e611c5d53 100644 --- a/src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp +++ b/src/OpenSHC/Synchrony/Commands/MakeUnitSelection.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/Units/UnitsState.func.hpp" @@ -13,44 +12,34 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00480E60 void Commands::MakeUnitSelection() { DAT_GameSynchronyState::instance.DAT_CommandSize = 402; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(DAT_UnitsState::instance.selectedUnitsBitFlags, 400, + DAT_GameSynchronyState::ptr)(DAT_UnitsState::instance.selectedUnitsBitFlags, + sizeof(DAT_UnitsState::instance.selectedUnitsBitFlags), OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(DAT_UnitsState::instance.selectedUnitsBitFlags, 400, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::playerMakeUnitSelection, DAT_UnitsState::ptr)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(DAT_UnitsState::instance.selectedUnitsBitFlags, + sizeof(DAT_UnitsState::instance.selectedUnitsBitFlags), + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::playerMakeUnitSelection, DAT_UnitsState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From 08c8a37f6e27b366e105d816f7478497446b254f Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:40 +0200 Subject: [PATCH 41/94] reimplement: SHC_3BB0A8C1_0x004821E0 100.0% Reimplemented ClickRecruitUnit, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 4cf7813cf9 ("reimplement: SHC_3BB0A8C1_0x004821E0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickRecruitUnit.cpp | 59 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp b/src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp new file mode 100644 index 0000000000..a3cff41b70 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp @@ -0,0 +1,59 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004821E0 + void Commands::ClickRecruitUnit() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 3; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessRecruitUnit)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), + DAT_GameSynchronyState::instance.DAT_GameCommandParam1); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ed2e338731..a6f2930a73 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22545,7 +22545,7 @@ SHC_3BB0A8C1_0x004821D4 | 0.0% | Pending SHC_3BB0A8C1_0x004821D5 | 0.0% | Pending -SHC_3BB0A8C1_0x004821E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004821E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00482280 | 100.0% | Reimplemented From c18449ab135ca4a8e40eee3c0cb658f51b97d7c3 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:30 +0100 Subject: [PATCH 42/94] style: ClickRecruitUnit (0x004821E0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - Param0 is cleared with 0 before its low bytes are read, where the draft assigns DAT_CommandActionPlan, which is GCS_EXECUTE (0) on that path; the code is the same. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickRecruitUnit.cpp | 42 +++++++------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp b/src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp index a3cff41b70..8b64a7019e 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickRecruitUnit.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -12,19 +11,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004821E0 void Commands::ClickRecruitUnit() { @@ -38,21 +24,21 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 - = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessRecruitUnit)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), - DAT_GameSynchronyState::instance.DAT_GameCommandParam1); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessRecruitUnit)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + DAT_GameSynchronyState::instance.DAT_GameCommandParam1); } } From 900d97116abc9d367420c18c3157bdea808841e2 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:36 +0200 Subject: [PATCH 43/94] reimplement: SHC_3BB0A8C1_0x00482620 100.0% Reimplemented ClickBuyOrSell, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit e45362c183 ("reimplement: SHC_3BB0A8C1_0x00482620 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickBuyOrSell.cpp | 61 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp b/src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp new file mode 100644 index 0000000000..27383fa4f4 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp @@ -0,0 +1,61 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/Game/Resources/ResourceType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::Game::Resources::ResourceType; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00482620 + void Commands::ClickBuyOrSell() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 2; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = ((ResourceType)0); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessBuyOrSell)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), + (ResourceType)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index a6f2930a73..fb31a8c1dc 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22559,7 +22559,7 @@ SHC_3BB0A8C1_0x00482420 | 0.0% | Pending SHC_3BB0A8C1_0x00482550 | 0.0% | Pending -SHC_3BB0A8C1_0x00482620 | 0.0% | Pending +SHC_3BB0A8C1_0x00482620 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004826C0 | 0.0% | Pending From 6891e23841bb99ad9ccc832fe5cc8541f0c2b066 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:35 +0100 Subject: [PATCH 44/94] style: ClickBuyOrSell (0x00482620) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The resource type is cleared with 0, without the cast. - Param0 is cleared with 0 before its low bytes are read, where the draft assigns DAT_CommandActionPlan, which is GCS_EXECUTE (0) on that path; the code is the same. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickBuyOrSell.cpp | 43 ++++++------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp b/src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp index 27383fa4f4..6316ae944c 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickBuyOrSell.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -13,20 +12,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::Game::Resources::ResourceType; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00482620 void Commands::ClickBuyOrSell() { @@ -40,21 +25,21 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 - = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = ((ResourceType)0); - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessBuyOrSell)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), - (ResourceType)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessBuyOrSell)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + (OpenSHC::Game::Resources::ResourceType)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1)); } } From ae24a29ab3dab8dba4ae9f129ae7ae0bcbee4066 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:42 +0200 Subject: [PATCH 45/94] reimplement: SHC_3BB0A8C1_0x004847B0 100.0% Reimplemented ClickUnitStance, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 140ef47ea0 ("reimplement: SHC_3BB0A8C1_0x004847B0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickUnitStance.cpp | 64 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp b/src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp new file mode 100644 index 0000000000..49bffdcdf4 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp @@ -0,0 +1,64 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/Units/TribesState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/Map/Units/Behavior/UnitStanceEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_TribesState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::Map::Units::Behavior::UnitStanceEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004847B0 + void Commands::ClickUnitStance() + { + undefined4 local_4; + DAT_GameSynchronyState::instance.DAT_CommandSize = 3; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)(short)local_4; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (UnitStanceEnum)(char)local_4; + /* + arg1 = section1016ID, arg2 = unit stance + */ + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::setUnitStance, DAT_TribesState::ptr)( + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + (UnitStanceEnum)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index fb31a8c1dc..9c50556699 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22707,7 +22707,7 @@ SHC_3BB0A8C1_0x004844A0 | 0.0% | Pending SHC_3BB0A8C1_0x004845B0 | 0.0% | Pending -SHC_3BB0A8C1_0x004847B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004847B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484850 | 0.0% | Pending From cf9428274d1e5aeb344b8632b35f9c5945f6690e Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:39 +0100 Subject: [PATCH 46/94] style: ClickUnitStance (0x004847B0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ClickUnitStance.cpp | 46 ++++++------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp b/src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp index 49bffdcdf4..1a1d78f555 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickUnitStance.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/Units/TribesState.func.hpp" @@ -14,24 +13,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::Map::Units::Behavior::UnitStanceEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004847B0 void Commands::ClickUnitStance() { - undefined4 local_4; DAT_GameSynchronyState::instance.DAT_CommandSize = 3; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -42,22 +26,22 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)(short)local_4; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (UnitStanceEnum)(char)local_4; - /* - arg1 = section1016ID, arg2 = unit stance - */ - MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::setUnitStance, DAT_TribesState::ptr)( - DAT_GameSynchronyState::instance.DAT_GameCommandParam0, - (UnitStanceEnum)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + int readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (short)readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 + = (OpenSHC::Map::Units::Behavior::UnitStanceEnum)(char)readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::setUnitStance, DAT_TribesState::ptr)( + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + (OpenSHC::Map::Units::Behavior::UnitStanceEnum)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1)); } } From 045dd1da648f8b1fb21e426f2beabf9b5e4e18f5 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:54 +0200 Subject: [PATCH 47/94] reimplement: SHC_3BB0A8C1_0x00484960 100.0% Reimplemented SiegeEngineRelated, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit fd0ff88d5b ("reimplement: SHC_3BB0A8C1_0x00484960 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SiegeEngineRelated.cpp | 63 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp b/src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp new file mode 100644 index 0000000000..844ca80755 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp @@ -0,0 +1,63 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + Command handler in OpenSHC::Commands. Serializes two short parameters (DAT_GameCommandParam0 and + DAT_GameCommandParam1) on GCS_SCHEDULE_AND_SEND, then on GCS_EXECUTE deserializes and calls + Map::Units::UnitsState::siegeEngineRelated with the invoking player ID and both params. renamed by: Claude + Sonnet 4.6 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00484960 + void Commands::SiegeEngineRelated() + { + short local_4[2]; + DAT_GameSynchronyState::instance.DAT_CommandSize = 4; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_4[0]; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (int)local_4[0]; + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectSiegeEngineAndPlayFeedback, + DAT_UnitsState::ptr)(DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 9c50556699..f2d10b4d4a 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22711,7 +22711,7 @@ SHC_3BB0A8C1_0x004847B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484850 | 0.0% | Pending -SHC_3BB0A8C1_0x00484960 | 0.0% | Pending +SHC_3BB0A8C1_0x00484960 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484A00 | 100.0% | Reimplemented From fd84a0d16dcc4c44d21002c4bb9fa4f4bc86dfbe Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:43 +0100 Subject: [PATCH 48/94] style: SiegeEngineRelated (0x00484960) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SiegeEngineRelated.cpp | 46 ++++++------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp b/src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp index 844ca80755..d464b53bc0 100644 --- a/src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp +++ b/src/OpenSHC/Synchrony/Commands/SiegeEngineRelated.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/Units/UnitsState.func.hpp" @@ -13,26 +12,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - Command handler in OpenSHC::Commands. Serializes two short parameters (DAT_GameCommandParam0 and - DAT_GameCommandParam1) on GCS_SCHEDULE_AND_SEND, then on GCS_EXECUTE deserializes and calls - Map::Units::UnitsState::siegeEngineRelated with the invoking player ID and both params. renamed by: Claude - Sonnet 4.6 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00484960 void Commands::SiegeEngineRelated() { - short local_4[2]; DAT_GameSynchronyState::instance.DAT_CommandSize = 4; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -43,20 +25,22 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_4[0]; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (int)local_4[0]; - MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectSiegeEngineAndPlayFeedback, - DAT_UnitsState::ptr)(DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + short readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectSiegeEngineAndPlayFeedback, DAT_UnitsState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + DAT_GameSynchronyState::instance.DAT_GameCommandParam1); } } From be0671dcf1fede9366c6b784e7d9862cc4c84fc1 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:46 +0200 Subject: [PATCH 49/94] reimplement: SHC_3BB0A8C1_0x00484A70 100.0% Reimplemented ReleaseDogs, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit e6650a9553 ("reimplement: SHC_3BB0A8C1_0x00484A70 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ReleaseDogs.cpp | 58 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp b/src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp new file mode 100644 index 0000000000..8533a33a65 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp @@ -0,0 +1,58 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00484A70 + void Commands::ReleaseDogs() + { + short local_4[2]; + DAT_GameSynchronyState::instance.DAT_CommandSize = 6; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 4, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_4[0]; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 4, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessReleaseDogs)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f2d10b4d4a..4fd0ce85f5 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22715,7 +22715,7 @@ SHC_3BB0A8C1_0x00484960 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484A00 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00484A70 | 0.0% | Pending +SHC_3BB0A8C1_0x00484A70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484B10 | 0.0% | Pending From 6d572c957d2f68ef60f6e65a1f98d11a6ebd4fb9 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:46 +0100 Subject: [PATCH 50/94] style: ReleaseDogs (0x00484A70) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ReleaseDogs.cpp | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp b/src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp index 8533a33a65..c0b90998ca 100644 --- a/src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp +++ b/src/OpenSHC/Synchrony/Commands/ReleaseDogs.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -12,23 +11,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00484A70 void Commands::ReleaseDogs() { - short local_4[2]; DAT_GameSynchronyState::instance.DAT_CommandSize = 6; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -39,19 +24,21 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)local_4[0]; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 4, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessReleaseDogs)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + short readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 4, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::ProcessReleaseDogs)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + DAT_GameSynchronyState::instance.DAT_GameCommandParam1); } } From 83858c62042e9a3d55e55d38a16e78a48d103c74 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:44 +0200 Subject: [PATCH 51/94] reimplement: SHC_3BB0A8C1_0x00485520 100.0% Reimplemented FlagsAndBraziersCommandUnk, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit cf376edf99 ("reimplement: SHC_3BB0A8C1_0x00485520 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/FlagsAndBraziersCommandUnk.cpp | 63 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp diff --git a/src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp b/src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp new file mode 100644 index 0000000000..bfcd304f52 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp @@ -0,0 +1,63 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00485520 + void Commands::FlagsAndBraziersCommandUnk() + { + short local_4; + DAT_GameSynchronyState::instance.DAT_CommandSize = 4; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (uint)local_4; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (uint)local_4; + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::spreadBrazierPlacementAlgorithm, DAT_TileMapState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), + (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 4fd0ce85f5..89f3b89649 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22743,7 +22743,7 @@ SHC_3BB0A8C1_0x00485330 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485380 | 0.0% | Pending -SHC_3BB0A8C1_0x00485520 | 0.0% | Pending +SHC_3BB0A8C1_0x00485520 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004855C0 | 100.0% | Reimplemented From 8c9c6192100319ccf54edb80a38ca53b687e9678 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:50 +0100 Subject: [PATCH 52/94] style: FlagsAndBraziersCommandUnk (0x00485520) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. - The short readBuffer goes into the two parameters without the (uint). The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/FlagsAndBraziersCommandUnk.cpp | 46 ++++++------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp b/src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp index bfcd304f52..8db13481bd 100644 --- a/src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp +++ b/src/OpenSHC/Synchrony/Commands/FlagsAndBraziersCommandUnk.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/TileMapState.func.hpp" @@ -13,26 +12,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00485520 void Commands::FlagsAndBraziersCommandUnk() { - short local_4; DAT_GameSynchronyState::instance.DAT_CommandSize = 4; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -43,20 +25,22 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (uint)local_4; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (uint)local_4; - MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::spreadBrazierPlacementAlgorithm, DAT_TileMapState::ptr)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), - (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + short readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::spreadBrazierPlacementAlgorithm, DAT_TileMapState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + DAT_GameSynchronyState::instance.DAT_GameCommandParam1); } } From ede48a75b7386e256897949fc39d907b7ef1f981 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:48 +0200 Subject: [PATCH 53/94] reimplement: SHC_3BB0A8C1_0x00485790 100.0% Reimplemented ResyncStatusStart, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit b19c1acba3 ("reimplement: SHC_3BB0A8C1_0x00485790 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncStatusStart.cpp | 61 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp b/src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp new file mode 100644 index 0000000000..ea60cd3235 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp @@ -0,0 +1,61 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00485790 + void Commands::ResyncStatusStart() + { + int iVar1; + byte local_1; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0xe; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + iVar1 = 0; + do { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.sharedDesyncFlags + iVar1, 1, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + iVar1 = iVar1 + 1; + } while (iVar1 < 14); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + iVar1 = 0; + do { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_1, 1, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.sharedDesyncFlags[iVar1] = local_1; + iVar1 = iVar1 + 1; + } while (iVar1 < 0xe); + DAT_GameSynchronyState::instance.syncStatus = 1; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 89f3b89649..829ebb4e24 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22751,7 +22751,7 @@ SHC_3BB0A8C1_0x00485650 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004856E0 | 0.0% | Pending -SHC_3BB0A8C1_0x00485790 | 0.0% | Pending +SHC_3BB0A8C1_0x00485790 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485830 | 0.0% | Pending From 808412ed756e6cc98e3fc73f2404d1d0db9e0fdc Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:53 +0100 Subject: [PATCH 54/94] style: ResyncStatusStart (0x00485790) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The buffer the received values are read into is readBuffer, declared at its first use. - Numbers are decimal. - Both do/while loops are for loops over countof(sharedDesyncFlags), the received byte read into readBuffer inside the loop. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncStatusStart.cpp | 46 ++++++------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp b/src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp index ea60cd3235..ac209016ae 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncStatusStart.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" @@ -11,50 +10,33 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00485790 void Commands::ResyncStatusStart() { - int iVar1; - byte local_1; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0xe; + DAT_GameSynchronyState::instance.DAT_CommandSize = 14; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { - iVar1 = 0; - do { + for (int flag = 0; flag < countof(DAT_GameSynchronyState::instance.sharedDesyncFlags); ++flag) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.sharedDesyncFlags + iVar1, 1, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.sharedDesyncFlags[flag], 1, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); - iVar1 = iVar1 + 1; - } while (iVar1 < 14); + } DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - iVar1 = 0; - do { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_1, 1, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.sharedDesyncFlags[iVar1] = local_1; - iVar1 = iVar1 + 1; - } while (iVar1 < 0xe); - DAT_GameSynchronyState::instance.syncStatus = 1; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + for (int flag = 0; flag < countof(DAT_GameSynchronyState::instance.sharedDesyncFlags); ++flag) { + byte readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 1, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.sharedDesyncFlags[flag] = readBuffer; } + DAT_GameSynchronyState::instance.syncStatus = 1; } } From 41f11acfb7b1179042168a79139dd5557f5394b3 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:45 +0200 Subject: [PATCH 55/94] reimplement: SHC_3BB0A8C1_0x00485E80 100.0% Reimplemented MapSendingRelated, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit ed8648fbfa ("reimplement: SHC_3BB0A8C1_0x00485E80 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/MapSendingRelated.cpp | 61 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp diff --git a/src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp b/src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp new file mode 100644 index 0000000000..c97687efbd --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp @@ -0,0 +1,61 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00485E80 + void Commands::MapSendingRelated() + { + char local_1; + DAT_GameSynchronyState::instance.DAT_CommandSize = 1; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 1, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_1, 1, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if (((DAT_GameSynchronyState::instance.isHost != FALSE) + && (DAT_GameSynchronyState::instance + .field290_0x109e20[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 2, + local_1 == '\x01')) + && (DAT_GameSynchronyState::instance + .mapSendingFileHandles[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + != (FILE*)0x0)) { + DAT_GameSynchronyState::instance + .mapSendingByteBufferAddress[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + = DAT_GameSynchronyState::instance.mapSendingFileSize; + } + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 829ebb4e24..63e48632a1 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22971,7 +22971,7 @@ SHC_3BB0A8C1_0x00485C10 | 0.0% | Pending SHC_3BB0A8C1_0x00485CC0 | 0.0% | Pending -SHC_3BB0A8C1_0x00485E80 | 0.0% | Pending +SHC_3BB0A8C1_0x00485E80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485F20 | 0.0% | Pending From 8dac8664173b9d35906c793c5073a8884aa6c165 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:18:58 +0100 Subject: [PATCH 56/94] style: MapSendingRelated (0x00485E80) follows the style guide On top of gynt's version in the commit before, which does not build on main as it is (below). reccmp reads 100.0 (normalized 100.0), with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The buffer the received values are read into is readBuffer, declared at its first use. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - It builds on main with main's field names: GameSynchronyState::field290_0x109e20 is mapSendRequestStatePerPlayer. - The comma expression in the host test is a statement of its own after an early return; the file handle is compared with NULL and the received byte with 1. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/MapSendingRelated.cpp | 51 +++++++------------ 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp b/src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp index c97687efbd..5487ba9d08 100644 --- a/src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp +++ b/src/OpenSHC/Synchrony/Commands/MapSendingRelated.cpp @@ -1,35 +1,18 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00485E80 void Commands::MapSendingRelated() { - char local_1; DAT_GameSynchronyState::instance.DAT_CommandSize = 1; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; @@ -39,21 +22,25 @@ namespace Synchrony { OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_1, 1, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - if (((DAT_GameSynchronyState::instance.isHost != FALSE) - && (DAT_GameSynchronyState::instance - .field290_0x109e20[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 2, - local_1 == '\x01')) - && (DAT_GameSynchronyState::instance - .mapSendingFileHandles[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] - != (FILE*)0x0)) { - DAT_GameSynchronyState::instance - .mapSendingByteBufferAddress[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] - = DAT_GameSynchronyState::instance.mapSendingFileSize; - } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + char readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 1, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if (!DAT_GameSynchronyState::instance.isHost) { + return; + } + DAT_GameSynchronyState::instance + .mapSendRequestStatePerPlayer[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 2; + if (readBuffer == 1 + && DAT_GameSynchronyState::instance + .mapSendingFileHandles[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + != NULL) { + DAT_GameSynchronyState::instance + .mapSendingByteBufferAddress[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + = DAT_GameSynchronyState::instance.mapSendingFileSize; } } From 83be19d47c056cc2025a821eec41613b9ebdf669 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:38 +0200 Subject: [PATCH 57/94] reimplement: SHC_3BB0A8C1_0x00480DB0 100.0% Reimplemented ClickNavigateMenuOrEscape, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit c7b288ad47 ("reimplement: SHC_3BB0A8C1_0x00480DB0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/ClickNavigateMenuOrEscape.cpp | 61 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp b/src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp new file mode 100644 index 0000000000..ec1d3402e2 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp @@ -0,0 +1,61 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + also activates when pressing the hotkey for a unit selection decompilerscript: committed: 2025-01-30 + 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00480DB0 + void Commands::ClickNavigateMenuOrEscape() + { + short local_4[2]; + DAT_GameSynchronyState::instance.DAT_CommandSize = 4; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (uint)local_4[0]; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::clearOrDeselectUnitFromSelection, + DAT_UnitsState::ptr)(DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 63e48632a1..5668c12f2e 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22443,7 +22443,7 @@ SHC_3BB0A8C1_0x00480B10 | 0.0% | Pending SHC_3BB0A8C1_0x00480BE0 | 0.0% | Pending -SHC_3BB0A8C1_0x00480DB0 | 0.0% | Pending +SHC_3BB0A8C1_0x00480DB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00480E60 | 100.0% | Reimplemented From 4192c31af668f2d0d40e113d2feed38fc893caa3 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:02 +0100 Subject: [PATCH 58/94] style: ClickNavigateMenuOrEscape (0x00480DB0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone (Ghidra's note on the function stays as one // line above it). - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/ClickNavigateMenuOrEscape.cpp | 45 +++++++------------ 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp b/src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp index ec1d3402e2..8ad1ffa041 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickNavigateMenuOrEscape.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/Units/UnitsState.func.hpp" @@ -13,24 +12,10 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - also activates when pressing the hotkey for a unit selection decompilerscript: committed: 2025-01-30 - 21:57:43.216000 - */ + // also activates when pressing the hotkey for a unit selection // FUNCTION: STRONGHOLDCRUSADER 0x00480DB0 void Commands::ClickNavigateMenuOrEscape() { - short local_4[2]; DAT_GameSynchronyState::instance.DAT_CommandSize = 4; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -41,20 +26,22 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (uint)local_4[0]; - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::clearOrDeselectUnitFromSelection, - DAT_UnitsState::ptr)(DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + short readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = readBuffer; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::clearOrDeselectUnitFromSelection, DAT_UnitsState::ptr)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + DAT_GameSynchronyState::instance.DAT_GameCommandParam1); } } From d7fb29eaa48a2b751fb3c94dad539f0f2581a144 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:52 +0200 Subject: [PATCH 59/94] reimplement: SHC_3BB0A8C1_0x004856E0 100.0% Reimplemented ShareGameStatePartialHashes, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 28d3298228 ("reimplement: SHC_3BB0A8C1_0x004856E0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/ShareGameStatePartialHashes.cpp | 63 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp b/src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp new file mode 100644 index 0000000000..e28e476bdd --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp @@ -0,0 +1,63 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004856E0 + void Commands::ShareGameStatePartialHashes() + { + int iVar1; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x30; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + iVar1 = 0; + do { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.DAT_PlayerMatchTimes + iVar1 + + DAT_GameSynchronyState::instance.currentPlayerSlotID * 0xc + 9, + 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + iVar1 = iVar1 + 1; + } while (iVar1 < 0xc); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + iVar1 = 0; + do { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.DAT_PlayerMatchTimes + iVar1 + + DAT_GameSynchronyState::instance.protocolInvokerPlayerID * 0xc + 9, + 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + iVar1 = iVar1 + 1; + } while (iVar1 < 0xc); + DAT_GameSynchronyState::instance + .syncStatus10Related[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 1; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 5668c12f2e..3558c47f0e 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22749,7 +22749,7 @@ SHC_3BB0A8C1_0x004855C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485650 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004856E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004856E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485790 | 100.0% | Reimplemented From d9ed59e12dd28e3f3702b8cec8f804fa2a152f2d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:05 +0100 Subject: [PATCH 60/94] style: ShareGameStatePartialHashes (0x004856E0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - Numbers are decimal. - The twelve values are HASH_PartialHashPerPlayer.player[slot].domain[i]; gynt's draft reached them through DAT_PlayerMatchTimes + 9, past the end of that array. Both do/while loops are for loops bounded by countof(domain). The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/ShareGameStatePartialHashes.cpp | 55 +++++++------------ 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp b/src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp index e28e476bdd..219afce0bf 100644 --- a/src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp +++ b/src/OpenSHC/Synchrony/Commands/ShareGameStatePartialHashes.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" @@ -11,52 +10,40 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004856E0 void Commands::ShareGameStatePartialHashes() { - int iVar1; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x30; + DAT_GameSynchronyState::instance.DAT_CommandSize = 48; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { - iVar1 = 0; - do { + for (int domain = 0; + domain < countof(DAT_GameSynchronyState::instance.HASH_PartialHashPerPlayer.player[0].domain); + ++domain) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.DAT_PlayerMatchTimes + iVar1 - + DAT_GameSynchronyState::instance.currentPlayerSlotID * 0xc + 9, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.HASH_PartialHashPerPlayer + .player[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .domain[domain], 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); - iVar1 = iVar1 + 1; - } while (iVar1 < 0xc); + } DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - iVar1 = 0; - do { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.DAT_PlayerMatchTimes + iVar1 - + DAT_GameSynchronyState::instance.protocolInvokerPlayerID * 0xc + 9, - 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - iVar1 = iVar1 + 1; - } while (iVar1 < 0xc); - DAT_GameSynchronyState::instance - .syncStatus10Related[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] = 1; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + for (int domain = 0; + domain < countof(DAT_GameSynchronyState::instance.HASH_PartialHashPerPlayer.player[0].domain); ++domain) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.HASH_PartialHashPerPlayer + .player[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + .domain[domain], + 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); } + DAT_GameSynchronyState::instance.syncStatus10Related[DAT_GameSynchronyState::instance.protocolInvokerPlayerID] + = 1; } } From 13b6f9ec8a03a70c29dbf093693d4679b136b0ed Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:49 +0200 Subject: [PATCH 61/94] reimplement: SHC_3BB0A8C1_0x0048A1F0 100.0% Reimplemented SendResyncBuilding, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 14ca2ef25d ("reimplement: SHC_3BB0A8C1_0x0048A1F0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SendResyncBuilding.cpp | 61 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp new file mode 100644 index 0000000000..674a80ad23 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp @@ -0,0 +1,61 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048A1F0 + void Commands::SendResyncBuilding() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x330; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_BuildingsState::instance.buildings + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0x32c, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_BuildingsState::instance.buildings + + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), + (size_t)((int)(812)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 3558c47f0e..2fd07e1075 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23115,7 +23115,7 @@ SHC_3BB0A8C1_0x0048A050 | 0.0% | Pending SHC_3BB0A8C1_0x0048A0E0 | 0.0% | Pending -SHC_3BB0A8C1_0x0048A1F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0048A1F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048A2A0 | 0.0% | Pending From a83a7c7c26669e8dd6b485e8c940735d51ca0134 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:08 +0100 Subject: [PATCH 62/94] style: SendResyncBuilding (0x0048A1F0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are sizeof(buildings[0]), one element (812 bytes), where the draft has the byte count. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SendResyncBuilding.cpp | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp index 674a80ad23..ec5cb12229 100644 --- a/src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp +++ b/src/OpenSHC/Synchrony/Commands/SendResyncBuilding.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_BuildingsState.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -14,26 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048A1F0 void Commands::SendResyncBuilding() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x330; + DAT_GameSynchronyState::instance.DAT_CommandSize = 816; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -41,19 +25,21 @@ namespace Synchrony { OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( - DAT_BuildingsState::instance.buildings + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0x32c, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_BuildingsState::instance.buildings + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + sizeof(DAT_BuildingsState::instance.buildings[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_BuildingsState::instance.buildings + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), - (size_t)((int)(812)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + sizeof(DAT_BuildingsState::instance.buildings[0]), + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From 93935f7fcec5f513c89d8742178cde6367e9a3b2 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:51 +0200 Subject: [PATCH 63/94] reimplement: SHC_3BB0A8C1_0x0048A2A0 100.0% Reimplemented SendResyncVeg, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 9c5367bdfa ("reimplement: SHC_3BB0A8C1_0x0048A2A0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SendResyncVeg.cpp | 60 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp new file mode 100644 index 0000000000..1413b2096b --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp @@ -0,0 +1,60 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_LandscapeState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048A2A0 + void Commands::SendResyncVeg() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0xa0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_LandscapeState::instance.trees + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0x9c, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_LandscapeState::instance.trees + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), + (size_t)((int)(156)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 2fd07e1075..8582c8f264 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23117,7 +23117,7 @@ SHC_3BB0A8C1_0x0048A0E0 | 0.0% | Pending SHC_3BB0A8C1_0x0048A1F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0048A2A0 | 0.0% | Pending +SHC_3BB0A8C1_0x0048A2A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048A350 | 0.0% | Pending From 321b66c46744bdcbcd4d3bdd80e6ec585cc1474d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:12 +0100 Subject: [PATCH 64/94] style: SendResyncVeg (0x0048A2A0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are sizeof(trees[0]), one element (156 bytes), where the draft has the byte count. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SendResyncVeg.cpp | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp index 1413b2096b..afdab64020 100644 --- a/src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp +++ b/src/OpenSHC/Synchrony/Commands/SendResyncVeg.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_LandscapeState.hpp" @@ -14,26 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048A2A0 void Commands::SendResyncVeg() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0xa0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 160; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -41,18 +25,19 @@ namespace Synchrony { OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( - DAT_LandscapeState::instance.trees + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0x9c, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_LandscapeState::instance.trees + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + sizeof(DAT_LandscapeState::instance.trees[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_LandscapeState::instance.trees + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), - (size_t)((int)(156)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + sizeof(DAT_LandscapeState::instance.trees[0]), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From edfc2edc3dcccd5734fe0288e7989d9b9dc379e9 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:50 +0200 Subject: [PATCH 65/94] reimplement: SHC_3BB0A8C1_0x0048A460 100.0% Reimplemented SendResyncPlayerData, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 395619eb83 ("reimplement: SHC_3BB0A8C1_0x0048A460 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/SendResyncPlayerData.cpp | 62 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp new file mode 100644 index 0000000000..47b6f1352f --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp @@ -0,0 +1,62 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048A460 + void Commands::SendResyncPlayerData() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x39f8; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_GameState::instance.playerDataArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + 0x39f4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_GameState::instance.playerDataArray + + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), + (size_t)((int)(14836)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 8582c8f264..226e7631c1 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23121,7 +23121,7 @@ SHC_3BB0A8C1_0x0048A2A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048A350 | 0.0% | Pending -SHC_3BB0A8C1_0x0048A460 | 0.0% | Pending +SHC_3BB0A8C1_0x0048A460 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048A510 | 0.0% | Pending From 1697536b4fac36f3ad865ae8502eb0fe47180adb Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:15 +0100 Subject: [PATCH 66/94] style: SendResyncPlayerData (0x0048A460) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are sizeof(playerDataArray[0]), one element (14836 bytes), where the draft has the byte count. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/SendResyncPlayerData.cpp | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp index 47b6f1352f..ce414e5acd 100644 --- a/src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp +++ b/src/OpenSHC/Synchrony/Commands/SendResyncPlayerData.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameState.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -14,26 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048A460 void Commands::SendResyncPlayerData() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x39f8; + DAT_GameSynchronyState::instance.DAT_CommandSize = 14840; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -42,19 +26,20 @@ namespace Synchrony { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( DAT_GameState::instance.playerDataArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, - 0x39f4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + sizeof(DAT_GameState::instance.playerDataArray[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_GameState::instance.playerDataArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), - (size_t)((int)(14836)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + sizeof(DAT_GameState::instance.playerDataArray[0]), + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From 935d241f1f417e1c49c58ff83af319f71df21fac Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:50 +0200 Subject: [PATCH 67/94] reimplement: SHC_3BB0A8C1_0x0048A710 100.0% Reimplemented SendResyncEntity, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit e4d787ce57 ("reimplement: SHC_3BB0A8C1_0x0048A710 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SendResyncEntity.cpp | 60 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp new file mode 100644 index 0000000000..d5dc14fb01 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp @@ -0,0 +1,60 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_EntityState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048A710 + void Commands::SendResyncEntity() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0xec; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_EntityState::instance.entityArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0xe8, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_EntityState::instance.entityArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), + (size_t)((int)(232)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 226e7631c1..02e17c102e 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23125,7 +23125,7 @@ SHC_3BB0A8C1_0x0048A460 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048A510 | 0.0% | Pending -SHC_3BB0A8C1_0x0048A710 | 0.0% | Pending +SHC_3BB0A8C1_0x0048A710 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048A7C0 | 0.0% | Pending From 6fd3b05112711c0d45cb4943631d7e9816f6df55 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:19 +0100 Subject: [PATCH 68/94] style: SendResyncEntity (0x0048A710) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are sizeof(entityArray[0]), one element (232 bytes), where the draft has the byte count. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/SendResyncEntity.cpp | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp b/src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp index d5dc14fb01..72a00eb18c 100644 --- a/src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp +++ b/src/OpenSHC/Synchrony/Commands/SendResyncEntity.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_EntityState.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -14,26 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048A710 void Commands::SendResyncEntity() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0xec; + DAT_GameSynchronyState::instance.DAT_CommandSize = 236; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -41,18 +25,20 @@ namespace Synchrony { OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( - DAT_EntityState::instance.entityArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0xe8, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_EntityState::instance.entityArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + sizeof(DAT_EntityState::instance.entityArray[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_EntityState::instance.entityArray + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), - (size_t)((int)(232)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + sizeof(DAT_EntityState::instance.entityArray[0]), + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From 2e9e848c38ea297a56e9f49a05ebc0c494dfa809 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:48 +0200 Subject: [PATCH 69/94] reimplement: SHC_3BB0A8C1_0x0048AB40 100.0% Reimplemented ResyncTeleClimb, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 65309ba47b ("reimplement: SHC_3BB0A8C1_0x0048AB40 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncTeleClimb.cpp | 62 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp b/src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp new file mode 100644 index 0000000000..a94062ab94 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp @@ -0,0 +1,62 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PathFindingState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048AB40 + void Commands::ResyncTeleClimb() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x208; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_PathFindingState::instance.climbData + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + 0x204, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_PathFindingState::instance.climbData + + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), + 0x204, DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 02e17c102e..02db323df3 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23135,7 +23135,7 @@ SHC_3BB0A8C1_0x0048A9F0 | 0.0% | Pending SHC_3BB0A8C1_0x0048AA80 | 0.0% | Pending -SHC_3BB0A8C1_0x0048AB40 | 0.0% | Pending +SHC_3BB0A8C1_0x0048AB40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048ABF0 | 0.0% | Pending From 3b24d6a9835dd92909785bbc540cf7db3e58897d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:23 +0100 Subject: [PATCH 70/94] style: ResyncTeleClimb (0x0048AB40) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are sizeof(climbData[0]), one element (516 bytes), where the draft has the byte count. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncTeleClimb.cpp | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp b/src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp index a94062ab94..593be660e4 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncTeleClimb.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_PathFindingState.hpp" @@ -14,26 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048AB40 void Commands::ResyncTeleClimb() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x208; + DAT_GameSynchronyState::instance.DAT_CommandSize = 520; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -42,19 +26,20 @@ namespace Synchrony { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( DAT_PathFindingState::instance.climbData + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, - 0x204, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + sizeof(DAT_PathFindingState::instance.climbData[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_PathFindingState::instance.climbData + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), - 0x204, DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + sizeof(DAT_PathFindingState::instance.climbData[0]), + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From c1691c4ef214e1893dce7615b606ac5ecbd67176 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:49 +0200 Subject: [PATCH 71/94] reimplement: SHC_3BB0A8C1_0x0048B280 100.0% Reimplemented SendQuitGameQuestion, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 8f1e58c0fc ("reimplement: SHC_3BB0A8C1_0x0048B280 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/SendQuitGameQuestion.cpp | 72 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp b/src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp new file mode 100644 index 0000000000..41f856bed7 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp @@ -0,0 +1,72 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::DE::SHCDE::eTextSections; + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048B280 + void Commands::SendQuitGameQuestion() + { + char cVar1; + char* pcVar2; + char* pcVar3; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + if (DAT_GameSynchronyState::instance.protocolInvokerPlayerID + != DAT_GameSynchronyState::instance.currentPlayerSlotID) { + DAT_GameSynchronyState::instance.quitGameVoteRelated = 1; + DAT_GameSynchronyState::instance.quitGameVoteRequestTime = timeGetTime(); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_ONLINE_VOTE_QUIT_GAME, FALSE); + } + /* + added by script: "End this game?" + */ + pcVar2 = MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 0x3b); + pcVar3 = DAT_GameSynchronyState::instance.receivedChatMessage; + do { + cVar1 = *pcVar2; + *pcVar3 = cVar1; + pcVar2 = pcVar2 + 1; + pcVar3 = pcVar3 + 1; + } while (cVar1 != '\0'); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::addChatMessageToDisplayList, + DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.protocolInvokerPlayerID, 0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 02db323df3..1cb0301977 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23143,7 +23143,7 @@ SHC_3BB0A8C1_0x0048ACB0 | 0.0% | Pending SHC_3BB0A8C1_0x0048B170 | 0.0% | Pending -SHC_3BB0A8C1_0x0048B280 | 0.0% | Pending +SHC_3BB0A8C1_0x0048B280 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048B330 | 0.0% | Pending From 323fbab6f41d1f66247d525ff693c619876c9cc7 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:28 +0100 Subject: [PATCH 72/94] style: SendQuitGameQuestion (0x0048B280) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - The copy loops are strcpy, with its pragma at the top of the file, as #415 writes them. - The text of a lookup is a // "..." line above it. - The question's text is copied with strcpy; its text is the // line above it. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/SendQuitGameQuestion.cpp | 59 ++++++------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp b/src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp index 41f856bed7..b1e3d13085 100644 --- a/src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp +++ b/src/OpenSHC/Synchrony/Commands/SendQuitGameQuestion.cpp @@ -1,4 +1,6 @@ -#include "../../Synchrony.func.hpp" +// disable deprecation warnings for strcpy +#pragma warning(disable : 4996) + #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" @@ -7,7 +9,6 @@ #include "OpenSHC/Commands/GameCommandScheduling.hpp" #include "OpenSHC/DE/SHCDE/eTextSections.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" @@ -16,26 +17,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::DE::SHCDE::eTextSections; - using OpenSHC::UI::Enums::MenuModalType; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048B280 void Commands::SendQuitGameQuestion() { - char cVar1; - char* pcVar2; - char* pcVar3; DAT_GameSynchronyState::instance.DAT_CommandSize = 0; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; @@ -43,29 +27,22 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - if (DAT_GameSynchronyState::instance.protocolInvokerPlayerID - != DAT_GameSynchronyState::instance.currentPlayerSlotID) { - DAT_GameSynchronyState::instance.quitGameVoteRelated = 1; - DAT_GameSynchronyState::instance.quitGameVoteRequestTime = timeGetTime(); - MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, - DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_ONLINE_VOTE_QUIT_GAME, FALSE); - } - /* - added by script: "End this game?" - */ - pcVar2 = MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, - DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 0x3b); - pcVar3 = DAT_GameSynchronyState::instance.receivedChatMessage; - do { - cVar1 = *pcVar2; - *pcVar3 = cVar1; - pcVar2 = pcVar2 + 1; - pcVar3 = pcVar3 + 1; - } while (cVar1 != '\0'); - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::addChatMessageToDisplayList, - DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.protocolInvokerPlayerID, 0); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + if (DAT_GameSynchronyState::instance.protocolInvokerPlayerID + != DAT_GameSynchronyState::instance.currentPlayerSlotID) { + DAT_GameSynchronyState::instance.quitGameVoteRelated = 1; + DAT_GameSynchronyState::instance.quitGameVoteRequestTime = timeGetTime(); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_ONLINE_VOTE_QUIT_GAME, FALSE); } + // "End this game?" + strcpy(DAT_GameSynchronyState::instance.receivedChatMessage, + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 59)); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::addChatMessageToDisplayList, + DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.protocolInvokerPlayerID, 0); } } From af9c1de8abb78b4f4348ebff899a4b9bb5c0ccd7 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:49 +0200 Subject: [PATCH 73/94] reimplement: SHC_3BB0A8C1_0x0048BBE0 100.0% Reimplemented ResyncVillage, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 65e49a1abb ("reimplement: SHC_3BB0A8C1_0x0048BBE0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncVillage.cpp | 63 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp b/src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp new file mode 100644 index 0000000000..9dee1844d8 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp @@ -0,0 +1,63 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_AIVState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + WARNING: Enum "MappersEnumShort": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048BBE0 + void Commands::ResyncVillage() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x6d9c; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_AIVState::instance.aivs + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0x6d98, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_AIVState::instance.aivs + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), + (size_t)((int)(28056)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 1cb0301977..03e8b48a38 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23159,7 +23159,7 @@ SHC_3BB0A8C1_0x0048B850 | 0.0% | Pending SHC_3BB0A8C1_0x0048B8F0 | 0.0% | Pending -SHC_3BB0A8C1_0x0048BBE0 | 0.0% | Pending +SHC_3BB0A8C1_0x0048BBE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048BC90 | 0.0% | Pending From f89126fdfa6cecac4b9dfc917f933b25917574f6 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:31 +0100 Subject: [PATCH 74/94] style: ResyncVillage (0x0048BBE0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are sizeof(aivs[0]), one element (28056 bytes), where the draft has the byte count. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncVillage.cpp | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp b/src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp index 9dee1844d8..a217568944 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncVillage.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_AIVState.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -14,29 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - WARNING: Enum "MappersEnumShort": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048BBE0 void Commands::ResyncVillage() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x6d9c; + DAT_GameSynchronyState::instance.DAT_CommandSize = 28060; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -44,18 +25,19 @@ namespace Synchrony { OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( - DAT_AIVState::instance.aivs + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0x6d98, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_AIVState::instance.aivs + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + sizeof(DAT_AIVState::instance.aivs[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_AIVState::instance.aivs + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), - (size_t)((int)(28056)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + sizeof(DAT_AIVState::instance.aivs[0]), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From e6b54185fbfa7aa6a7a8e10d97e3a36b7b2706dd Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:47 +0200 Subject: [PATCH 75/94] reimplement: SHC_3BB0A8C1_0x0048BC90 100.0% Reimplemented ResyncAIZone, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 923c4c246f ("reimplement: SHC_3BB0A8C1_0x0048BC90 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncAIZone.cpp | 63 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp b/src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp new file mode 100644 index 0000000000..f6629b27a3 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp @@ -0,0 +1,63 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_AIVState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + WARNING: Enum "MappersEnumShort": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048BC90 + void Commands::ResyncAIZone() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0xf04; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_AIVState::instance.heatMaps + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0xf00, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_AIVState::instance.heatMaps + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), + (size_t)((int)(3840)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 03e8b48a38..df05db7077 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23161,7 +23161,7 @@ SHC_3BB0A8C1_0x0048B8F0 | 0.0% | Pending SHC_3BB0A8C1_0x0048BBE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0048BC90 | 0.0% | Pending +SHC_3BB0A8C1_0x0048BC90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048BD40 | 100.0% | Reimplemented From a5a4ebb7ee9e0e9a33e2a5cab72c9b354afb8e51 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:35 +0100 Subject: [PATCH 76/94] style: ResyncAIZone (0x0048BC90) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - heatMaps + n is &heatMaps[n], and 0xf00 and 3840 are sizeof(heatMaps[0]); the receiving half is an early return. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncAIZone.cpp | 43 ++++++------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp b/src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp index f6629b27a3..d6deaaab25 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncAIZone.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_AIVState.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -14,29 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - WARNING: Enum "MappersEnumShort": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048BC90 void Commands::ResyncAIZone() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0xf04; + DAT_GameSynchronyState::instance.DAT_CommandSize = 3844; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -44,19 +25,21 @@ namespace Synchrony { OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( - DAT_AIVState::instance.heatMaps + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 0xf00, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + &DAT_AIVState::instance.heatMaps[DAT_GameSynchronyState::instance.DAT_GameCommandParam0], + sizeof(DAT_AIVState::instance.heatMaps[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( - (char*)(DAT_AIVState::instance.heatMaps + DAT_GameSynchronyState::instance.DAT_GameCommandParam0), - (size_t)((int)(3840)), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE + || DAT_GameSynchronyState::instance.isHost) { + return; } + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)&DAT_AIVState::instance.heatMaps[DAT_GameSynchronyState::instance.DAT_GameCommandParam0], + sizeof(DAT_AIVState::instance.heatMaps[0]), DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From 6aa93cfa90b02b78ffa39ef7a7f23e46f43b3f42 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:34 +0200 Subject: [PATCH 77/94] reimplement: SHC_3BB0A8C1_0x004833F0 100.0% Reimplemented AcknowledgeMapExistence, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 06ce58ccad ("reimplement: SHC_3BB0A8C1_0x004833F0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/AcknowledgeMapExistence.cpp | 62 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp diff --git a/src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp b/src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp new file mode 100644 index 0000000000..97feee49a7 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp @@ -0,0 +1,62 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004833F0 + void Commands::AcknowledgeMapExistence() + { + int _flag; + int _index; + DAT_GameSynchronyState::instance.DAT_CommandSize = 8; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&_flag, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&_index, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if ((_flag == 0) && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + DAT_GameSynchronyState::instance.unknownMapRelatedReceivedDataArray[_index] = 0; + DAT_GameSynchronyState::instance.field239_0x1072f8 = 50; + } + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index df05db7077..a85eab8950 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22575,7 +22575,7 @@ SHC_3BB0A8C1_0x00482C80 | 0.0% | Pending SHC_3BB0A8C1_0x00483290 | 0.0% | Pending -SHC_3BB0A8C1_0x004833F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004833F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004834B0 | 0.0% | Pending From 0ca543ebf47f982e0e6ff6cc4b2771b7fbd5f08d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:38 +0100 Subject: [PATCH 78/94] style: AcknowledgeMapExistence (0x004833F0) follows the style guide On top of gynt's version in the commit before, which does not build on main as it is (below). reccmp reads 100.0 (normalized 100.0), with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. - It builds on main with main's field names: GameSynchronyState::field239_0x1072f8 is mapExistenceAckCountdown. - gynt's _flag and _index are parameter0 and mapIndex, each declared where it is read. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/AcknowledgeMapExistence.cpp | 43 ++++++------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp b/src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp index 97feee49a7..4b9cb64ca3 100644 --- a/src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp +++ b/src/OpenSHC/Synchrony/Commands/AcknowledgeMapExistence.cpp @@ -1,36 +1,18 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004833F0 void Commands::AcknowledgeMapExistence() { - int _flag; - int _index; DAT_GameSynchronyState::instance.DAT_CommandSize = 8; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; @@ -44,17 +26,20 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&_flag, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&_index, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - if ((_flag == 0) && (DAT_GameSynchronyState::instance.isHost != FALSE)) { - DAT_GameSynchronyState::instance.unknownMapRelatedReceivedDataArray[_index] = 0; - DAT_GameSynchronyState::instance.field239_0x1072f8 = 50; - } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + int parameter0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(¶meter0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + int mapIndex; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&mapIndex, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if (parameter0 == 0 && DAT_GameSynchronyState::instance.isHost) { + DAT_GameSynchronyState::instance.unknownMapRelatedReceivedDataArray[mapIndex] = 0; + DAT_GameSynchronyState::instance.mapExistenceAckCountdown = 50; } } From 38ef68fc152058a22c8f722ccbb959655430367f Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:53 +0200 Subject: [PATCH 79/94] reimplement: SHC_3BB0A8C1_0x004834B0 100.0% Reimplemented ShareMSVMapIndex, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit eac98547dc ("reimplement: SHC_3BB0A8C1_0x004834B0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ShareMSVMapIndex.cpp | 62 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp b/src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp new file mode 100644 index 0000000000..66837675ca --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp @@ -0,0 +1,62 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x004834B0 + void Commands::ShareMSVMapIndex() + { + int local_8; + int local_4; + DAT_GameSynchronyState::instance.DAT_CommandSize = 8; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_8, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if ((local_8 == 0) && (DAT_GameSynchronyState::instance.isHost != FALSE)) { + DAT_MenuTextInputState::instance.DAT_ArrayOfMapIndices[local_4 + 499] = 0; + } + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index a85eab8950..50213990fa 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22577,7 +22577,7 @@ SHC_3BB0A8C1_0x00483290 | 0.0% | Pending SHC_3BB0A8C1_0x004833F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004834B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004834B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00483570 | 0.0% | Pending From e0118a1244ca66ac4ac63d6c1e5f7daef643d42d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:41 +0100 Subject: [PATCH 80/94] style: ShareMSVMapIndex (0x004834B0) follows the style guide On top of gynt's version in the commit before. On main's headers his file reads reccmp 97.9 (normalized 92.3); this reads 100.0 (normalized 100.0), with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The BOOLEnum include goes: BOOLEnum is never named here. - 0/1 values are tested by truth. - The original stores at MenuTextInputState + 0x1050 + mapIndex * 4. gynt's draft writes that as DAT_ArrayOfMapIndices[mapIndex + 499], with the array at 0x884 on his branch. On main that array starts at 0x880 and has 501 entries, so the address lies in the next one: DAT_ArrayOfMapIndices2[mapIndex - 1] (the array at 0x1054), the form main's MenuItemRenderFunction_SaveLoadMap_TableContent reads the same entries with. - The two received values are parameter0 and mapIndex, each declared where it is read. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ShareMSVMapIndex.cpp | 41 ++++++------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp b/src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp index 66837675ca..4f89bb29d9 100644 --- a/src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp +++ b/src/OpenSHC/Synchrony/Commands/ShareMSVMapIndex.cpp @@ -1,11 +1,9 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" @@ -13,25 +11,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x004834B0 void Commands::ShareMSVMapIndex() { - int local_8; - int local_4; DAT_GameSynchronyState::instance.DAT_CommandSize = 8; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; @@ -45,16 +27,19 @@ namespace Synchrony { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_8, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - if ((local_8 == 0) && (DAT_GameSynchronyState::instance.isHost != FALSE)) { - DAT_MenuTextInputState::instance.DAT_ArrayOfMapIndices[local_4 + 499] = 0; - } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + int parameter0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(¶meter0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + int mapIndex; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&mapIndex, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + if (parameter0 == 0 && DAT_GameSynchronyState::instance.isHost) { + DAT_MenuTextInputState::instance.DAT_ArrayOfMapIndices2[mapIndex - 1] = 0; } } From 173e445202e45971bfbde5bf604de4620a746804 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:49 +0200 Subject: [PATCH 81/94] reimplement: SHC_3BB0A8C1_0x00484E70 100.0% Reimplemented ResyncZone, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 6cd4395b6a ("reimplement: SHC_3BB0A8C1_0x00484E70 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- src/OpenSHC/Synchrony/Commands/ResyncZone.cpp | 62 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncZone.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncZone.cpp b/src/OpenSHC/Synchrony/Commands/ResyncZone.cpp new file mode 100644 index 0000000000..b4f790aebf --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncZone.cpp @@ -0,0 +1,62 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_WildlifeState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00484E70 + void Commands::ResyncZone() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x1904; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_WildlifeState::instance.grid + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + (size_t)((int)(6400)), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_WildlifeState::instance.grid + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + (size_t)((int)(6400)), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 50213990fa..debcc1ec5e 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22725,7 +22725,7 @@ SHC_3BB0A8C1_0x00484DA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484E10 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00484E70 | 0.0% | Pending +SHC_3BB0A8C1_0x00484E70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484F30 | 0.0% | Pending From 1e02e9003be7c9c72d8140d366f6641346fd1e1e Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:44 +0100 Subject: [PATCH 82/94] style: ResyncZone (0x00484E70) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are sizeof(grid[0]), one row of 40 cells (6400 bytes), where the draft has the byte count. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- src/OpenSHC/Synchrony/Commands/ResyncZone.cpp | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncZone.cpp b/src/OpenSHC/Synchrony/Commands/ResyncZone.cpp index b4f790aebf..46d9712d9b 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncZone.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncZone.cpp @@ -1,11 +1,9 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_WildlifeState.hpp" @@ -13,26 +11,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00484E70 void Commands::ResyncZone() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x1904; + DAT_GameSynchronyState::instance.DAT_CommandSize = 6404; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -41,19 +25,19 @@ namespace Synchrony { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( DAT_WildlifeState::instance.grid + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, - (size_t)((int)(6400)), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + sizeof(DAT_WildlifeState::instance.grid[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( DAT_WildlifeState::instance.grid + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, - (size_t)((int)(6400)), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + sizeof(DAT_WildlifeState::instance.grid[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); } } From 8c4ecf410121d6d8d1be4299b80ed2983c025236 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 13:43:55 +0200 Subject: [PATCH 83/94] reimplement: SHC_3BB0A8C1_0x00485020 100.0% Reimplemented CommandSelectionReplenishAmmo, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit a4dfc5780b ("reimplement: SHC_3BB0A8C1_0x00485020 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../CommandSelectionReplenishAmmo.cpp | 64 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp diff --git a/src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp b/src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp new file mode 100644 index 0000000000..bba9372825 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp @@ -0,0 +1,64 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00485020 + void Commands::CommandSelectionReplenishAmmo() + { + undefined4 local_4; + DAT_GameSynchronyState::instance.DAT_CommandSize = 3; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)(short)local_4; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&local_4, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (int)(char)local_4; + if (DAT_GameSynchronyState::instance.DAT_GameCommandParam1 == 0) { + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::TryAcquireAmmunitionOrPlanToBuyStone)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + return; + } + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::SelectionReplenishAmmo)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index debcc1ec5e..23a5718467 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22729,7 +22729,7 @@ SHC_3BB0A8C1_0x00484E70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00484F30 | 0.0% | Pending -SHC_3BB0A8C1_0x00485020 | 0.0% | Pending +SHC_3BB0A8C1_0x00485020 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004850E0 | 100.0% | Reimplemented From ebb4f060dc28914539d9577461220e0ecaea98d4 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:48 +0100 Subject: [PATCH 84/94] style: CommandSelectionReplenishAmmo (0x00485020) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - The buffer the received values are read into is readBuffer, declared at its first use. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../CommandSelectionReplenishAmmo.cpp | 51 +++++++------------ 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp b/src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp index bba9372825..43796c56c6 100644 --- a/src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp +++ b/src/OpenSHC/Synchrony/Commands/CommandSelectionReplenishAmmo.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -12,23 +11,9 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00485020 void Commands::CommandSelectionReplenishAmmo() { - undefined4 local_4; DAT_GameSynchronyState::instance.DAT_CommandSize = 3; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -39,25 +24,27 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (int)(short)local_4; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&local_4, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (int)(char)local_4; - if (DAT_GameSynchronyState::instance.DAT_GameCommandParam1 == 0) { - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::TryAcquireAmmunitionOrPlanToBuyStone)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); - return; - } - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::SelectionReplenishAmmo)( + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; + } + int readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 2, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = (short)readBuffer; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&readBuffer, 1, OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = (char)readBuffer; + if (DAT_GameSynchronyState::instance.DAT_GameCommandParam1 == 0) { + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::TryAcquireAmmunitionOrPlanToBuyStone)( DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0))); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); + return; } + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::SelectionReplenishAmmo)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0); } } From 5c7f53e9c25cdf20b29c165720f94cb25bb5ffad Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:55 +0200 Subject: [PATCH 85/94] reimplement: SHC_3BB0A8C1_0x00485210 100.0% Reimplemented SyncPacketSizeAnnouncement, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit c49a65aef9 ("reimplement: SHC_3BB0A8C1_0x00485210 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Commands/SyncPacketSizeAnnouncement.cpp | 66 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp diff --git a/src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp b/src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp new file mode 100644 index 0000000000..9178b49c9a --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp @@ -0,0 +1,66 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + Command handler in OpenSHC::Commands. On GCS_SCHEDULE_AND_SEND (host), serializes currentPacketTotalSize, + field73_0xbdc, and field67_0xba4, then immediately executes. On GCS_EXECUTE (non-host), deserializes those three + fields. Used to broadcast resync packet size metadata from the host to all clients before a resync pass. renamed + by: Claude Sonnet 4.6 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00485210 + void Commands::SyncPacketSizeAnnouncement() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 0xc; + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.currentPacketTotalSize, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field73_0xbdc, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field67_0xba4, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.currentPacketTotalSize, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field73_0xbdc, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field67_0xba4, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 23a5718467..94e195708a 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22735,7 +22735,7 @@ SHC_3BB0A8C1_0x004850E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00485140 | 0.0% | Pending -SHC_3BB0A8C1_0x00485210 | 0.0% | Pending +SHC_3BB0A8C1_0x00485210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004852D0 | 100.0% | Reimplemented From 213ad4847cce099073ff1870174dc0bb135a0bb9 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:50 +0100 Subject: [PATCH 86/94] style: SyncPacketSizeAnnouncement (0x00485210) follows the style guide On top of gynt's version in the commit before, which does not build on main as it is (below). reccmp reads 100.0 (normalized 100.0), with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - It builds on main with main's field names: GameSynchronyState::field67_0xba4 is field_0xba4; GameSynchronyState::field73_0xbdc is resyncTransferTotalSize. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Commands/SyncPacketSizeAnnouncement.cpp | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp b/src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp index 9178b49c9a..1e8ed9ebd3 100644 --- a/src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp +++ b/src/OpenSHC/Synchrony/Commands/SyncPacketSizeAnnouncement.cpp @@ -1,38 +1,19 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - Command handler in OpenSHC::Commands. On GCS_SCHEDULE_AND_SEND (host), serializes currentPacketTotalSize, - field73_0xbdc, and field67_0xba4, then immediately executes. On GCS_EXECUTE (non-host), deserializes those three - fields. Used to broadcast resync packet size metadata from the host to all clients before a resync pass. renamed - by: Claude Sonnet 4.6 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00485210 void Commands::SyncPacketSizeAnnouncement() { - DAT_GameSynchronyState::instance.DAT_CommandSize = 0xc; + DAT_GameSynchronyState::instance.DAT_CommandSize = 12; DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { @@ -40,24 +21,24 @@ namespace Synchrony { DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.currentPacketTotalSize, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field73_0xbdc, 4, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.resyncTransferTotalSize, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field67_0xba4, 4, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field_0xba4, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.currentPacketTotalSize, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field73_0xbdc, 4, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.resyncTransferTotalSize, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field67_0xba4, 4, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.field_0xba4, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); } } From 05f56f5fbf5036afe2dcda4e6c2d5407c3352a77 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:47 +0200 Subject: [PATCH 87/94] reimplement: SHC_3BB0A8C1_0x0048AA80 100.0% Reimplemented ResyncMoat, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 38851ffddc ("reimplement: SHC_3BB0A8C1_0x0048AA80 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp | 64 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp b/src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp new file mode 100644 index 0000000000..454ff203b4 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp @@ -0,0 +1,64 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048AA80 + void Commands::ResyncMoat() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x644; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_TileMapState::instance.moats + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100, 0x640, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_TileMapState::instance.moats + + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100), + 0x640, DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 94e195708a..e450800fd0 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23133,7 +23133,7 @@ SHC_3BB0A8C1_0x0048A8A0 | 0.0% | Pending SHC_3BB0A8C1_0x0048A9F0 | 0.0% | Pending -SHC_3BB0A8C1_0x0048AA80 | 0.0% | Pending +SHC_3BB0A8C1_0x0048AA80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048AB40 | 100.0% | Reimplemented From 85dce40d8a8cb61a48c0621bdca984b55e258aa9 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:52 +0100 Subject: [PATCH 88/94] style: ResyncMoat (0x0048AA80) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are 100 * sizeof(moats[0]) (1600 bytes): the hundred moats from index Param0 * 100. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp b/src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp index 454ff203b4..4e2e5008cc 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncMoat.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_TileMapState.hpp" @@ -14,29 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048AA80 void Commands::ResyncMoat() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x644; + DAT_GameSynchronyState::instance.DAT_CommandSize = 1604; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -44,19 +25,21 @@ namespace Synchrony { OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( - DAT_TileMapState::instance.moats + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100, 0x640, - OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + DAT_TileMapState::instance.moats + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100, + 100 * sizeof(DAT_TileMapState::instance.moats[0]), OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_TileMapState::instance.moats + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100), - 0x640, DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100); + 100 * sizeof(DAT_TileMapState::instance.moats[0]), + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100); } } From 4e28ee6ad2c13288c9a0904db2a5c66663d69625 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:47 +0200 Subject: [PATCH 89/94] reimplement: SHC_3BB0A8C1_0x0048ABF0 100.0% Reimplemented ResyncPitch, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit cfdcbeccd0 ("reimplement: SHC_3BB0A8C1_0x0048ABF0 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncPitch.cpp | 65 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp b/src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp new file mode 100644 index 0000000000..4c1a3fa1c4 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp @@ -0,0 +1,65 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x0048ABF0 + void Commands::ResyncPitch() + { + DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] + .time = 0; + DAT_GameSynchronyState::instance.DAT_CommandSize = 0x7d4; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)( + DAT_TileMapState::instance.pitchDitches + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100, + 2000, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, + OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) + && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( + (char*)(DAT_TileMapState::instance.pitchDitches + + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100), + 2000, DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index e450800fd0..c069020eaa 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -23137,7 +23137,7 @@ SHC_3BB0A8C1_0x0048AA80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048AB40 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0048ABF0 | 0.0% | Pending +SHC_3BB0A8C1_0x0048ABF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048ACB0 | 0.0% | Pending From 85a9a827906d57b44d86c299e9ce62bf242e4fa2 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:54 +0100 Subject: [PATCH 90/94] style: ResyncPitch (0x0048ABF0) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The BOOLEnum include goes: BOOLEnum is never named here. - Numbers are decimal. - 0/1 values are tested by truth. - Both sizes are 100 * sizeof(pitchDitches[0]) (2000 bytes): the hundred ditches from index Param0 * 100. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Synchrony/Commands/ResyncPitch.cpp | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp b/src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp index 4c1a3fa1c4..30afe10389 100644 --- a/src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp +++ b/src/OpenSHC/Synchrony/Commands/ResyncPitch.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony.func.hpp" @@ -6,7 +5,6 @@ #include "OpenSHC/Commands/GameCommandParameterLocation.hpp" #include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" #include "OpenSHC/Commands/GameCommandScheduling.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" #include "OpenSHC/Globals/DAT_TileMapState.hpp" @@ -14,29 +12,12 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x0048ABF0 void Commands::ResyncPitch() { DAT_GameSynchronyState::instance.DAT_GameCommandArray[DAT_GameSynchronyState::instance.DAT_CurrentGameCommandID] .time = 0; - DAT_GameSynchronyState::instance.DAT_CommandSize = 0x7d4; + DAT_GameSynchronyState::instance.DAT_CommandSize = 2004; if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { DAT_GameSynchronyState::instance.DAT_CommandActionPlan = OpenSHC::Commands::GCS_EXECUTE; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, @@ -45,19 +26,20 @@ namespace Synchrony { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)( DAT_TileMapState::instance.pitchDitches + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100, - 2000, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, - OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + 100 * sizeof(DAT_TileMapState::instance.pitchDitches[0]), + OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } if ((DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) - && (DAT_GameSynchronyState::instance.isHost == FALSE)) { + && (!DAT_GameSynchronyState::instance.isHost)) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 4, OpenSHC::Commands::GCPL_FIXED_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); MACRO_CALL(OpenSHC::Synchrony_Func::MemCopyFromParameter)( (char*)(DAT_TileMapState::instance.pitchDitches + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100), - 2000, DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100); + 100 * sizeof(DAT_TileMapState::instance.pitchDitches[0]), + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 * 100); } } From 2d9b3ccedac7a8ead08f6190831a8ddb3d549854 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:37 +0200 Subject: [PATCH 91/94] reimplement: SHC_3BB0A8C1_0x00481050 100.0% Reimplemented ClickErase, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 9ed0f09f5c ("reimplement: SHC_3BB0A8C1_0x00481050 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- src/OpenSHC/Synchrony/Commands/ClickErase.cpp | 70 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickErase.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickErase.cpp b/src/OpenSHC/Synchrony/Commands/ClickErase.cpp new file mode 100644 index 0000000000..eb74589dac --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickErase.cpp @@ -0,0 +1,70 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00481050 + void Commands::ClickErase() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 5; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::eraseAreaWithBrush, DAT_TileMapState::ptr)( + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1)), + (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam2))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index c069020eaa..295a883f76 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22449,7 +22449,7 @@ SHC_3BB0A8C1_0x00480E60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00480F00 | 0.0% | Pending -SHC_3BB0A8C1_0x00481050 | 0.0% | Pending +SHC_3BB0A8C1_0x00481050 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00481120 | 0.0% | Pending From 48307cf398668a37866338f6d8e877443ca7c6b8 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:19:58 +0100 Subject: [PATCH 92/94] style: ClickErase (0x00481050) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - Param0 is cleared with 0 before its low bytes are read, where the draft assigns DAT_CommandActionPlan, which is GCS_EXECUTE (0) on that path; the code is the same. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- src/OpenSHC/Synchrony/Commands/ClickErase.cpp | 53 +++++++------------ 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickErase.cpp b/src/OpenSHC/Synchrony/Commands/ClickErase.cpp index eb74589dac..a31aa6b9a8 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickErase.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickErase.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Map/TileMapState.func.hpp" @@ -13,22 +12,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00481050 void Commands::ClickErase() { @@ -45,25 +28,25 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 - = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = 0; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 1, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::eraseAreaWithBrush, DAT_TileMapState::ptr)( - DAT_GameSynchronyState::instance.DAT_GameCommandParam0, - (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1)), - (uint)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam2))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::eraseAreaWithBrush, DAT_TileMapState::ptr)( + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + DAT_GameSynchronyState::instance.DAT_GameCommandParam1, + DAT_GameSynchronyState::instance.DAT_GameCommandParam2); } } From 57b028b4174c63efa9e886f8d258b84a7b8c6ec6 Mon Sep 17 00:00:00 2001 From: Gynt Date: Sat, 3 Oct 2026 11:08:41 +0200 Subject: [PATCH 93/94] reimplement: SHC_3BB0A8C1_0x00482550 100.0% Reimplemented ClickSomethingWithDrawBridgeUnk, gynt's file as it stands on upstream's reimpl/Synchrony-Commands (ca943baa12), from his commit 84cec66487 ("reimplement: SHC_3BB0A8C1_0x00482550 100.0% Reimplemented", 2026-10-03), with his status line from that branch. His fork's reimpl/Synchrony-Commands (6fa5eaa533) has the same file. Taken as it is; what main's headers and the style rules need on top follows in our own commit. Co-Authored-By: Claude Fable 5.2 --- .../ClickSomethingWithDrawBridgeUnk.cpp | 66 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp diff --git a/src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp b/src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp new file mode 100644 index 0000000000..65531527bc --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp @@ -0,0 +1,66 @@ +#include "../../Synchrony.func.hpp" +#include "../Commands.func.hpp" + +#include "OpenSHC/Synchrony/Actions.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandParameterLocation.hpp" +#include "OpenSHC/Commands/GameCommandParameterReadWrite.hpp" +#include "OpenSHC/Commands/GameCommandScheduling.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandParameterLocation; + using OpenSHC::Commands::GameCommandParameterReadWrite; + using OpenSHC::Commands::GameCommandScheduling; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00482550 + void Commands::ClickSomethingWithDrawBridgeUnk() + { + DAT_GameSynchronyState::instance.DAT_CommandSize = 7; + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_SCHEDULE_AND_SEND) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 4, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); + return; + } + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 4, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::OpenOrCloseDrawbridge)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1)), + (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam2))); + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 295a883f76..cec205a54d 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22557,7 +22557,7 @@ SHC_3BB0A8C1_0x004823C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00482420 | 0.0% | Pending -SHC_3BB0A8C1_0x00482550 | 0.0% | Pending +SHC_3BB0A8C1_0x00482550 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00482620 | 100.0% | Reimplemented From 471511bc83c36f33aa66395e895afa31be997cd9 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 02:20:01 +0100 Subject: [PATCH 94/94] style: ClickSomethingWithDrawBridgeUnk (0x00482550) follows the style guide On top of gynt's version in the commit before; the code is the same, reccmp 100.0 (normalized 100.0) before and after, with the data resolvers and the function resolvers of this branch's functions on. - The first include is ../Commands.func.hpp, once; the using lines and the imported block comments are gone. - The execute half is an early return. - The casts around the command parameters are gone. - Param0 is cleared with 0 before its low bytes are read, where the draft assigns DAT_CommandActionPlan, which is GCS_EXECUTE (0) on that path; the code is the same. The status line is gynt's, 100.0% (Reimplemented), from the commit before. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../ClickSomethingWithDrawBridgeUnk.cpp | 50 +++++++------------ 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp b/src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp index 65531527bc..72f1a62893 100644 --- a/src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp +++ b/src/OpenSHC/Synchrony/Commands/ClickSomethingWithDrawBridgeUnk.cpp @@ -1,4 +1,3 @@ -#include "../../Synchrony.func.hpp" #include "../Commands.func.hpp" #include "OpenSHC/Synchrony/Actions.func.hpp" @@ -12,19 +11,6 @@ namespace OpenSHC { namespace Synchrony { - using OpenSHC::Commands::GameCommandParameterLocation; - using OpenSHC::Commands::GameCommandParameterReadWrite; - using OpenSHC::Commands::GameCommandScheduling; - - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00482550 void Commands::ClickSomethingWithDrawBridgeUnk() { @@ -41,25 +27,25 @@ namespace Synchrony { OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_SERIALIZE_INTO_PARAM_1); return; } - if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan == OpenSHC::Commands::GCS_EXECUTE) { - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 - = DAT_GameSynchronyState::instance.DAT_CommandActionPlan; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, - DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 4, - OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); - MACRO_CALL(OpenSHC::Synchrony::Actions_Func::OpenOrCloseDrawbridge)( - DAT_GameSynchronyState::instance.protocolInvokerPlayerID, - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam0)), - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam1)), - (int)((int)(DAT_GameSynchronyState::instance.DAT_GameCommandParam2))); + if (DAT_GameSynchronyState::instance.DAT_CommandActionPlan != OpenSHC::Commands::GCS_EXECUTE) { + return; } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam0, 2, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam1, 1, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::serializeOrDeserializeCommandParameter, + DAT_GameSynchronyState::ptr)(&DAT_GameSynchronyState::instance.DAT_GameCommandParam2, 4, + OpenSHC::Commands::GCPL_DYNAMIC_COMMAND_DATA_ADDRESS, OpenSHC::Commands::GCPRW_DESERIALIZE_FROM_PARAM1); + MACRO_CALL(OpenSHC::Synchrony::Actions_Func::OpenOrCloseDrawbridge)( + DAT_GameSynchronyState::instance.protocolInvokerPlayerID, + DAT_GameSynchronyState::instance.DAT_GameCommandParam0, + DAT_GameSynchronyState::instance.DAT_GameCommandParam1, + DAT_GameSynchronyState::instance.DAT_GameCommandParam2); } }