mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
4b25538f2f
Extracts the self-contained code into its own function to clean up the flow of Jit() a little more. This also introduces a helper function to HLE.h that will be used to reduce the boilerplate here and in the interpreter and Jit64 in the following commits. This function performs all of the preliminary checks required prior to attempting to hook/replace a function at a given address. The function then calls a provided object that satisfies the FunctionObject concept in the C++ standard library. This can be a lambda, a regular function pointer, an object with an overloaded function call operator, etc. The only requirement is that the function return a bool, indicating whether or not the function was replaced, and that it can take parameters in the form: fn(u32 function, HLE::HookType type)