Commit Graph

27 Commits

Author SHA1 Message Date
ba6fea1c81 HLE: Refactor ReplaceFunctionIfPossible 2023-11-27 21:40:42 +01:00
e1dbea3658 JIT: Fix calls to HLE::Execute.
This got broken in 7cecb28bdf.
2023-02-13 11:47:47 +01:00
7cecb28bdf DolphinQt: Properly lock CPU before accessing emulated memory
This fixes a problem I was having where using frame advance with the
debugger open would frequently cause panic alerts about invalid addresses
due to the CPU thread changing MSR.DR while the host thread was trying
to access memory.

To aid in tracking down all the places where we weren't properly locking
the CPU, I've created a new type (in Core.h) that you have to pass as a
reference or pointer to functions that require running as the CPU thread.
2023-02-12 11:27:50 +01:00
7fd552081f HLE function hooking: Avoid ppcState global. 2023-01-27 15:22:46 +01:00
e51119c4ce HLE: Fix hooks overlapping Riivolution patches 2021-11-01 00:07:14 +04:00
e149ad4f0a treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
4c75b96254 HLE: Improve naming
Replace 'function' with 'hook' when appropriate
2020-08-28 20:29:05 +04:00
17ad2ac719 HLE: Rename GetFunctionIndex functions 2020-08-27 22:12:15 +04:00
79bfb48d68 HLE: Remove unused function 2020-08-27 21:07:42 +04:00
a3046fe807 Core/HLE/HLE: Use std::string_view where applicable
Now that SymbolDB's querying functions accept std::string_view
instances, we can alter the Patch/UnPatch HLE functions to follow suit.
2019-06-16 01:20:12 -04:00
4b25538f2f 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)
2018-05-16 18:55:49 -04:00
3deb8ce074 HLE: Use enum classes for HookType and HookFlag 2018-02-04 14:50:55 +01:00
4f9e5e1141 [HLE] Added GetFirstFunctionIndex matching the start address 2017-04-29 19:38:40 +01:00
5a1ebe232e HLE: Add Reload() function 2017-04-09 14:02:34 +01:00
20a9c5b12d HLE: Add PatchFixedFunctions() function 2017-04-09 14:02:34 +01:00
31cf8432bf HLE: Differentiate Address hooks from Symbol hooks
GeckoCodes require address hooks which don't correspond to any
symbol in the symbol table. The hooks get deleted when repatching
the game because they did not persist across calls to
HLE::PatchFunctions.
2016-10-03 16:27:42 +11:00
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
846c904624 HLE: Move static variable out of header
It's only ever used in the implementation file.
2016-01-11 04:11:12 -05:00
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
76bbd46829 Core: Remove some header inclusions in header files
Replaces them with forward declarations of used types, or removes them entirely if they aren't used at all. This also replaces certain Common headers with less inclusive ones (in terms of definitions they pull in).
2015-05-08 22:38:59 -04:00
e92e1e5873 Remove HLE_HOOK_END.
It isn't used, it isn't implemented in interpreter, and the implementation
in JIT is wrong.
2015-01-15 11:54:20 -08:00
c3b36de51e HLE code replacement: remove unused code. 2014-12-03 14:05:05 -08:00
a82675b7d5 Kill off some usages of c_str.
Also changes some function params, but this is ok.
Some simplifications were also able to be made (ie. killing off strcmps with ==, etc).
2014-03-14 13:51:23 -04:00
2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
d2038049f5 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00