Repository navigation
UI: three more functions at 100%: the lobby's start button, the save list's header and the mission rows - #423
Open
kotijekriv wants to merge 3 commits into
Open
kotijekriv wants to merge 3 commits into
kotijekriv wants to merge 3 commits into
Conversation
LobbyMenu::MenuItemActionHandler_LobbyMenu_LobbyscreenStartButtonClick, from gynt's draft (c0a2f52 at 40.85% on his fork's development; c88d7a2 at 40.8% on upstream's reimpl/UI-MenuItems; f53ef94 to d81f02f, 54.93% to 69.03%, his fork's reimpl/UI-MenuItems; a4fb7c2 of 2026-10-28 on his fork's reimpl/Wilps-2026-10-18; 99cb905 at 80.53%, 35aef55 at 80.71% and dd1a7c4 of 2026-11-02, his newest commit on the file, on his fork's reimpl/UI-MenuItems-development) and our cb601a0 and 1918de9 in draft sourcehold#327 (90.7%). 90.3% -> 100.0% on main 3458fea: - case 4 sets the draw buffer back once, after the if / else that launches the game: the original pops three registers before that store in the skirmish arm (pop esi / pop ebp / pop ebx / mov / pop edi / ret); - the two keep-position loops read keepPositions[position].x where they use it, with no local, which gives lea ebp, [eax + edi + 572] with x as the base (a local gave [edi + eax + 572]); - the map index. Case 4 writes its two sums as DAT_MapSelectionScrollOffset + DAT_MapSelectionRelativeSelected, and case 105 takes its index through a local that is declared before the switch. That gives both cases the original's two loads and add (0x0044284E: edx, eax, add eax, edx; 0x00442AD8: ecx, edx, add edx, ecx). The three sums are coupled: of 32 combinations (each case's sum written out, as a block-scope local or as this local, in both operand orders) only this one and its twin with case 105's operands swapped match. A block-scope local in case 105 swaps case 4's loads, which is why the declaration stands before the switch, with one comment line. The local starts at 0, which nothing reads: declared without a value, style rule 24 asks for it in case 105, and the code is the same either way. quick_diff reads 0.9956: its two lines are a tail jump it prints as a label and the jmp over the first loop's alignment padding; it cannot see the load order, since it prints both fields as [G]. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SaveLoadMap::MenuItemActionHandler_SaveLoadMap_TableHeader, rewritten from the binary with gynt's draft for the names (f788afb at 17.2% on upstream's reimpl/UI-MenuItems; 54e57c4 and 21d4dcf at 47.81% and 49.40% on his fork's reimpl/UI-MenuItems; 8725ec5 at 49.4% on his reimpl/UI-MenuItems-development, his newest reimplement commit on the file). reccmp 100.0 (normalized 100.0) on main 3458fea with the data and its own function resolver on; the draft reads 47.8 there. The array index changed with the header. gynt's draft uses DAT_ArrayOfMapIndices[i - 1] and [i], which was right on his branch, where the array is declared at offset 0x884. Main's sync 12854bc (2026-11-04) moved the declared start to 0x880, so the original's 0x01126E28 and 0x01126E2C are [i] and [i + 1] here. - The order store is in each arm and previewedListIndex = -1 is written once after the if / else. MSVC copies that store into both arms, after the last pop, as the original has it; only the order store sits between the pops. Written in each arm, it keeps -1 in ebx and pushes ebx at the top, and the first sort's two loops lose their alignment padding. - The swap reads the moved element into a local inside the if. With both elements in locals before the test they land in each other's registers. - fileListEntryCount is read in the loop condition: the original reloads it after each swap's stores. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HistoricMissionSelect::MenuItemRenderFunction_HistoricMissionSelect_MissionRows, rewritten from the binary with gynt's draft for the names (298b3af at 20.6% on upstream's reimpl/UI-MenuItems; 633d784 at 41.41% on his fork's reimpl/UI-MenuItems; 626fd68 at 44.53% on his reimpl/UI-MenuItems-development, his newest reimplement commit on the file). reccmp 100.0 (normalized 100.0) on main 3458fea with the data and its own function resolver on; the draft reads 45.3 there. Behaviour: a mission not reached yet is drawn as a greyed cell and the function returns (0x00426A53). The draft went on and drew the number and the name over it. - The number and the name are written in each of the three arms, and DAT_ButtonUnknownZero = FALSE once after them: MSVC hoists the arms' common pushes and shares the tail, as the original has it. - The number's position is written out in each arm; with locals for it the two loads come in the other order. - In the selected arm the name's position and index are read into locals before the nested call, Y, X, then the index, which gives the original's registers for that call. - The locked test compares (int)(DAT_00b96100 - row - 1): the global is an undefined4, and the original's jle is signed. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three more UI functions at 100%, with no header changes. The lobby's start button comes from our draft #327, and the other two are rewritten from the binary with gynt's drafts for the names.
LobbyMenu::MenuItemActionHandler_LobbyMenu_LobbyscreenStartButtonClickSaveLoadMap::MenuItemActionHandler_SaveLoadMap_TableHeaderHistoricMissionSelect::MenuItemRenderFunction_HistoricMissionSelect_MissionRowsMeasured.
Stronghold Crusader.exe(3bb0a8c1…5387ac5a), both resolver sets enabled locally (not committed), and sourcehold's reccmp with--resolve-wrapped-calls --ignore-security-cookie.tools/). All three functions read 100.0 raw and normalised, and no function on main moved.openshc-pr-fixfinds nothing to change, andopenshc-pr-checkgives 0 ERROR and 26 CHECK, all explained below.What got them to 100%
if/elsethat launches the game, because the original pops three registers before that store in the skirmish arm.keepPositions[position].xwhere they use it, with no local.previewedListIndex = -1is written once after theif/else. MSVC copies that store into both arms after the last pop, as the original has it.if.fileListEntryCountis read in the loop condition, because the original reloads it after each swap's stores.Behaviour compared with the drafts
INT_00b95960 = -1on every path, and stops when no position is under the mouse.DAT_ArrayOfMapIndices[i - 1]was right on gynt's branch, where the array is declared at offset 0x884. Main's sync 12854bc moved the declared start to 0x880, so the index here is[i].What the placeholders hold
These are read from how the code uses them. Ghidra has no better names, so the names are unchanged.
DAT_00b960dc: the lobby's fade. It is non-zero while the menu fades in or out, and the handler ignores clicks while it is non-zero.DAT_00b960f4: the map description's scroll offset.INT_00b95b74: probably the description text's height, since the scroll limit is this value minus 114.INT_00b95960: the player position being dragged onto another keep, or -1 when nothing is being dragged.INT_00b95f64: the keep slot that position was picked up from.DAT_00b96100: probably the number of missions in the list, since a row shows missionDAT_00b96100 - row - 1.DAT_00b95b2c: the selected campaign, which indexes the four progress counters inScenarioProgress.MenuTextInputState::field_0x9c: set to 1 before the lobby opens the load dialog. I don't know what it means.The checker's 26 CHECKs
:201,:202,:203,:209,:210,:211,:212DAT_00b960f4:236,:246,:271INT_00b95960:237,:262,:263INT_00b95f64:41DAT_00b960dc:77field_0x9c:208INT_00b95b74:50:17:35,:50,:61,:71,:79DAT_00b96100:36DAT_00b95b2c:35DAT_00b96100is anundefined4and the original's compare is signed; see the proposal below:53Proposed, not changed here
Neither of the first two has been measured.
ScenarioProgress: MissionRows:36reads(&DAT_GameCore::instance.scenarioProgress.progressCallToArms)[DAT_00b95b2c::instance], indexing the four campaign counters from the first one. They could be one array of four ints, which would make this a plain index.DAT_00b96100as anint: this would remove the(int)cast at MissionRows:35.loadOrSaveGame(int): the options click handler passes it 9 for Load (0x00496C85) and 10 for Save (0x00496CFA), which areMMT_LOAD_MAPandMMT_SAVE_MAP. Its parameter is probably aMenuModalType, and the lobby's9is probablyMMT_LOAD_MAP.One function leaves #327
The lobby's start button moves here from the draft #327. 942d855 on #327 takes it out of that draft.
🤖 Generated with Claude Code