Commit Graph

130 Commits

Author SHA1 Message Date
JosJuice b93983b50a Remove Atomic.h
The STL has everything we need nowadays.

I have tried to not alter any behavior or semantics with this
change wherever possible. In particular, WriteLow and WriteHigh
in CommandProcessor retain the ability to accidentally undo
another thread's write to the upper half or lower half
respectively. If that should be fixed, it should be done in a
separate commit for clarity. One thing did change: The places
where we were using += on a volatile variable (not an atomic
operation) are now using fetch_add (actually an atomic operation).

Tested with single core and dual core on x86-64 and AArch64.
2021-05-13 18:56:27 +02:00
Léo Lam a6f6211dde
Merge pull request #9633 from Pokechu22/BitfieldExtract-pointer-to-member
Change BitfieldExtract to use a pointer to the bitfield member
2021-05-08 00:21:15 +02:00
Pokechu22 0f7c9ef767 Change BitfieldExtract to use a pointer to the bitfield member 2021-05-07 15:11:17 -07:00
JosJuice f96ee475e4 Implement ArmFPURoundMode.cpp
Fixes https://bugs.dolphin-emu.org/issues/12388. Might also fix
other games that have problems with float/paired instructions
in JitArm64, but I haven't tested any.
2021-04-25 15:56:19 +02:00
Pokechu22 6653bd7199 Create EnumFormatter 2021-03-06 14:57:42 -08:00
iwubcode 00bc7e6b38 Common: Add RAII object that initializes and cleans up winsock 2021-03-04 13:44:12 -06:00
Shawn Hoffman 84128d9532 rename Common/File to Common/IOFile 2021-01-27 14:29:48 -08:00
waddlesplash 2df11d3911 Rehabilitate Haiku support. 2021-01-02 16:54:24 -05:00
Léo Lam 62eeb05519
Common: Validate the number of {} fields in format strings
Unfortunately, {fmt} allows passing too many arguments to a format call
without raising any runtime or compile-time error [1].

As this is a common source of bugs since we started migrating to {fmt},
this commit adds some custom logic to validate the number of
replacement fields in format strings in addition to {fmt}'s own checks.

[1] https://github.com/fmtlib/fmt/issues/492
2020-11-19 17:09:24 +01:00
Lioncash 57534777d4 Common: Move OSThreads into core
Common shouldn't be depending on APIs in Core (in this, case depending
on the PowerPC namespace). Because of the poor separation here, this
moves OSThread functionality into core, so that it resolves the implicit
dependency on core.
2020-10-21 07:35:42 -04:00
JosJuice 6e1e6d2311 Android: Add content provider support to File::IOFile
Taking the hit now to prepare us for when Google Play will
force us to use scoped storage...
2020-09-16 18:38:53 +02:00
JosJuice 2137fb7813 Externals: Add zstd
I had to rename Source/Common/Compiler.h because the VS build
confuses it with Externals/zstd/lib/common/compiler.h otherwise.
2020-05-13 20:53:10 +02:00
Sepalani 39d34e133f Debugger: Add a Thread widget
DebugInterface: Add GetThreads

WatchWidget: Update widget on AddWatch
2020-05-03 20:48:30 +04:00
spycrab 213a9adcff CMake: Fix building ARM64 on Windows 2020-02-12 12:29:31 +01:00
JosJuice 3eb360b818 VolumeVerifier: Add zip support for datfile 2019-08-24 16:37:19 +02:00
Lioncash d52e69bab1
Common/CMakeLists: Link in fmt
While not currently used by common, this will become the case when the
logging system eventually transitions to it, among other things.
2019-06-10 15:26:46 -04:00
Lioncash 48b82e82db Common/CMakeLists: Specify headers alongside source files
Allows these files to show up as part of the project when generating IDE
builds from CMake.
2019-05-31 06:52:44 -04:00
spycrab b5160ec685 Common/CMake: Fix Windows build 2019-05-12 00:05:08 +02:00
Stenzek a4f7c04470 Common: Add DynamicLibrary helper class 2019-03-29 19:52:33 +10:00
Jordan Woyak b9a00a40a9 Common: Move Matrix classes out of MathUtil into their own files and make their interface more friendly. 2019-02-03 11:35:31 -06:00
Stenzek c95802afeb CMake: Make X11 and EGL optional 2018-10-20 21:11:34 +10:00
Stenzek 0559311f92 GLContext: Runtime selection of EGL/GLX on Linux 2018-10-20 21:11:34 +10:00
Stenzek 134d967be2 Refactoring and cleanup of GLInterface (now GLContext) 2018-10-20 21:11:34 +10:00
Stenzek 74b82bab3b GLInterface: Drop Haiku support 2018-10-20 21:11:33 +10:00
zackhow 82f82a6b7d Android: Add usage statistics to android.
Added an option in General config to enable/disable usage statistics. Added a popup on first open if
the user would like to engage in reporting. Clicking cancel or out of the box opts out. Only
clicking 'Ok' will enable reporting. Also added a new android specific values to report.
2018-08-23 17:31:17 -04:00
Techjar 4407854e9c NetPlay save data synchronization
This adds the functionality of sending the host's save data (raw memory
cards, as well as GCI files and Wii saves with a matching GameID) to
all other clients. The data is compressed using LZO1X to greatly reduce
its size while keeping compression/decompression fast. Save
synchronization is enabled by default, and toggleable with a checkbox
in the NetPlay dialog.

On clicking start, if the option is enabled, game boot will be delayed
until all players have received the save data sent by the host. If any
player fails to receive it properly, boot will be cancelled to prevent
desyncs.
2018-07-19 18:09:20 -04:00
David Korth 0149d22385 Removed some more double-expansions of CMAKE_SYSTEM_NAME. 2018-07-02 13:01:16 -04:00
Lioncash c4fb07f428 Common, DSP: Only compile in x86-64 emitter related utilities on x86 platforms
Previously these were required to be built into the executable so that
the JIT portion of the DSP code would build properly, as the
x86-64-specifics were tightly coupled to the DSP common code. As this is
no longer the case, this is no longer necessary.
2018-06-21 06:53:31 -04:00
Lioncash d1e278218e Common/CMakeLists: Link in libraries privately for traversal_server
Without this, CMake script errors can occur, as explicit linkage
specifiers and non-explicit specifier commands aren't compatible with
one another.
2018-06-08 17:40:44 -04:00
Léo Lam fff1db9730 Common: Add Random utilities
This makes it easier to generate random numbers or fill a buffer with
random data in a cryptographically secure way.

This also replaces existing usages of RNG functions in the codebase:

* <random> is pretty hard to use correctly, and std::random_device does
  not give enough guarantees about its results (it's
  implementation-defined, non cryptographically secure and could be
  deterministic on some platforms).
  Doing things correctly is error prone and verbose.

* rand() is terrible and should not be used especially in crypto code.
2018-05-31 17:54:43 +02:00
Sepalani 8fa898fe9a DebugInterface: MemoryPatches methods added
CodeView: Restore instruction added
2018-05-22 10:31:31 +04:00
Emmanuel Gil Peyrot 17e65a7167 VideoCommon: Replace SOIL with libpng for hires textures 2018-05-20 13:44:38 +02:00
Lioncash 86018b503b Common: Move floating-point utility functions to FloatUtils.h/.cpp
Keeps all of the floating-point utility functions in their own file to
keep them all together. This also provides a place for other
general-purpose floating-point functions to be added in the future,
which will be necessary when improving the flag-setting within the
interpreter.
2018-05-07 02:56:32 -04:00
Sepalani 74d4a4478f DebugInterface: Watches methods added
Move Watches to Common
2018-04-28 17:46:51 +04:00
Lioncash 236aed9fd1
Common/CMakeLists: Link curl and VTune libraries in privately
These are only used internally.
2018-04-16 12:38:24 -04:00
Léo Lam 371f807e67
Merge pull request #6615 from leoetlino/sysconf
SysConf: Migrate to new filesystem interface
2018-04-14 23:29:25 +02:00
Lioncash b31281527a
CMakeLists: Define an OProfile target and use it
Allows us to bring includes and relevant libraries into scope by explicitly declaring linkage against the target
as opposed to using a variable. Also removes the dumping of OProfile includes into the top-level directory.
2018-04-13 19:35:17 -04:00
Léo Lam a287bbc3bd Move SysConf to Core
It's not common code that could be reused for, say, Citra;
it's absolutely specific to Wii emulation and only used by the Dolphin
core, so let's move it there.

Another reason for doing this is to avoid having Common depend on Core.
2018-04-12 22:16:37 +02:00
Lioncash 8db4ab7dd6
CMakeLists: Remove iconv from the LIBS variable
Adjusts Common to use the ICONV_LIBRARIES variable directly and doesn't
append it to the LIBS variable.

After this, there's only one remaining usage where libraries are added
to the LIBS variable, after which it can be removed once the rest of
the targets are migrated off add_dolphin_library
2018-04-01 14:00:55 -04:00
Lioncash e93159e54a
CMakeLists: Link in system framework libraries explicitly on macOS
Makes our libraries explicitly link in which libraries they need.
This makes our dependencies explicit and removes the reliance on the
LIBS variable to contain the libraries that they need.
2018-03-30 16:14:10 -04:00
Lioncash 2548ccda8e
Common/CMakeLists: Migrate off add_dolphin_library
Continues the migration work that was started in 3a4c3bbe01
2018-03-23 19:08:30 -04:00
Hannes Mann 41682a07cb Add Quality of Service (QoS) support 2018-03-09 00:11:18 +01:00
Pierre Bourdon 9e0739f5e5 traversal: add systemd watchdog support 2018-03-08 06:10:17 +00:00
MerryMage 4c24629b95 Config: Flatten structures
Originally, Layer contained a std::map of Sections, which containted a std::map
containing the (key, value) pairs. Here we flattern this structure so that only
one std::map is required, reducing the number of indirections required and
vastly simplifying the code.
2017-11-15 18:04:40 +00:00
MerryMage ec7b84c5f2 Config: Extract ConfigInfo into own header 2017-11-15 18:04:40 +00:00
Michael M fc306faad8 CMake: use miniupnpc target instead of global vars 2017-08-17 13:15:02 -07:00
Leo Lam a53b01360c Merge pull request #5898 from ligfx/extractupnp
Common: extract UPnP namespace from NetPlayServer
2017-08-17 03:11:41 +08:00
Jonathan Hamilton 2a66b88d01 Fix OPROFILE linux build with -Wl,--as-needed
The opagent library was (incorrectly) marked as a dependency for "Core"
instead of "Common".

When linked with --as-needed, any symbols the linker can tell are not
used are discarded. As the link is done in command-line order, and the
Core library (and dependencies) are processed before Common, it would
link in Core, then opagent, but as at that point no opagent symbols are
used the whole opagent library would be discarded.

Moving the opagent library to be a dependency of Common fixes this, as
after the Common library is linked, there *are* opagent symbols used.
2017-08-14 14:38:44 -07:00
Michael M 3386543a9c Common: extract UPnP namespace from NetPlayServer 2017-08-13 18:50:51 -07:00
Michael M 9afb2ff40e Common/CMakeLists: sort source files 2017-08-13 18:50:51 -07:00