Repository navigation
Two UI::MenuModals functions at 100%: ChooseNetworkServiceProvider and FindingNetworkSessions - #474
Open
kotijekriv wants to merge 2 commits into
Open
kotijekriv wants to merge 2 commits into
kotijekriv wants to merge 2 commits into
Conversation
ChooseNetworkServiceProvider::MenuModalRenderFunction_ChooseNetworkServiceProvider, moved out of our draft sourcehold#360 (5485692, 65.1%), from Gynt's draft (968b1ee at 65.32% on his fork's reimpl/UI-MenuModals-development; his closed sourcehold#252 had an earlier version). One behaviour fix against his draft, already in sourcehold#360: the modem tab's second box reaches from y + 265 to y + 345; his draft moved y on to the bottom first and then drew the top at y + 265 from there (y + 610). The original takes the top first (0x0047C9C5), as sourcehold's reimpl/UI-MenuModals has it and as this does. Both frames, the list's (y + 85 to y + 165) and the modem tab's (y + 265 to y + 345), run from x + 40 to x + 460: the outline is one pixel outside that (x + 39 to x + 461), and the dimmed box ends at the scroll bar's column line at x + 440. Each is written in a block with its four edges as int const locals (left = x + 40, top, right = x + 460, bottom) and every coordinate written from them. The original keeps each frame's top in ebx (0x0047C907, 0x0047C9C5). In the list's frame it keeps the left edge less 1 in y's stack slot (0x0047C91C, read back at 0x0047C934, 0x0047C94A and 0x0047C96E) and computes x + 461 again for each line that uses it; in the modem box's it keeps x + 440 in that slot (0x0047C9E3) and x + 461 in esi (0x0047C9F8). In the draft x and y swapped esi and edi, and x + 440 kept ebx, where the original keeps the list's top (quick_diff 0.6780, 177 instructions against 177). With only the list's frame in a block, the modem box's top and left edge swap ebx and ebp (0.9435); with both blocks the listing is the original's (1.0000). Both orders tried for the edges (left, top, right, bottom and right, left, top, bottom) give the same listing, and so does int without const. A comment on each block says why it is one. On main since sourcehold#387 drawHeaderTextBanner takes an eTextSections: the banner's 76 is TEXT_MULTIPLAYER_CONNECTION. y - 0x3c is written y - 60, and the kick timer's test the other way round (timeGetTime() - kickedAtTime > 5000), with the same listing; an unused include is dropped, and so are the casts on the lines' colour (the same listing). Gynt's newest commit on the file, af1d790 on his reimpl/UI-MenuItems-development (2026-11-02, 45.8% there), writes that test as `DVar2 > 5000 - kickedAtTime`, which is a different test; the original subtracts first (`sub eax`, `cmp eax, 0x1388`, `jbe`), as this does. No line for cmake/compiler-flags-gl.txt: the file reads 100.0% off the /GL list, and 100.0% on it too. reccmp in a build of main's whole /GL list (the 133 files that exist) and this file, off the list, with every resolver of those files on: 144 functions, average 99.56. The function 100.0% raw and normalised, no differing line; the other 143 functions read the same as without the file. That build had the casts, the include and shorter comments; quick_diff gives the same 177 instructions, line for line, for this text. The sources were main's at 3458fea; main's commits since add cmake files and tools, and two other UI functions' files (sourcehold#466, sourcehold#467). 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>
FindingNetworkSessions::MenuModalRenderFunction_FindingNetworkSessions, moved out of our draft sourcehold#360 (e01e709, 66.9%), from Gynt's draft (9ae7d0b at 66.91% on his fork's reimpl/UI-MenuModals-development, "orig spills one local"; before it 57.97% at e4d0a08, 58.30% at 861024c and 39.1% at 4462f5d / 70f15af; his closed sourcehold#252 had an earlier version). The draft computes what the original computes; no behaviour is changed against it. The session list's frame (a dimmed box, its outline, the scroll bar's column and the column's two squares) is written in a block with its four edges as int const locals, declared left, top, right, bottom (left = x + 40, top = y + 85, right = x + 460, bottom = y + 285), and every coordinate is written from them. That is how the original computes them: x's register becomes the right edge (add ebp, 0x1cc at 0x0047D1C7) and y's the bottom (add edi, 0x11d at 0x0047D1CD), and the left edge less 1 is taken from x's stack slot (0x0047D1EB, 0x0047D1F8) and kept in a slot of its own (0x0047D1FC). In the draft, with the top, the bottom, the right edge and the outline's two edges (right + 1, x + 39) as locals and the box's left edge written out, the right edge did not take x's register, x was not read again, and the function came out four instructions shorter, without the 4-byte frame (quick_diff 0.6691, 134 instructions against 138). Of the 24 declaration orders, the three with left before right, top before bottom and right before bottom give the original's listing (left, top, right, bottom as here; top, left, right, bottom; left, right, top, bottom). The other 21 keep 138 instructions: with the bottom declared before the right edge only the two additions swap (3 orders, quick_diff 0.9855); with right before left or bottom before top the registers differ (18 orders, 0.8478 to 0.9638). A comment on the block says why it is one. On main since sourcehold#387 drawHeaderTextBanner takes an eTextSections: the banner's 76 is TEXT_MULTIPLAYER_CONNECTION, and eTextSections.hpp is included. No line for cmake/compiler-flags-gl.txt: the file reads 100.0% off the /GL list, and 100.0% on it too. reccmp in a build of main's whole /GL list (the 133 files that exist) and this file, off the list, with every resolver of those files on: 144 functions, average 99.56. The function 100.0% raw and normalised, no differing line; the other 143 functions read the same as without the file. That build had a shorter comment on the block; quick_diff gives the same 138 instructions, line for line, for this text. The sources were main's at 3458fea; main's commits since add cmake files and tools, and two other UI functions' files (sourcehold#466, sourcehold#467). Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Two more functions at 100%, moved out of our open draft #360, with no header changes and no line for
cmake/compiler-flags-gl.txt. One behaviour fix against gynt's draft of the first (below). Both draw a modal of the multiplayer connection screens, and both are from gynt's drafts on his fork'sreimpl/UI-MenuModals-development(his closed #252 had earlier versions); each commit credits him as co-author.ChooseNetworkServiceProvider::MenuModalRenderFunction_ChooseNetworkServiceProviderdraws the service-provider modal: its banner, the "You Were Ejected!" notice while it shows, the providers' list in a framed box, and on the modem tab a second framed box below it.FindingNetworkSessions::MenuModalRenderFunction_FindingNetworkSessionsdraws the modal shown while the game searches for sessions: its banner, the session list's framed box and the searching animation.ChooseNetworkServiceProvider::MenuModalRenderFunction_ChooseNetworkServiceProvider/GLlist and on itFindingNetworkSessions::MenuModalRenderFunction_FindingNetworkSessions/GLlist and on itMeasured.
Stronghold Crusader.exe(3bb0a8c1…5387ac5a), both resolver sets enabled locally (not committed), and sourcehold's reccmp with--resolve-wrapped-calls --ignore-security-cookie./GLlist (neither file is on it), and with 0x004314E0 (theMapEditorLandscaping_GeneralButtonshandler) left out and its resolver off, as in main's baseline: 0 failed of 2,427 compile steps, 99.58 over 2,443 functions.MenuModalRenderFunction_ChooseNetworkServiceProviderandMenuModalRenderFunction_FindingNetworkSessionsread 100.0 raw and normalised there too, with no diff entry, and main'sConstructor_MenuModal_ChooseNetworkServiceProviderandConstructor_MenuModal_FindingNetworkSessions, which pass these functions' addresses to their modals, go from 93.8 (92.3 normalised) to 100.0, asConstructor_MenuModal_ProgressBarBoxdid with One more UI::MenuModals function at 100%: ProgressBarBox #467. Two main functions read lower, and it is how reccmp prints a constant, not their code:Menu::handleMenuItems(0x004F6280) reads 97.9 (91.4 normalised) andMenu::Constructor_Menu(0x004F4100) 98.4 (95.2), both 100.0 before. Both compare a menu item's type with the constant 0x11000000, five compares in all; in this build's layout a symbol of our DLL lies at exactly that address, so reccmp prints the constant as that symbol's name on our side, and the instructions are the same on both sides (UI: the single-player game launch at 100% #466 describes the same two readings). Every other function reads exactly what it read before; against main's own build (made at f489b72, 2,439 functions) the only other changes are main's since then (One more UI::MenuModals function at 100%: ProgressBarBox #467'sMenuModalRenderFunction_ProgressBarBoxand its constructor, UI: the single-player game launch at 100% #466'sLaunchSinglePlayerGameUnk) (unrounded 99.5827 raw and 99.5540 normalised, 2,327 functions at 100.0 raw; with those two at 100.0, 99.5842 and 99.5594, 2,329; main 0e4a83b alone: 99.5788 and 99.5528 over 2,441, 2,325 at 100.0)./GLlist that exist on main, and one of the two files, off the list: 144 functions, average 99.56. Each function reads 100.0% raw and normalised, with no diff entries, and the same with its file on the list. The other 143 functions read the same as without the file. Those builds had slightly earlier texts (ChooseNetworkServiceProvider with the colour casts, one unused include and shorter comments; FindingNetworkSessions with a shorter comment); quick_diff gives the same instructions, line for line, for these texts. The sources were main's at 3458fea; main's commits since add cmake files and tools, and two other UI functions' files (UI: the single-player game launch at 100% #466, One more UI::MenuModals function at 100%: ProgressBarBox #467).field_0x474, a placeholder name; below); our local fixer finds nothing to change.The behaviour fix (ChooseNetworkServiceProvider)
lea ebx, [edi + 0x109]at 0x0047C9C5) and then movesyon to the bottom (add edi, 0x159).yfirst and then wrote the top asy + 265, which made it y + 610: 345 pixels below where it belongs, and the frame's lines with it. It came in with his 968b1ee (65.32%), which replaced the local of his 8f37773 (65.13%), so the 0.2 points between the two were a changed value. sourcehold'sreimpl/UI-MenuModalshas the top right.y + 265and the bottomy + 345, the edges of the second frame (below).What got them to 100%
left = x + 40,top,right = x + 460andbottomasint constlocals, the box is(left, top, right - 20, bottom), the outline runs fromleft - 1toright + 1, and the column is atright - 20. ChooseNetworkServiceProvider has two such frames, the list (y + 85 to y + 165) and the modem tab's box (y + 265 to y + 345); FindingNetworkSessions has one, the session list (y + 85 to y + 285), with the column's two squares (right - 20toright + 1attop + 20,right - 19torightatbottom - 20). A comment on each block says why it is one.ebx(0x0047C907, 0x0047C9C5). In the list's frame it keeps the left edge less 1 iny's stack slot (0x0047C91C, read back at 0x0047C934, 0x0047C94A and 0x0047C96E) and computesx + 461again for each line that uses it; in the modem box's it keepsx + 440in that slot (0x0047C9E3, read back at 0x0047CA5A) andx + 461inesi(0x0047C9F8). The draft had locals for the list's top, bottom and left edge less 1, wrote the other values out at each call, and movedyandxon for the modem box. Therexandyswappedesiandedi, andx + 440keptebx, where the original keeps the list's top: quick_diff 0.6780, the same 177 instructions. With only the list's frame in a block, the modem box's top and left edge swapebxandebp(0.9435). With both blocks it reads 1.0000. The edges' declaration order does not matter here: both orders we tried (left, top, right, bottom, and One more UI::MenuItems function at 100%: LobbyMenu MapDesc #464's right, left, top, bottom) give the same listing, and so doesintwithoutconst.x's register becomes the right edge (add ebp, 0x1ccat 0x0047D1C7) andy's the bottom (add edi, 0x11dat 0x0047D1CD), and the left edge less 1 is taken fromx's stack slot (0x0047D1EB, 0x0047D1F8) and kept in a slot of its own (0x0047D1FC; a 4-byte frame). In the draft, with the top, the bottom, the right edge and the outline's two edges (right + 1,x + 39) as locals and the box's left edge written out, the right edge did not takex's register,xwas not read again, and the function came out four instructions shorter, without that frame (quick_diff 0.6691, 134 instructions against 138). Of the 24 declaration orders of the four edges, the three with left before right, top before bottom and right before bottom give the original's listing: left, top, right, bottom (as here), top, left, right, bottom, and left, right, top, bottom (quick_diff 0.9928, which is quick_diff's display of the% 32mask; reccmp reads 100.0 for ours). The other 21 keep 138 instructions: with the bottom declared before the right edge only the two additions swap (three orders, 0.9855), and with right before left or bottom before top the registers differ (18 orders, 0.8478 to 0.9638).drawHeaderTextBannertakes aneTextSectionssince Fix main's build: drawHeaderTextBanner and its 15 callers take eTextSections #387, so both drafts' 76 isTEXT_MULTIPLAYER_CONNECTION(FindingNetworkSessions now includeseTextSections.hpp).y - 0x3cisy - 60, the kick timer's test readstimeGetTime() - kickedAtTime > 5000(the draft had5000 < ...), an unused include is dropped, and so are the casts on the lines' colour. gynt's newest commit on the file, af1d790 on hisreimpl/UI-MenuItems-development(45.8% there), writes that test asDVar2 > 5000 - kickedAtTime, which is a different test; the original subtracts first (sub eax, [kickedAtTime],cmp eax, 0x1388,jbe), as this does.No line for
cmake/compiler-flags-gl.txt/GLlist, and 100.0% on it too (the same builds with the line added). So they need no line.cmake/function-visibility.txt(cmake: function-visibility.txt, which callers must see which callees' bodies #398) either: the manifest names neither function nor any of their callees.Proposed, not changed here
ProtocolDefinedData::field_0x474(int[32]) is the searching animation's frame table (the checker's CHECK): FindingNetworkSessions draws picture 398 plus entry(tick / 2) % 32of it. Its 32 values in the exe are 0 to 7, 7, 7, 6 down to 1, then 8 to 15, 15, 15, 14 down to 9: pictures 398 to 413, each run of eight played out and back. Nothing else in the original reads it (one reference, at 0x0047D2E7), and no other code on main. gynt'sreimpl/Wilps-2026-10-18already calls itsessionSearchAnimFrames(8ca7861); that is a header change, so it is left out of this PR.Other PRs
reimpl/UI-MenuModalstext of both files, with only his commits on them, and so does gynt'sreimpl/Wilps-2026-10-18, except that its FindingNetworkSessions reads the table assessionSearchAnimFrames(above). We know of no other open PR that holds them.🤖 Generated with Claude Code