Repository navigation
Reimplement 6 UI::Helpers and UI::MenuItems functions (not yet 100%) - #318
Draft
kotijekriv wants to merge 60 commits into
Draft
kotijekriv wants to merge 60 commits into
kotijekriv wants to merge 60 commits into
Conversation
TrimStoredMenuString stores the string's length into it as an integer (a plain mov, no float conversion), and the scrolling-credits code compares it with an int. The name stays as generated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header declared int, but the function only leaves the last rand() / 10 in eax; no caller reads it (each of the four call sites overwrites eax right after the call). Declaring it void compiles to the same instructions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It returns the hotspot number or -1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The four siege slots' remaining points sit in one array: SomeSiegeRelatedCopying and SomeSiegeUnitsComputation index it with the slot number. DAT_00b960bc, INT_00b960c0 and INT_00b960c4 were its elements 1 to 3 and go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It holds one siege setup: 7 units by 3 values, the same shape as one row of DAT_SiegeInformationArray_2 (int[4][7][3]), which it is copied to and from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s in the unit loops; where the remaining points are loaded UI::Helpers::SomeSiegeUnitsComputation (parameter: the siege slot), rewritten from the binary (gynt's version on his fork's reimpl/UI-MenuItems-development measured 10.6% here). It totals slot 1's remaining points and the value of its siege setup, gives each of the 4 slots its percentage of that total, resets all 4 setups from the template, rescales slot 1 from the chosen slot and the other slots from slot 1, and stores what each slot has left (at least 0). The unit values are a run of 21 ints starting at RenderingDefinedData.ARCHER and the slot percentages 4 ints starting at field1003_0x548dc (the two overlap by one int); INT_00b960b8 is the slots' int[4] (see the header commit). The template copy is one run of 21 values per setup: written as units by values, MSVC keeps a unit loop the original does not have (0.60 vs 0.93 quick_diff). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…places the new-file block before the read path UI::Helpers::WriteMissionToScoresFile (parameters: file name, score), rewritten from the binary (gynt's version on his fork's reimpl/UI-MenuItems-development measured 46.3% here). The scores file is a version (1) followed by the 10 best scores, best first; the version and the scores are one local struct, matching the original's 11-int block. Behaviour fixes against the decompile: a score that does not reach the top 10 returns without writing (the decompile's search never stopped at 10), and a file that cannot be opened for writing returns instead of being written through a null handle. The original lays the new-file block out before the read path; writing the condition as ||, as two ifs, or with the read path in the then-branch all compile to our order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… parameter stores (the 100.0 is read from a shared constant in the original) UI::Helpers::TrimStoredMenuString: the length loop is strlen (MSVC inlines it as the original's loop), stored as an int (see the header commit before this one; the decompile converted it to float, which changes the stored bits). gynt's version on his fork's reimpl/UI-MenuItems-development measured 37.5% here. What is left is which register each parameter store goes through; the order of the statements follows the original's stores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r level and the result in the same register (eax) UI::Helpers::SomeFearFactorComputation: gynt's version from his fork's reimpl/UI-MenuItems-development (58.3% here) with the comparisons as the asm has them (<= -5, <= -3, <= -1, >= 5) and decimal message numbers. The instructions match; only the register differs: the original reuses eax for the result once the level is no longer needed, ours keeps the level in ecx. A ternary, if/else and early returns all compile to setge instead. The header declares the return type undefined4; it is a message number like its siblings' int. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gister again at the top of each setup; the loop's end address UI::Helpers::ClearSiegeInformationArray2: gynt's version from his fork's reimpl/UI-MenuItems-development (73.9% here) as an index loop over the 4 setups instead of a pointer walking to a raw end address. Like the original it clears only the first 11 of each setup's 21 values. Left: the original sets its zero register again at the top of every setup (ours hoists it), and the loop's end address (the next global there). An intrinsic memset becomes a call instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t other addresses; LARGE_INTEGER is spelled _LARGE_INTEGER on our side UI::Helpers::TicksSinceCounterStart, rewritten from the binary (gynt's version on his fork's reimpl/UI-MenuItems-development measured 59.4% here and returned undefined4 where the header says BOOLEnum). It waits until TIME_QueryMargin ticks have passed, then stores the margin over the elapsed time (both unsigned, which is where the decompile's + 4.2949673e+09 came from) and its inverse. reccmp shows 88.7% because the float constants live at different addresses and LARGE_INTEGER is spelled _LARGE_INTEGER on our side; the instructions match. The flag is compared with TRUE because the original compares it with 1, and the wait stays a do-while because it must read the clock at least once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ddresses carry no symbol (they are FLAG_JokeAIMessageArray[i]) UI::Helpers::PlayJokeVideoBasedOnCurrentTimeAndPlayTime: gynt's version from his fork's reimpl/UI-MenuItems-development (90.6% here). His branch read the joke flags through 13 globals main does not have (FLAG_JokeAIMessage05, INT_00ee236c, ...); they are the elements of main's FLAG_JokeAIMessageArray (0x00EE2350), so the code indexes that array (index = (address - 0x00EE2350) / 4). The 10-second test is written >= 10000 as in the asm, the comma expressions are gone, and the Christmas search is a for loop. reccmp shows 91.3% because the original's flag addresses (0x00EE2354 and so on) carry no symbol while ours resolve to FLAG_JokeAIMessageArray[i]; the addresses and instructions are the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…differs (the same address under another symbol) UI::Helpers::LoadScoresFileToMemory. gynt's version from his fork's reimpl/UI-MenuItems-development. The read loop indexes DAT_MissionScores instead of walking a pointer to a raw end address; only the loop's end address differs from the original (the next global's address there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…differs (the same address under another symbol) UI::Helpers::PrepareHistoryBook: gynt's version from his fork's reimpl/UI-MenuItems-development (56.4% here) with the particle setup as a plain loop over the 48 entries of INT_ARRAY_00eb0b28 instead of a pointer walking to a raw end address; only the loop's end address differs from the original (the next global's address there). The function returns nothing (see the header commit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…differs (the same address under another symbol) UI::Helpers::FindCampaignMapHotspotAtMouse: gynt's version from his fork's reimpl/UI-MenuItems-development (70.1% here) as an index loop over the 24 elements of DAT_ARRAY_00ec0348 instead of a pointer walking to a raw end address. The mouse position is read once and the border in each step, as the original does. Only the loop's end address differs (the next global there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_TextEditor_Buttons stores and tests 0 in pendingTokenTypeToSkip for "no token pending"; the enum had no name for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… .sav/.msv tails not cross-jumped gynt's draft (30.4%) rewritten: the original dispatches with a switch whose save cases come first, copies and extends the file name with the strcpy/strcat intrinsics (the split .tmp/.map/.sav/.msv literals from string-macros.hpp), and calls resolveResourceFileName in every arm, which MSVC cross-jumps. The hand-written security cookie is gone (the compiler adds its own). Left: the .sav/.msv arms are not cross-jumped like the original's, and register allocation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… register allocation gynt's draft (75.0%) with the decompiled loops written as the strlen and strcpy intrinsics (case 4 copies the help section name into ResourceManager's strFileTitle and strFile), and the inner switch's case 0xe writing out the tail it shared with case 4 instead of a goto into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…llocation gynt's draft (57.7%) with the map file name built by the strcpy/strcat intrinsics (the split .map literal from string-macros.hpp) and without the hand-written security cookie (the compiler adds its own). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… register allocation Scrolling up keeps the offset in a local and stores it once, which gives the original's sub eax, 18 (reading the field into a local and storing iVar4 - 18 gave add eax, -18). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s and do-whiles; registers No gotos or do-whiles left. quick_diff for each form, from 0.6904: - search for a positive siege count, then clear: for + break + index test with the 21 zero stores written out 0.6596; a pointer while 0.6848; for + break + index test with the zeros as a loop 0.8257 (kept) - the second search, leaving the function: indexed for + return 0.8204; pointer for + return 0.8257 (kept, ties the do-while) - the 20-count copy as an indexed for over SEC_SiegeInformation (read as 20 ints): ties the byte-offset do-while - the map description call written in both arms with its constants 0.8918 (kept); with the decompiler's locals 0.8707; the goto to the function's end is a return (ties). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion The two tails Ghidra shared through gotos (the token-advance-and-layout tail, and the token-store tail of cases 11, 12 and 14) are written out at every site with the token named: HTT_INCLUDE and HTT_STRING where the decompiler had ORed two others into 14 and 12. No gotos left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… gotos as break; shared building-focus goto kept; register allocation Stance cases call queueUnitStance with their own constant instead of jumping to one shared call (0.6719 -> 0.7059 in quick_diff). The engineer and tunneler gotos into the post-switch code became break, which compiles identically. The building-focus check stays one shared block behind a goto: written out in each building case it measures 0.6050, and moving the label to the granary case ties. Number casts to enums replaced by named values (header commits before this one). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s != order; register allocation If-chains in the original's layout order (!= tests, else arm last) in the load file-name chain and the load tail; the isHost test without negation, each arm with its whole .msv tail; soundID read inside the arm that uses it, before switchToMenuView; the lordIcon assignment out of the condition, tested as >= 2 as the original does; the player-ID and death-flag store runs as for loops (quick_diff 0.7888 -> 0.9169). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erMapChoice_MapTable == FALSE as negation; an unused using removed. The generated code does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 7, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 7, 2026
6and8
pushed a commit
to 6and8/OpenSHC
that referenced
this pull request
Nov 8, 2026
* reimplement: SHC_3BB0A8C1_0x004BBF40 100.0% Reimplemented Moved here unchanged from the draft sourcehold#328 (reimpl/UI-MenuItems-3-development-2, 13fbfea). It was 100% before the header sync a9401a7 and 92.3% on sourcehold#328's base 72b2732, where MSVC stopped sharing the tails of its two number calls. On main 57d3334 it compiles to the original's 100 instructions again, with the shared tail. quick_diff is left with its own artefacts only: the jump-table spelling, the colour immediates, the picture table's address written as its base less 14, and ret / ret 0. reccmp: 99.2% raw and 100% normalized, where only the picture table's address differs (reccmp shows it as an offset into DAT_GMImageHeaders), which the project records as 100%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * headers: MenuItemActionHandler_InGameMenu_Scrolling takes no parameters The original ends with push 1 / call RecordTutorialPlayerAction / pop ecx (0x00434200 to 0x00434207). Declared (int, ...), our function tail-calls through its own argument slot instead (mov [esp + 4], 1 / jmp), which MSVC can only do when the function has a named parameter. Only the menu tables refer to it (six dwords, no call), and like WaitingForHost_ConnectToLobby it never reads an argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * headers: SoundEffectID values 254 to 256 as SEID_UNKNOWN_<hex> LobbyMenu_SkirmishTypeAndBalance plays them when the balance changes: 256 at either end (buttons 10 and 14), 255 one step from even (11 and 13) and 254 at even (12); the pushes are at 0x0042A888, 0x0042A8A1 and 0x0042A8B5. The draft wrote them as (SoundEffectID)0x100 and as SEID_UNIT_DAMAGE3 | SEID_PEOPLE_ARE_COMING_TO_THE_CASTLE (248 | 7) and SEID_UNIT_DAMAGE3 | SEID_ARROW_KILL (248 | 6). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * reimplement: SHC_3BB0A8C1_0x0042A840 100.0% Reimplemented From gynt's fork branch reimpl/UI-MenuItems-100, 97.6% there. On main's headers it compiles to the original's 41 instructions, and quick_diff differs only in its own ret / ret 0. The style pass names the parameter and the button ranges, and the three sound effects by the names the previous commit adds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * reimplement: SHC_3BB0A8C1_0x004D99F0 100.0% Reimplemented From gynt's fork branch reimpl/UI-MenuItems-100, 97.6% there. Rewritten without the decompiler's gotos, it keeps the original's 85 instructions. quick_diff's differences are its own: ret / ret 0, and the tail jump to MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface at 0x004D9A4F, which our listing writes as jmp trampoline<4603888> (0x00463FF0) and quick_diff does not count as a function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * reimplement: SHC_3BB0A8C1_0x00442C30 100.0% Reimplemented Moved from the draft sourcehold#318 (reimpl/batch2-development 49a51e7), 92.6% there. The search for a siege unit now sets a flag and leaves the loop, so its exit jumps past the clearing as the original's does (jg at 0x00442DE3 to 0x00442E64) instead of testing p == end after the loop: quick_diff 0.9753 -> 0.9807. A goto, a flag over the pointer loop and a flag over an index loop all measure the same; the index loop reads best. What is left is quick_diff's own: the security cookie, the timeGetTime import call, ret / ret 0, and the 11 bytes of alignment before the copy loop at 0x00442EA5, which the original's assembler wrote as a jmp over the filler. The style pass replaces the pointer loops with index loops over the 21 counts and returns early for maps that are not sieges. Clean alone build: reccmp 98.9% raw and 100% normalized. The two raw differences are one address, the end of the siege search loops (cmp eax, 0x00B95B1C, one past DAT_SiegeInformationArray), which reccmp resolves to the next global in the original and to our array's end in the DLL; the project records that as 100%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * reimplement: SHC_3BB0A8C1_0x0047E420 100.0% Reimplemented From gynt's reimpl/UI-MenuItems (PR sourcehold#254, closed), 74.1% there. The label is drawn in two calls with the same colour, one per hover state, and the position goes through two locals computed before them: MSVC then merges the two calls but for the text ID's push (the jne at 0x0047E45D). One call is quick_diff 0.8136, the position inside each arm 0.5479, this form 0.9375, which leaves only the colour immediate and ret / ret 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * reimplement: SHC_3BB0A8C1_0x00434120 100.0% Reimplemented Moved from the draft sourcehold#327 (reimpl/UI-MenuItems-3-development c1c152b), 89.9% there. With the header taking no parameters (previous commit) the closing RecordTutorialPlayerAction(1) is a call again rather than a tail call: quick_diff 0.9343 -> 0.9710, left with the jump-table spelling and ret / ret 0. The comments now say what -1000 does, and that the frame-rate formula makes up for only part of the slowdown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * reimplement: SHC_3BB0A8C1_0x00442F40 100.0% Reimplemented From gynt's reimpl/UI-MenuItems (PR sourcehold#254, closed), 77.4% there. The cases now come in the original's order, 1, 2/3, 4, 7, 5, 6, as in LobbyMenu_MapSelectScrollbar on main: the original lays the blocks out in that order (case 7's store at 0x00442FDA sits between case 4 and case 5). quick_diff then differs only in its own jump-table spelling and ret / ret 0. The style pass names the parameters as the LobbyMenu scrollbar does and writes - 13 and ++ / --. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * reimplement: SHC_3BB0A8C1_0x0047CCA0 100.0% Reimplemented From gynt's reimpl/UI-MenuItems (PR sourcehold#254, closed), 73.6% there, after main's renames (isNameEntryActive). Each case now computes the text's position, fetches the text and draws it itself: MSVC merges the copies of cases 0 to 3 into one tail but for the push of the text's index, as the original has push 5 / push 6 / push 7 / push 0 before its shared tail at 0x0047CDE7; case 4 keeps its own call and the surface reset. With one call after the switch the index goes through a register (quick_diff 0.9365); this form is 0.9664, which leaves the jump-table spelling, the colour immediates and ret / ret 0. The cursor's bottom is written DAT_ButtonY + DAT_ButtonH - 4, the order of the original's lea (0.9030 -> 0.9365 by itself). == TRUE stays: the original compares with 1, and a truthiness test is 0.9365. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * headers: DAT_SH1_SiegeAdvancedMode is a BOOLEnum It was undefined4. Every store is 0 or 1: the toggle xor [0x00B960C8], 1 at 0x0042D81F, 0 at 0x0042D855 (edx, 0 in that handler) and 0x00448DC2 (ebx), 1 at 0x00442E66; the decompilation agrees (SingleplayerMapChoice's MapTable stores 1, ButtonsAndHands toggles it and stores 0, SingleplayerMapChoice_Prepare stores 0), and every read compares with 0 (spawnQueuedReinforcementWaves, LaunchSinglePlayerGameUnk). A linear sweep of the exe's code finds every absolute reference; reads and writes through a pointer to the struct are not covered by that, and the decompilation shows none. Its one user in the code, this PR's MenuItemActionHandler_SingleplayerMapChoice_MapTable (0x00442C30), stores 1 and compiles the same (quick_diff 0.9807 before and after); main has none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * headers: DAT_StoredGameMode is a GameModeInt It was undefined4. Its one store, at 0x004D972A (MenuView_RankingGames_Prepare), copies GameSynchronyState.currentGameMode (0x0191DD80, a GameModeInt), and its one read, in MenuItemActionHandler_RankingGames_Main, copies it back. Both are on main and compile the same; the copy no longer converts between unsigned and int. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * headers: DAT_SkirmishTrailRelated1 is an int It was undefined4. It is a count that can go below 0: MenuView_CrusadeMap_Prepare (0x004D8CB0) stores 3 (0x004D8D48), decrements it once per mission skipped with the chicken and stores the result (0x004D8DD5), then clamps it at 0 with a signed test (cmp edx, edi / jge at 0x004D8DDB); 0x004D8F3B subtracts from it in memory. Main's user, MenuItemRenderFunction_General_CrusadeMapAndEndscreen, tests it with a signed > 0 through an (int) cast, which the next commit drops; it compiles the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * headers: MissionDefinedData.descending is a BOOLEnum It was undefined4. MenuItemActionHandler_RankingGames_Main (0x004D9730) is its only writer: it stores 1 at 0x004D995F when a new column is picked and 1 - descending at 0x004D9970 / 0x004D9976 when the same column is picked again, so it only holds 0 and 1. A linear sweep of the exe's code finds every absolute reference; reads and writes through a pointer to the struct are not covered by that, and the decompilation shows none. The handler is on main and compiles the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * headers: TileMapState.wallDragButtonUp is a BOOLEnum It was undefined4. Its only store, in MenuItemActionHandler_InGameMenu_TriggerPlaceWallCommand at 0x0043803E, writes the result of a sete (0x00438034), so it only holds 0 and 1. A linear sweep of the exe's code finds every absolute reference; reads and writes through a pointer to the struct are not covered by that, and the decompilation shows none. The handler is on main and compiles the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * CrusadeMapAndEndscreen: drop the (int) cast DAT_SkirmishTrailRelated1 no longer needs DAT_SkirmishTrailRelated1 is an int since the commit before this one, so the signed > 0 test needs no cast. It compiles the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * SingleplayerMapChoice_MapTable: store TRUE in DAT_SH1_SiegeAdvancedMode The global is a BOOLEnum since the header commit before this one. Same code (quick_diff 0.9807 before and after). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 9, 2026
General's ToolbarButtonPressed handler (0x00444410) goes from 71.4% here to 100.0% in the round 13 PR (reimpl/UI-B-round13-100, b1710db), with its cases in the original's block order and two Engineer Build fixes this draft needed too: with one catapult or trebuchet and under 10 stone the original only plays the lack-of-stone sound, where this draft queued the command anyway, and after queueing the command the original returns, where this draft also cleared the patrol button and marked an engineer selected. This draft drops its .cpp file, and its status line goes back to main's. Main doesn't have the function, and this draft changes no header, so nothing else goes. 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.
Six functions, so others can continue from them (gynt's rule: ready functions in their own PR, the rest in a draft):
This is the draft half of this batch (9 files); the ready half, #319, is merged. TrimStoredMenuString and WriteMissionToScoresFile reached 100% and moved to the ready #332. Both continue gynt's drafts on his fork (
reimpl/UI-MenuItems-development). Five more Helpers functions started here (FindCampaignMapHotspotAtMouse, LoadScoresFileToMemory, PlayJokeVideoBasedOnCurrentTimeAndPlayTime, PrepareHistoryBook, TicksSinceCounterStart) and are at 100% in #323.Built on top of
main(ed469ea, since merged with main up to 72b2732 and its header syncs) with the bundled MSVC1400-SP1, natively on Windows, against the SteamStronghold Crusader.exe(3bb0a8c1…5387ac5a). The branch was built and measured on its own (every reimplemented.cppit contains), with the struct and function resolvers enabled locally (not committed), using sourcehold's reccmp with--resolve-wrapped-calls --ignore-security-cookie. None of it has been run in game.Every function matches its status line. The mechanical style points from the reviews of #311 and #312 are applied; the drafts from gynt's branch still have some decompiler names in places.
No header change left: main's Ghidra sync a9401a7 named -1
UT_INVALID(and 0UT_NONE), so the patrol button in ToolbarButtonPressed now compares getUnitTypeOfFirstSelectedUnit's result withUT_INVALID. Main 72b2732 is merged in, with the sync's other new names used.Main's Ghidra syncs took every other header change this PR proposed:
INT_00eb9b24(wasFLOAT_00eb9b24) as anint, PrepareHistoryBook'svoid,HTT_NONE,GCT_UNKNOWN_86,SEID_UNKNOWN_0x87andBT_NONE, and before thatINT_ARRAY_00b960b8andDAT_SiegeInformationArray.MenuItemActionHandler_General_ToolbarButtonPressedClearSiegeInformationArray2SomeFearFactorComputationSomeSiegeUnitsComputationMenuItemActionHandler_ProgressBarBox_LoadAndSaveGameButtonLogicMenuItemActionHandler_TextEditor_ButtonsBehaviour fixed compared with the drafts
🤖 Generated with Claude Code