mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-14 00:09:24 +01:00
HLE: Rename GetFunctionIndex functions
This commit is contained in:
parent
6b05e48bd6
commit
17ad2ac719
@ -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);
|
auto iter = s_hooked_addresses.find(address);
|
||||||
return (iter != s_hooked_addresses.end()) ? iter->second : 0;
|
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
|
// Fixed hooks use a fixed address and don't patch the whole function
|
||||||
if (index == 0 || os_patches[index].flags == HookFlag::Fixed)
|
if (index == 0 || os_patches[index].flags == HookFlag::Fixed)
|
||||||
return index;
|
return index;
|
||||||
|
@ -33,10 +33,10 @@ void Patch(u32 pc, std::string_view func_name);
|
|||||||
u32 UnPatch(std::string_view patch_name);
|
u32 UnPatch(std::string_view patch_name);
|
||||||
void Execute(u32 _CurrentPC, u32 _Instruction);
|
void Execute(u32 _CurrentPC, u32 _Instruction);
|
||||||
|
|
||||||
// Returns the HLE function index if the address is located in the function
|
// Returns the HLE function index of the address
|
||||||
u32 GetFunctionIndex(u32 address);
|
u32 GetHookByAddress(u32 address);
|
||||||
// Returns the HLE function index if the address matches the function start
|
// Returns the HLE function index if the address matches the function start
|
||||||
u32 GetFirstFunctionIndex(u32 address);
|
u32 GetHookByFunctionAddress(u32 address);
|
||||||
HookType GetFunctionTypeByIndex(u32 index);
|
HookType GetFunctionTypeByIndex(u32 index);
|
||||||
HookFlag GetFunctionFlagsByIndex(u32 index);
|
HookFlag GetFunctionFlagsByIndex(u32 index);
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ bool IsEnabled(HookFlag flag);
|
|||||||
template <typename FunctionObject>
|
template <typename FunctionObject>
|
||||||
bool ReplaceFunctionIfPossible(u32 address, FunctionObject fn)
|
bool ReplaceFunctionIfPossible(u32 address, FunctionObject fn)
|
||||||
{
|
{
|
||||||
const u32 function = GetFirstFunctionIndex(address);
|
const u32 function = GetHookByFunctionAddress(address);
|
||||||
if (function == 0)
|
if (function == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user