From ab5aa597287d656a4a3cdb0c385c0a6aba3afa8a Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Sun, 8 Nov 2026 01:01:21 +0100 Subject: [PATCH] tools: Enable-Reimplemented-Functions also flips resolvers wrapped after the flag The script matched `, false` followed by `, Address::...` with exactly one space, so a resolver that clang-format wrapped after the flag (`false,` then a line break and `Address::...`) was never flipped. 540 of main's 3,663 function resolvers are wrapped that way. With such a callee left off, nothing hooks or calls our function, and /GL gives it a register calling convention, which reccmp then reads low. That is what #357's GetIfDisplayElementStateNotZero (81.8) and RenderTimeUntilDefeatDisplayElement (54.5) showed in a full build: their resolvers are wrapped, FindDisplayElementWithID's is not. In an alone build of the three, the old pattern flips only FindDisplayElementWithID and reads 100.0 / 81.8 / 54.5; `\s*,\s*Address` flips all three and reads 100.0 / 100.0 / 100.0. The batch helpers (enable_local_functions.py, common.py) already allow the line break. Co-Authored-By: Claude Opus 5.5 --- .../reimplementation-control/Enable-Reimplemented-Functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/reimplementation-control/Enable-Reimplemented-Functions.ps1 b/tools/reimplementation-control/Enable-Reimplemented-Functions.ps1 index f54fa5fa7d..1b04383a56 100644 --- a/tools/reimplementation-control/Enable-Reimplemented-Functions.ps1 +++ b/tools/reimplementation-control/Enable-Reimplemented-Functions.ps1 @@ -32,7 +32,7 @@ function Enable-Reimplemented-Functions { Where-Object { $null -ne (Select-String -Path $_ -Pattern "$address") } | ForEach-Object { (Get-Content -Path $_ -Raw) -replace - "(?s)(MACRO_FUNCTION_RESOLVER\b(?:(?!MACRO_FUNCTION_RESOLVER).)*?),\s*$target(\s*, Address::SHC_3BB0A8C1_$address)", "`$1, $replacement`$2" | + "(?s)(MACRO_FUNCTION_RESOLVER\b(?:(?!MACRO_FUNCTION_RESOLVER).)*?),\s*$target(\s*,\s*Address::SHC_3BB0A8C1_$address)", "`$1, $replacement`$2" | Set-Content -Path $_ -NoNewLine } }