mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
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:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user