fix: inline runtime-visible patch address key

Runtime config parsing uses the physical alias key but does not link the recompiler patch implementation. Keep the dependency-free key in the C++17-compatible header and exercise it in the header smoke test.
This commit is contained in:
Matthew Stanley
2026-07-13 22:36:32 -07:00
parent 2f73f73f92
commit 5f62dedaa3
3 changed files with 8 additions and 6 deletions
-4
View File
@@ -23,10 +23,6 @@ uint32_t apply_one_recompiler_patch(const RecompilerPatch& patch,
} // namespace
uint32_t recompiler_patch_address_key(uint32_t address) {
return address & 0x1FFFFFFFu;
}
uint32_t apply_recompiler_patch(const std::vector<RecompilerPatch>& patches,
uint32_t address,
uint32_t observed,
+3 -1
View File
@@ -21,7 +21,9 @@ struct RecompilerPatch {
std::string note;
};
uint32_t recompiler_patch_address_key(uint32_t address);
inline uint32_t recompiler_patch_address_key(uint32_t address) {
return address & 0x1FFFFFFFu;
}
// Apply the patch targeting address, if any. A main-EXE guard mismatch throws;
// an overlay mismatch is an expected different variant and leaves the observed
@@ -5,5 +5,9 @@
int main() {
std::vector<PSXRecompV4::RecompilerPatch> patches;
patches.push_back({"header-smoke", 0x80010000u, 0u, 0u, {}});
return patches.front().id == "header-smoke" ? 0 : 1;
return patches.front().id == "header-smoke" &&
PSXRecompV4::recompiler_patch_address_key(
patches.front().address) == 0x00010000u
? 0
: 1;
}