Repository navigation
One more UI::MenuModals function at 100%: ProgressBarBox - #467
Merged
TheRedDaemon merged 1 commit intoNov 22, 2026
Merged
Conversation
ProgressBarBox::MenuModalRenderFunction_ProgressBarBox, moved out of our draft sourcehold#360 (f860f20, Gynt's code with the fixer's rewrites), from Gynt's draft (217700a at 96.33% on his fork's reimpl/UI-MenuModals-development, "spill slot differs"). That draft computes what the original computes; no behaviour is changed against it. His earlier copies (45.2% at 266d7a5, in his closed sourcehold#252; 48.6% at 6987e8c) have no else on the second test and dim the filled box; he put the else in in 85a110f (85.97%), as the original has it (it returns at 0x00493642), and it is here. His draft has the original's 109 instructions; four of them use another stack slot. The original keeps the bar's x in the second parameter's slot: computed at 0x0049360F, stored there in front of the draw (0x00493620) and read back for progressBarX (0x0049362F; 0x0049364E, 0x0049365E and 0x0049366D in the other arm). The draft assigns the value to height, the unused fourth parameter, and gets the fourth slot. Here: - the bar's x is assigned to y. On its own that keeps the value in y's register (105 instructions), an own local gets a new stack slot (112 instructions), and so does the expression written out at both uses (112); - so y is read through a local, top, that is assigned from y in each arm of the language test, where the original loads the second parameter (0x00493572, 0x004935A2). Then top gets y's register (edi), y is not kept in a register, and its new value lives in its own slot: 109 instructions against 109. Declared with y as its value (int top = y; or int const top = y;), top is loaded at the function's start and the match is lost (107 instructions); the unused height as the copy gives the same listing as top; - the bar's bottom is written out in the two calls (as a local, the same listing), and the casts on the text's number and on the box's colour are dropped (the same listing). 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, and the same with the file on the list. The other 143 functions of main's list read the same as without the file. Both builds had an earlier text of this file (one unused include more, and the bar's bottom in a local); quick_diff gives the same 109 instructions, line for line, for that text and for this one. The sources are main's at 3458fea; main's two commits since (02fab42, 812d149) add cmake files only, with the new option off. 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>
TheRedDaemon
requested changes
Nov 22, 2026
TheRedDaemon
approved these changes
Nov 22, 2026
This was referenced Nov 22, 2026
Open
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.
One more function at 100%, moved out of our open draft #360, with no header changes and no line for
cmake/compiler-flags-gl.txt. No behaviour change against gynt's 96.3% draft, which has anelsethat his older copies miss (below).ProgressBarBox::MenuModalRenderFunction_ProgressBarBoxdraws the box of the load and save progress bar: its title, in a smaller font for English and American, and the bar's background, a very soft yellow box or a dimmed one. It keeps the bar's place forRenderLoadAndSaveBar, which draws the progress. It is from gynt's draft on his fork'sreimpl/UI-MenuModals-development, and the commit credits him as co-author.ProgressBarBox::MenuModalRenderFunction_ProgressBarBox/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), with main's own/GLlist and with 0x004314E0 (theMapEditorLandscaping_GeneralButtonshandler) left out and its resolver off, as in main's baseline: 0 failed of 2,424 compile steps, 99.58 over 2,440 functions, against 99.58 over 2,439 for main alone (built at f489b72; 3458fea only adds files undertools/, and cmake: optional wrapper units built from function-visibility.txt #399 and cmake: function-visibility.txt, which callers must see which callees' bodies #398 add the optional function-visibility units, off by default).MenuModalRenderFunction_ProgressBarBoxreads 100.0 raw and normalised there too, with no diff entry. One function on main reads higher:Global::Init::Constructor_MenuModal_ProgressBarBox(0x0059B6E0) goes from 93.8 to 100.0 (92.3 to 100.0 normalised), because the address it stores is now this function and no longer the resolver's trampoline; its code is unchanged. Every other main function reads exactly what it read before (unrounded 99.5786 against 99.5759 raw, 99.5526 against 99.5492 normalised; 2,324 against 2,322 functions at 100.0 raw)./GLlist that exist on main, and this file, off the list: 144 functions, average 99.56. The function reads 100.0% raw and normalised, with no diff entries, and the same with the file on the list. The same build without the file has 143 functions, and each of them reads the same. Both builds had an earlier text of this file (one unused include more, and the bar's bottom in a local); quick_diff gives the same 109 instructions, line for line, for that text and for this one. The sources were main's at 3458fea; main's two commits since (02fab42, 812d149) add cmake files only, with the new option off.top, declared without a value; below); our local fixer finds nothing to change.Against the draft
gynt's 96.3% draft (217700a, on his fork's reimpl/UI-MenuModals-development) computes what the original computes, and nothing in its control flow or its values is changed here: the same two tests, the same text, boxes and stores. What differs is where two values are kept:
topholdsy, andyholds the bar's x, which his draft keeps inheight. Neither parameter is read again behind the last store. The casts on the text's number and on the box's colour are dropped (the same listing).His earlier copies draw the filled box and then the dimmed box over it: their second test has no
else, so the dimmed arm runs in every case. These are the 45.2% text of #252 (266d7a5), the 42.5% text (a461509) that 20 of his other branches carry (his style passes on top), 48.6% at 6987e8c, and the copy on reimpl/Wilps-2026-10-18 (8ca7861). He put theelsein himself in 85a110f (85.97%, "one extra stack slot"), as the original has it (it returns at 0x00493642), and came to 96.3% in 217700a ("spill slot differs"). Both steps are his, and both are here.What got it to 100%
gynt's draft has the original's 109 instructions already. Four of them use another stack slot (96.3%), and that is all this PR changes.
ycame in (0x00493620) in front of the draw, and reads it back from there forprogressBarX(0x0049362F); the other arm does the same (0x0049364E, 0x0049365E, 0x0049366D). gynt's draft assigns the value toheight, the fourth parameter, which the function does not use otherwise: the same instructions with the fourth slot.yas the draft assigns it toheight, the value stays in y's register:yis inedifor the whole function, and the compiler puts the new value there too (105 instructions against 109). An own local gets a new stack slot (112 instructions), and with the expression written out at both uses the compiler saves it in a new slot as well (112).yis read through a copy, and the copy is made in each arm of the language test. The original loads the second parameter in each arm (0x00493572, 0x004935A2). With a localtopthat is assigned fromythere,topgetsedi,yitself is not kept in a register, and its new value lives in its own slot: 109 instructions against 109.topcannot be declared withyas its value (int top = y;orint const top = y;): thenyis loaded at the function's start, in front of the language test, and the match is lost (107 instructions).heightas the copy (height = y;in each arm) gives the same listing astop. Butheightwould then hold the box's top (barY = height + 65), and the function already has one parameter,y, that holds something else; a local says what it holds.barY, as the draft has it: in front of it, or withbarYwritten out at its two uses, the compiler takes a new stack slot (112 instructions). The bar's bottom, used once, is written out in the call: as a local it gives the same listing.quick_diff reads 1.0000: 109 instructions against 109.
No line for
cmake/compiler-flags-gl.txt/GLlist, and 100.0% on it too (the same build with the line added). So it needs no line.cmake/function-visibility.txt(cmake: function-visibility.txt, which callers must see which callees' bodies #398) either: the manifest names neither this function nor any of its callees.Kept as they are
int top;is declared without a value (the checker's note) and assigned in both arms of the language test: see above. A comment in the code says why.y: a local of its own gets a new stack slot (112 instructions), andywithout the copy keeps it in a register (105); see above. A comment says so at both assignments.What some placeholders hold (nothing changed here)
MenuTextInputState::DAT_MenuOptionsActionParameter: the number of the title's text in the game options' text group, which has "Load" and "Save". It isundefined4in the header; the exe refers to it in 35 places.GameSynchronyState::saveRelated: not zero for the filled box;undefined4, 17 references in the exe.MenuTextInputState::progressBarXandprogressBarY: the bar's place.RenderLoadAndSaveBar(0x00493690, on main) draws the progress there.Other PRs
🤖 Generated with Claude Code