From ba6991a9141b7ddbb5ff6c18488772b823de1c16 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 02:56:39 +0100 Subject: [PATCH 1/7] reimplement: SHC_3BB0A8C1_0x004E1B30 100.0% Reimplemented From gynt's fork branch reimpl/UI-MenuViews-development (99.0% there), after main's renames (INT_00ec082c, CHAR_00eb0e44, which also replaces the draft's (*(char*)&INT_00eb0e44::instance) pun) and a style pass; the statements are his. What changed: the decompiler's two gotos between the skirmish picture and the victory speech become three plain tests of the game mode in the original's order, and the eight written-out alive-player tests become a loop over playerIsAlive from player 1, bounded by countof as main writes such loops, testing each entry by truthiness (every store is 0 or 1); both measure the same as the draft. DVar2 = timeGetTime() is folded into the subtraction; iVar3, cVar4, pcVar5 and local_104 go or get names (alivePlayers, fileName, scoresFile); pMVar1 is Menu* const menu, and menuY and menuX are const; the unused xPos and the stray ; go; (BuildingsAndStatusMenuTabType)0 is BASMTT_NONE; DAT_SomeTextArrayIndex = 9 is TAIT_NINE__FILTER_B, as main writes it; the missions 7 to 11 test is a range; the lord-type test becomes an else-if; 0x50 and 0x3c are 80 and 60; the (ushort) and (int) casts go; the scores file's source name is MapPropertiesState's field at offset 0, SEC_Section1089 (the map's file name), where the draft cast the whole struct to char*; seven using lines and the BOOLEnum.hpp include go; comments say what each part does. The scores file name is still read into a local before WriteMissionToScoresFile, as the draft had it (the call inside the argument list: quick_diff 0.9845 -> 0.9741), and the four playBINK calls stay four, as the original's compiler merged their tails (one call after picking the file: quick_diff 0.9845 -> 0.8421); both kept with a comment. quick_diff 0.9845, the draft's own number, which leaves only the security cookie and the timeGetTime import call. playBINK and putFileNameAndAppendFileExtension take a char*, so their strings are cast with (char*), as main's playBikVideoFromPlayer.cpp does. The strings are the s_ pointers from string-literals.hpp, with their text above them (SG 19), as in main's sibling PrepareHistoryBook (the original pushes each address; the S_ macros are for inline copies). This file was measured as it stands, not only the draft: 100.0% raw and 100.0% normalized in reccmp in a clean alone build of the branch on main 1c294596c. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- ...View_MissionFinishedTransition_Prepare.cpp | 181 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/MissionFinishedTransition/MenuView_MissionFinishedTransition_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/MissionFinishedTransition/MenuView_MissionFinishedTransition_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MissionFinishedTransition/MenuView_MissionFinishedTransition_Prepare.cpp new file mode 100644 index 0000000000..1eb83d24c5 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MissionFinishedTransition/MenuView_MissionFinishedTransition_Prepare.cpp @@ -0,0 +1,181 @@ +#include "../MissionFinishedTransition.func.hpp" + +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Game/Skirmish.func.hpp" +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/IO/ResourceManager.func.hpp" +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/MenuTextInputState.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/IO/FileResourceType.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/CHAR_00eb0e44.hpp" +#include "OpenSHC/Globals/CHAR_ARRAY_00eb9ac8.hpp" +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_00eb9af8.hpp" +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_FinalResultsOrderByColumn.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition2.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_ResourceManager.hpp" +#include "OpenSHC/Globals/DAT_SFXState.hpp" +#include "OpenSHC/Globals/DAT_SoundSystemState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_VideoBikQueue.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/DWORD_00ed27b4.hpp" +#include "OpenSHC/Globals/INT_00ec0828.hpp" +#include "OpenSHC/Globals/INT_00ec082c.hpp" +#include "OpenSHC/Globals/INT_00ed279c.hpp" +#include "OpenSHC/Globals/SEC_RNG.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1B30 + void MissionFinishedTransition::MenuView_MissionFinishedTransition_Prepare() + { + DAT_GameCore::instance.gameDuration = timeGetTime() - DAT_GameCore::instance.timeSum_2; + INT_00ed279c::instance = 0; + DAT_FinalResultsOrderByColumn::instance = 0; + DAT_00eb9af8::instance = 0; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_800x600) { + DAT_GameCore::instance.activeMenuTab.tabType = OpenSHC::UI::Enums::BASMTT_NONE; + INT_00ec082c::instance = 0; + } else { + DAT_GameCore::instance.activeMenuTab.tabType = OpenSHC::UI::Enums::BASMTT_KEEP_OR_MPMENU_IPX; + INT_00ec082c::instance = 2; + } + DAT_VideoBikQueue::instance.storedMessages_0x924 = 0; + DWORD_00ed27b4::instance = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition2::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition3::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + CHAR_00eb0e44::instance = 0; + MACRO_CALL(OpenSHC::Game::Skirmish_Func::StoreLocalTime)(); + int const menuY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const menuX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = menuX; + menu->yPosition = menuY; + DAT_MenuHandlerState::instance.y = menuY; + DAT_MenuHandlerState::instance.x = menuX; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + // the victory video unless at the skirmish end screen: Arabian for missions 7 to 11 or an Arabian lord + // four calls (one call after picking the file: quick_diff 0.9845 -> 0.8421) + if (DAT_GameSynchronyState::instance.currentGameMode + != OpenSHC::Game::GM_SKIRMISH_END_OF_GAME_SINGLE_PLAYER) { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_CAMPAIGN_MISSION) { + if (DAT_GameCore::instance.missionNumber1to20 >= 7 + && DAT_GameCore::instance.missionNumber1to20 <= 11) { + // "arabian_win.bik" + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, + DAT_BinkControlState::ptr)(0, (char*)s_arabian_win_bik_005ab800, 0, 0, + DAT_MenuHandlerState::instance.x + 80, DAT_MenuHandlerState::instance.y + 60, 2); + } else { + // "crusader_win.bik" + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, + DAT_BinkControlState::ptr)(0, (char*)s_crusader_win_bik_005ab7ec, 0, 0, + DAT_MenuHandlerState::instance.x + 80, DAT_MenuHandlerState::instance.y + 60, 2); + } + } else if (MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::getLordTypeForPlayer, + DAT_GameSynchronyState::ptr)(DAT_GameSynchronyState::instance.currentPlayerSlotID) + == 1) { + // "arabian_win.bik" + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, + DAT_BinkControlState::ptr)(0, (char*)s_arabian_win_bik_005ab800, 0, 0, + DAT_MenuHandlerState::instance.x + 80, DAT_MenuHandlerState::instance.y + 60, 2); + } else { + // "crusader_win.bik" + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, + DAT_BinkControlState::ptr)(0, (char*)s_crusader_win_bik_005ab7ec, 0, 0, + DAT_MenuHandlerState::instance.x + 80, DAT_MenuHandlerState::instance.y + 60, 2); + } + } + // a skirmish's end shows its stored end-screen picture + if (DAT_GameSynchronyState::instance.currentGameMode + == OpenSHC::Game::GM_SKIRMISH_END_OF_GAME_SINGLE_PLAYER) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(CHAR_ARRAY_00eb9ac8::instance); + } + if (DAT_GameSynchronyState::instance.currentGameMode + != OpenSHC::Game::GM_SKIRMISH_END_OF_GAME_SINGLE_PLAYER) { + // the victory speech in a skirmish game or while any player is alive + int alivePlayers = 0; + for (int player = 1; player < countof(DAT_GameState::instance.mapAndTime.playerIsAlive); ++player) { + if (DAT_GameState::instance.mapAndTime.playerIsAlive[player]) { + ++alivePlayers; + } + } + if (DAT_GameSynchronyState::instance.currentGameMode == OpenSHC::Game::GM_SKIRMISH_SINGLE_PLAYER + || alivePlayers != 0) { + if (SEC_RNG::instance.currentNumber1 % 3 != 0) { + // "Victory!" ("general_victory1.wav") + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playWAVSFX, DAT_SFXState::ptr)( + s_general_victory1_wav_005ab7d4); + } else { + // "We are victorious sire!" ("general_victory2.wav") + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playWAVSFX, DAT_SFXState::ptr)( + s_general_victory2_wav_005ab7bc); + } + } + MACRO_CALL_MEMBER( + OpenSHC::Audio::MSS::SoundSystem_Func::playWinMusicVariation, DAT_SoundSystemState::ptr)(); + } + DAT_MenuTextInputState::instance.DAT_SomeTextArrayIndex = OpenSHC::Text::TAIT_NINE__FILTER_B; + MACRO_CALL_MEMBER( + OpenSHC::UI::MenuTextInputState_Func::clearAnyOtherModalDialogs, DAT_MenuTextInputState::ptr)(); + // outside skirmish and multiplayer, the mission's score goes into its .sco file + if (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) { + INT_00ec0828::instance = 0; + MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::computeMissionCompletionScore, + DAT_MapPropertiesState::ptr)(); + char fileName[256]; + // "sco" + MACRO_CALL_MEMBER( + OpenSHC::IO::LowLevelMemory_Func::putFileNameAndAppendFileExtension, DAT_LowLevelMemory::ptr)( + (char*)DAT_MapPropertiesState::instance.SEC_Section1089, fileName, (char*)s_sco_005ab7b8); + MACRO_CALL_MEMBER(OpenSHC::IO::ResourceManager_Func::resolveResourceFileName, DAT_ResourceManager::ptr)( + OpenSHC::IO::FRT_SCORES, fileName); + // the file name first, then the call (the name inside the call: quick_diff 0.9845 -> 0.9741) + char* const scoresFile = MACRO_CALL_MEMBER( + OpenSHC::IO::ResourceManager_Func::getFileNameOfCurrentActiveResource, DAT_ResourceManager::ptr)(); + MACRO_CALL(OpenSHC::UI::Helpers_Func::WriteMissionToScoresFile)( + scoresFile, DAT_MapPropertiesState::instance.missionScore); + } + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 6e036f9340..f91a2395af 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36381,7 +36381,7 @@ SHC_3BB0A8C1_0x004E1A50 | 0.0% | Pending SHC_3BB0A8C1_0x004E1AA0 | 0.0% | Pending -SHC_3BB0A8C1_0x004E1B30 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1B30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1E30 | 0.0% | Pending From 634bd6c3cfb8ec9c816a386dac9378b9a3ad10da Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 02:56:39 +0100 Subject: [PATCH 2/7] reimplement: SHC_3BB0A8C1_0x004B8080 100.0% Reimplemented From gynt's fork branch archive/UI-MenuViews-merged-full (99.2% there), after a style pass. The map-surface store moves up, before the list box's corners are worked out: after them, as the draft had it, MSVC spills the left edge one instruction early (quick_diff 0.9840 -> 0.9920, which leaves only ret / ret 0). What else changed: the banner's text group 199 is TEXT_SCENARIO (text 2 is "Scenario Editor"; the script's block comment becomes that line); the offsets are decimal; the colour casts and the stray return go; x1 and x2 are frameLeft and frameRight; the six locals are const; two unused using lines go; comments say what the background and the box are. This file was measured as it stands, not only the draft: 100.0% raw and 100.0% normalized in reccmp in a clean alone build of the branch on main 1c294596c. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_EditScenario_DoEveryFrame.cpp | 70 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/EditScenario/MenuView_EditScenario_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/EditScenario/MenuView_EditScenario_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/EditScenario/MenuView_EditScenario_DoEveryFrame.cpp new file mode 100644 index 0000000000..545d0aae97 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/EditScenario/MenuView_EditScenario_DoEveryFrame.cpp @@ -0,0 +1,70 @@ +#include "../EditScenario.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B8080 + void EditScenario::MenuView_EditScenario_DoEveryFrame() + { + // the background, centred + DAT_TextureRenderCoreObject::instance.currentRenderSurfaceIdentifierUnk_0x8 + = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + if (DAT_MenuModalComposition1::instance.activeModalDialogID == OpenSHC::UI::Enums::MMT_NONE) { + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + // "Scenario Editor" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_SCENARIO, 2, DAT_MenuHandlerState::instance.x, + DAT_MenuHandlerState::instance.y, 800, 60); + // the map surface, set before the corners are worked out (after them: quick_diff 0.9920 -> 0.9840) + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + // the list box: dimmed and framed in yellow, with a 20 pixel strip on its right for the scroll buttons + int const left = DAT_MenuHandlerState::instance.x + 270; + int const top = DAT_MenuHandlerState::instance.y + 90; + int const right = DAT_MenuHandlerState::instance.x + 770; + int const bottom = DAT_MenuHandlerState::instance.y + 489; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::dimBox, DAT_PencilRenderCore::ptr)( + left, top, right - 20, bottom); + int const frameRight = right + 1; + int const frameLeft = left - 1; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + frameLeft, top - 1, frameRight, top - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + frameLeft, bottom + 1, frameRight, bottom + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + right - 20, top + 20, frameRight, top + 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + frameLeft, top, frameLeft, bottom, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + frameRight, top, frameRight, bottom, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + right - 20, top, right - 20, bottom, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + right - 19, bottom - 20, right, bottom - 20, COL_VERY_SOFT_YELLOW::instance.shortValue); + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f91a2395af..09aab34f98 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -27105,7 +27105,7 @@ SHC_3BB0A8C1_0x004B8000 | 0.0% | Pending SHC_3BB0A8C1_0x004B8050 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004B8080 | 0.0% | Pending +SHC_3BB0A8C1_0x004B8080 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B8200 | 100.0% | Reimplemented From f8e3c784a2751b9d29e57250178604397cc3498a Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 02:56:39 +0100 Subject: [PATCH 3/7] headers: WindowAndDirectDraw.pendingMenuRedraw is a BOOLEnum It was a dword. Every store in the binary is 0 or 1: the 1s at 0x00430CC4 and 0x00431ADF (immediates), 0x004475E2 (ebp = 1, set at 0x00446C81), 0x00470021 and 0x00472A70 (edi = 1); the 0s at 0x00430DBD, 0x00431C15, 0x0043242F and 0x00439974 (the zero register). Every read compares it with a register holding 0 (0x00430DAA, 0x00431BD3, 0x004323ED, 0x0043993C). Main's two writers, MenuView_MapEditorLandscaping_Prepare and prepareWindowAndDDrawUnk, store 1 and compile the same (quick_diff 0.8889 and 0.9773 before and after). Co-Authored-By: Claude Opus 5.5 --- src/OpenSHC/UI/Rendering/WindowAndDirectDraw.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenSHC/UI/Rendering/WindowAndDirectDraw.hpp b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw.hpp index 36f03a5f07..9a9e39fadb 100644 --- a/src/OpenSHC/UI/Rendering/WindowAndDirectDraw.hpp +++ b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw.hpp @@ -70,7 +70,7 @@ namespace UI { dword pendingBltMode; // 0x000000D0 length: 4 ushort* surfacePointer_screenMenu; // 0x000000D4 length: 4 ushort* surfacePointer_mapGame; // 0x000000D8 length: 4 - dword pendingMenuRedraw; // 0x000000DC length: 4 + BOOLEnum pendingMenuRedraw; // 0x000000DC length: 4 BOOLEnum not_DDCAPS2_CANBOBHARDWARE_0xe0; // 0x000000E0 length: 4 undefined1 padding_0xe4[8]; // 0x000000E4 length: 8 IDirectDraw* pointerToIDirectDrawInterface; // 0x000000EC length: 4 From 30c7deeae0293b9de0fb96b0f8ef0e51957e710a Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 02:56:39 +0100 Subject: [PATCH 4/7] reimplement: SHC_3BB0A8C1_0x00430CE0 100.0% Reimplemented From gynt's fork branch archive/UI-MenuViews-merged-full (97.9% there). One fix: at 640x480 the draft never set DAT_MenuHandlerState::instance.y, which the original does in both branches (the store at 0x00430D0E), so at that resolution the menu handler kept whatever y it had before. With the store back, the two branches have the same shape, each with its own Menu* const local (the draft's pMVar1) and the border width read once into x, and quick_diff goes 0.9840 -> 0.9975, which leaves only ret / ret 0. Style pass: menuTopY is y and `+ -600` is `- 600`; the offsets and box corners are decimal; the colour casts and the redundant parentheses go; the pending-redraw test becomes an early return that keeps the draft's truthiness, if (!pendingMenuRedraw), and the store is FALSE, as the field is a BOOLEnum since the header commit before this one (both measure the same); three unused using lines go; comments say what the blocks draw, and a fixme says the original loads the left edge picture for both sides in every resolution, though the right ones exist and other editor views use them (the code keeps it). The strings are the s_ pointers from string-literals.hpp, with their text above them (SG 19), as in main's sibling PrepareHistoryBook (the original pushes each address; the S_ macros are for inline copies). This file was measured as it stands, not only the draft: 100.0% raw and 100.0% normalized in reccmp in a clean alone build of the branch on main 1c294596c. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- ...enuView_MapEditorLandscaping_DoInitial.cpp | 304 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 305 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoInitial.cpp new file mode 100644 index 0000000000..66a9e7fa2a --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoInitial.cpp @@ -0,0 +1,304 @@ +#include "../MapEditorLandscaping.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/COL_MAGENTA.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00430CE0 + void MapEditorLandscaping::MenuView_MapEditorLandscaping_DoInitial() + { + // the menu sits at the bottom of the screen, at its left edge at 640x480 + int const y = DAT_WindowAndDirectDraw::instance.resolutionY - 600; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_640x480) { + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = 0; + menu->yPosition = y; + DAT_MenuHandlerState::instance.x = 0; + DAT_MenuHandlerState::instance.y = y; + } else { + int const x = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = x; + menu->yPosition = y; + DAT_MenuHandlerState::instance.x = x; + DAT_MenuHandlerState::instance.y = y; + // a magenta box under the menu panel at 800x600 and 1024x768 + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_800x600) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(0, 434, 799, 599, COL_MAGENTA::instance.shortValue); + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1024x768) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(DAT_MenuHandlerState::instance.x, 602, + DAT_MenuHandlerState::instance.x + 799, 767, COL_MAGENTA::instance.shortValue); + } + } + if (DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SIEGETOWER + && DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setMenuTabIndexUnk, + DAT_TextureRenderCoreObject::ptr)(2); + } + if (!DAT_WindowAndDirectDraw::instance.pendingMenuRedraw) { + return; + } + DAT_WindowAndDirectDraw::instance.pendingMenuRedraw = FALSE; + // the edge pictures left and right of the menu, for this resolution + // fixme: the original loads the left edge picture for both sides (the r pictures exist, other views use + // them) + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1024x768) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1024l_tgx_005a2388); + // "edge1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1024l_tgx_005a2388); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 912, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1024x600) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1024l_tgx_005a2388); + // "edge1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1024l_tgx_005a2388); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 912, 600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1280x1024) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1280l_tgx_005a2378); + // "edge1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1280l_tgx_005a2378); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 1024 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1040, 1024 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1600x1200) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1600l_tgx_005a2368); + // "edge1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1600l_tgx_005a2368); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1200, 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1280x720) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1280l_tgx_005a2378); + // "edge1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1280l_tgx_005a2378); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 720 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1040, 720 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1440x900) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1440l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1440l_tgx_005a2358); + // "edge1440l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1440l_tgx_005a2358); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1120, 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1920x1080) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1920l_tgx_005a2348); + // "edge1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1920l_tgx_005a2348); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 1080 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1360, 1080 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1920x1200) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1920l_tgx_005a2348); + // "edge1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1920l_tgx_005a2348); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1360, 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_2560x1440) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge2560l_tgx_005a2338); + // "edge2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge2560l_tgx_005a2338); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 1440 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1680, 1440 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_2560x1600) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge2560l_tgx_005a2338); + // "edge2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge2560l_tgx_005a2338); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 1600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1680, 1600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1366x768) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1366l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1366l_tgx_005a2328); + // "edge1366l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1366l_tgx_005a2328); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1082, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1360x768) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1360l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1360l_tgx_005a2318); + // "edge1360l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1360l_tgx_005a2318); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1080, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1680x1050) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1680l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1680l_tgx_005a2308); + // "edge1680l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1680l_tgx_005a2308); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 1050 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1240, 1050 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1600x900) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "edge1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1600l_tgx_005a2368); + // "edge1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_edge1600l_tgx_005a2368); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, 0, 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 1, 1200, 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 09aab34f98..d4c2b19bd1 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -10537,7 +10537,7 @@ SHC_3BB0A8C1_0x00430CB8 | 0.0% | Pending SHC_3BB0A8C1_0x00430CC0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00430CE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00430CE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004313C0 | 0.0% | Pending From efd37873d17addbe1c56e54957fe437f3982567e Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 02:56:39 +0100 Subject: [PATCH 5/7] headers: DAT_IntroStep and DAT_IntroBlendStrength are ints Both were undefined4. MenuView_IntroLogos_DoEveryFrame (0x004247A0) treats them as signed: it tests DAT_IntroStep with cmp [0x00B9611C], 2 and jge at 0x004247A0, and DAT_IntroBlendStrength holds negative values: the fade-in stores a signed division by 20 (0x00424870, above 32 for one frame before the clamp) and the fade-out stores 32 - elapsed / 20 (0x00424904), which is 0 or below on the frame the fade ends and is never reset after the last logo; that negative value is what the jg at 0x00424909 tests, with jl at 0x00424875 and jge at 0x00424968. DAT_IntroStep only holds 0, 1 and 2. The two other users only compare with == and store constants: MenuItemActionHandler_IntroLogos_General on main (quick_diff 0.8667 before and after) and MenuView_IntroLogos_Prepare (0x00424720, pending), which tests the step and stores 0 in the blend. With int, the (int) casts on them go. Co-Authored-By: Claude Opus 5.5 --- src/OpenSHC/Globals/DAT_IntroBlendStrength.hpp | 4 ++-- src/OpenSHC/Globals/DAT_IntroStep.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenSHC/Globals/DAT_IntroBlendStrength.hpp b/src/OpenSHC/Globals/DAT_IntroBlendStrength.hpp index 4ef493ed1c..967735036b 100644 --- a/src/OpenSHC/Globals/DAT_IntroBlendStrength.hpp +++ b/src/OpenSHC/Globals/DAT_IntroBlendStrength.hpp @@ -9,11 +9,11 @@ #pragma once // GLOBAL: STRONGHOLDCRUSADER 0x00B96118 -// StructResolver::Instance::instance +// StructResolver::Instance::instance namespace OpenSHC { -MACRO_STRUCT_RESOLVER(undefined4, false, Address::SHC_3BB0A8C1_0x00B96118) DAT_IntroBlendStrength; +MACRO_STRUCT_RESOLVER(int, false, Address::SHC_3BB0A8C1_0x00B96118) DAT_IntroBlendStrength; } // namespace OpenSHC MACRO_STRUCT_INSTANCE(Address::SHC_3BB0A8C1_0x00B96118); diff --git a/src/OpenSHC/Globals/DAT_IntroStep.hpp b/src/OpenSHC/Globals/DAT_IntroStep.hpp index 0929943021..61a123466b 100644 --- a/src/OpenSHC/Globals/DAT_IntroStep.hpp +++ b/src/OpenSHC/Globals/DAT_IntroStep.hpp @@ -9,11 +9,11 @@ #pragma once // GLOBAL: STRONGHOLDCRUSADER 0x00B9611C -// StructResolver::Instance::instance +// StructResolver::Instance::instance namespace OpenSHC { -MACRO_STRUCT_RESOLVER(undefined4, false, Address::SHC_3BB0A8C1_0x00B9611C) DAT_IntroStep; +MACRO_STRUCT_RESOLVER(int, false, Address::SHC_3BB0A8C1_0x00B9611C) DAT_IntroStep; } // namespace OpenSHC MACRO_STRUCT_INSTANCE(Address::SHC_3BB0A8C1_0x00B9611C); From 0244b5464327cc52215bd212c8a71989eda7ec59 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 02:56:40 +0100 Subject: [PATCH 6/7] reimplement: SHC_3BB0A8C1_0x004247A0 100.0% Reimplemented From gynt's fork branch reimpl/UI-MenuViews-development (99.3% there), after a style pass; the statements are his (his archive/UI-MenuViews-merged-full draft of it measures lower, quick_diff 0.8727 against 0.9489). What changed: the goto that skipped the full-strength test after the fade-in becomes an if around the step-1 stores, which measures the same and keeps the original's jumps (the fade-in test still jumps straight to the black box); the decompiler's comma test for step 2 becomes an assignment and an if; the two stores of DAT_IntroStep::instance where it is 0 are written 0; _currentTime, _yParam, _xPos and _introStepDuration are currentTime, y, x and duration, declared where they are first used; 0x1e, 0x9c4, 0x14, 0x20 and 0x10 are 30, 2500, 20, 32 and 16; 0xffffff is main's COL_FFFFFF (ColorsEnum.hpp instead of BGR24.hpp); the (ushort) cast on COL_BLACK, the (int) cast on the blend argument and the stray return go; the script's block comments become line comments; five using lines and the BOOLEnum.hpp include go. DAT_IntroStep and DAT_IntroBlendStrength are int since the header commit before this one, so their (int) casts go too; the casts that stay make the elapsed times signed, as the original has them. The timeGetTime() call whose result the original drops stays, with a comment. quick_diff 0.9489, the draft's own number, which leaves the colour immediate, the timeGetTime import calls and ret / ret 0. This file was measured as it stands, not only the draft: 100.0% raw and 100.0% normalized in reccmp in a clean alone build of the branch on main 1c294596c. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_IntroLogos_DoEveryFrame.cpp | 105 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_DoEveryFrame.cpp new file mode 100644 index 0000000000..de5b76b9ed --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_DoEveryFrame.cpp @@ -0,0 +1,105 @@ +#include "../IntroLogos.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_IntroBlendStrength.hpp" +#include "OpenSHC/Globals/DAT_IntroStep.hpp" +#include "OpenSHC/Globals/DAT_IntroTimestamp.hpp" +#include "OpenSHC/Globals/DAT_IntroTransitionStep.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004247A0 + void IntroLogos::MenuView_IntroLogos_DoEveryFrame() + { + // the two logos, then the online-play notice on black + if (DAT_IntroStep::instance < 2) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, + DAT_WindowAndDirectDraw::instance.resolutionY, COL_BLACK::instance.shortValue); + int const y = DAT_WindowAndDirectDraw::instance.resolutionY / 2 - 30; + int const x = DAT_WindowAndDirectDraw::instance.resolutionX / 2; + // "Gameplay may change during online play" + 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_GAMEPLAY_ONLINE, 0), + x, y, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_FFFFFF, 16, FALSE, 0); + } + DWORD const currentTime = timeGetTime(); + if (DAT_IntroTransitionStep::instance == 0) { + // fade in + DAT_IntroBlendStrength::instance = (int)(currentTime - DAT_IntroTimestamp::instance) / 20; + if (DAT_IntroBlendStrength::instance >= 32) { + DAT_IntroBlendStrength::instance = 32; + DAT_IntroTransitionStep::instance = 1; + DAT_IntroTimestamp::instance = timeGetTime(); + } + } else if (DAT_IntroTransitionStep::instance == 1) { + // hold: 2.5 seconds, the second logo 6 + int duration = 2500; + if (DAT_IntroStep::instance == 1) { + duration = 6000; + } + if ((int)(currentTime - DAT_IntroTimestamp::instance) > duration) { + DAT_IntroTransitionStep::instance = 2; + DAT_IntroTimestamp::instance = timeGetTime(); + } + } else if (DAT_IntroTransitionStep::instance == 2) { + // fade out, then the next logo or the intro video + DAT_IntroBlendStrength::instance = 32 - (int)(currentTime - DAT_IntroTimestamp::instance) / 20; + if (DAT_IntroBlendStrength::instance <= 0) { + if (DAT_IntroStep::instance == 0) { + DAT_IntroTransitionStep::instance = 0; + DAT_IntroBlendStrength::instance = 0; + DAT_IntroStep::instance = 1; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_INTRO_LOGOS, 0); + } else if (DAT_IntroStep::instance == 1) { + DAT_IntroTransitionStep::instance = 0; + DAT_IntroBlendStrength::instance = 0; + DAT_IntroStep::instance = 2; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_INTRO_LOGOS, 0); + } else { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_INTRO_VIDEO, 0); + } + } + } + if (DAT_IntroBlendStrength::instance >= 32) { + return; + } + // the original calls timeGetTime() here and drops the result + timeGetTime(); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, + DAT_WindowAndDirectDraw::instance.resolutionY, DAT_IntroBlendStrength::instance); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index d4c2b19bd1..54497380ce 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6665,7 +6665,7 @@ SHC_3BB0A8C1_0x00424720 | 0.0% | Pending SHC_3BB0A8C1_0x00424770 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004247A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004247A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424990 | 100.0% | Reimplemented From 26d2a947d94cc4fc0858a5d2a9e2f4c99edec67c Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sat, 7 Nov 2026 02:56:40 +0100 Subject: [PATCH 7/7] reimplement: SHC_3BB0A8C1_0x00424B10 100.0% Reimplemented From gynt's fork branch archive/UI-MenuViews-merged-full (96.8% there), with the return-key handling of his live reimpl/UI-MenuViews-development draft: the original reads returnPressed into a register, clears the field and then tests the register, which the live draft writes with a local (the merged-full draft tests the field itself: quick_diff 0.9375 -> 0.9053, kept with that comment); the live draft's second returnPressed = 0 in the zero path goes, as the merged-full draft has it. Both isNameEntryActive tests stay `== TRUE`: the original compares with 1 (cmp ..., 1 at 0x00424B10 and 0x00424B4B), and by truthiness they compare with 0 (quick_diff 0.9375 -> 0.8542; kept with that comment). The second test can never be true, as the function returned for TRUE at the top and the draw call does not touch the flag; the original has the dead branch too, so it stays, with a comment. What else changed: the outer if (isNameEntryActive != TRUE) becomes an early return (it measures the same); the timeout and right-click tests are one condition before the one switchToMenuView call (it measures the same as the drafts' two calls); DVar1 is now, declared where it is first used; 0x3e8 is 1000; resetToTextIndex(9) is TAIT_NINE__FILTER_B, as main writes it; the names are written from OpenSHC:: as in the other four files; the stray return, three using lines and the BOOLEnum.hpp include go; comments say what each branch does. quick_diff 0.9375, which leaves the timeGetTime import call and ret / ret 0. This file was measured as it stands, not only the draft: 100.0% raw and 100.0% normalized in reccmp in a clean alone build of the branch on main 1c294596c. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- ...nuView_GameStartEnterName_DoEveryFrame.cpp | 64 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoEveryFrame.cpp new file mode 100644 index 0000000000..abd30f69ab --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoEveryFrame.cpp @@ -0,0 +1,64 @@ +#include "../GameStartEnterName.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424B10 + void GameStartEnterName::MenuView_GameStartEnterName_DoEveryFrame() + { + // == TRUE as in the original, which compares with 1 (truthiness: quick_diff 0.9375 -> 0.8542) + if (DAT_GameCore::instance.isNameEntryActive == TRUE) { + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + // the original tests the flag again after the draw call; nothing sets it there, so this branch does not run + if (DAT_GameCore::instance.isNameEntryActive == TRUE) { + // after a second, once draggingStopped is set or on a right click, back to the main menu + DWORD const now = timeGetTime(); + if (now - DAT_GameCore::instance.nameEntryStartTime <= 1000 && !DAT_MouseState::instance.draggingStopped + && !DAT_MouseState::instance.rightClickStop) { + return; + } + } else { + // return pressed: close the dialog and go to the main menu + // read, cleared, then tested (testing the field itself: quick_diff 0.9375 -> 0.9053) + dword const returnPressed = DAT_UserTextHandlerState::instance.returnPressed; + DAT_UserTextHandlerState::instance.returnPressed = 0; + if (returnPressed == 0) { + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + OpenSHC::Text::TAIT_NINE__FILTER_B); + } + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_MAIN_MENU, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 54497380ce..8afa985f89 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6673,7 +6673,7 @@ SHC_3BB0A8C1_0x00424A50 | 0.0% | Pending SHC_3BB0A8C1_0x00424AD0 | 0.0% | Pending -SHC_3BB0A8C1_0x00424B10 | 0.0% | Pending +SHC_3BB0A8C1_0x00424B10 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424BD0 | 100.0% | Reimplemented