diff --git a/Source/Core/Core/HLE/HLE.cpp b/Source/Core/Core/HLE/HLE.cpp index 146cd99896..7242018a63 100644 --- a/Source/Core/Core/HLE/HLE.cpp +++ b/Source/Core/Core/HLE/HLE.cpp @@ -161,15 +161,15 @@ void Execute(u32 current_pc, u32 instruction) } } -u32 GetFunctionIndex(u32 address) +u32 GetHookByAddress(u32 address) { auto iter = s_hooked_addresses.find(address); return (iter != s_hooked_addresses.end()) ? iter->second : 0; } -u32 GetFirstFunctionIndex(u32 address) +u32 GetHookByFunctionAddress(u32 address) { - const u32 index = GetFunctionIndex(address); + const u32 index = GetHookByAddress(address); // Fixed hooks use a fixed address and don't patch the whole function if (index == 0 || os_patches[index].flags == HookFlag::Fixed) return index; diff --git a/Source/Core/Core/HLE/HLE.h b/Source/Core/Core/HLE/HLE.h index 2d5b8ce0e8..5be7b983ec 100644 --- a/Source/Core/Core/HLE/HLE.h +++ b/Source/Core/Core/HLE/HLE.h @@ -33,10 +33,10 @@ void Patch(u32 pc, std::string_view func_name); u32 UnPatch(std::string_view patch_name); void Execute(u32 _CurrentPC, u32 _Instruction); -// Returns the HLE function index if the address is located in the function -u32 GetFunctionIndex(u32 address); +// Returns the HLE function index of the address +u32 GetHookByAddress(u32 address); // Returns the HLE function index if the address matches the function start -u32 GetFirstFunctionIndex(u32 address); +u32 GetHookByFunctionAddress(u32 address); HookType GetFunctionTypeByIndex(u32 index); HookFlag GetFunctionFlagsByIndex(u32 index); @@ -56,7 +56,7 @@ bool IsEnabled(HookFlag flag); template bool ReplaceFunctionIfPossible(u32 address, FunctionObject fn) { - const u32 function = GetFirstFunctionIndex(address); + const u32 function = GetHookByFunctionAddress(address); if (function == 0) return false;