Commit Graph

3279 Commits

Author SHA1 Message Date
JosJuice 1084cfec1a Add helper function for fmt::format(GetStringT(... 2020-10-19 14:36:08 +02:00
iwubcode fd3af4c5d3 InputCommon: Introducing the "Dynamic Input Texture". Configuration links an emulated input action to an image based on what host key is defined for that emulated input. Specific regions are called out in configuration that mark where to replace an input button with a host key image. 2020-10-03 17:10:35 -05:00
Christian Aguilera 213610e95d Extended WorkQueueThread class with Clear(), Cancel() and IsCancelled(). 2020-10-01 22:09:45 +02:00
Jordan Woyak 1063c4e940 MathUtil: Add Population (vs Sample) versions of Variance and StandardDeviation to RunningVariance. 2020-09-28 18:09:33 -05:00
JosJuice 16d2ef1ea9 DolphinQt: Handle non-ASCII characters in Windows cmd arguments
CommandLineParse expects UTF-8 strings. (QApplication, on the
other hand, seems to be designed so that you can pass in the
char** argv untouched on Windows and get proper Unicode handling.)
2020-09-21 17:26:29 +02:00
JosJuice 3805b84906 Android: Add content provider support to File::Delete 2020-09-16 18:38:53 +02: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
JMC47 a31c204ca8
Merge pull request #8765 from AdmiralCurtiss/jit-reuse-memory
Jit64 codegen space reuse.
2020-09-09 08:16:09 -04:00
Jordan Woyak 0a63340c20
Merge pull request #9037 from shuffle2/code-cleanup
Code cleanup
2020-08-30 19:43:23 -05:00
Shawn Hoffman 969ea6e4f5 msvc: enable /Zc:preprocessor and make build compile cleanly 2020-08-27 21:58:48 -07:00
Kate 5981a1929d Add support for FreeBSD/arm64 2020-08-27 21:54:04 +01:00
Admiral H. Curtiss 5b52b3e9cb x64Emitter: Check end of allocated space when emitting code. 2020-08-24 19:31:32 +02:00
Shawn Hoffman fcc8dfd189 Common/Assert: no longer needs special impl for msvc 2020-08-23 13:57:05 -07:00
Shawn Hoffman 12ea56a6b2 remove extraneous WIN32_LEAN_AND_MEAN definition 2020-08-23 13:57:05 -07:00
Shawn Hoffman 181e0dba21 apply `if constexpr` in a couple places 2020-08-23 13:57:05 -07:00
Shawn Hoffman c22748dc38 windows: fix some incorrect string lengths 2020-08-23 13:55:15 -07:00
Shawn Hoffman b021573a70 GekkoDisassembler: fix rld* 2020-08-23 13:55:14 -07:00
Shawn Hoffman 49590c9a42 FileUtil: handle some error conditions 2020-08-23 13:55:14 -07:00
Shawn Hoffman 3bc8a26083 don't use std::move on const variables 2020-08-23 13:55:14 -07:00
Shawn Hoffman 1b1fc39f02 handle to GetFileVersionInfoW must be zero 2020-08-23 13:55:14 -07:00
Shawn Hoffman 6ef9d70701 name some threads 2020-08-22 17:22:07 -07:00
Shawn Hoffman a769dff1d0 windows: additionally set thread name via SetThreadDescription 2020-08-22 17:22:07 -07:00
LC 4a34b74e68
Merge pull request #9035 from shuffle2/vs-pretty
misc vcxproj cleanup
2020-08-22 20:13:25 -04:00
Shawn Hoffman cff4806d8d windows: fix build if pch were to be disabled 2020-08-22 16:18:24 -07:00
Shawn Hoffman 2f47f486af msbuild: re-enable standalone vcxproj processing 2020-08-22 16:17:50 -07:00
Shawn Hoffman 94bf48b67c msbuild: refactor stuff out of project files (for dolphin) 2020-08-22 16:17:50 -07:00
Shawn Hoffman 36ace8eb52 prettify some constructs in vcxproj files 2020-08-22 16:17:50 -07:00
Ryan Meredith 6020133f5b LogManager: Add missing include 2020-08-02 19:52:10 -04:00
JosJuice 234eaa0ff9
Merge pull request #7252 from Ebola16/Log
Android: Add Log Configuration to UI
2020-08-02 22:00:48 +02:00
Pokechu22 59dc7cfe7d Use size_t in some DSP code code 2020-07-24 15:06:39 -07:00
Ryan Meredith fdcc6a436b Android: Add Log Configuration to UI 2020-07-24 13:59:13 -04:00
LC 487cd7abd9
Merge pull request #8905 from JosJuice/jni-encoding
Android: Use correct encoding when converting strings
2020-07-18 22:13:14 -04:00
Techjar 037aa2192f NetPlay: Limit nickname length
Ridiculously long nicknames cause UI silliness, so 30 characters seems
like a reasonable limit, as it's the same as the forum.
2020-07-16 19:03:54 -04:00
LC c59648337a
Merge pull request #8955 from JosJuice/android-no-ashmem
Android: Don't access /dev/ashmem on newer Android versions
2020-07-16 14:23:51 -04:00
JosJuice 00cde7cbbd Android: Don't access /dev/ashmem on newer Android versions
Fixes a critical regression where 95945a0 made us unable to
start emulation on Android 10 and newer. Android is restricting
direct access to /dev/ashmem starting with the new SDK version,
but we can use the new (and simpler) ASharedMemory API instead.
We have to keep using the /dev/ashmem approach on old versions
of Android, though.
2020-07-16 20:06:58 +02:00
JosJuice f2cc3a2948 Add Android check for strerror_r variant
I don't know why Android does it like this, but at least
it's easy to fix. (We are currently at __ANDROID_API__ == 21.)
2020-07-16 18:51:58 +02:00
Tilka 695a96498a
Merge pull request #8922 from Filoppi/timer-fixes
Timer fixes
2020-07-13 00:16:45 +01:00
Jordan Woyak eab07866a3 Common/Timer: Fix integer underflow in Timer::GetDoubleTime for dates before ~2008. 2020-07-12 12:55:02 -05:00
JosJuice f5da6e07d7 Android: Use correct encoding when converting strings
The functions with "UTF" in the name use "modified UTF-8" rather
than the standard UTF-8 which Dolphin uses, at least according
to Oracle's documentation, so it is incorrect for us to use them.
This change fixes the problem by converting between UTF-8 and
UTF-16 manually instead of letting JNI do it for us.
2020-07-08 14:52:05 +02:00
JosJuice 38791eec18 Common: Never convert from UCS-2 in WStringToUTF8
Probably not something we would run into in practice since
Windows uses a separate implementation, but let's do it
for the sake of correctness.
2020-07-08 14:51:35 +02:00
JosJuice 15d9fab0bb Common: Rename UTF16ToUTF8
This function does *not* always convert from UTF-16. It converts
from UTF-16 on Windows and UTF-32 on other operating systems.

Also renaming UTF8ToUTF16 for consistency, even though it
technically doesn't have the same problem since it only was
implemented on Windows.
2020-07-08 14:51:35 +02:00
Filoppi 4b5ca9923c Fixes the timer returning 1 when it should return 0. The case mentioned by the comment does not exist anymore.
Also added a IsRunning function as it was impossible to know whether it had been started or not (I will use it in later PRs but it should be there anyway)
2020-07-01 22:29:30 +03:00
JosJuice 293745afce Support the new MSVC preprocessor
Intends to fix https://bugs.dolphin-emu.org/issues/12170.
2020-06-29 13:50:59 +02:00
Tilka 9f5e6edc34
Merge pull request #8809 from Ebola16/ABB
Replace some acronyms
2020-06-14 14:30:52 +01:00
Ryan Meredith 2a70d86d55 Replace some acronyms 2020-06-14 08:37:24 -04:00
iwubcode 85e11cd4ab Common / Core: Update StringUtil to allow specifying the base, default to 0. Fix ActionReplay code to use this instead of prepending '0x' in front 2020-05-23 18:40:10 -05: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
Léo Lam 07ab79db64 MathUtil: Fix Rectangle::GetWidth/Height for unsigned types
`std::abs(x - y)` where x and y are unsigned integers fails to compile
with an "call of overloaded 'abs(unsigned int)' is ambiguous" error
on GCC, and even if it did compile, that expression still wouldn't
give the correct result since `x - y` is unsigned.
2020-05-03 14:41:58 +02:00
Léo Lam 19da101164 Remove redundant Config prefix from ConfigInfo/ConfigLocation
Both structs are already in the Config namespace.
2020-05-02 14:40:14 +02:00
degasus fc0df37d94 Fix windows build system. 2020-04-29 12:56:52 +02:00
degasus f8f592c345 Externals: Update minizip search path. 2020-04-29 12:41:36 +02:00
JosJuice 5d6f23e424 SettingsHandler: Don't output null bytes
https://bugs.dolphin-emu.org/issues/12019, take two.
2020-03-24 17:01:15 +01:00
JosJuice 76b97a4183
Merge pull request #8680 from Leseratte10/master
SettingsHandler: Always decode the whole settings.txt file
2020-03-24 00:21:29 +01:00
Jun Su 7c7a41ecd8 Cleanup warnings of -Wunused-variable
remove unused variables.
2020-03-23 14:24:27 +08:00
Florian Bach cba4acc54b SettingsHandler: Always decode the whole settings.txt file 2020-03-20 16:08:25 +01:00
Léo Lam 4711b76cc4
Merge pull request #8655 from Techjar/fix-hotkey-groups
Core/HotkeyManager: Fix group names in config
2020-03-18 12:03:07 +01:00
JosJuice 5f6598f9e9 StringUtil: Add PathToFileName function 2020-03-16 21:03:34 +01:00
Florian Bach 3487e5037e Fix settings.txt parsing in case of weird line endings 2020-03-15 00:12:19 +01:00
Stenzek 86db015c23 Common: Add a render_window field to WindowSystemInfo
We need this because we need to pass the layer to MoltenVK, not
the view handle. But the input subsystem still needs the window.
2020-03-11 23:09:30 +10:00
Sergei Trofimovich 0478ce72f5 Source/Core/Common/StringUtil.h: include <limits> for std::numeric_limits
Without included header build fails on gcc-10 as:

```
[ 13%] Building CXX object Source/Core/AudioCommon/CMakeFiles/audiocommon.dir/CubebUtils.cpp.o
In file included from ../../../../Source/Core/AudioCommon/CubebUtils.cpp:13:
../../../../Source/Core/Common/StringUtil.h: In function 'bool TryParse(const string&, T*)':
../../../../Source/Core/Common/StringUtil.h:84:20: error: 'numeric_limits' is not a member of 'std'
   84 |   if (value < std::numeric_limits<LimitsType>::min() ||
      |                    ^~~~~~~~~~~~~~
```

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2020-03-05 21:20:34 +00:00
Techjar 08c95883e9 Common/IniFile: Add Exists function for section name only 2020-02-29 01:39:36 -05:00
Jordan Woyak 8343dadd58 InputCommon: Add types to ControllerEmu that represent raw controller inputs and calibration data to calculate normalized input values. 2020-02-17 15:57:43 -06:00
Jordan Woyak 259a7191d2 Common: Add additional Vector operations. 2020-02-17 15:57:43 -06:00
Jordan Woyak 9efcd08ea3 MathUtil: Add RunningMean/RunningVariance classes. 2020-02-17 15:57:43 -06:00
Léo Lam 44b4c2db49 Common: Avoid std::function overhead in ScopeGuard
So far in all our uses of ScopeGuard, the type of the callable is
usually just a lambda or a function pointer, so there is no need
to rely on std::function's type erasure.

While the cost of using std::function is probably negligible, it still
causes some unnecessary overhead that can be avoided by making
ScopeGuard a templated class. Thanks to class template argument
deduction in C++17 most existing usages do not even need to be changed.

See https://godbolt.org/z/KcoPni for a comparison between
a ScopeGuard that uses std::function and one that doesn't
2020-02-15 21:33:31 +01:00
spycrab 213a9adcff CMake: Fix building ARM64 on Windows 2020-02-12 12:29:31 +01:00
magiblot 55e8601192
Fix another implicit false-to-nullptr conversion 2020-02-09 15:51:30 +01:00
Jordan Woyak 4f47cccd9f Cleanup: Use std::abs instead of abs. 2020-02-08 18:21:14 -06:00
Lioncash 91deb40a22 Common: Amend includes to handle the upgrade to fmt 2020-02-04 15:03:51 -05:00
Techjar 185e49d2a9 x64CPUDetect: Add flag for slow PDEP/PEXT on AMD Zen
For some unknown reason PDEP and PEXT are ridiculously slow on AMD Zen
architecture.
2020-01-26 22:09:46 -05:00
Techjar 52b52631c2 x64CPUDetect: Add detection for AMD Zen architecture 2020-01-26 22:09:13 -05:00
Tilka a632bc7324
Merge pull request #8579 from jordan-woyak/rvalue-cleanups
Common/Core: Minor rvalue reference related cleanups.
2020-01-25 21:09:22 +00:00
Tilka 9827aa7a37
Merge pull request #8577 from jordan-woyak/shared_mutex
Common/Analytics: Replace mutex with shared_mutex and minor cleanups.
2020-01-25 20:08:22 +00:00
Jordan Woyak 5e3472eba9 Common/Analytics: Replace mutex with shared_mutex and minor cleanups. 2020-01-25 14:04:00 -06:00
Tilka 119ccc5e4f
Merge pull request #8556 from Sintendo/bestrest
x64Emitter: Avoid 8-bit displacement when possible
2020-01-25 19:10:47 +00:00
Jordan Woyak 732032cdb2 Common/Core: Minor rvalue reference related cleanups. 2020-01-23 22:58:23 -06:00
Léo Lam 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
Pierre Bourdon 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
JosJuice 966e1b31ba
Merge pull request #8394 from Pokechu22/misc-di-gpio
Various DI improvements
2020-01-13 17:17:24 +01:00
Connor McLaughlin ae6d3be449
Merge pull request #8530 from s-daveb/master
MacOS: Fixes configuration hang; bump MacOS SDK.
2020-01-13 20:21:08 +10:00
Sintendo 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
Sintendo f82c38e156 X64Emitter: Remove obsolete TODO
TODO was already taken care of in PR #941.
2020-01-13 08:43:42 +01:00
Sintendo bdfc472751 x64Emitter: Refactor OpArg::WriteRest
Shorter, displacement is now handled in one location.
2020-01-13 08:43:42 +01:00
Sintendo 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
Jordan Woyak 0aacf3a627 WiimoteEmu: Make the "Total Yaw" setting work again. 2020-01-09 13:11:13 -06:00
Tilka 6e18dfb600
Merge pull request #8133 from Sintendo/mov64imm32
x64Emitter: Emit shorter MOVs for 32-bit immediates
2020-01-06 13:12:56 +01:00
Léo Lam 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
Pokechu22 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
Pokechu22 a695b05b21 Add support for std::optional to PointerWrap 2020-01-04 11:43:26 -08:00
Jordan Woyak 0e8d4cb6ac StringUtil: Make TryParse of floats handle comma and dot decimal separators. 2020-01-04 07:19:15 -06:00
Léo Lam 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
Jordan Woyak 8ab3694f51 Common: Add Matrix33::FromQuaternion. 2020-01-02 15:16:37 -06:00
George Talusan b1a6cbc3b4 MacOS: Dispatch GL calls to main thread to prevent crashes on Catalina 2020-01-01 23:06:19 -05:00
David Korth 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
David Korth 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
Stenzek d744c5a148 Compile fixes for Windows-on-ARM64 2019-12-28 19:20:41 +10:00
Stenzek 6fcb1c6c46 Add an ARM64 target to Visual Studio projects 2019-12-28 19:20:41 +10:00
Techjar 79092cdda0 Common/BitUtils: Implement BitCast(To|From)Array 2019-12-22 14:48:47 -05:00
S David 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