Repository navigation
UI: the population report's graph at 100% - #436
Open
kotijekriv wants to merge 1 commit into
Open
kotijekriv wants to merge 1 commit into
kotijekriv wants to merge 1 commit into
Conversation
StatusMenus::RenderStatusMenu_Population, from gynt's drafts: a92aa37 at 59.18% and 142ef0b at 64.1%, the second on sourcehold's reimpl/UI-StatusMenus; 73.2% in the status line of 67318e1 on his fork's reimpl/UI-StatusMenus-development; the newest commit on the file, e30b3f0, is on his reimpl/UI-MenuItems-development. Through our drafts 4faa418 (82.4%, on our fork kotijekriv's reimpl/UI-StatusMenus-development) and 6a2b835 (93.8%, in the draft PR sourcehold#313). Two differences were left, in two different loops, with one cause: the year labels' loop took the label's years as label * 5. The compiler turns that into a counter of its own either way (add ebp, 5 at 0x0043F999), but with the multiplication in the source - the sum of the first year and the label's years was an lea into a third register, where the original adds in place (add ecx, ebp at 0x0043F985), and - in the next loop, the bars' loop, the three scratch registers came out rotated (the screen width in ecx where the original has eax, at 0x0043F9F0). With the years as a second counter of the for loop (years += 5) both are gone. That the next loop followed suggests the compiler hands out scratch registers in turn, so one temporary more shifts the choices behind it. Measured: quick_diff 0.9984 with 318 instructions against 317; the one line is the jmp over the padding in front of the labels' loop (0x0043F926), which our listing shows as padding. reccmp 100.0% (normalized 100.0%) alone, data resolvers and its own resolver on. Not run in game. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 20, 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.
StatusMenus::RenderStatusMenu_Populationat 100%, moved out of our open draft #313, from gynt's draft. No header changes.StatusMenus::RenderStatusMenu_PopulationMeasured.
Stronghold Crusader.exe(3bb0a8c1…5387ac5a), and sourcehold's reccmp with--resolve-wrapped-calls --ignore-security-cookie. The struct resolvers and the function resolvers are enabled locally (not committed); in the full build 0x004314E0 (MapEditorLandscaping_GeneralButtonshandler) is left out and its resolver stays off, as in main's baseline.tools/). The function reads 100.0 raw and normalised, with no diff entry.Menu::handleMenuItems(0x004F6280) reads 97.9 (91.4 normalised) andMenu::Constructor_Menu(0x004F4100) reads 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 the address 0x11000000, so reccmp prints the constant as that symbol's name on our side. The instructions are the same on both sides. UI: three more functions at 100%: the building menu's DoInitial, the credits' prepare and activateModalDialog2 #435's text describes the same thing for its build.openshc-pr-checkgives 0 ERROR and 2 CHECK (below).openshc-pr-fixfinds nothing to change.What got it to 100%
Two differences were left, in two different loops, with one cause.
label * 5. The compiler turns that into a counter of its own either way (add ebp, 5at 0x0043F999). But with the multiplication in the source, the sum of the first year and the label's years was anleainto a third register, where the original adds in place (add ecx, ebpat 0x0043F985).ecxwhere the original haseax(0x0043F9F0), and so on.forloop (years += 5), both are gone.That the next loop followed suggests the compiler hands out scratch registers in turn, so one temporary more shifts the choices behind it. This may help with other functions whose only gap is a rotation of
eax,ecxandedx.The checker's 2 CHECKs
int scale;declared without a valuedrawLinecalls that differ only in a number stepping by oneforloops the compiler keeps loops where the original has the calls written out (measured with both sides as loops: 289 instructions against the original's 318). The comment above the calls says so🤖 Generated with Claude Code