Commit Graph

92 Commits

Author SHA1 Message Date
Lioncash
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
Lioncash
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
Lioncash
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
Sepalani
04cfddca33 HLE_VarArgs: PowerPC::HostRead_F64 used 2018-04-17 16:25:43 +04:00
Lioncash
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
Lioncash
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
Sepalani
4f1c0ca3e9 HLE: Improve format string detection heuristic 2018-03-06 21:21:56 +04:00
Léo Lam
3deb8ce074 HLE: Use enum classes for HookType and HookFlag 2018-02-04 14:50:55 +01:00
Léo Lam
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
Sepalani
6ffb5dbaaa HLE: DWC_Printf debug added 2018-01-23 19:02:32 +01:00
Lioncash
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
Shawn Hoffman
90f863a7a3 HLE: fix unreachable code warning 2017-06-07 19:52:07 -07:00
Sepalani
f28f23af1d StringUtil: StringPopBackIf added 2017-06-06 05:08:51 +01:00
Sepalani
1209959012 HLE: Prevent GetStringVA to strip newlines 2017-06-06 04:31:01 +01:00
Sepalani
190f7cbc4f HLE_OS: Fix missing-declarations warnings 2017-06-06 04:23:54 +01:00
shuffle2
065c3d78b7 Merge pull request #5486 from sepalani/hle-print
HLE: More printf logs added
2017-06-05 17:29:13 -07:00
Sepalani
ba5cb50afc HLE: Improve HLE_GeneralDebugPrint detection 2017-06-04 20:53:14 +01:00
Sepalani
ac51c80ad0 HLE: Log (v)fprintf messages 2017-06-03 21:05:14 +01:00
Sepalani
2989c0cb61 HLE: Log (v)dprintf messages 2017-06-03 21:05:13 +01:00
Sepalani
9f6d6e6921 HLE: HLE_GeneralDebugVPrint added 2017-06-03 21:03:44 +01:00
Sepalani
061dadbc61 HLE: SVR4 VAList struct added 2017-06-03 21:01:59 +01:00
Sepalani
5a4f085c10 HLE: VAList cleanup and SystemVABI namespace 2017-06-03 21:01:59 +01:00
Sepalani
e9dd0072de HLE: Variable Argument Lists support 2017-06-03 21:01:58 +01:00
Sepalani
2afa546551 HLE: Fix __write_console implementation 2017-06-03 20:06:31 +01:00
Sepalani
0f74f1ffb3 HLE: Use a proper apploader OSReport 2017-05-02 20:47:47 +01:00
Sepalani
02f9c03c45 HLE: Fix apploader regression 2017-04-30 02:21:50 +01:00
Sepalani
4f9e5e1141 [HLE] Added GetFirstFunctionIndex matching the start address 2017-04-29 19:38:40 +01:00
Sepalani
e259b3fa76 [HLE] Fixes XFB and invisible printf 2017-04-29 19:38:39 +01:00
Sepalani
5a1ebe232e HLE: Add Reload() function 2017-04-09 14:02:34 +01:00
Sepalani
20a9c5b12d HLE: Add PatchFixedFunctions() function 2017-04-09 14:02:34 +01:00
Sepalani
5f7002da5c HLE: More printf floating point types handled 2017-02-17 10:51:10 +00:00
Matthew Parlane
b9fc79020d Merge pull request #4817 from sepalani/debug_print_case
Handle another case with HLE_GeneralDebugPrint
2017-02-06 17:40:44 +13:00
Lioncash
f7b9db9846 PowerPC: Convert CoreMode enum into an enum class
Prevents constants from polluting the namespace.
2017-02-04 19:34:56 -05:00
Sepalani
e280f5615a Handle another case with HLE_GeneralDebugPrint 2017-02-03 23:30:37 +00:00
Léo Lam
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
Matthew Parlane
5790f15be8 Merge pull request #4299 from sepalani/hle_symbols
SymbolDB: Multiple symbols detection allowed
2017-01-13 10:05:32 +13:00
Lioncash
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
Lioncash
2941468857 HLE: Align table formatting 2017-01-05 14:13:30 -05:00
Sepalani
d778b8a820 SymbolDB: GetSymbolsFromName added 2016-12-19 21:02:23 +00:00
Léo Lam
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
JosJuice
b47e607105 HLE_OS: More bounds checking in GetStringVA 2016-11-12 19:17:15 +01:00
JosJuice
3d80d454ce HLE_OS: Implement %n in GetStringVA
%n writes to a pointer that's provided as a parameter.
We didn't have a custom implementation of this before,
meaning that %n would trigger a write to the host
memory instead of the emulated memory!
2016-11-12 19:16:55 +01:00
Sepalani
aa63253838 HLE: Logs nlPrintf calls 2016-10-05 19:15:26 +01:00
shuffle2
d1df222367 Merge pull request #4297 from sepalani/hle_patch
HLE: Remove duplicate in OSPatches
2016-10-04 17:39:50 -07:00
shuffle2
71aa243333 Merge pull request #4298 from sepalani/hle_bp
HLE: Wrong array used in BP patching fixed
2016-10-04 17:38:06 -07:00
Sepalani
58f5cd944c HLE: Another DebugPrint case added 2016-10-04 21:40:43 +01:00
Sepalani
6e8c5040df HLE: Wrong array used in BP patching fixed 2016-10-04 16:47:06 +01:00
Sepalani
61580b0dec HLE: Remove duplicate in OSPatches 2016-10-04 16:33:47 +01:00
EmptyChaos
76558c4d87 HLE: Fix warnings 2016-10-03 18:49:08 +11:00
shuffle2
fba6801851 Merge pull request #4216 from EmptyChaos/geckocodes-cleanup
GeckoCodes: Don't run PPC code in CoreTiming callbacks
2016-10-02 22:37:51 -07:00