Commit graph

33779 commits

Author SHA1 Message Date
Lioncash
e527b69d54 Core: Use C++17 deduction guides with locked recursive mutexes
Cleans up some locks that explicitly specify the recursive mutex type in
it. Meant to be included with the previous commit that cleaned out
regular mutexes, but I forgot.
2020-12-29 18:31:31 -05:00
Léo Lam
3b2e31230f
Merge pull request #9386 from leoetlino/config-cache-invalidate
Config: Fix cache not being invalidated when callbacks are suppressed
2020-12-29 22:22:15 +01:00
Jordan Woyak
92de0431a2
Merge pull request #9389 from lioncash/deduction
Core: Make use of C++17 deduction guides with locks
2020-12-29 15:18:45 -06:00
Léo Lam
9ffd345df0
Config: Fix cache not being invalidated when callbacks are suppressed
The config version should always be incremented whenever config is
changed, regardless of callbacks being suppressed or not.
Otherwise, getters can return stale data until another config change
(with callbacks enabled) happens.
2020-12-29 22:07:47 +01:00
Lioncash
a8b0661fb0 Core: Make use of C++17 deduction guides with locks
C++17 allows omitting the mutex type, which makes for both less reading
and more flexibility (e.g. The mutex type can change and all occurrences
don't need to be updated).
2020-12-29 16:06:17 -05:00
Léo Lam
351fb71653
Merge pull request #9387 from lioncash/priv
DSPCore: Make several SDSP members private
2020-12-29 22:05:11 +01:00
Lioncash
f4e1f48b4f DSPCore: Make IRAM CRC and step counter private
We can construct an API around these two members to allow them to be
private.
2020-12-29 14:32:11 -05:00
Lioncash
5fb1f0bfd3 DSPCore: Make ifx registers private
These aren't used externally, so they can be made private.
2020-12-29 14:22:39 -05:00
Lioncash
e3de37e47b DSPCore: Make the accelerator private
This is only used internally.
2020-12-29 14:15:04 -05:00
Léo Lam
41316daf91
Merge pull request #9384 from lioncash/mbox-enum
DSP: Convert Mailbox enum into an enum class
2020-12-29 19:57:55 +01:00
Lioncash
e1f41bab1c DSP: Make mailboxes use std::array
Makes the array strongly typed and prevents pointer decay. This also
allows for tuning bounds checks with various implementations.
2020-12-29 12:27:56 -05:00
Lioncash
f9d8d06037 DSP: Make mailboxes private
These aren't used externally anywhere and can be made private.
2020-12-29 12:27:40 -05:00
Lioncash
024e983c3a DSP: Make Mailbox enum strongly typed
Avoids implicit conversions and also prevents dumping identifiers into
the current namespace.
2020-12-29 12:20:00 -05:00
Léo Lam
ee048ad83c
Merge pull request #9377 from lioncash/analyzer
DSPAnalyzer: Migrate off file-scope state
2020-12-29 18:04:54 +01:00
Léo Lam
5ff2cb9a74
Merge pull request #9383 from lioncash/cr-fn
DSP: Eliminate some magic values related to the CR register
2020-12-29 17:37:24 +01:00
Léo Lam
15d4ddf5da
Merge pull request #9379 from Pokechu22/audio-latency-disable
Fix latency field being initially enabled on audio backends not supporting it
2020-12-29 17:28:10 +01:00
Léo Lam
5e186f4830
Merge pull request #9382 from lioncash/precise
DSPCore: Move PRECISE_BACKLOG define to the interpreter code
2020-12-29 17:17:59 +01:00
Léo Lam
f21e1d1859
Merge pull request #9381 from JosJuice/fix-core-filters
Fix Core.vcxproj.filters
2020-12-29 17:16:56 +01:00
Lioncash
359fe0d8c3 DSPCore: Move PRECISE_BACKLOG define to the interpreter code
The only usages of this define are within this source file.
2020-12-29 09:50:40 -05:00
Lioncash
64f93610ee DSP: Eliminate some magic values related to the CR register
Makes some values more immediately readable.
2020-12-29 09:43:04 -05:00
JosJuice
732887ec85 Fix Core.vcxproj.filters
Without this, Visual Studio will try to fix the problem on
its own any time the file is changed.
2020-12-29 13:50:37 +01:00
Pokechu22
147636986d Fix latency field being initially enabled on audio backends not supporting it 2020-12-28 17:06:02 -08:00
Lioncash
8aecaf784c DSPAnalyzer: Separate instruction searching and idle skip finding
Places them into their own function to keep their functionality isolated
and self-documenting.
2020-12-28 13:15:48 -05:00
Lioncash
cc512a7524 DSPAnalyzer: Break tight coupling to SDSP
Allows the analyzer to exist independently of the DSP structure. This
allows for unit-tests to be created in a nicer manner.

SDSP is only necessary during the analysis phase, so we only need to
keep a reference around to it then as opposed to the entire lifecycle of
the analyzer.

This also allows the copy/move assignment operators to be defaulted, as
a reference member variable prevents that.
2020-12-28 13:15:48 -05:00
Lioncash
f9c488f0d9 DSPAnalyzer: Merge Analyzer namespace into DSP namespace
Now that the Analyzer class fully encapsulates all analyzer state, the
namespace is no longer necessary.
2020-12-28 13:15:48 -05:00
Lioncash
9d1c8fe492 DSPAnalyzer: Make CodeFlags private to the analyzer
Now that we have the convenience functions around the flag
bit manipulations, there's no external usages of the flags, so we can
make these private to the analyzer implementation.

Now the Analyzer namespace is largely unnecessary and can be merged with
the DSP namespace in the next commit.
2020-12-28 13:15:48 -05:00
Lioncash
2ff4d04785 DSPAnalyzer: Add convenience functions over bit tests
Makes it harder to accidentally misuse and increases readability.
2020-12-28 13:15:45 -05:00
Lioncash
5756ece7ce DSPAnalyzer: Implement DSP analyzer skeleton and use it
Attempts to simply make use of the interface. Cleanup will follow in
subsequent commits to make for nicer review.
2020-12-28 11:37:29 -05:00
Lioncash
8f4c6ad7b1 DSPAnalyzer: Add basic class skeleton
Adds the non-functional skeleton for the to-be Analyzer interface with
deglobalized components.
2020-12-28 10:47:12 -05:00
Léo Lam
3f68aceaca
Merge pull request #9348 from lioncash/dsp-deglobal
DSP: Eliminate most global state
2020-12-28 15:48:11 +01:00
Léo Lam
e509353eb0
Merge pull request #9372 from jordan-woyak/cmake-version-warnings
CMake: Update cmake_minimum_required calls using versions less than 2.8.12.
2020-12-28 12:20:46 +01:00
Léo Lam
506cbd336a
Merge pull request #9375 from iWeaker4you/master
BitUtils: Fix uint64_t gcc compile (Linux)
2020-12-28 12:18:27 +01:00
iWeaker4you
a636fcf230
BitUtils: Fix uint64_t gcc compile (Linux) 2020-12-28 11:50:57 +01:00
LC
28a666a35f
Merge pull request #9363 from MerryMage/rorx
Jit_Integer: Use RORX where possible
2020-12-27 22:25:03 -05:00
LC
4b24215efb
Merge pull request #9371 from MerryMage/rlwinmx-BEXTR
Jit_Integer: rlwinmx: Use BEXTR where possible
2020-12-27 22:24:17 -05:00
LC
fcd86e9b21
Merge pull request #9370 from MerryMage/rlwinmx
Jit_Integer: rlwinmx: Generalize byte/word extract plus shift case
2020-12-27 22:23:18 -05:00
LC
d06d59e9c2
Merge pull request #9262 from Sintendo/jit64imm
Jit64: More constant propagation optimizations
2020-12-27 22:21:25 -05:00
LC
c163bc3187
Merge pull request #9374 from MerryMage/clz
BitUtils: Add CountLeadingZeros
2020-12-27 22:18:46 -05:00
MerryMage
e415580f54 Jit_Integer: Use Common::CountLeadingZeros in cntlzwx 2020-12-28 01:08:50 +00:00
MerryMage
7e9824611e Interpreter_Integer: Use Common::CountLeadingZeros in cntlzwx 2020-12-28 01:08:50 +00:00
MerryMage
d695fcb126 BitUtils: Add CountLeadingZeros 2020-12-27 22:56:43 +00:00
Jordan Woyak
1699afff87 CMake: Update cmake_minimum_required calls using versions less than 2.8.12. CMake warns support will be removed in a future version. 2020-12-27 14:51:04 -06:00
Léo Lam
4705af59c6
Merge pull request #9355 from JosJuice/perfmon
Call UpdatePerformanceMonitor when needed
2020-12-27 16:13:36 +01:00
MerryMage
73b6166f18 Jit_Integer: rlwinmx: Use BEXTR where possible 2020-12-27 15:08:45 +00:00
MerryMage
11643ee2f0 Jit_Integer: rlwinmx: Generalize byte/word extract plus shift case 2020-12-27 14:43:51 +00:00
LC
263784639b
Merge pull request #9368 from JosJuice/android-game-properties-one-settings
Android: Only have one settings entrypoint in game properties
2020-12-27 07:08:34 -05:00
JosJuice
7cf62fed59 Android: Only have one settings entrypoint in game properties
In 8c723d0, I intended to update the main activity, emulation
activity and game properties dialog, but I forgot to actually
update the game properties dialog. This commit fixes that.

The changes outside of GamePropertiesDialog.java are just
to hide the Wii controller settings for GameCube games.
2020-12-27 13:05:26 +01:00
JosJuice
74ba993b4a
Merge pull request #9364 from MerryMage/AndWithMask
Jit_Integer: Add trivial AndWithMask cases
2020-12-27 12:45:34 +01:00
Lioncash
5f65bad68c DSP: Migrate code that modifies m_dsp into SDSP itself
Localizes code that modifies m_dsp into the struct itself. This reduces
the overal coupling between DSPCore and SDSP by reducing access to its
member variables.

This commit is only code movement and has no functional changes.
2020-12-27 06:38:23 -05:00
Lioncash
7d1bd565a6 DSP: Eliminate most global state
An unfortunately large single commit that deglobalizes the DSP code.
(which I'm very sorry about).

This would have otherwise been extremely difficult to separate due to
extensive use of the globals in very coupling ways that would result in
more scaffolding to work around than is worth it.

Aside from the video code, I believe only the DSP code is the hairiest
to deal with in terms of globals, so I guess it's best to get this dealt
with right off the bat.

A summary of what this commit does:
  - Turns the DSPInterpreter into its own class
    This is the most involved portion of this change.
    The bulk of the changes are turning non-member functions into member
    functions that would be situated into the Interpreter class.

  - Eliminates all usages to globals within DSPCore.
    This generally involves turning a lot of non-member functions into
    member functions that are either situated within SDSP or DSPCore.

  - Discards DSPDebugInterface (it wasn't hooked up to anything,
    and for the sake of eliminating global state, I'd rather get rid of
    it than think up ways for this class to be integrated with
    everything else.

  - Readjusts the DSP JIT to handle calling out to member functions.
    In most cases, this just means wrapping respective member function
    calles into thunk functions.

Surprisingly, this doesn't even make use of the introduced System class.
It was possible all along to do this without it. We can house everything
within the DSPLLE class, which is quite nice =)
2020-12-27 06:38:02 -05:00