Commit Graph

101 Commits

Author SHA1 Message Date
85cd59c585 HLE: Add more debug functions 2020-03-30 17:46:50 +04:00
d8a3218726 HLE: Fix patching functions with the same name 2019-09-28 17:38:43 +04:00
32bacfa4bd Core: Use nested namespace specifiers where applicable
Same thing, less visual noise.
2019-06-17 16:32:30 -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
a9663669dc Common/CommonFuncs: Remove now-unneccessary ArraySize function
Since C++17, non-member std::size() is present in the standard library
which also operates on regular C arrays. Given that, we can just replace
usages of ArraySize with that where applicable.

In many cases, we can just change the actual C array ArraySize() was
called on into a std::array and just use its .size() member function
instead.

In some other cases, we can collapse the loops they were used in, into a
ranged-for loop, eliminating the need for en explicit bounds query.
2019-06-01 10:07:57 -04:00
ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
e3075f3834 PowerPC: Factor out CR helpers into POD class 2019-03-08 20:42:09 +01:00
49fe9f5db1 Use empty instead of size 2019-02-13 00:03:49 +01:00
244d083f0e PowerPC: Remove separate macros for paired singles
Previously, PowerPC.h had four macros in it like so:

\#define rPS0(i) (*(double*)(&PowerPC::ppcState.ps[i][0]))
\#define rPS1(i) (*(double*)(&PowerPC::ppcState.ps[i][1]))

\#define riPS0(i) (*(u64*)(&PowerPC::ppcState.ps[i][0]))
\#define riPS1(i) (*(u64*)(&PowerPC::ppcState.ps[i][1]))

Casting between object representations like this is undefined behavior.
Given this is used heavily with the interpreter (that is, the most
accurate, but slowest CPU backend), we don't exactly want to allow
undefined behavior to creep into it.

Instead, this adds a helper struct for operating with the paired singles,
and replaces the four macros with a single macro for accessing the
paired-singles/floating-point registers.

This way, it's left up to the caller to explicitly decide how it wants to interpret
the data (and makes it more obvious where different interpretations of
the same data are occurring at, as there'll be a call to one of the
[x]AsDouble() functions).
2018-12-25 10:35:09 -05:00
4288bfe0f9 Common: Move host communication enum to Host.h
Given this is actually a part of the Host interface, this should be
placed with it.

While we're at it, turn it into an enum class so that we don't dump its
contained values into the surrounding scope. We can also make
Host_Message take the enum type itself directly instead of taking a
general int value.

After this, it'll be trivial to divide out the rest of Common.h and
remove the header from the repository entirely
2018-05-28 14:34:59 -04:00
b9aad3310e PowerPC: Move MMU-specifics from PowerPC.h to MMU.h
PowerPC.h at this point is pretty much a general glob of stuff, and it's
unfortunate, since it means pulling in a lot of unrelated header
dependencies and a bunch of other things that don't need to be seen by
things that just want to read memory.

Breaking this out into its own header keeps all the MMU-related stuff
together and also limits the amount of header dependencies being
included (the primary motivation for this being the former reason).
2018-05-17 19:18:55 -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
04cfddca33 HLE_VarArgs: PowerPC::HostRead_F64 used 2018-04-17 16:25:43 +04:00
4c97deb364 PowerPC: Namespace all header contents for PowerPC.h
Puts everything under the same namespace. Previously the header was only
partially namespaced, which is inconsistent.
2018-03-22 19:01:47 -04:00
50a476c371 Assert: Uppercase assertion macros
Macros should be all upper-cased. This is also kind of a wart that's
been sticking out for quite a while now (we avoid prefixing
underscores).
2018-03-14 22:03:12 -04:00
4f1c0ca3e9 HLE: Improve format string detection heuristic 2018-03-06 21:21:56 +04:00
3deb8ce074 HLE: Use enum classes for HookType and HookFlag 2018-02-04 14:50:55 +01:00
a184ab93b6 HLE: Remove an unused function
There is nothing using PanicAlert in either official titles or libogc.
2018-02-04 14:41:55 +01:00
6ffb5dbaaa HLE: DWC_Printf debug added 2018-01-23 19:02:32 +01:00
dd4203bec8 Core: Remove unnecessary includes
Also moves a cpp file's related header file to the top of the inclusions if it isn't already there.
2017-06-15 18:52:22 -04:00
90f863a7a3 HLE: fix unreachable code warning 2017-06-07 19:52:07 -07:00
f28f23af1d StringUtil: StringPopBackIf added 2017-06-06 05:08:51 +01:00
1209959012 HLE: Prevent GetStringVA to strip newlines 2017-06-06 04:31:01 +01:00
190f7cbc4f HLE_OS: Fix missing-declarations warnings 2017-06-06 04:23:54 +01:00
065c3d78b7 Merge pull request #5486 from sepalani/hle-print
HLE: More printf logs added
2017-06-05 17:29:13 -07:00
ba5cb50afc HLE: Improve HLE_GeneralDebugPrint detection 2017-06-04 20:53:14 +01:00
ac51c80ad0 HLE: Log (v)fprintf messages 2017-06-03 21:05:14 +01:00
2989c0cb61 HLE: Log (v)dprintf messages 2017-06-03 21:05:13 +01:00
9f6d6e6921 HLE: HLE_GeneralDebugVPrint added 2017-06-03 21:03:44 +01:00
061dadbc61 HLE: SVR4 VAList struct added 2017-06-03 21:01:59 +01:00
5a4f085c10 HLE: VAList cleanup and SystemVABI namespace 2017-06-03 21:01:59 +01:00
e9dd0072de HLE: Variable Argument Lists support 2017-06-03 21:01:58 +01:00
2afa546551 HLE: Fix __write_console implementation 2017-06-03 20:06:31 +01:00
0f74f1ffb3 HLE: Use a proper apploader OSReport 2017-05-02 20:47:47 +01:00
02f9c03c45 HLE: Fix apploader regression 2017-04-30 02:21:50 +01:00
4f9e5e1141 [HLE] Added GetFirstFunctionIndex matching the start address 2017-04-29 19:38:40 +01:00
e259b3fa76 [HLE] Fixes XFB and invisible printf 2017-04-29 19:38:39 +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
5f7002da5c HLE: More printf floating point types handled 2017-02-17 10:51:10 +00:00
b9fc79020d Merge pull request #4817 from sepalani/debug_print_case
Handle another case with HLE_GeneralDebugPrint
2017-02-06 17:40:44 +13:00
f7b9db9846 PowerPC: Convert CoreMode enum into an enum class
Prevents constants from polluting the namespace.
2017-02-04 19:34:56 -05:00
e280f5615a Handle another case with HLE_GeneralDebugPrint 2017-02-03 23:30:37 +00:00
24199293d3 IOS: Reorganise the source files and IPC_HLE→IOS
IPC_HLE is actually IOS HLE. The actual IPC emulation is not in
IPC_HLE, but in HW/WII_IPC.cpp. So calling IPC_HLE IOS is more
accurate. (If IOS LLE gets ever implemented, it'll likely be at
a lower level -- Starlet LLE.)

This also totally gets rid of the IPC_HLE prefix in file names, and
moves some source files to their own subdirectories to make the file
hierarchy cleaner.

We're going to get ~14 additional source files with the USB PR,
and this is really needed to keep things from becoming a total pain.
2017-01-18 20:43:10 +01:00
5790f15be8 Merge pull request #4299 from sepalani/hle_symbols
SymbolDB: Multiple symbols detection allowed
2017-01-13 10:05:32 +13:00
a10bb15f17 HLE: Add explicit initializers for OSBreakPoints' stub entry
No behavior change, this just makes implicit values explicit.
2017-01-05 14:15:45 -05:00
2941468857 HLE: Align table formatting 2017-01-05 14:13:30 -05:00
d778b8a820 SymbolDB: GetSymbolsFromName added 2016-12-19 21:02:23 +00:00
09fdab7fb4 HLE: Add a hook for JUTWarningConsole_f
JUTWarningConsole_f calls vprintf, but in a way we currently don't
handle (which messes up the printed message). However, it is a standard
debug print function, so we can directly hook it instead of waiting for
the vprintf call.

This is necessary to fix debug output in a few games now that vprintf
is properly detected in more games.
2016-12-09 23:40:06 +01:00
b47e607105 HLE_OS: More bounds checking in GetStringVA 2016-11-12 19:17:15 +01:00