Repository navigation
Conversation
…n with /GL RenderStatusMenu_Overview only matches when SomeFearFactorComputation is compiled with it under /GL: the original's caller knows the callee clobbers only ecx. Entries taken from draft sourcehold#529. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Taken from draft sourcehold#529. Measured on main 40cbb1c with the three files of this PR in .local, both resolver sets enabled and the /GL entries: reccmp 100.0 / normalized 100.0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Taken from draft sourcehold#529. Measured on main 40cbb1c with the three files of this PR in .local, both resolver sets enabled and the /GL entries: reccmp 100.0 / normalized 100.0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…ro_DoEveryFrame Taken from draft sourcehold#529. Measured on main 40cbb1c with the three files of this PR in .local, both resolver sets enabled and the /GL entries: reccmp 96.2 / normalized 96.0, the only differences being float constant names and _ftol2_sse, so counted as 100% per main's convention. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
|
Style guide reading (advisory, posted once) 12 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 2 of the 3 reimplemented The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.
WhereRule 1 — Drop the decompiler trailing
Rule 16 — Give variables a name that says what they hold
Rule 18 — Use the name, not the number
Rule 23 — Prefer if-else over ternary
Rule 24 — Declare variables upon first use
|
…GUIDE MenuView_HistoricMissionIntro_DoEveryFrame: - named locals (windPlaying, ticks, blendStrength) instead of BVar1/iVar2, declared at first use - early return instead of the comma operator in the fade condition, += for the fade step - decimal coordinates, 0.0f/30.0f/31.0f float literals, no redundant (double) casts, countof for the mission sound table - the 31.0 in the fade reversal stays a double with a comment: the original subtracts in double precision (fsubr qword) - dropped the trailing return and the unused usings RenderStatusMenu_Overview: - decimal coordinates, font size and text index, += for the width sum, comments for the three description parts - dropped the unused usings and the unused BGR24 include SomeFearFactorComputation: namespace closing comments. Re-measured on main 40cbb1c with a full build and reccmp: unchanged, SomeFearFactorComputation and RenderStatusMenu_Overview at 100.0 / 100.0, HistoricMissionIntro at 96.2 / 96.0 with only float constant names and _ftol2_sse differing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…on_Prepare, register allocation differs Taken from draft sourcehold#529, with the style pass applied (imported string literals with their text as comments, the comma-operator condition written out as nested ifs, named locals for the event-condition clear, no unused usings or trailing return). memset was measured for the clear and costs the match (it is called, not inlined), so the pointer walk stays with a comment. Measured on main 592a17d with a full build and reccmp: 96.3 / 88.2. The only remaining differences are allocation ones: - the two stores after the rep stosd use the zero in esi instead of the eax that rep stosd leaves at zero; - the mov ecx, 0x1f40 count load sits before instead of after xor eax, eax; - one branch offset moves by 2 bytes because the esi stores encode longer. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
- SomeFearFactorComputation, HistoricMissionIntro: the comments that only explained match-driven forms move to the PR thread. - HistoricMissionIntro: the wind-sound check and the tick count feed the ifs directly instead of going through one-use locals. - ScenarioDescription_Prepare: the event-condition clear is a countof loop over SEC_EventsExtra[event].conditionIsTrue instead of a pointer walk; MSVC still turns it into the original's rep stosd. - RenderStatusMenu_Overview: the two description comments are one. Re-measured on main 592a17d with a full build and reccmp, unchanged: 100.0 / 100.0 / 96.2 (counted) / 96.3 (register allocation differs). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
|
These forms stay as they are because they are needed for the match. Each was measured with a full build and reccmp on main 592a17d.
Casts kept after the cast pass. No cast in this PR could go without changing the code or the build. Kept:
|
This PR carries the finished part of draft #529 (
reimpl/ui-menuviews-modals-development): the three functions from that draft that are at 100%, plus one function where only register allocation differs. The files come from the draft and compile against main's headers without changes.Measured on
origin/main(40cbb1c), then again after merging main 592a17d into this branch: I ran a full DLL build with exactly these files incmake/openshc-sources.txt.local. Both resolver sets were switched on: the struct resolvers throughenable_reimplemented_data.pyand the function resolvers throughenable_local_functions.py. The/GLentries below were in place. I then ran reccmp.UI::Helpers::SomeFearFactorComputation100.0% | ReimplementedUI::StatusMenus::RenderStatusMenu_Overview100.0% | ReimplementedUI::MenuViews::HistoricMissionIntro::MenuView_HistoricMissionIntro_DoEveryFrame100.0% | Reimplemented (counted: only float constant names and _ftol2_sse differ)UI::MenuViews::ScenarioDescription::MenuView_ScenarioDescription_Prepare96.3% | Register allocation differsIn
MenuView_HistoricMissionIntro_DoEveryFrame, only labels differ: the 30.0/31.0/32.0 float constants, which reccmp leaves unlabelled on the original's side, and_ftol2_sse.In
MenuView_ScenarioDescription_Prepare, every remaining difference is an allocation difference, with no functional effect:rep stosdtake their zero fromesiinstead of theeaxthatrep stosdleaves at zero;mov ecx, 0x1f40sits beforexor eax, eaxinstead of after it;esistores have a longer encoding.This function was added after the user clarified what counts as register allocation only. Its style pass is in its own commit:
return;are gone.The event conditions are cleared with a nested
countofloop overSEC_EventsExtra[event].conditionIsTrue, which MSVC compiles to the original'srep stosd.memsetis compiled as a call instead and drops the function to 84.9.Header changes: none.
GL / visibility entries:
cmake/compiler-flags-gl.txtgetsRenderStatusMenu_Overview.cppandSomeFearFactorComputation.cpp, as in the draft. The original'sRenderStatusMenu_Overviewrelies on knowing thatSomeFearFactorComputationclobbers onlyecx, and that only reproduces when both are compiled with/GL. No function-visibility entries are needed.Overlap with open PRs: #318 also contains
SomeFearFactorComputation.cpp, in a different version. Whichever PR is merged second will conflict on that file. The version in this PR is the one measured at 100% on current main.Left in the draft:
RenderPlayerInfoOnHoverDisplayElement(68.2%)MenuView_CampaignUnk_Prepare(98.2%)MenuView_CrusadeMap_DoEveryFrame(75.3%)MenuView_RankingGames_DoEveryFrame(80.4%)MenuView_ScenarioDescription_DoEveryFrame(90.7%)None of these differs in register allocation alone, so none goes into this PR.
RenderPlayerInfoandScenarioDescription_DoEveryFramereassociate an addition (ecx = -0x30 - a; b += ecxin the original againstb -= a; b -= 0x30in ours).CampaignUnkdiffers inleaagainstadd.CrusadeMapandRankingGamesdiffer in block layout and tail merging. Draft #529 stays open for them.There is one commit per function, each with its status line. There is also one commit for the
/GLentries, plus the style commit and a merge of main.Style pass (7da4461): all three files now follow
REIMPLEMENTATION_STYLE_GUIDE.mdas it is on main.MenuView_HistoricMissionIntro_DoEveryFrame:windPlaying,ticks,blendStrength) instead ofBVar1/iVar2, declared at first use;+=;ffloat literals and no redundant(double)casts;countoffor the mission sound table;return;and no unused usings.31.0in the fade reversal stays a double, with a comment: the original subtracts in double precision (fsubr qword).RenderStatusMenu_Overview:+=for the width sum;BGR24include is gone.SomeFearFactorComputation: comments on the closing namespaces.Re-measured with a full build and reccmp: unchanged. Two functions are at 100.0 / 100.0, and
HistoricMissionIntrois at 96.2 / 96.0 with only labels differing. No change had to be reverted.Pre-review pass (61bee57): code comments that only explained match-driven forms are now in the PR thread. One-use locals that are not needed for the match are folded into their ifs, and the event clear is a
countofloop. The four measurements are unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp