Commit Graph

3454 Commits

Author SHA1 Message Date
119ccc5e4f Merge pull request #8556 from Sintendo/bestrest
x64Emitter: Avoid 8-bit displacement when possible
2020-01-25 19:10:47 +00:00
732032cdb2 Common/Core: Minor rvalue reference related cleanups. 2020-01-23 22:58:23 -06:00
89b0ab2d22 StringUtil: Add IsPrintableCharacter and use it
Add a function that safely returns whether a character is printable
i.e. whether 0x20 <= c <= 0x7e is true.

This is done in several places in our codebase and it's easy to run
into undefined behaviour if the C version defined in <cctype>
is used instead of this one, since its behaviour is undefined
if the character is not representable as an unsigned char.

This fixes MemoryViewWidget.
2020-01-16 00:22:26 +01:00
1ac3264d5d Merge pull request #8545 from jordan-woyak/imu-cursor-centering
WiimoteEmu: IMU pointing behavior improvements and code cleanup.
2020-01-15 12:10:57 +01:00
966e1b31ba Merge pull request #8394 from Pokechu22/misc-di-gpio
Various DI improvements
2020-01-13 17:17:24 +01:00
ae6d3be449 Merge pull request #8530 from s-daveb/master
MacOS: Fixes configuration hang; bump MacOS SDK.
2020-01-13 20:21:08 +10:00
bdcdd763fe x64Emitter: Remove unused macros
No users, and one them seems to do the same as stddef.h's offsetof()
already used elsewhere.
2020-01-13 08:43:42 +01:00
f82c38e156 X64Emitter: Remove obsolete TODO
TODO was already taken care of in PR #941.
2020-01-13 08:43:42 +01:00
bdfc472751 x64Emitter: Refactor OpArg::WriteRest
Shorter, displacement is now handled in one location.
2020-01-13 08:43:42 +01:00
cde3a3b448 x64Emitter: Avoid 8-bit displacement when possible
Due to the way the ModRM encoding works on x86, memory addressing
combinations involving RBP or R13 need an additional byte for an 8-bit
displacement of zero.

However, this was also applied in cases where it is unnecessary,
effectively wasting a byte.

- MatR with RSP or R12

8B 44 24 00          mov         eax,dword ptr [rsp]
8B 04 24             mov         eax,dword ptr [rsp]

- MRegSum with base != RBP or R13

46 8D 7C 37 00       lea         r15d,[rdi+r14]
46 8D 3C 37          lea         r15d,[rdi+r14]

- MComplex without offset

8B 4C CA 00          mov         ecx,dword ptr [rdx+rcx*8]
8B 0C CA             mov         ecx,dword ptr [rdx+rcx*8]
2020-01-13 08:43:42 +01:00
0aacf3a627 WiimoteEmu: Make the "Total Yaw" setting work again. 2020-01-09 13:11:13 -06:00
6e18dfb600 Merge pull request #8133 from Sintendo/mov64imm32
x64Emitter: Emit shorter MOVs for 32-bit immediates
2020-01-06 13:12:56 +01:00
f35f4f2bf0 Merge pull request #8541 from jordan-woyak/float-parse-fix
StringUtil: Make TryParse of floats handle comma and dot decimal separators.
2020-01-05 12:12:09 +01:00
77189e74cd Implement Broadway GPIOs
SLOT_LED and the AVE ones are not implemented yet, but the other Broadway ones are.
2020-01-04 11:43:26 -08:00
a695b05b21 Add support for std::optional to PointerWrap 2020-01-04 11:43:26 -08:00
0e8d4cb6ac StringUtil: Make TryParse of floats handle comma and dot decimal separators. 2020-01-04 07:19:15 -06:00
ad75215bb0 Fix several warnings
A small, nonexhaustive set of warning fixes. The DiscIO Volume change
is a workaround for a GCC bug [1] that causes returning an unengaged
std::optional to emit annoying -Wmaybe-uninitialized warnings.
This last change alone fixes pages upon pages of warnings since
Volume.h is included from several files.

-Wstringop-truncation is another irrelevant warning for us, but
unfortunately there seems to be no way to disable it without
adding ugly pragmas wherever the warning appears.
2020-01-04 12:11:39 +01:00
8ab3694f51 Common: Add Matrix33::FromQuaternion. 2020-01-02 15:16:37 -06:00
b1a6cbc3b4 MacOS: Dispatch GL calls to main thread to prevent crashes on Catalina 2020-01-01 23:06:19 -05:00
c2dd2e8a2e Use std::istringstream or std::ostringstream instead of std::stringstream where possible.
This removes std::iostream from the inheritance chain, which reduces
overhead slightly.
2019-12-29 23:45:02 -05:00
a23b3d26f4 GLExtensions.cpp: Use arrays of const char *const instead of std::string.
The strings end up being copied, so we might as well initialize the
std::string in the unordered_map directly.
2019-12-29 23:45:02 -05:00
d744c5a148 Compile fixes for Windows-on-ARM64 2019-12-28 19:20:41 +10:00
6fcb1c6c46 Add an ARM64 target to Visual Studio projects 2019-12-28 19:20:41 +10:00
79092cdda0 Common/BitUtils: Implement BitCast(To|From)Array 2019-12-22 14:48:47 -05:00
21f42fafb7 MacOS: Fixes configuration hang; bump MacOS SDK.
Removed conditional use of std::mutex instead of std::shared_mutex on MacOS.

Because MacOS < 10.12 did not support std::shared_mutex, a previous commit
naïvely substituted std::mutex, which does not have the same behavior.

Reverses PR #8273, which substitues std::mutex for std::shared_mutex on
macOS, and results in several bugs that seem to only affect MacOS

- https://bugs.dolphin-emu.org/issues/11919
- https://bugs.dolphin-emu.org/issues/11842
- https://bugs.dolphin-emu.org/issues/11845

This change eliminates conditional code for MacOS in the core configuration
layer code and enables the use of modern language features that are more
secure and thread-safe.
2019-12-22 00:49:17 -05:00
81edcca8db Common/Network: Use std::nullopt in StringToMacAddress
Prevents unnecessary zeroing out of std::optional's internal buffer in
some implementations.
2019-12-06 09:59:11 -05:00
cbfacc41ba Common/Network: Remove unused header inclusions
Removes unused header dependencies.
2019-12-06 09:51:28 -05:00
f06461d208 Common/Network: Make StringToMacAddress use a string_view
This function only ever reads the contents of the string in a non-owning
manner, so we can change the parameter over to being a string view.
2019-12-06 09:45:25 -05:00
dd23a1ee79 Update VS projects/solutions to VS2019 2019-11-30 13:42:52 +10:00
c792961000 Common: Unify logging namespace with Common
Previously the logging was a in a little bit of a disarray. Some things
were in namespaces, and other things were not.

Given this code will feature a bit of restructuring during the
transition over to fmt, this is a good time to unify it under a single
namespace and also remove functions and types from the global namespace.

Now, all functions and types are under the Common::Log namespace. The
only outliers being, of course, the preprocessor macros.
2019-11-28 05:13:21 -05:00
fe9e7d5578 Prefer MessageBoxW to MessageBoxA 2019-11-23 13:56:05 +00:00
0334dde2cf Fix typo in comment 2019-11-11 13:20:04 -06:00
066012b80d Merge pull request #8454 from jordan-woyak/motion-input-indicators
DolphinQt: Add accelerometer/gyroscope mapping indicators.
2019-11-10 18:57:31 +01:00
eebc64aaf8 Merge pull request #8460 from jordan-woyak/evdev-motion-data
InputCommon: Detect when evdev exposes acceleration/gyroscope data.
2019-11-09 23:34:51 +01:00
f4e12f85bc Merge pull request #8393 from CookiePLMonster/long-paths
Support Windows 10 long paths
2019-11-09 21:10:16 +01:00
1180c231a6 InputCommon: Detect when evdev exposes acceleration/gyroscope data. 2019-11-09 13:34:29 -06:00
1e028025e5 Common: Add additional Matrix/Vec functions. 2019-11-08 15:46:45 -06:00
a89fdb628c Merge pull request #8343 from stenzek/fbdev
DolphinNoGUI: Add a FBDev platform
2019-11-08 11:05:53 +10:00
1f3d1a9b7f Merge pull request #8352 from rlnilsen/motion-controller-support-via-cemuhook-protocol
Support for motion controllers like the DualShock 4
2019-10-28 16:39:10 +01:00
da1f153b47 Rename all instances of "CemuhookUDPServer"/"UDPServer" to "DualShockUDPClient"/"DSUClient". 2019-10-27 16:05:22 +01:00
4cb3baba5c Add support for motion controllers via the CemuHook controller input protocol.
This is done by:
1) Implementing said protocol in a new controller input class CemuHookUDPServer.
2) Adding functionality in the WiimoteEmu class for pushing that motion input to the emulated Wiimote and MotionPlus.
3) Suitably modifying the UI for configuring an Emulated Wii Remote.
2019-10-26 02:19:53 +02:00
2210a0a70c Rebuild D_REDUMPCACHE_IDX path when needed 2019-10-25 20:49:28 +02:00
2c79c63608 Merge pull request #8330 from JosJuice/redump-integration
VolumeVerifier: Add Redump.org integration
2019-10-23 16:43:52 +02:00
0d254d9cb8 StringUtil: Require TryParse of float types to use the entire string. 2019-10-18 19:56:48 -05:00
d39555919d Merge pull request #8395 from CookiePLMonster/improve-work-queue
Improvements to WorkQueueThread
2019-10-13 15:24:56 -04:00
26ebf5b650 Improvements to WorkQueueThread
- Do not use a lambda for std::thread as invoke constructor exists
- Use simpler std::lock_guard wherever possible
- Do not require T to be default constructible
- Move T out of the queue instead of copying
2019-10-08 22:57:33 +02:00
45890c20cf Remove obsolete "Windows compatibility" macros 2019-10-07 22:46:37 +02:00
689378b435 Move GetModuleName to Common
This unifies GetModuleFileName calls between Dolphin and WinUpdater
and allows to gracefully remove MAX_PATH limit from GetExePath
2019-10-07 22:46:36 +02:00
3b21d32865 Remove MAX_PATH limit from:
- GetTempFilenameForAtomicWrite
- SetUserDirectory
2019-10-07 22:45:16 +02:00
4fd262d0b8 FixedSizeQueue: Work around GCC generating large amounts of debug info 2019-10-06 16:23:45 +10:00