Commit graph

3036 commits

Author SHA1 Message Date
Lioncash
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
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
Lioncash
66596c5176 Common/x64Emitter: Resolve TODO in OpArg's operator==
We now require C++17, so we can use std::tie here.
2019-05-30 10:27:28 -04:00
Lioncash
7346679986 Common/FileUtil: Use std::string::data within ReadFileToString
With C++17, .data() for std::string now has a non-const overload, so we
can make use of that instead of taking the address of the first element.
2019-05-29 07:06:56 -04:00
Lioncash
c0f499b7f7 Common/FileUtil: Use std::string_view with WriteStringToFile
Allows writing out other forms of strings (e.g. C strings) without the
need to allocate a std::string and discard it after use.
2019-05-29 07:06:56 -04:00
Lioncash
eb475025b8 Common/FileUtil: Make WriteStringToFile consistent with ReadFileToString
Makes the parameter ordering consistent and less error-prone.
2019-05-29 07:06:53 -04:00
Lioncash
ab2adfb0a7 Common/HttpRequest: Simplify cURL initialization
std::call_once is guaranteed to execute the given callable object
exactly once. This guarantee holds even if the function is called
concurrently from several threads.

Given that, we can replace the mutex and boolean flag with
std::call_once and a std::once_flag to perform the same behavior.
2019-05-27 09:46:57 -04:00
Lioncash
b15f595130 Common/HttpRequest: Avoid unnecessary copies in loop in Fetch()
Previously, every entry pair within the map would be copied. The reason
for this is subtle.

A std::map's internal entry type is defined as:

std::pair<const Key, Value>

but the loop was declaring it as:

std::pair<Key, Value>

These two types aren't synonymous with one another and so the compiler
is required to always perform a copy.

Using structured bindings avoids this (as would plain auto or correcting
the explicit type), while also allowing the use of more appropriate
names compared to first and second.
2019-05-27 09:36:31 -04:00
Lioncash
8dc8cf8019 Common/HttpRequest: std::move callback in constructor
std::function is allowed to heap allocate in order to hold any necessary
bound data in order to execute properly (e.g. lambdas with captures), so
this avoids unnecessary reallocating.
2019-05-27 09:26:28 -04:00
Léo Lam
617747e905
Merge pull request #8113 from lioncash/ini-key
Common/IniFile: Simplify Set()
2019-05-23 12:15:30 +02:00
Léo Lam
67c2aa0701
Merge pull request #8114 from lioncash/ini-line
IniFile: Prevent potential out-of-bounds access in ParseLine()
2019-05-23 12:12:41 +02:00
Lioncash
2ae370fc37 IniFile: Prevent potential out-of-bounds access in ParseLine()
While current usages of ParseLine aren't problematic, this is still a
public function that can be used for other purposes. Essentially makes
the function handle potential external inputs a little nicer.
2019-05-22 21:09:11 -04:00
Lioncash
869acb96c6 Common/IniFile: Simplify Set()
We can just utilize map's insert_or_assign() function and check the
return value to determine whether or not we need to insert the key into
the keys_order vector.
2019-05-22 20:58:49 -04:00
Connor McLaughlin
68877c52d1
Merge pull request #8027 from MerryMage/MOVAPS
Jit64: Prefer MOVAPS where possible
2019-05-22 15:05:17 +10:00
Léo Lam
d2c7a6f239
Merge pull request #8094 from leoetlino/log-type-names
Qt/LogConfigWidget: Show log type short names
2019-05-20 18:27:57 +02:00
spycrab
ec734065db
Merge pull request #8087 from spycrab/cmake_win2019
Support CMake on Windows
2019-05-14 21:07:26 +02:00
Connor McLaughlin
707266aeed
Merge pull request #8069 from iwubcode/passive_support
VideoCommon: Implement passive stereoscopic 3D
2019-05-12 15:15:34 +10:00
spycrab
b5160ec685 Common/CMake: Fix Windows build 2019-05-12 00:05:08 +02:00
Léo Lam
453c1d4170 Qt/LogConfigWidget: Show log type short names
Makes it easier for users to determine which option they need to
enable/disable as log messages only show the short name.
2019-05-11 16:05:22 +02:00
Michael M
916a97b869 TraversalServer: use C++ <chrono> instead of gettimeofday 2019-05-10 21:33:26 +02:00
Léo Lam
123bbbca2c
Merge pull request #8073 from vladfi1/re-frame-mw
Bring back MemoryWatcher, but without CoreTiming
2019-05-10 14:55:27 +02:00
Techjar
ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Vlad Firoiu
f4d950f4e2 Revert "Core: Remove MemoryWatcher"
This reverts commit 0c02e77eee.
2019-05-05 21:43:45 +01:00
iwubcode
c513bb5309 VideoCommon: Implement passive stereoscopic 3D 2019-05-04 22:58:00 -05:00
Léo Lam
ab9ece9bca Replace MathUtil::Clamp with std::clamp 2019-05-04 23:12:17 +02:00
Léo Lam
cb168f22d6 Replace custom UNUSED macro with [[maybe_unused]] 2019-05-04 23:04:18 +02:00
Léo Lam
04c8201c32 Enable C++17
All supported platforms now have easy access to a compiler with C++17
support.

C++17 potentially allows for some nice cleanups and removes the need
for standard library backports (optional/variant).

See discussion at https://dolp.in/pr6264#discussion_r158134178
2019-05-04 23:04:18 +02:00
Léo Lam
99a4ca8de7
Merge pull request #7839 from ShFil119/impr/redundant
Remove redundant initialization
2019-05-04 22:50:51 +02:00
Léo Lam
6c7aeb3ffb
Merge pull request #8064 from JosJuice/notify-host-symbols-clear
Call Host_NotifyMapLoaded when clearing g_symbolDB
2019-05-03 11:47:26 +02:00
booto
2ff0486335 Debugger/Memory: Add support for address spaces
Different address spaces can be chosen in the memory view panel.
 * Effective (or virtual): Probably the view people mostly want. Address
   translation goes through MMU.
 * Auxiliary: ARAM address space. Does not display anything in Wii mode.
 * Physical: Physical address space. Only supports mem1 and mem2 (wii
   mode) so far.
2019-05-02 21:14:30 -04:00
JosJuice
8fd6f8f6e9 Call Host_NotifyMapLoaded when clearing g_symbolDB
Otherwise DolphinQt will have a stale symbol list and
you can get nullptr dereferences when trying to use it.
2019-05-01 17:48:27 +02:00
Filip Gawin
c110ffcdaa Remove redundant initialization 2019-04-30 01:22:24 +02:00
Techjar
0c02e77eee Core: Remove MemoryWatcher
MemoryWatcher only works on Linux and affects emulation determinism due
to scheduling additional events, which causes NetPlay to desync.
Considering that this interface is a rather specialized use case, the
communication with it is kinda crappy *and* it's affecting emulation, I
think it's best to just axe it and come up with a better implementation
of the functionality.
2019-04-28 06:22:27 -04:00
MerryMage
1baa8ee970 x64Emitter: Prefer MOVAPS to MOVSD
* The high half of regOp is immediately overwritten so the value in it is irrelevant.
* MOVSD produces an unnecessary dependency on the high half of regOp.
* MOVAPS is implemented as a register rename on modern microarchitectures.
2019-04-27 12:56:05 +01:00
MerryMage
2d4dd8cdc1 x64Emitter: Prefer MOVAPS to MOVAPD
There is no reason to use MOVAPD over MOVAPS, for two reasons:
* There has never been a microarchitecture with separate single and double domains.
* MOVAPD is one byte longer than MOVAPS
2019-04-27 12:54:43 +01:00
Connor McLaughlin
664cfb2ca5
Merge pull request #7970 from Techjar/netplay-mii-sync
NetPlay: Synchronize Mii data
2019-04-27 13:26:55 +10:00
Jordan Woyak
ba1b335118 WiimoteEmu: Improve emulated swing. 2019-04-23 19:02:41 -05:00
Connor McLaughlin
44d5a71e27
Merge pull request #7965 from jordan-woyak/condvar-fixes
Minor changes to usages of std::condition_variable.
2019-04-21 23:50:53 +10:00
spycrab
eddcb70b84 Common/HttpRequest: Add option to allow non 200 response codes 2019-04-13 12:58:23 +02:00
Techjar
1b8eda827b NetPlay: Synchronize Mii data
It's bundled with the Wii saves for simplicity, since it's quite small.
2019-04-08 07:06:21 -04:00
Jordan Woyak
d34a9afe04 Minor changes to usages of std::condition_variable. 2019-04-06 17:39:25 -05:00
spycrab
ca5eac0c63 Common/HttpRequest: Fix EscapeComponent leaking memory 2019-04-06 13:27:49 +02:00
spycrab
094bf0d2ff Qt/NetPlay: Integrate NetPlayIndex 2019-04-06 12:27:30 +02:00
spycrab
3dbf44417a Common/HttpRequest: Implement EscapeComponent 2019-03-30 17:13:57 +01:00
Stenzek
a4f7c04470 Common: Add DynamicLibrary helper class 2019-03-29 19:52:33 +10:00
Tilka
a865cc0bf6
Merge pull request #7806 from jordan-woyak/wiimote-emu-swing-improve
WiimoteEmu: Reimplement tilt/swing/camera/orientation data using matrix math.
2019-03-05 23:37:00 +00:00
Jordan Woyak
bbc6bf5294 Common/Config: Add a utility class to suppress config change callbacks. 2019-03-03 17:35:22 -06:00
Jordan Woyak
4db4840d7c WiimoteEmu: Reimplement tilt/swing/camera/orientation data using matrix math. 2019-03-03 12:43:25 -06:00
spycrab
3e3f6922c0 Common/FileUtil: Fix GetExePath() cutting off the bundle name 2019-02-26 20:00:23 +01:00
Stenzek
f039149198 Move most backend functionality to VideoCommon 2019-02-19 16:57:54 +10:00