Please sign in to comment.
CachedInterpreter: Factor function hooking code out of Jit()
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)
- Loading branch information...
Showing with 48 additions and 20 deletions.