From c69264ce7aa63f40740ec0e923a8fccab9d522db Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 01:27:10 +0100 Subject: [PATCH 1/5] reimplement: SHC_3BB0A8C1_0x0047E3A0 100.0% Reimplemented MenuModalRenderFunction_WaitingForHost, gynt's code from his fork, branch reimpl/UI-MenuModals-100 (25e0f9fb1, 95.5% "asm differs" there). Unchanged, it measures reccmp 100.0% here, with today's headers, the resolvers on and --ignore-security-cookie. His newer reimpl/UI-MenuModals (2026-11-02) has an older decompiler-style form of it at 80-86%; that one is not used. Against the draft: decimal constants, COL_C2F0EB, a line comment with the text in place of the script's block comment, the four unused using-declarations (eTextSections, BGR24, TextAlignment, BOOLEnum) and the BOOLEnum.hpp include dropped, BGR24.hpp becomes ColorsEnum.hpp. His yParam / xParam locals go: the position is passed straight into the call (x + width / 2, y + 23; his width / 2 + x order is a tie), which gives the same code, as the arguments are pushed right to left and y is still computed before x. Same generated code (quick_diff and reccmp unchanged). Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- ...MenuModalRenderFunction_WaitingForHost.cpp | 26 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuModals/WaitingForHost/MenuModalRenderFunction_WaitingForHost.cpp diff --git a/src/OpenSHC/UI/MenuModals/WaitingForHost/MenuModalRenderFunction_WaitingForHost.cpp b/src/OpenSHC/UI/MenuModals/WaitingForHost/MenuModalRenderFunction_WaitingForHost.cpp new file mode 100644 index 0000000000..c2037fe1a7 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/WaitingForHost/MenuModalRenderFunction_WaitingForHost.cpp @@ -0,0 +1,26 @@ +#include "../WaitingForHost.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047E3A0 + void WaitingForHost::MenuModalRenderFunction_WaitingForHost(int x, int y, int width, int height) + { + // "Waiting for host..." + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_MULTIPLAYER_CONNECTION, 20), + x + width / 2, y + 23, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 17, FALSE, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index a105efbb9b..c687972c45 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -22361,7 +22361,7 @@ SHC_3BB0A8C1_0x0047E1A0 | 0.0% | Pending SHC_3BB0A8C1_0x0047E240 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0047E3A0 | 0.0% | Pending +SHC_3BB0A8C1_0x0047E3A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047E3E0 | 0.0% | Pending From ce88389471cf17cb3ca571d73131b11838481b96 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 01:27:11 +0100 Subject: [PATCH 2/5] reimplement: SHC_3BB0A8C1_0x004AD2B0 100.0% Reimplemented MenuModalRenderFunction_AlliesOrder, gynt's code from his fork, branch reimpl/UI-MenuModals-100 (25e0f9fb1, 95.0% "asm differs" there). Unchanged, it measures reccmp 100.0% here, with today's headers, the resolvers on and --ignore-security-cookie. His newer reimpl/UI-MenuModals (2026-11-02) has an older decompiler-style form of it at 80-86%; that one is not used. Against the draft: decimal constants, COL_CCFAFF, a line comment with the text in place of the script's block comment, the four unused using-declarations (eTextSections, BGR24, TextAlignment, BOOLEnum) and the BOOLEnum.hpp include dropped, BGR24.hpp becomes ColorsEnum.hpp. His yParam / xParam locals go: the position is passed straight into the call (x + 30, y + 25), which gives the same code, as the arguments are pushed right to left and y is still computed before x. His int xParam; declared before the BuildEnemyPlayerList call goes with them. The list is still rebuilt first on every render, as the original does. Same generated code (quick_diff and reccmp unchanged). Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuModalRenderFunction_AlliesOrder.cpp | 28 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuModals/AlliesOrder/MenuModalRenderFunction_AlliesOrder.cpp diff --git a/src/OpenSHC/UI/MenuModals/AlliesOrder/MenuModalRenderFunction_AlliesOrder.cpp b/src/OpenSHC/UI/MenuModals/AlliesOrder/MenuModalRenderFunction_AlliesOrder.cpp new file mode 100644 index 0000000000..17c8a6919d --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/AlliesOrder/MenuModalRenderFunction_AlliesOrder.cpp @@ -0,0 +1,28 @@ +#include "../AlliesOrder.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AD2B0 + void AlliesOrder::MenuModalRenderFunction_AlliesOrder(int x, int y, int width, int height) + { + MACRO_CALL(OpenSHC::UI::Helpers_Func::BuildEnemyPlayerList)(); + // "Set Orders" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_ALLIES, 5), + x + 30, y + 25, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 15, FALSE, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index c687972c45..f2bb595113 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -25801,7 +25801,7 @@ SHC_3BB0A8C1_0x004AD110 | 0.0% | Pending SHC_3BB0A8C1_0x004AD1E0 | 0.0% | Pending -SHC_3BB0A8C1_0x004AD2B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AD2B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AD2F0 | 0.0% | Pending From 5d4a0320092eb59b998e9ded2fbefd3b67d9b18c Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 01:27:11 +0100 Subject: [PATCH 3/5] reimplement: SHC_3BB0A8C1_0x004AD780 100.0% Reimplemented MenuModalRenderFunction_AlliesRequestGoods, gynt's code from his fork, branch reimpl/UI-MenuModals-100 (25e0f9fb1, 94.7% "asm differs" there). Unchanged, it measures reccmp 100.0% here, with today's headers, the resolvers on and --ignore-security-cookie. His newer reimpl/UI-MenuModals (2026-11-02) has an older decompiler-style form of it at 80-86%; that one is not used. Against the draft: decimal constants, COL_CCFAFF, a line comment with the text in place of the script's block comment, the four unused using-declarations (eTextSections, BGR24, TextAlignment, BOOLEnum) and the BOOLEnum.hpp include dropped, BGR24.hpp becomes ColorsEnum.hpp. His yParam / xParam locals go: the position is passed straight into the call (x + 20, y + 25), which gives the same code, as the arguments are pushed right to left and y is still computed before x. His int xParam; declared first goes with them. Same generated code (quick_diff and reccmp unchanged). Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- ...ModalRenderFunction_AlliesRequestGoods.cpp | 26 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuModals/AlliesRequestGoods/MenuModalRenderFunction_AlliesRequestGoods.cpp diff --git a/src/OpenSHC/UI/MenuModals/AlliesRequestGoods/MenuModalRenderFunction_AlliesRequestGoods.cpp b/src/OpenSHC/UI/MenuModals/AlliesRequestGoods/MenuModalRenderFunction_AlliesRequestGoods.cpp new file mode 100644 index 0000000000..73b444d235 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/AlliesRequestGoods/MenuModalRenderFunction_AlliesRequestGoods.cpp @@ -0,0 +1,26 @@ +#include "../AlliesRequestGoods.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AD780 + void AlliesRequestGoods::MenuModalRenderFunction_AlliesRequestGoods(int x, int y, int width, int height) + { + // "Request Goods" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_ALLIES, 7), + x + 20, y + 25, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 15, FALSE, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f2bb595113..7d58c4d6dc 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -25807,7 +25807,7 @@ SHC_3BB0A8C1_0x004AD2F0 | 0.0% | Pending SHC_3BB0A8C1_0x004AD480 | 0.0% | Pending -SHC_3BB0A8C1_0x004AD780 | 0.0% | Pending +SHC_3BB0A8C1_0x004AD780 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AD7C0 | 0.0% | Pending From 7e777928c40578a7af099a43a49628e725bbf8b9 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 01:27:12 +0100 Subject: [PATCH 4/5] reimplement: SHC_3BB0A8C1_0x004ADD90 100.0% Reimplemented MenuModalRenderFunction_AlliesSendGoods, gynt's code from his fork, branch reimpl/UI-MenuModals-100 (25e0f9fb1, 94.7% "asm differs" there). Unchanged, it measures reccmp 100.0% here, with today's headers, the resolvers on and --ignore-security-cookie. His newer reimpl/UI-MenuModals (2026-11-02) has an older decompiler-style form of it at 80-86%; that one is not used. Against the draft: decimal constants, COL_CCFAFF, a line comment with the text in place of the script's block comment, the four unused using-declarations (eTextSections, BGR24, TextAlignment, BOOLEnum) and the BOOLEnum.hpp include dropped, BGR24.hpp becomes ColorsEnum.hpp. His yParam / xParam locals go: the position is passed straight into the call (x + 20, y + 25), which gives the same code, as the arguments are pushed right to left and y is still computed before x. His int xParam; declared first goes with them. The comment keeps cr.tex's "Send Goods" (the draft had both "Send goods" and "Send Goods"). Same generated code (quick_diff and reccmp unchanged). Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- ...enuModalRenderFunction_AlliesSendGoods.cpp | 26 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuModals/AlliesSendGoods/MenuModalRenderFunction_AlliesSendGoods.cpp diff --git a/src/OpenSHC/UI/MenuModals/AlliesSendGoods/MenuModalRenderFunction_AlliesSendGoods.cpp b/src/OpenSHC/UI/MenuModals/AlliesSendGoods/MenuModalRenderFunction_AlliesSendGoods.cpp new file mode 100644 index 0000000000..ecefb444d8 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/AlliesSendGoods/MenuModalRenderFunction_AlliesSendGoods.cpp @@ -0,0 +1,26 @@ +#include "../AlliesSendGoods.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ADD90 + void AlliesSendGoods::MenuModalRenderFunction_AlliesSendGoods(int x, int y, int width, int height) + { + // "Send Goods" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_ALLIES, 6), + x + 20, y + 25, OpenSHC::Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_CCFAFF, 15, FALSE, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 7d58c4d6dc..f887399166 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -25813,7 +25813,7 @@ SHC_3BB0A8C1_0x004AD7C0 | 0.0% | Pending SHC_3BB0A8C1_0x004AD920 | 0.0% | Pending -SHC_3BB0A8C1_0x004ADD90 | 0.0% | Pending +SHC_3BB0A8C1_0x004ADD90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004ADDD0 | 0.0% | Pending From a70fd8d604623408ac5d3f4dc31af9311a077648 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 01:27:12 +0100 Subject: [PATCH 5/5] reimplement: SHC_3BB0A8C1_0x004AE070 100.0% Reimplemented MenuModalRenderFunction_ChooseRandomNumberOfEnemies, gynt's code from his fork, branch reimpl/UI-MenuModals-100 (25e0f9fb1, 94.7% "asm differs" there). Unchanged, it measures reccmp 100.0% here, with today's headers, the resolvers on and --ignore-security-cookie. His newer reimpl/UI-MenuModals (2026-11-02) has an older decompiler-style form of it at 80-86%; that one is not used. Against the draft: decimal constants, COL_CCFAFF, a line comment with the text in place of the script's block comment, the four unused using-declarations (eTextSections, BGR24, TextAlignment, BOOLEnum) and the BOOLEnum.hpp include dropped, BGR24.hpp becomes ColorsEnum.hpp. The decompiler's iVar2 to iVar5 go: both texts' positions (x + 300, y + 100 and x + 100, y + 300), the font sizes, the wrap width 400 and the blend 0 are passed straight into the calls, which gives the same code. The second comment drops the script's triple space after "You can" (cr.tex has one space); the two one-line calls are clang-formatted. Same generated code (quick_diff and reccmp unchanged). Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- ...erFunction_ChooseRandomNumberOfEnemies.cpp | 32 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuModals/ChooseRandomNumberOfEnemies/MenuModalRenderFunction_ChooseRandomNumberOfEnemies.cpp diff --git a/src/OpenSHC/UI/MenuModals/ChooseRandomNumberOfEnemies/MenuModalRenderFunction_ChooseRandomNumberOfEnemies.cpp b/src/OpenSHC/UI/MenuModals/ChooseRandomNumberOfEnemies/MenuModalRenderFunction_ChooseRandomNumberOfEnemies.cpp new file mode 100644 index 0000000000..27fc3ec4c8 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/ChooseRandomNumberOfEnemies/MenuModalRenderFunction_ChooseRandomNumberOfEnemies.cpp @@ -0,0 +1,32 @@ +#include "../ChooseRandomNumberOfEnemies.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AE070 + void ChooseRandomNumberOfEnemies::MenuModalRenderFunction_ChooseRandomNumberOfEnemies( + int x, int y, int width, int height) + { + // "How many opponents can you handle!" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 1), + x + 300, y + 100, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, FALSE, 0); + // "This will create some random opponents for you. You can still change opponent types afterwards." + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 2), + x + 100, y + 300, 400, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f887399166..6e036f9340 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -25863,7 +25863,7 @@ SHC_3BB0A8C1_0x004AE002 | 0.0% | Pending SHC_3BB0A8C1_0x004AE010 | 0.0% | Pending -SHC_3BB0A8C1_0x004AE070 | 0.0% | Pending +SHC_3BB0A8C1_0x004AE070 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AE0F0 | 0.0% | Pending