Add midasm hook patching.

This commit is contained in:
Skyth
2024-10-06 18:54:47 +03:00
parent 1f5d7c32e8
commit 516e23f1f7
3 changed files with 110 additions and 0 deletions

View File

@@ -73,4 +73,20 @@ void RecompilerConfig::Load(const std::string_view& configFilePath)
}
}
}
if (auto midAsmHookArray = toml["midasm_hook"].as_array())
{
for (auto& entry : *midAsmHookArray)
{
auto& table = *entry.as_table();
RecompilerMidAsmHook midAsmHook;
midAsmHook.name = *table["name"].value<std::string>();
for (auto& reg : *table["registers"].as_array())
{
midAsmHook.registers.push_back(*reg.value<std::string>());
}
midAsmHooks.emplace(*table["address"].value<uint32_t>(), std::move(midAsmHook));
}
}
}