Skip to content

Reimplement 47 UI::MenuViews functions: gynt's finished backlog (100%) - #379

Merged
gynt merged 59 commits into
sourcehold:mainfrom
kotijekriv:reimpl/UI-gynt-backlog-MenuViews
Nov 10, 2026
Merged

gynt merged 59 commits into
sourcehold:mainfrom
kotijekriv:reimpl/UI-gynt-backlog-MenuViews

Conversation

@kotijekriv

@kotijekriv kotijekriv commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

gynt's finished MenuViews functions, landed as he OK'd on Discord on 2026-11-09 ("Yes you can make a PR for them and check they still build. Cleaning up the backlog, love it").

These 47 functions read 100% on his fork, but were never in a PR. Each one comes in as a commit authored by him, with his file exactly as it stands at the tip of one of two branches, where its status line reads 100%:

  • archive/UI-MenuViews-merged-full (2755710): 35 functions;
  • archive/UI-MenuViews-development-second-pass (32939bb): 12 functions.

Each commit body names its branch and commit. What main needed on top follows in our own commits, which credit him as co-author.

Measured on today's main (9528350):

  • Setup: the bundled MSVC1400-SP1 against the Steam Stronghold Crusader.exe (3bb0a8c1…5387ac5a), resolvers enabled locally (not committed), and sourcehold's reccmp with --resolve-wrapped-calls --ignore-security-cookie.
  • A full build of all 47 reads 100.0% raw, both before and after our commits.
  • openshc-pr-check gives no errors, and status_regression.py finds nothing lower than a known score.
  • None of it has been run in game.

Our commits on top of his

  1. Main's names. Three files didn't compile against today's headers:
    • field3_0xc → field_0xc (twice);
    • field225_0x106ee4 → field_0x106ee4;
    • (BuildMenuTabTypeShort)0x3e: that type isn't on main, so the value comes from the header commit below.
  2. The style fixer's pass (decimals, compound assignments, truth tests) in 29 files.
  3. String pointers: s_ pointers in place of about 90 string literals. Each was picked by the address the original pushes, and has its text in a // "…" comment above it.
  4. Leftovers removed: trailing return;s, block comments and the decompiler's parentheses.
  5. Loops for repeated stores where the original has a loop. The button-timing loops measure 100.0, the same as the unrolled stores.
  6. Locals: named, const where they're assigned once, and declared at first use. The menu-position block in 11 files now has the shape of main's MenuView_General_DoInitial_OnlySetMenuXY.
  7. One goto removed (MapEditorLandscaping_DoEveryFrame); the function still measures 100.0.
  8. Early returns where the whole body sat in one if.
  9. TRUE/FALSE for flag globals that only ever hold 0/1.
  10. Unneeded casts and includes dropped, such as (ushort) on the colours' shortValue and unused BOOLEnum.hpp includes.

One change to gynt's naming. In CrusadeEndscreen_Prepare, his SHC_SoundStream names for AppendCreditsSoundStreamCommand's second argument are now plain numbers. That parameter is an int, and the values just count 1 to 8 over the jester's eight blocks (5, 6 and 7 were OR-ed constants). The MUSIC and SPEECH_1 arguments in the same calls became their numbers too. Happy to put them back if the names are preferred.

Header changes (each in a commit of its own)

Main's Ghidra sync (6c1e0bd) brought these header lines, and main (d5d965d) is merged in, with our code following main's spellings (TAIT_UNKNOWN for text index 4, INT_00b9840c), so the declaration check passes now.

BuildMenuTabType gets BMTT_UNKNOWN_62 (eb52adb).

  • MenuView_BuildMenu_DoEveryFrame (0x00433030) compares the tab with 62 (cmp …, 0x3e at 0x0043303E).
  • Main's hideOrUnhideUI (0x00471AA0) switches the build menu from BMTT_SOLDIERS to 62 when it hides the menu, and back again when it shows it. So 62 is the hidden soldiers tab.
  • It's named the way the enum already names 49. BMTT_SOLDIERS_HIDDEN would fit as a real name.
  • Main's own five bare 62s (hideOrUnhideUI ×3, switchToMenuView, playVideoOverMap) are left alone.

TextArrayIndexType gets TAIT_UNKNOWN_4 (07a1c3a).

  • Three of these functions push 4 before resetToTextIndex: SingleplayerMapChoice_Prepare (0x00448D40), BuildMenu_Prepare (0x00431A90) and LobbyMenu_Prepare (0x00427320).
  • The enum skips 4 between TAIT_THREE__FILTER_A and TAIT_FIVE__NUMERIC_DOT, and TheRedDaemon asked for such values on Reimplement 33 Map::Version functions that are 100% #300.
  • The MenuModals backlog PR carries the same line, so the two merge in either order.

Left as they are, with the reason

  • CrusadeEndscreen_Prepare's five texts are written out: a loop over them measures lower (quick_diff 0.9985 → 0.9718), and the code says so in one line. The credits blocks are written out too, because the original has no loop or table there.
  • The 32 (char*) casts in CrusadeEndscreen_Prepare stay: Credits.hpp declares AppendCreditsBinkVideoCommand and AppendCreditsBinkVideoWithAudioCommand with char* parameters. char const* would drop the casts, but those are Jake Vawter's functions on his fork, so we left that header alone.
  • Unknown33_DoEveryFrame keeps its loop: memset measures lower (0.9643 → 0.7965).
  • SingleplayerMapChoice_Prepare keeps (int)DAT_MapMissionType < 2: the global is undefined4, and the original compares it signed. Its values are 0 just build, 1 economic, 2 siege and 3 invasion.
  • BuildMenu_Prepare tests the game mode three times: the original reads it again after each call.
  • DAT_MainMenuSwingSwordBool = 0 stays a number: despite its name the global holds 0-2 (main stores rng % 3 in it).
  • HistoricCampaignIntro's case labels are numbers: historicCampaignNumber (1-4) has no enum, and the labels match the merged HistoricCampaignOutro.
  • HistoricMissionSelect_Prepare's int chapter; has no initial value: every branch assigns it.

Header changes we didn't make (suggestions)

  • DAT_MapMissionType → int, which would drop the cast above.
  • DAT_00b960dc → int, since it stores -3.
  • historicCampaignNumber → int, since it holds 1-4.
  • MinimapViewState::needsRedraw → BOOLEnum: main stores TRUE to it.
  • setRenderingRect(xPos, yPos, width, heigth) really takes right/bottom: setRenderingRect.cpp stores them in .right/.bottom, and BuildMenu_DoEveryFrame passes x + 513, y + 576.
  • BOOLEnum candidates: every store we can see is 0/1, but not every user is reimplemented yet. They are INT_00b95b64, INT_00b960e4, INT_00b95f68, INT_00ed27b8, postWindowCloseMessage, DAT_SH1_SiegeAdvancedMode and isTimeHalted2.

What some placeholders hold

These come from these functions; most of the checker's remaining notes are about these names.

  • INT_00b95abc: the hovered button, -1 for none.
  • INT_00b960f0 / INT_00b960fc: timeGetTime() values kept in int globals.
  • INT_00ed27b8: set once the German easter-egg music has started.
  • DAT_00b95b2c: the chapter (0-3).
  • DAT_00b96100: that chapter's first mission (1/6/11/16).
  • INT_00b95b64: set by the load/save map UI, cleared in the map choice's Prepare.
  • INT_00b960e0: 24 at 800×600, otherwise 0.
  • INT_00b95b34: the demo screen's start time.
  • DAT_00ed278c: counts clicks on the Extreme ad's hotspot; the window closes at 3.
  • INT_00ed3140: a tick counter.
  • DAT_UnknownGFXIndex: 1 while a modal dialog is open.
  • Misleading names: missionNumber1to20 is set to 33 in UnusedEconomicMissionSelect, and unk_resetViewportRelated takes 1-4.
  • SelectCrusade's == 1..4 are the crusade-select buttons (First Edition, Custom Game, Warchest, Extreme). A button enum would help there and in SelectCrusade_Main, GameLost_DoEveryFrame and Unknown61_Prepare.

The 47 functions

Function, address, and which of gynt's two branches it comes from
Function Address From
MenuView_BuildMenu_DoEveryFrame 0x00433030 second-pass
MenuView_BuildMenu_Prepare 0x00431A90 second-pass
MenuView_CampaignUnk_DoInitial 0x004DD0C0 merged-full
MenuView_Credits_DoInitial 0x004262B0 merged-full
MenuView_CrusadeEndscreen_DoEveryFrame 0x004E1F50 merged-full
MenuView_CrusadeEndscreen_DoInitial 0x004D91D0 merged-full
MenuView_CrusadeEndscreen_Prepare 0x004DF2E0 merged-full
MenuView_CustomScenarios_DoEveryFrame 0x00425FF0 second-pass
MenuView_CustomScenarios_Prepare 0x00425EA0 merged-full
MenuView_GameStartEnterName_DoInitial 0x004406F0 merged-full
MenuView_General_DoInitial_BlackBorderAndGfx 0x004DB5C0 second-pass
MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture 0x00425F60 merged-full
MenuView_General_DoInitial_CrusadeAndRankMenu 0x004DD750 merged-full
MenuView_General_DoInitial_DefaultMainMenuStructure 0x004276F0 merged-full
MenuView_General_DoInitial_ScreenToBlack 0x00430100 merged-full
MenuView_HistoricCampaignIntro_Prepare 0x004DBAF0 merged-full
MenuView_HistoricCampaignSelect_DoEveryFrame 0x00425580 second-pass
MenuView_HistoricCampaignSelect_Prepare 0x00425500 merged-full
MenuView_HistoricMissionSelect_Prepare 0x00426830 merged-full
MenuView_IntroLogos_Prepare 0x00424720 merged-full
MenuView_IntroVideo_DoEveryFrame 0x00424AD0 second-pass
MenuView_IntroVideo_Prepare 0x00424A50 merged-full
MenuView_LobbyMenu_Prepare 0x00427320 merged-full
MenuView_MainMenu_DoInitial 0x00424CD0 merged-full
MenuView_MainMenu_Prepare 0x00424C40 second-pass
MenuView_MapEditorLandscaping_DoEveryFrame 0x004313C0 merged-full
MenuView_MissionSelect_DoEveryFrame 0x004268C0 merged-full
MenuView_MpConnection_Prepare 0x00427110 merged-full
MenuView_ScenarioDescription_DoInitial 0x004DD300 merged-full
MenuView_SelectCrusade_DoEveryFrame 0x0042BBF0 merged-full
MenuView_SelectCrusade_DoInitial 0x0042BB90 merged-full
MenuView_SingleplayerMapChoice_Prepare 0x00448D40 merged-full
MenuView_Unknown26_CampaignRelatedUnk_DoInitial 0x004E1E30 merged-full
MenuView_Unknown33_DoEveryFrame 0x0042C090 second-pass
MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame 0x004272C0 merged-full
MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial 0x00427240 merged-full
MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare 0x004409C0 merged-full
MenuView_UnusedCreateSiege_Prepare 0x00430690 second-pass
MenuView_UnusedDemoBuyItScreen_Prepare 0x00426570 second-pass
MenuView_UnusedEconomicGametypeSelect_DoInitial 0x00425A40 merged-full
MenuView_UnusedEconomicGametypeSelect_Prepare 0x004259D0 second-pass
MenuView_UnusedEconomicMissionSelect_Prepare 0x00426C50 second-pass
MenuView_UnusedExtremeAd_DoEveryFrame 0x004E1AA0 merged-full
MenuView_UnusedExtremeAd_DoInitial 0x004E1A50 merged-full
MenuView_UnusedOldTitleMenu_DoInitial 0x0042DD00 merged-full
MenuView_UnusedOldTitleMenu_Prepare 0x0042DCB0 merged-full
MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame 0x0042B960 merged-full

Other PRs: the rest of gynt's backlog is in #380 (MenuModals, DisplayElements, Rendering), #381 and #382 (MenuItems). Our drafts below 100% stay open: #313, #318, #321, #327, #328, #356, #360 and #363.

🤖 Generated with Claude Code

gynt and others added 30 commits November 9, 2026 10:47
MenuView_BuildMenu_DoEveryFrame, gynt's version as it stands on his fork's
archive/UI-MenuViews-development-second-pass at 32939bb (2026-10-25), where its status line reads 100.0%; that
commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_BuildMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass
at 32939bb (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file.
Taken unchanged; what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_CampaignUnk_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 83c1d80 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004DD0C0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_Credits_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710
(2026-10-25), where its status line reads 100.0%; the file was last changed in 08040dd (2026-10-25, "reimplement:
SHC_3BB0A8C1_0x004262B0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own
commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_CrusadeEndscreen_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full
at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in fa5f9af (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004E1F50 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_CrusadeEndscreen_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 3003347 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004D91D0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_CrusadeEndscreen_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in d91816f (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004DF2E0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_CustomScenarios_DoEveryFrame, gynt's version as it stands on his fork's
archive/UI-MenuViews-development-second-pass at 32939bb (2026-10-25), where its status line reads 100.0%; that
commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_CustomScenarios_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 459b8d9 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x00425EA0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_GameStartEnterName_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full
at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 6ee93e3 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004406F0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_General_DoInitial_BlackBorderAndGfx, gynt's version as it stands on his fork's
archive/UI-MenuViews-development-second-pass at 32939bb (2026-10-25), where its status line reads 100.0%; that
commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture, gynt's version as it stands on his fork's
archive/UI-MenuViews-merged-full at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last
changed in 3cb6e95 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00425F60 100.00% Reimplemented"). Taken unchanged;
what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_General_DoInitial_CrusadeAndRankMenu, gynt's version as it stands on his fork's
archive/UI-MenuViews-merged-full at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last
changed in 28a288b (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004DD750 100.00% Reimplemented"). Taken unchanged;
what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_General_DoInitial_DefaultMainMenuStructure, gynt's version as it stands on his fork's
archive/UI-MenuViews-merged-full at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last
changed in 20a601e (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004276F0 100.00% Reimplemented"). Taken unchanged;
what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_General_DoInitial_ScreenToBlack, gynt's version as it stands on his fork's
archive/UI-MenuViews-merged-full at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last
changed in 225b15f (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00430100 100.00% Reimplemented"). Taken unchanged;
what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_HistoricCampaignIntro_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full
at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 7c34016 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004DBAF0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_HistoricCampaignSelect_DoEveryFrame, gynt's version as it stands on his fork's
archive/UI-MenuViews-development-second-pass at 32939bb (2026-10-25), where its status line reads 100.0%; that
commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_HistoricCampaignSelect_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full
at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 8c72f92 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x00425500 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_HistoricMissionSelect_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full
at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in f2a9ee6 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x00426830 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_IntroLogos_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in b7a43d1 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x00424720 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_IntroVideo_DoEveryFrame, gynt's version as it stands on his fork's
archive/UI-MenuViews-development-second-pass at 32939bb (2026-10-25), where its status line reads 100.0%; that
commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_IntroVideo_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in dfb6eac (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x00424A50 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_LobbyMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710
(2026-10-25), where its status line reads 100.0%; the file was last changed in 8327b9c (2026-10-25, "reimplement:
SHC_3BB0A8C1_0x00427320 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own
commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_MainMenu_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 440a25e (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x00424CD0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_MainMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass
at 32939bb (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file.
Taken unchanged; what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_MapEditorLandscaping_DoEveryFrame, gynt's version as it stands on his fork's
archive/UI-MenuViews-merged-full at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last
changed in baf5a43 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004313C0 100.00% Reimplemented"). Taken unchanged;
what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_MissionSelect_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 57e21ac (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004268C0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_MpConnection_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 5f0385e (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x00427110 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_ScenarioDescription_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full
at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in e76bc7c (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x004DD300 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_SelectCrusade_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in a4b0298 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x0042BBF0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gynt and others added 13 commits November 9, 2026 10:48
MenuView_UnusedOldTitleMenu_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full
at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in df53f89 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x0042DD00 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_UnusedOldTitleMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at
2755710 (2026-10-25), where its status line reads 100.0%; the file was last changed in 2ff2116 (2026-10-25,
"reimplement: SHC_3BB0A8C1_0x0042DCB0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in
our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame, gynt's version as it stands on his fork's
archive/UI-MenuViews-merged-full at 2755710 (2026-10-25), where its status line reads 100.0%; the file was last
changed in 9a09c92 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x0042B960 100.00% Reimplemented"). Taken unchanged;
what main needs on top follows in our own commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… otherwise

Main renamed these since gynt's base, which kept three of the 47 files from compiling: MinimapViewState's
field3_0xc is field_0xc (MenuView_BuildMenu_DoEveryFrame, MenuView_MapEditorLandscaping_DoEveryFrame) and
GameSynchronyState's field225_0x106ee4 is field_0x106ee4 (MenuView_LobbyMenu_Prepare). MenuView_BuildMenu_DoEveryFrame
also compared activeMenuTab.buildMenuTab with (BuildMenuTabTypeShort)0x3e, a type his branch has and main doesn't;
main's buildMenuTab is a BuildMenuTabTypeInt and BuildMenuTabType has no 62, so it compares with the number. With
this, all 47 build on main 9528350 and measure reccmp 100.0.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
openshc-pr-fix.py over the 29 of gynt's 47 files it had something for: hex numbers that aren't masks or colours
written in decimal (246), usings nothing uses dropped (57), "+ -N" written "- N" (4), compound assignments (2) and
BOOL comparisons as truth tests (4). Mechanical; the code is the same.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The decompiler's argument locals (iVar1 to iVar8, TVar4, BVar5, BVar7) become named positions declared where they
are set, the other arguments are written in the calls, the colour is COL_CCFAFF, the "added by script" block comments
are // "text" lines, and the trailing return goes. quick_diff identical before and after (0.9519, the listing's ret).

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…of literals

The 19 files of gynt's that wrote file names and texts as literals use main's s_ pointers instead (style guide 12),
each for the address the original pushes where a text is stored more than once, and include string-literals.hpp.
MenuView_CrusadeEndscreen_Prepare passes them to AppendCreditsBinkVideoCommand and
AppendCreditsBinkVideoWithAudioCommand through (char*), as main does where a header takes a char*. quick_diff
identical for every file.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The decompiler's trailing return; goes from the 13 void functions that ended with one (style guide 1), and the
"added by script" block comments with a text in them become // "the text" lines above the call (style guide 19).
quick_diff identical for every file.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ee more files

The button timings in MenuView_CustomScenarios_Prepare, MenuView_HistoricCampaignSelect_Prepare and
MenuView_UnusedEconomicGametypeSelect_Prepare (each button's animation starts 1600 ms after the previous one) and
MenuView_Unknown33_DoEveryFrame's nine cleared DAT_PlayerSlotArraySomeValue entries are for-loops; MSVC unrolls them
back into the same stores (a memset in Unknown33: quick_diff 0.9643 -> 0.7965). Unknown33's player loop counts
playerID up to countof(currentPlayerFullIDArray) and tests the ready check directly.
MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame and MenuView_CrusadeEndscreen_Prepare get named positions in
place of the decompiler's argument locals. CrusadeEndscreen's AppendCreditsSoundStreamCommand values are plain
numbers, as its int parameter takes them: gynt's SHC_SoundStream names there were Ghidra's guess. The (8, n) calls
count n from 1 to 8 over the first jester run's eight blocks (SFX_1Unk, SFX_2Unk, SPEECH_1 and SPEECH_2, then three
OR-ed constants for 5, 6 and 7, then a cast 8), and the (24, MUSIC), (4, SPEECH_1), (3, ...) and (1, 0x5a) calls are
plain numbers too. The text size it picks for Italian is fontSize. quick_diff identical for every file; reccmp 100.0
for each of them in the full build at the branch head.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alues, one goto

Ten more files of gynt's: decompiler locals named for what they hold or dropped where the call can be tested
directly (TicksSinceCounterStart, FindCampaignMapHotspotAtMouse, getEventIDForTimeUntilDefeatEventType), the
current menu as menu, the chapter of a historic mission, the campaign texts as text; lastClickedListIndex is set to
-1 and DAT_00b960dc to -3 rather than their unsigned hex; the minimap clear's byte count is sizeof(loadedMiniMap);
the old title menu's colour is COL_0080FF and its positions are declared where they are computed; a doubled include
goes; and MenuView_MapEditorLandscaping_DoEveryFrame draws its panel under one test of unk_resetViewportRelated in
place of the goto, which compiles to the same branches. quick_diff identical for every file; reccmp 100.0 for each
of them in the full build at the branch head, as with gynt's goto.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuView_BuildMenu_DoEveryFrame (0x00433030) compares activeMenuTab.buildMenuTab with 62 (cmp ..., 0x3e at
0x0043303E), a tab the enum has no name for; gynt's branch wrote it (BuildMenuTabTypeShort)0x3e. Main's
hideOrUnhideUI (0x00471AA0) switches the build menu from BMTT_SOLDIERS to 62 when it hides the menu and from 62 back
to BMTT_SOLDIERS when it shows it again, so 62 is the hidden soldiers tab. Named the way the enum already names 49
(BMTT_UNKNOWN_49) until Ghidra has a name for it. Used in the next commit; code generation is the same.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three of gynt's MenuViews functions reset the user text handler to index 4 (push 4 before resetToTextIndex):
MenuView_SingleplayerMapChoice_Prepare (0x00448D40), MenuView_BuildMenu_Prepare (0x00431A90) and
MenuView_LobbyMenu_Prepare (0x00427320). The enum leaves 4 out between TAIT_THREE__FILTER_A and
TAIT_FIVE__NUMERIC_DOT; TheRedDaemon asked for such values on sourcehold#300. The ModalsDisplayRendering backlog branch
carries the same line for MenuModalRenderFunction_Chat, so the two merge cleanly. Used in the next commit; code
generation is the same.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The current menu is `Menu* const menu` at its one assignment and the border values are int const, in the shape of
  main's MenuView_General_DoInitial_OnlySetMenuXY (21 files had pMVar1, _menu or _menuPtr declared early).
- No (ushort) casts on the COL_ shortValues (drawColorBox takes them as they are), no unused BOOLEnum.hpp includes.
- Every s_ string pointer has its text in a comment above the statement.
- BMTT_UNKNOWN_62 and TAIT_UNKNOWN_4 (previous two commits; TAIT_UNKNOWN_4 in all three resets) and
  TAIT_NINE__FILTER_B for the numbers 62, 4 and 9; TEXT_MAINOPTIONS, 15 for MissionSelect's text; COL_000000 for the
  old title menu's black text.
- Early returns in Unknown33_DoEveryFrame, UnusedExtremeAd_DoEveryFrame (whose two click tests are one condition) and
  MissionSelect_DoEveryFrame; HistoricCampaignIntro_Prepare stores its two texts straight from the call, as main's
  HistoricCampaignOutro_Prepare does; BuildMenu_DoEveryFrame takes timeGetTime() in the store.
- TRUE/FALSE for BOOL-like flags (needsRedraw, pendingMenuRedraw, mapLoadedForEditor, INT_00ed27b8, INT_00b960e4,
  INT_00b95f68), == 0 for counters and IDs, truth tests for isBinkVideoPlaying, NULL for the Bink handle, and casts
  and parentheses that did nothing removed (MainMenu_DoInitial's sword position, BuildMenu_DoEveryFrame's tab test,
  Unknown33's ready check).
- Comments where a reader would ask: the repeated game-mode test, the button timings, the Custom Game button, the
  Italian text size (fontSizeUnk, as its meaning isn't proven), HistoricCampaignIntro's two campaign texts, and why
  CrusadeEndscreen_Prepare writes its five texts and its three runs of blocks out (a loop over the texts: quick_diff
  0.9985 -> 0.9718).
quick_diff identical for every file; all 47 functions reccmp 100.0 in a full build at the branch head.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kotijekriv and others added 2 commits November 10, 2026 00:41
Main's Ghidra sync 6c1e0bd brought this branch's header changes; main's versions are kept.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NKNOWN, INT_00b9840c)

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the declaration/type change This requires changes to the generated/exported types or definitions. label Nov 9, 2026
@gynt
gynt added this pull request to the merge queue Nov 10, 2026
Merged via the queue into sourcehold:main with commit fd73343 Nov 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants