Commit Graph

3122 Commits

Author SHA1 Message Date
Markus Wick 2449be7f0c
Merge pull request #6571 from lioncash/rotate
CommonFuncs: Generify rotation functions and move them to BitUtils.h
2018-04-02 12:18:22 +02:00
Markus Wick dea30e08bf
Merge pull request #6576 from lioncash/iconv
CMakeLists: Remove iconv from the LIBS variable
2018-04-02 11:07:19 +02:00
Lioncash fd9eab73fb CPUDetect: Make CPUVendor enum an enum class
Avoids dumping the enum contents into the global namespace.
2018-04-01 17:47:50 -04: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 c3483a1823 CommonFuncs: Generify rotation functions and move them to BitUtils.h
These are bit manipulation functions, so they belong within BitUtils.

This also gets rid of duplicated code and avoids relying on compiler
reserved names existing or not existing to determine whether or not we
define a set of functions.

Optimizers are smart enough in GCC and clang to transform the code to a
ROR or ROL instruction in the respective functions.
2018-03-31 18:09:45 -04:00
Léo Lam de15e09a4f Log: Rename IOS_FILEIO to IOS_FS
Let's use the actual name of the system module.

Also, the FS code is not all about files.
2018-03-31 10:58:37 +02:00
Léo Lam 5a7b966b6d IOS: Rewrite FS to use FileSystem
This is the large change in the branch.

This lets us use either the host filesystem or (in the future) a NAND
image exactly the same way, and make sure the IPC emulation code
behaves identically. Less duplicated code.

Note that "FileIO" and "FS" were merged, because it actually doesn't
make a lot of sense to split them: IOS handles requests for both
/dev/fs and files in the same resource manager, and as it turns out,
/dev/fs commands can *also* be sent to non /dev/fs file descriptors!
If we kept /dev/fs and files split, there would be no way to
emulate that correctly. I'm not aware of anything that does that (yet?)
but I think it's important to be correct.
2018-03-31 10:58:37 +02:00
Léo Lam 1bdfedf3c6 Common: Add a Result class
This adds a lightweight, easy to use std::variant wrapper intended to
be used as a return type for functions that can return either a result
or an error code.
2018-03-31 10:45:44 +02: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
Léo Lam 03a6a9b240
Merge pull request #6546 from spycrab/updater_ui
Implement Updater UI
2018-03-28 20:04:32 +02:00
spycrab f700fcae2e HttpRequest: Add callback option 2018-03-28 17:33:34 +02:00
Pierre Bourdon ac97f0463f
Merge pull request #6548 from lioncash/const
LinearDiskCache: Don't cast away const in Read()
2018-03-28 03:14:38 +02:00
Lioncash 008442898c LinearDiskCache: Don't cast away const in Read()
We really shouldn't make the out pointer in the read function const and
then summarily cast it away. Also alters Write to be consistent with
casting.
2018-03-27 21:09:18 -04:00
Léo Lam ceed6890df
Merge pull request #6526 from lioncash/emitter
x64Emitter: Minor cleanup and changes
2018-03-27 08:49:36 +02:00
Lioncash 476c71efc1 x64Emitter: Make eligible register and immediate functions constexpr
Pointer variants aren't eligible as expressions with reinterpret cast
within them cannot be constexpr.
2018-03-26 18:21:22 -04:00
Lioncash 8b072e1383 x64Emitter: Make remaining eligible functions in OpArg constexpr 2018-03-26 18:21:21 -04:00
Lioncash 964201f2d3 x64Emitter: Use std::tie in OpArg's operator==. Provide operator!= for symmetry 2018-03-26 18:21:21 -04:00
Lioncash 7f583b66cb x64Emitter: Clean up constructors for OpArg
Default initializes members and moves initial assignments into the
initializer list.
2018-03-26 18:21:17 -04:00
Miikka Juomoja 7169be242f StringUtil: Fix possible bad free 2018-03-26 23:48:13 +02:00
Stenzek c82be53d5c GLInterface: Use EXT_swap_control or MESA_swap_control over SGI
The SGI extension does not define calling SwapInterval with a parameter
of zero as valid. It was just lucky that drivers interpreted this as
vsync off. The EXT_swap_control extension defines zero as a valid value.

Mesa does not appear to support the EXT variant, so we fall back to
MESA_swap_control here, which also supports zero.
2018-03-26 22:09:22 +10:00
Lioncash 2861e8f868 x64Emitter: Clean up constructor and destructors of XEmitter
In-class initializes members, defaults the default constructor and
virtual destructor, and puts members in the initializer list.
2018-03-25 16:50:02 -04:00
Léo Lam 4c5efb0f3a
Merge pull request #6508 from lioncash/cmake-common
Common/CMakeLists: Migrate off add_dolphin_library
2018-03-24 09:08:20 +01:00
Lioncash f889cae8c4
Arm64Emitter: Satisfy unrelated linter issues that cropped up by modifying the cpp file 2018-03-23 19:17:44 -04:00
Lioncash 91cefe6c8a
Arm64Emitter: Make IsImmArithmetic, IsImmLogical, FPImm8ToFloat, and FPImm8FromFloat internally linked
These aren't used anywhere outside of the emitter. Centralizes them under an anonymous namespace.
2018-03-23 19:17:26 -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
Lioncash b11c237c43
Arm64Emitter: Remove unnecessary V8_UINT64_C preprocessor macro
UINT64_C is provided via <cstdint>, so we can just use that instead.
2018-03-23 13:31:48 -04:00
Lioncash 03671a5534
Arm64Emitter: Remove duplicate IsPowerOf2 function
We can just use the generified version in MathUtil.
2018-03-23 13:31:44 -04:00
Lioncash 79f40fb8d7
MathUtil: Generify IsPow2
This will allow it to also be used in the AArch64 emitter.
2018-03-23 09:50:49 -04:00
Pierre Bourdon 9628333b86 AutoUpdater: support optionally restarting Dolphin after update 2018-03-23 11:10:25 +01:00
Léo Lam 5e76f3a6d4
Merge pull request #6488 from aldelaro5/symbols-log
LOG: Add a log type for Symbols
2018-03-22 22:06:04 +01:00
aldelaro5 c54e56793a
Add a log type for Symbols and move symbols related logs to it
This fix the awkwardness of having the symbols detection, parsing and loading related logs be in OS HLE while they don't have anything to do with that.
2018-03-22 14:57:28 -04:00
Pierre Bourdon fe600ab0ed
Merge pull request #6146 from HannesMann/qos-support
Netplay: Add Quality of Service (QoS) support
2018-03-21 02:46:46 +01:00
Anthony ad8c31699f
Merge pull request #6463 from delroth/auto-update
Initial implementation of the Dolphin auto-updater for Windows
2018-03-20 11:28:26 -07:00
Pierre Bourdon bc9deb7be3 HttpRequest: make curl initialization thread-safe 2018-03-20 00:36:43 +01:00
Pierre Bourdon 5498f9b7ef make_scmrev.h.js: set default auto-update track from environment 2018-03-19 00:11:55 +01:00
Lioncash 975ba4abf0 x64Emitter: Make FloatOp and NormalOp enum classes
Reduces the amount of identifiers placed in the Gen namespace internally.
2018-03-18 18:04:54 -04:00
Lioncash c22a6f4551 x64Emitter: Move FloatOp and NormalOp enums to the cpp file
These are only used internally. This also allows us to eliminate some
symbols that get dumped into the exposed Gen namespace.

By extension this also hides the Write[X] functions from OpArg's public
interface. This is only used internally by XEmitter, so they shouldn't
be usable by anything else.
2018-03-18 18:04:48 -04:00
Lioncash 7926a0c814 Use __func__ instead of __FUNCTION__ where applicable
This replaces usages of the non-standard __FUNCTION__ macro with the standard
mandated __func__ identifier.

__FUNCTION__ is a preprocessor definition that is provided as an
extension by compilers. This was the only convenient option to rely on
pre-C++11. However, C++11 and greater mandate the predefined identifier
__func__, which lets us accomplish the same thing.

The difference between the two, however, is that __func__ isn't a
preprocessor macro, it's an actual identifier that exists at function
scope. The C++17 draft standard (N4659) at section [dcl.fct.def.general]
paragraph 8 states:

"
The function-local predefined variable __func__ is defined as if a
definition of the form

static const char __func__[] = "function-name ";

had been provided, where function-name is an implementation-defined
string. It is unspecified whether such
a variable has an address distinct from that of any other object in the
program.
"

Thankfully, we don't do any macro or string concatenation with __FUNCTION__
that can't be modified to use __func__.
2018-03-16 13:41:53 -04:00
Lioncash 75f5fcdfee Assert: Remove unused parameter from DEBUG_ASSERT
This brings the macro in line with the regular ASSERT macro, which only has one
macro parameter.
2018-03-16 13:01:11 -04:00
Lioncash f44e2dc425 Assert: Wrap assertion macro bodies in do {} while (0)
Enforces the termination of the macro with a semicolon. Aside from that
requirement, behavior remains the same.
2018-03-16 12:35:23 -04:00
Lioncash 50a476c371 Assert: Uppercase assertion macros
Macros should be all upper-cased. This is also kind of a wart that's
been sticking out for quite a while now (we avoid prefixing
underscores).
2018-03-14 22:03:12 -04:00
Pierre Bourdon d72947d638
Merge pull request #6427 from JosJuice/thousandseparate-encoding
StringUtil: Fix Windows encoding in ThousandSeparate
2018-03-10 13:16:00 +01:00
JosJuice 34be8488a5 StringUtil: Fix Windows encoding in ThousandSeparate
Some locales use non-breaking spaces as separators, so getting the
encoding right is important. If DolphinWX gets a string that isn't
valid UTF-8, it flat out won't display the string.
2018-03-10 12:13:30 +01:00
Stenzek 93ab50c555 OGL: Move primitive restart enable logic to GLUtil 2018-03-10 16:11:20 +10:00
Stenzek 51a586d11a GLUtil: Encapsulate functions in a namespace 2018-03-10 16:11:19 +10: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
hubslave 4ae48e10e5
Include <endian.h> for byte swap macros on OpenBSD
There is code below that assumes the presence of those macros (by #undef'ing them), but none of the included headers provided them.

This fixes a build failure on OpenBSD where the undef'd macros _do_ get picked up later on in a compilation unit (through which include, I don't know), and thus shadow the Common::swap* functions.
2018-02-26 00:07:05 +02:00
Stenzek aaea515d71 GLUtil: Drop now-unused attributeless VAO helpers 2018-02-22 19:09:28 +10:00
degasus a5a0599145 CustomTexture: Drop old texture format. 2018-01-20 17:08:47 +01:00
34will 86a787bdf9 Modified StringUtil to change UTF16ToUTF8 to use a wstring_convert and codecvt_utf8<wchar_t> to convert a UTF16 wstring to a UTF8 string. 2018-01-11 21:49:25 +00:00
34will a949e98d9b Modified UTF16BEUTF8 to just convert the UTF-16 C-string into a std::u16string, and pass it into CodeToUTF8 with the 'from' parameter being "UTF-16BE", rather than manually performing the big endian to little endian encoding. 2018-01-11 19:51:19 +00:00
34will ba111959fa Modified StringUtil to use a u16string instead of a wstring in the non-win32 UTF16BEToUTR8 method. 2018-01-11 02:45:27 +00:00
Vlad Firoiu 45ac9b678d Require WINDOW_BIT if we have a window handle. 2017-12-29 23:20:16 -05:00
Vlad Firoiu eb59267196 Surfaceless egl rendering. 2017-12-29 19:35:43 -05:00
JosJuice b3b7aef09a Android: Extract Sys to a different folder than the User folder 2017-12-26 09:53:32 +01:00
JosJuice d1c1793a34 Don't expose SYSDATA_DIR in a header 2017-12-24 17:13:04 +01:00
Markus Wick 0bf24f549a
Merge pull request #6190 from JosJuice/is-trivially-copyable-vs
Remove IsTriviallyCopyable hack for VS
2017-12-19 11:15:58 +01:00
JosJuice bd5da5cfd6 Handle both the XSI and GNU versions of strerror_r
Trying to force the XSI version by undefining _GNU_SOURCE can lead
to compilation errors on some systems because of headers expecting
that _GNU_SOURCE is defined.

This commit uses define checks to detect which version we have.
I tried making an overloaded function (int and const char*) instead,
but that led to a warning about one of the variants being unused.
2017-12-18 22:09:02 +01:00
Jonathan Hamilton 8ae76a6680 Fix arm64 MOVI2R for addresses between 2gb and 4gb offset from PC
The PC offset ADRP() path takes a s32 value, but the input offset was
being tested as abs(ptr) < 0xFFFFFFFF. This caused values between
0x80000000 and 0xFFFFFFFF to incorrectly use this path, despite the
offsets not being representable in an s32.

This caused a crash in the VertexLoader on android 8.1 immediate in wind
waker (and possibly all other apps on android 8.1) as the jit and data
sections happened to be loaded 4gb apart in virtual memory, causing some
pointers to hit this
2017-12-09 13:21:58 -08:00
Leo Lam 1a9d6b99e9
Merge pull request #6237 from lioncash/gekko-disasm
GekkoDisassembler: Correct disassembly of fabs, fnabs, and fneg
2017-12-08 22:50:40 +01:00
Pierre Bourdon 8a830074b6
Merge pull request #6220 from leoetlino/utf8
WX: Fix argument parsing
2017-12-07 15:16:39 +01:00
JosJuice 9d8a82e1d9 Don't use wrong encoding for paths when opening streams on Windows 2017-12-05 21:23:35 +01:00
Lioncash de82330a74 GekkoDisassembler: Correct disassembly of fabs, fnabs, and fneg
These three instructions use the B field (bits 16-20 of the opcode)
to determine what the operand register is. However, the code was
using the path that uses the C field (bits 21-25).

This amends the code to use the B field (and also fixes the 64-bit PPC
opcodes, because why not?).

Fixes issue 10683.
2017-12-04 00:02:35 -05:00
Léo Lam 05c8d229af Config: Handle unknown system strings better
Currently, a simple typo in the system name will trigger an assert
message that complains about a "programming error". This is not
user friendly and misleading.

So this changes GetSystemFromName to return an std::optional, which
allows for callers to check whether the system exists and handle
failures better.
2017-11-26 18:24:01 +01:00
Stenzek f43d85921d VideoBackends: Add AbstractStagingTexture class
Can be used for asynchronous readback or upload of textures.
2017-11-22 18:47:04 +10:00
JosJuice b8c83dd5f3
Merge pull request #5973 from ligfx/renamefifoqueue
Rename Common::FifoQueue to Common::SPSCQueue
2017-11-19 13:51:22 +01:00
MerryMage 37419b9a57 Config/Layer: Allow all keys of a section to be iterated over 2017-11-15 18:04:40 +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 e331a76176 ConfigInfo: Switch to doing case-insensitive comparison 2017-11-15 18:04:40 +00:00
MerryMage ec7b84c5f2 Config: Extract ConfigInfo into own header 2017-11-15 18:04:40 +00:00
MerryMage c8f970e2b0 Config: Remove recursive layer 2017-11-15 18:04:40 +00:00
JosJuice 72b7b96571 Remove IsTriviallyCopyable hack for VS 2017-11-13 19:51:16 +01:00
JosJuice 983b986303 Don't delete BitField copy assignment operator on VS 2017-11-13 19:51:11 +01:00
JosJuice 2c10ba9be1 Simplify StringUtil::UTF16ToUTF8 2017-11-11 20:30:06 +01:00
JosJuice 65c1df094f Remove unneeded check in StringUtil::UTF16ToUTF8
No code is relying on this unexplained null byte check, since
the only code that calls UTF16ToUTF8 on non-Windows systems
is UTF16BEToUTF8, which explicitly strips null bytes.
2017-11-11 20:30:06 +01:00
Greg Wicks c2dcb97d06 Android: Fix NDK r16b2 build 2017-11-07 11:02:27 -05:00
JosJuice 6902bbb696 When NAND is damaged, show title names from save files
The earlier code always tried to use TitleDatabase for getting
title names, but that didn't work for disc-based games, because
there was no way to get the maker ID.
2017-11-03 23:17:36 +01:00
JosJuice 5a6d90900e Add WiiSaveBanner class
This class is similar to the BannerLoaderWii class that was
removed in ee694e32.
2017-11-03 23:00:43 +01:00
Léo Lam 28d648b802 MemArena: Use names that are based on the PID
Fixes a regression which broke running several Dolphin instances at the
same time on Windows. Thanks to exjam for spotting the issue
pretty much immediately. Sorry about that!

Also changes the file names to be more consistent on all platforms.
2017-10-11 17:40:05 +02:00
Dane Z. Bush 4dfe6c0875 MemArena: Name shared memory handle
Assign a name to the CreateFileMapping handle on Win32 so third party
applications can read from Dolphin's memory and integrate with the
current emulation.

Built and tested, multiple sessions are still possible without
collisions.
2017-10-11 16:35:32 +02:00
Sepalani f65dcdcdca DebugInterface: Rename InsertBLR to Patch 2017-10-05 20:22:16 +02:00
Pierre Bourdon 43f067c6e1 StringUtil: support TryParse(u16*) 2017-09-18 05:04:11 +02:00
JosJuice 38304da947 DiscIO: Use Common::Lazy for loading filesystems
This simplifies FileMonitor a lot and also lets us
clean up FilesystemPanel.
2017-09-15 18:57:05 +02:00
Stenzek 4d36f0cc87 Bitfield: Cast value to storage type in assignment operator
This allows us to use enum classes in bitfields.
2017-09-11 19:40:25 +10:00
Léo Lam 8cd8e9d905 JIT: Don't always look up symbols for blocks
With tons of symbols, this results in noticeable stuttering, so
skip lookups if the perf dir option isn't set anyway.
2017-09-10 11:42:12 +02:00
Lioncash 696e1b40b5 Common: Move version strings to their own header
Ideally Common.h wouldn't be a header in the Common library, and instead be renamed to something else, like PlatformCompatibility.h or something, but even then, there's still some things in the header that don't really fall under that label

This moves the version strings out to their own version header that doesn't dump a bunch of other unrelated things into scope, like what Common.h was doing.

This also places them into the Common namespace, as opposed to letting them sit in the global namespace.
2017-09-09 19:28:10 -04:00
degasus 304e601ad3 JitArm64: Reimplement aarch64 cycle counters.
CNTVCT_EL0 is force-enabled on all linux plattforms.
Windows is untested, but as this is the best way to get *any* low
overhead performance counters, they likely use it as well.
2017-09-02 13:24:37 +02:00
JosJuice 87d982982d Fix regression in File::CopyDir
This apparently fixes https://bugs.dolphin-emu.org/issues/10499 somehow.

The first changed line of this commit is just for performance - the
second changed line is where the difference in behavior is.
2017-08-25 19:14:14 +02:00
Michael M b58f8d19ab Rename Common::FifoQueue to Common::SPSCQueue
Since all queues are FIFO data structures, the name wasn't informative
as to why you'd use it over a normal queue. I originally thought it had
something to do with the hardware graphics FIFO.

This renames it using the common acronym SPSC, which stands for
single-producer single-consumer, and is most commonly used to talk about
lock-free data structures, both of which this is.
2017-08-23 17:00:52 -07:00
Anthony 935c1da357 Merge pull request #5951 from ligfx/gametrackerworkqueuethread
GameTracker: use new Common::WorkQueueThread instead of signals/slots
2017-08-23 08:02:36 -07:00
Pierre Bourdon a641609857 WFSI: Implement patch install finalization. 2017-08-22 23:41:37 +02:00
Leo Lam 6e1cdfadc9 Merge pull request #5955 from leoetlino/copy
FileUtil: Simplify File::Copy on non-Windows platforms
2017-08-22 21:29:46 +02:00
Markus Wick 3094d6531d Merge pull request #5962 from degasus/arm-fixes
JitArm64: Fix rlwinmx.
2017-08-22 20:27:45 +02:00
JosJuice 09f3f9b41a Remove NonCopyable
The class NonCopyable is, like the name says, supposed to disallow
copying. But should it allow moving?

For a long time, NonCopyable used to not allow moving. (It declared
a deleted copy constructor and assigment operator without declaring
a move constructor and assignment operator, making the compiler
implicitly delete the move constructor and assignment operator.)
That's fine if the classes that inherit from NonCopyable don't need
to be movable or if writing the move constructor and assignment
operator by hand is fine, but that's not the case for all classes,
as I discovered when I was working on the DirectoryBlob PR.

Because of that, I decided to make NonCopyable movable in c7602cc,
allowing me to use NonCopyable in DirectoryBlob.h. That was however
an unfortunate decision, because some of the classes that inherit
from NonCopyable have incorrect behavior when moved by default-
generated move constructors and assignment operators, and do not
explicitly delete the move constructors and assignment operators,
relying on NonCopyable being non-movable.

So what can we do about this? There are four solutions that I can
think of:

1. Make NonCopyable non-movable and tell DirectoryBlob to suck it.

2. Keep allowing moving NonCopyable, and expect that classes that
   don't support moving will delete the move constructor and
   assignment operator manually. Not only is this inconsistent
   (having classes disallow copying one way and disallow moving
   another way), but deleting the move constructor and assignment
   operator manually is too easy to forget compared to how tricky
   the resulting problems are.

3. Have one "MovableNonCopyable" and one "NonMovableNonCopyable".
   It works, but it feels rather silly...

4. Don't have a NonCopyable class at all. Considering that deleting
   the copy constructor and assignment operator only takes two lines
   of code, I don't see much of a reason to keep NonCopyable. I
   suppose that there was more of a point in having NonCopyable back
   in the pre-C++11 days, when it wasn't possible to use "= delete".

I decided to go with the fourth one (like the commit title says).
The implementation of the commit is fairly straight-forward, though
I would like to point out that I skipped adding "= delete" lines
for classes whose only reason for being uncopyable is that they
contain uncopyable classes like File::IOFile and std::unique_ptr,
because the compiler makes such classes uncopyable automatically.
2017-08-22 16:40:34 +02:00
degasus b00c60618b JitArm64: Fix rlwinmx.
Seems like I was wrong that ANDI2R doesn't require a temporary register here.
There is *one* case when the mask won't fit in the ARM AND instruction:
mask = 0xFFFFFFFF
But let's just use MOV instead of AND here for this case...
2017-08-22 08:47:43 +02:00
Léo Lam 6f923ffae4 FileUtil: Simplify File::Copy on non-Windows platforms
The old way of doing it is error prone and unnecessarily complex.
2017-08-21 18:31:46 +02:00
Pierre Bourdon 873521ce0b Revert "Try to fix File::Copy with non-1024-byte aligned sizes" 2017-08-21 18:29:58 +02:00
Markus Wick 8280d15357 Merge pull request #5939 from JonnyH/WIP/broken-fstream-copy
Try to fix File::Copy with non-1024-byte aligned sizes
2017-08-21 17:01:16 +02:00
Lioncash 7a5577498b CommonTypes: Qualify standard integral types in typedefs with std::
Given a relatively recent proposal (P0657R0), which calls for deprecation of putting stuff into the global namespace when using C++ headers, this just futureproofs our code a little more.

Technically this is what we should have been doing initially, since an
implementation is allowed to not provide these types in the global
namespace and still be compliant.
2017-08-20 19:34:52 -04:00
Leo Lam 08004d409e Merge pull request #5937 from ligfx/miniupnpccmake
CMake: use miniupnpc target instead of global vars
2017-08-20 23:44:06 +02:00
Michael M 8c13e0230c GameTracker: use WorkQueueThread 2017-08-20 14:40:56 -07:00
Michael M de9378bf63 Common: add WorkQueueThread 2017-08-20 14:40:56 -07:00
Sepalani 4e5fe6366a CommonFuncs: LastStrerrorString added 2017-08-18 20:08:50 +01:00
Jonathan Hamilton 643b3ba9f8 Try to fix File::Copy with non-1024-byte aligned sizes
ifstream::read() sets the failbit if trying to read over the end, which
means that (!input) would be hit for the 'last' block if it wasn't
exactly BSIZE (1024) bytes.
2017-08-17 14:08:56 -07:00
Michael M fc306faad8 CMake: use miniupnpc target instead of global vars 2017-08-17 13:15:02 -07:00
Léo Lam 4b4e488189 WFS: Use a separate log type for WFS related logs
Makes it easier to turn off general IOS messages that can be
distracting (e.g. /dev/net/ssl being opened hundreds of time...)
without losing the ability to view WFS messages.
2017-08-16 22:27:29 +02: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
Leo Lam 70931f460d Merge pull request #5929 from JonnyH/PR/fix-oprofile-build-linked-as-needed
Fix OPROFILE linux build with -Wl,--as-needed
2017-08-17 03:06:59 +08:00
Sepalani 93b5a5369b SymbolDB: Blank stripped symbol name fixed 2017-08-16 04:07:19 +01:00
Pierre Bourdon 9b79e0ac72 Merge pull request #5930 from delroth/wfs
Fix Dragon Quest X offline mode on Dolphin
2017-08-15 22:40:56 +02:00
Pierre Bourdon f810f1edb2 WFS/NAND: Better handle GID. 2017-08-15 22:29:10 +02: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 1ade08c607 Fix two small lint errors 2017-08-13 19:06:10 -07:00
Michael M 8702ffccc3 UPnP: use value-initialization instead of std::memset 2017-08-13 18:50:53 -07:00
Michael M 0e51082bbb UPnP: move variable declaration to where it's used 2017-08-13 18:50:52 -07:00
Michael M 7ce9f1f984 UPnP: remove unneeded vector in InitUPnP() 2017-08-13 18:50:52 -07:00
Michael M a09f8744b9 UPnP: cleanup variable name desc_xml 2017-08-13 18:50:52 -07:00
Michael M ff1d1a7a4d UPnP: use std::to_string 2017-08-13 18:50:52 -07:00
Michael M 862e0bec79 UPnP: cleanup function names 2017-08-13 18:50:52 -07:00
Michael M 281f90efc3 UPnP: coalesce s_our_ip and cIP 2017-08-13 18:50:51 -07:00
Michael M 106ae9636e UPnP: cleanup variable names 2017-08-13 18:50:51 -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
Markus Wick d78009877b JitArm64: Fix LSL/LSR/ROR/ASR wrappers.
The other method has a latency of 2 cycles. This also improves the
throughput a lot.
2017-08-12 00:00:41 +02:00
Léo Lam 940cc843ed Config: Fix Movie config loading/saving
* Add missing Language setting loading/saving. This was added after the
  original OnionConfig PR, which is why support for it was missing.

* Change MovieConfigLoader to reuse ConfigInfos. Less duplication.

* Extract MovieConfigLoader::Save into SaveToDTM. The DTM should use
  the current config and not just the movie layer. This makes more
  sense than just saving the movie layer, which may not always exist,
  and also fixes a crash that would happen when creating a new
  recording because the movie layer wouldn't exist in that case.

  (Plus, having to get the loader from the layer and call ChangeDTM
  on it manually is not very pretty.)
2017-08-11 15:36:32 +08:00
Léo Lam b2c41cec0a Config: Include SYSCONF in base layer
Settings that come from the SYSCONF are now included in Dolphin's
config system as part of the base layer. They are handled in a
special way compared to other settings to make sure they are only
loaded from and saved to the SYSCONF (to avoid different, possibly
contradicting sources of truth).
2017-08-11 15:36:31 +08:00
Léo Lam c900e77ac5 Config: Add Get/Set on Layer
For convenience, when getting/setting from ConfigInfos.
2017-08-11 15:28:11 +08:00
Michael M 6faacbeea5 TraversalClient: make FailureReason an enum class 2017-08-08 15:29:56 -07:00
Léo Lam 58b7350562 SettingsHandler: Fix generated serial numbers
Must be 9 characters at most; otherwise the serial number will be
rejected by SDK libraries, as there is a check to ensure the string
length is strictly lower than 10.
2017-08-08 23:25:40 +08:00
Lioncash f0308151a8 File: Make GetSize() a const member function 2017-08-06 07:57:43 -04:00
Anthony 3c5112bb21 Merge pull request #5856 from stenzek/optimus-crash
Fix ubershader crashes with primus/bumblebee
2017-08-05 00:54:28 -07:00
Leo Lam f274bbcbe1 Merge pull request #5872 from ligfx/wxnetplayonionconfig
WX: make Netplay use new-style config
2017-08-04 10:07:05 +08:00
Michael M 737651f298 MsgHandler: small cleanup 2017-08-03 13:29:59 -07:00
Michael M 7d509a7a94 Config/Section: support u16 values 2017-08-03 13:16:16 -07:00
Markus Wick 9649494f67 Merge pull request #5827 from JonnyH/WIP/fix-glMultiDrawElementsBaseVertex-invalid-OES-suffix
Fix an incorrect OES suffix on glMultiDrawElementsBaseVertex
2017-08-03 18:45:32 +02:00
Stenzek 287859c5e1 GLInterface: Support surfaceless contexts on GLX 2017-08-02 20:12:28 +10:00
Leo Lam 02e80af104 Merge pull request #5863 from MerryMage/oop
Config: Missed a line in #5770
2017-08-02 11:56:31 +08:00
JosJuice b0ee8bd0a0 NonCopyable: Allow moving
NonCopyable is only supposed to prevent classes from being copied,
not make it hard for classes to be moveable.
2017-08-01 20:50:11 +02:00
MerryMage 31ec3e2501 Config: Missed a line in #5770 2017-08-01 18:07:53 +01:00
Leo Lam 764c93f932 Merge pull request #5683 from JosJuice/volume-wii-defer
VolumeWii: Defer loading tickets, TMDs and keys until when needed
2017-08-01 17:11:30 +08:00
Stenzek d18988f41e GLExtensions: Add GL_ARB_texture_compression_bptc 2017-08-01 11:58:57 +10:00
Léo Lam f5fd183571 Config: Fix the loader Load() being called twice
The Config::AddLoadLayer functions call Load on the layer
explicitly, but Load is already called in the constructor,
so they'd cause the loader's Load function to be called twice,
which is potentially expensive considering we have to read an INI
from the host filesystem.

This commit removes the Config::AddLoadLayer functions because
they don't appear to be necessary.
2017-07-31 22:32:05 +08:00
Leo Lam ed331918f0 Merge pull request #5851 from leoetlino/sysconf-fix
SysConf: Fix writing a new SYSCONF
2017-07-31 16:45:06 +08:00
Leo Lam ca49de80c5 Merge pull request #5826 from JonnyH/WIP/add-option-to-prefer-GLES-when-using-EGL
Add "PreferGLES" option to EGL GLInterface
2017-07-31 16:43:38 +08:00
Léo Lam b5e7c417ff SysConf: Fix writing a new SYSCONF
On Windows, File::GetTempFilenameForAtomicWrite returns a path
somewhere in C:\Users\XXX\AppData\Local\Temp\{UUID here}\
in which all writes just fail.

Just use the SYSCONF path + ".tmp" for the temporary file name.
2017-07-31 15:18:43 +08:00
Lioncash f6c21e002b General: Remove unnecessary semicolons 2017-07-30 16:39:53 -04:00
Lioncash b3c1bff34b SysConf: Add explicit to single-argument constructor
Prevents implicit construction from FromWhichRoot values.
2017-07-30 15:35:16 -04:00
Stenzek 447aeb8f77 EGLInterface: Create shared context with same attributes as main context 2017-07-30 12:38:50 +10:00
Stenzek 416afa065c BitField: Add StartBit() and NumBits() accessors 2017-07-30 12:38:49 +10:00
Stenzek 3e508fc0a2 GLInterface: Support shared contexts on AGL 2017-07-30 12:38:49 +10:00
Ryan Houdek 01ae02482c GLInterface: Support shared contexts in GLX 2017-07-30 12:38:49 +10:00
ligfx 2f932273bb LogManager: remove stand-alone semicolon
My bad!
2017-07-27 21:15:05 -07:00
Anthony 6fe33f844f Merge pull request #5770 from ligfx/lognewconfig
LogManager: use layered config
2017-07-27 11:58:57 -07:00
Jonathan Hamilton 0fbd0cab6a Add "PreferGLES" option to EGL GLInterface
This makes the EGL interface select OpenGL|ES contexts over "desktop"
OpenGL ones.

Possibly not useful for anyone outside my own debugging, but you never
know
2017-07-26 19:26:36 -07:00
Jonathan Hamilton 184e4d7b4a Fix an incorrect OES suffix on glMultiDrawElementsBaseVertex
The spec says it should have an EXT not OES suffix, as it's enabled as
an interaction with GL_EXT_multi_draw_arrays.

On some drivers GetProcAddress() returns NULL, which causes the
GLExtensions init to fail

This 'happened' to work if GetProcAddress() doesn't return NULL on missing
functions (as allowed in EGL) - as the function appears to never be called so
this would not have been noticed.

Mesa also (incorrectly?) exports the EXT version, so this would all
happen to work there, but appears to be contrary to the spec.

This invalid prefix even ended up in the upstream khronos registry, the
issue was reported here:
https://github.com/KhronosGroup/OpenGL-Registry/issues/81
2017-07-25 12:52:39 -07:00
Léo Lam c759739ee9 SysConf: Handle array entries properly
It turns out that the last byte of array entries isn't unused (as we
thought); instead, it looks like it's actually part of the main data,
and the length stored next to the name is in fact the length minus one.

Getting it wrong and always storing a null byte in there won't affect
most entries (since the last byte is zeroed most of the time), except:

- IPL.NIK: the length is stored in the last byte, and it must be kept.
- BT.DINF: u8 unknown[0x45] should be another Bluetooth device entry.
- Possibly other unknown affected entries.
2017-07-23 15:57:29 +08:00
Lioncash 5859914da5 TraversalClient: Fix memory leaks in ReleaseTraversalClient()
release() relinquishes ownership of a pointer, it doesn't actually free
it.
2017-07-22 18:19:25 -04:00
Leo Lam b6c3479bb4 Merge pull request #5720 from JosJuice/file-metadata
FileUtil: Redesign Exists/IsDirectory/GetSize
2017-07-11 00:28:34 +02:00
Michael Maltese 28d6c61e34 LogManager: use layered config 2017-07-09 16:28:54 -07:00
Michael Maltese e6c4455e65 remove commented-out FileLogListener::GetName 2017-07-09 16:28:54 -07:00
Michael Maltese 8b54ac225b Merge Core/Config/Config.h into Common/Config/Config.h
Allows code in Common to take advantage of the layered config logic.
2017-07-09 16:28:54 -07:00
Michael Maltese c9e8289e82 LogManager: add SaveSettings 2017-07-07 16:44:38 -07:00
Michael Maltese 8ff8dfcdf2 LogManager: make LogContainer a POD and don't allocate 2017-07-07 16:44:38 -07:00
Michael Maltese 18da6dee8e LogManager: remove per-container listeners 2017-07-07 16:44:38 -07:00
Michael Maltese 546fa628fb LogManager: remove per-container verbosities 2017-07-07 16:44:38 -07:00
Michael Maltese 26aa9f88a4 LogManager: clean up header 2017-07-07 16:44:38 -07:00
Leo Lam c941cd6aa9 Merge pull request #5753 from ZirconiumX/master
Explain what Yes/No means in an assert window
2017-07-07 16:56:21 +02:00
Jules Blok f3508742ac OGL: Support Quad-Buffered stereoscopy. 2017-07-05 22:43:39 +02:00
Dan Ravensloft 982663c728 Explain what Yes/No means in an assert window
It's a bit confusing to get a yes/no dialogue box without any indication
of what yes or no will do in this situation, so add a short explanatory
sentence.
2017-07-05 20:00:52 +00:00
Léo Lam 90f8265497 Replace StringFromInt with std::to_string
Updated version of #47. Android should support to_string now that
we use a modern version of libc++ when building.
2017-07-05 13:49:33 +02:00
JosJuice 2c7e93f3b8 Common: Add a Lazy type 2017-07-04 20:58:03 +02:00
JosJuice 5ca3aee00a FileUtil: Add a class for Exists/IsDirectory/GetSize
Some code was calling more than one of these functions in a row
(in particular, FileUtil.cpp itself did it a lot...), which is
a waste since it's possible to call stat a single time and then
read all three values from the stat struct. This commit adds a
File::FileInfo class that calls stat once on construction and
then lets Exists/IsDirectory/GetSize be executed very quickly.

The performance improvement mostly matters for functions that
can be handling a lot of files, such as File::ScanDirectoryTree.

I've also done some cleanup in code that uses these functions.
For instance, some code had checks like !Exists() || !IsDirectory(),
which is functionally equivalent to !IsDirectory(), and some
code was using File::GetSize even though there was an IOFile
object that the code could call GetSize on.
2017-06-29 19:07:29 +02:00
JosJuice 98b0d8a119 Fix DoFileSearch for non-ASCII extensions on Windows
We don't use non-ASCII extensions for anything right now,
but we might as well fix this.
2017-06-28 09:50:02 +02:00
JosJuice 6f98915c32 Fix DoFileSearch for non-ASCII paths on Windows
It didn't work when there were non-ASCII characters
in the directories argument, but it worked fine with
non-ASCII characters in names of found files and folders.
2017-06-28 09:48:28 +02:00
shuffle2 951f6400fb Merge pull request #5706 from JosJuice/more-gamelist-speedup-followup
More follow-up for the gamelist speedup PR
2017-06-27 12:36:16 -07:00
JosJuice a6471234a2 FileSearch: Use strcasecmp in non-std code
Because why should only Windows get in on the FileSearch speedup fun?
(Not that this fixes the slowness of File::ScanDirectoryTree...)
2017-06-27 21:32:07 +02:00
shuffle2 d19e1ed4bf Merge pull request #5705 from JosJuice/strerror-r-version
Try to make sure that we have the XSI version of strerror_r
2017-06-27 11:49:26 -07:00
shuffle2 2579a7c03d Merge pull request #5607 from leoetlino/logging-fix
Logging fixes
2017-06-27 11:40:26 -07:00
JosJuice 5b7f99e57a Try to make sure that we have the XSI version of strerror_r 2017-06-27 11:59:39 +02:00
Michael Maltese 033492717c BlockingLoop: fix unhandled enum value warning
Fixes compiler warning:

```
Source/Core/Common/BlockingLoop.h:212:13: warning: enumeration value 'kNonBlock' not handled in switch [-Wswitch]
    switch (mode)
            ^
```
2017-06-26 23:34:33 -07:00
Leo Lam 0ace7fd8f3 Merge pull request #5694 from leoetlino/dolphin-drm
Refuse to launch the shop with default credentials
2017-06-26 21:31:32 +02:00
shuffle2 02690d5d7c Merge pull request #5693 from JosJuice/filesearch-minor-changes
FileSearch: Minor changes
2017-06-26 11:44:44 -07:00
Léo Lam 60c6fbe9cc Add CommonTitles.h for common Wii title IDs 2017-06-26 15:17:55 +02:00
JosJuice 1fc5eae5bd FileSearch: Add a static_assert for the preferred separator 2017-06-26 11:50:10 +02:00
JosJuice 382356627a FileSearch: Check isDirectory in the non-Windows code
c5fa470 made the extension check discard directories, but
only in the new code that currently only is used on Windows.
Let's add an equivalent check in the old code so that the
behavior is consistent across platforms.
2017-06-26 11:44:23 +02:00
Markus Wick 99b1735424 Merge pull request #5660 from shuffle2/unblock-blockingloop
Change "blocking" BlockingLoop::Stop to give up and die after a timeout.
2017-06-26 10:23:21 +02:00
Shawn Hoffman ed8f293b4f Change "blocking" BlockingLoop::Stop to give up and die after a timeout.
This fixes the global-static fifo object causing infinite hangs in some
cases. Notably, failure to initialize a graphics backend would result in
BlockingLoop::Prepare being called but never executing Run(), leaving the
object in a bad state.
2017-06-25 20:47:30 -07:00
Shawn Hoffman 1634f0cf5e Use CompareStringOrdinal in DoFileSearch instead of _wcsicmp 2017-06-25 16:47:46 -07:00
JosJuice be162a3316 FileSearch: Remove unnecessary function 2017-06-25 13:21:25 +02:00
shuffle2 991062093b Merge pull request #5682 from MerryMage/SCMRevGen
SCMRevGen: Use DisableFastUpToDateCheck
2017-06-24 10:44:53 -07:00
MerryMage 11a03e7dd2 SCMRevGen: Use DisableFastUpToDateCheck 2017-06-24 17:34:21 +01:00
Tillmann Karras c8255092d7 Fix warnings 2017-06-24 01:41:58 +01:00
Shawn Hoffman c5fa470ad8 replace DoFileSearch with optimized version 2017-06-23 17:25:53 -07:00
Shawn Hoffman f16599f4a8 DolphinWX: defer gamelist scanning and switch to single-file cache. 2017-06-23 17:25:53 -07:00
Niels Boehm df82adca43 Add function testing whether a bitmask is valid.
This one verifies bitmasks where low bits are set to 1 (hence the name).
Any stray 0 among the lower ones or any stray 1 among the higher zeros
renders the mask invalid.

The edge cases of all zeros and all ones are considered valid masks.

It uses an efficient implementation. It's the counterpart of
https://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
2017-06-22 20:22:53 +02:00
Léo Lam 29e8988c90 Analytics: Set the timeout to 5 seconds
3 seconds is sometimes not enough.
2017-06-18 23:16:03 +02:00
Leo Lam 9a1503a75c Merge pull request #5642 from lioncash/chrono
HttpRequest: Use std::chrono for indicating time periods
2017-06-18 23:13:52 +02:00
Léo Lam 7222ce78ff SysConf: Don't set "config done" flags by default
This allows the user to go through the Wii Menu first boot setup
screen when they launch the System Menu for the first time.

Most useful on a clean profile, after doing a full system update,
to configure settings like the console country.
2017-06-18 22:32:56 +02:00
Lioncash 251de89b5c HttpRequest: Use std::chrono for indicating time periods
Allows the use of chrono time points, on top of being more indicative of
time periods used at call sites, if custom timeouts are specified.
2017-06-18 15:48:37 -04:00
Léo Lam d86f020e81 Rewrite SysConf handling
This rewrites the SysConf code for several reasons:

* Modernising the SysConf class. The naming was entirely cleaned up.
  constexpr for constants.

* Exposing less stuff in the header.

* Probably less efficient parsing and writing logic, but much simpler
  to understand and use in my opinion. No more hardcoded offsets.
  No more duplicated code for the initial SYSCONF generation.

* More flexibility. It is now possible to add and remove entries,
  since we rebuild the file. This allows us to stop spamming
  "section not found" panic alerts; we can now use and insert
  default entries.
2017-06-18 16:17:05 +02:00
Léo Lam dd8dcdf880 LogManager: Check if listener is valid before using it 2017-06-17 10:39:06 +02:00
Léo Lam a2ad3e14d0 Logging: Remove duplicated code 2017-06-17 10:20:30 +02:00
Léo Lam 100c433261 Logging: Move verbosity setting code to LogManager
No clue why it was in DolphinWX.
2017-06-17 10:20:30 +02:00
Sepalani b359d82890 File/IOFile: Check _tfopen_s properly 2017-06-17 02:16:58 +01:00
Léo Lam 01faa5c852 FileUtil: Use errno for printing errors in IsDirectory
stat() returns an error code in errno on both POSIX compliant
platforms and Windows.

This means we should always use errno instead of GetLastErrorMsg
which uses GetLastError() (Win32) on Windows.
2017-06-16 12:43:41 +02:00
Léo Lam aa63199977 FileUtil: Don't manually strip trailing slashes
POSIX allows one or more trailing slashes for directories.

From POSIX.1-2008, section 3.271 (Base Definitions / Pathname):

> A pathname can optionally contain one or more trailing <slash>
> characters. Multiple successive <slash> characters are considered to
> be the same as one <slash>, except for the case of exactly two
> leading <slash> characters.

On Windows, the extra trailing slashes are ignored for directories too.
2017-06-16 12:31:26 +02:00
Shawn Hoffman f469d86467 cmake/win32: add CompatPatches 2017-06-15 21:26:40 -07:00
Shawn Hoffman 1210c74955 [windows]: Apply compatibility patches to problematic gamepad vibration drivers.
Move ucrtFreadWorkaround to use the new LdrWatcher.
2017-06-15 21:21:01 -07:00
Leo Lam 8f460a1cda Merge pull request #5611 from JosJuice/reorganize-file-namespace
Reorganize File namespace
2017-06-15 23:28:36 +02:00
JosJuice cf94ce6305 Add a namespace to OpenFStream
For consistency with the other functions in FileUtil.h.
2017-06-15 21:34:04 +02:00
JosJuice f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
Léo Lam 0d58a0bfe2 HttpRequest: Add support for custom timeouts 2017-06-13 19:17:11 +02:00
Léo Lam ba3f16edbf HttpRequest: Add support for sending custom headers 2017-06-13 12:52:31 +02:00
Léo Lam 8f87433719 HttpRequest: Log response body on failure 2017-06-13 12:52:31 +02:00
Léo Lam 18678afa6d Common: Add HttpRequest to simplify HTTP requests
Too much boilerplate that is duplicated if we use curl directly.
Let's add a simple wrapper class that hides the implementation details
and just allows to simply make HTTP requests and get responses.
2017-06-13 12:52:31 +02:00
Léo Lam 17ef4c8046 StringUtil: Make SplitString return by value
Simpler usage.
2017-06-11 16:48:20 +02:00
MerryMage 33879bf611 Config: Remove creation of unnecessary CommandLine layer 2017-06-10 19:07:17 +01:00
Shawn Hoffman f206a4ea9c remove MemUsage, and therefor psapi dependency 2017-06-08 22:25:46 -07:00
Shawn Hoffman fd166032ab msbuild: obey some warnings about missing virtual destructors 2017-06-07 20:20:25 -07:00
Shawn Hoffman 9357cee2ef do not assign in conditional statements 2017-06-07 20:09:44 -07:00
Shawn Hoffman e1a3e41bf3 fix various instances of -1 being assigned to unsigned types 2017-06-07 19:52:07 -07:00
Shawn Hoffman f7f1d5d2ca msvc: disable meaningless constant truncation warnings in SDCardUtil 2017-06-07 18:44:03 -07:00
Shawn Hoffman 4f9dd7277b msvc: disable unused symbol warning in Core/Common/Crypto/ec.cpp 2017-06-07 18:44:03 -07:00
JosJuice b2af07a7b7 DiscIO: Remove C/I/S prefixes from class names
These prefixes were inconsistent with the rest of Dolphin.

I'm also renaming VolumeWiiCrypted to VolumeWii because of 1113b13.
2017-06-06 12:31:59 +02:00
shuffle2 442e614021 Merge pull request #5536 from sepalani/getstring
HLE: Prevent GetStringVA to strip newlines
2017-06-05 21:31:09 -07:00
shuffle2 c8166951a0 Merge pull request #5418 from MerryMage/config-again-and-again
VideoConfig: Port to layered configuration system
2017-06-05 21:11:04 -07:00
Sepalani f28f23af1d StringUtil: StringPopBackIf added 2017-06-06 05:08:51 +01:00
shuffle2 192fec50b9 Merge pull request #5276 from ligfx/macosheadless
Add headless support on macOS
2017-06-05 20:49:02 -07:00
Léo Lam d9fd056803 Fix minor formatting issues
These were not caught by the lint script while it was broken.
2017-06-05 02:32:19 +02:00
Shawn Hoffman 397720a9fe might as well update yet some more pointless version numbers.. 2017-06-03 18:20:40 -07:00
MerryMage 1e766ab490 Config: Add layers CommandLine and CurrentRun 2017-06-03 18:11:57 +01:00
MerryMage 1548a15c68 Config: Implement Get and Set 2017-06-03 18:11:56 +01:00
MerryMage 6151bc1714 Config: Extract layer search order to header 2017-06-03 18:11:56 +01:00
Léo Lam 74f636dfc4 Analytics: Don't crash when a DNS resolve times out 2017-06-03 14:09:14 +02:00
Léo Lam e38a66fe1b Common: Add a std::variant implementation
Based on https://github.com/mpark/variant (which is based on libc++).
2017-06-03 12:36:24 +02:00
Léo Lam b08653d69d Common: Add a std::optional implementation
std::optional makes a few things a bit neater and less error prone.
However, we still cannot use C++17 (unfortunately), so this commit
adds an implementation of std::optional that we can use right now.

Based on https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/lib/gtl/optional.h
which seems to be fairly similar to C++17's <optional> and standards
compliant. It's one of the few implementations that handle propagating
type traits like copy constructibility, just like libc++/libstdc++.
2017-06-03 12:36:24 +02:00
shuffle2 3443454ba2 Merge pull request #5271 from JosJuice/allow-aslr
Allow (but don't force) ASLR
2017-06-02 21:53:02 -07:00
BhaaL 072c161445 upgrade to Windows SDK 10.0.15063.0
this is required for /permissive- to work, because some headers in the
Windows SDK use Microsoft extensions that are not allowed in standards mode
2017-05-28 13:37:31 +02:00
Michael Maltese d416cbd9ed Add CubebUtils namespace and hook up cubeb logging 2017-05-27 18:28:57 -07:00
Pierre Bourdon d592bdd4d4 Migrate to Visual Studio 2017.
Auto-generated by the IDE, I'll trust it knows what it's doing.
2017-05-25 15:58:59 -07:00
JosJuice 89e60a41eb MemoryUtil: 0 -> nullptr 2017-05-20 09:35:53 +02:00
JosJuice 4b4cf509f8 Remove code for only allocating low memory
This is unnecessary when we have position-independent code.
2017-05-20 09:35:53 +02:00
Léo Lam f96ab66d31 Drop remnants of the plugin system 2017-05-19 19:13:16 +02:00
MerryMage bd3e493695 Section: Fix Section::Get 2017-05-13 15:22:29 +01:00
Léo Lam 6185933d18 Config: Fix a formatting issue
Not sure why clang-format did not catch this on the lint builder, but
it definitely doesn't like the lines being too long here.
2017-05-10 17:56:09 +02:00
MerryMage 32d9428171 Config/Layer: Fix accidental cast of RecursiveSection to Section 2017-05-09 00:17:00 +01:00
JosJuice 40653a6607 NandPaths: Make .h function order match .cpp 2017-05-06 17:51:50 +02:00
JosJuice 36b9e3dd35 Don't duplicate code for getting paths based on title IDs
I've seen the expression (u32)(title_id >> 32), (u32)title_id
a few more times in my life than I would've liked to...
2017-05-06 17:45:08 +02:00
Léo Lam 5088fac54b Merge pull request #5354 from leoetlino/iosc
IOS: Implement IOSC-like library (+ bug fixes)
2017-05-04 19:58:47 +02:00
degasus 7389f0f55e Analytics: Set proper thread name. 2017-05-03 23:59:29 +02:00
Markus Wick eaa4565e63 Merge pull request #5362 from Tilka/hash
Common/Hash: small cleanup
2017-05-03 23:44:48 +02:00
Tillmann Karras c54c49714d Arm64Emitter: add FRECPE 2017-05-03 08:02:35 +01:00
Tillmann Karras 3a13e1aa7a Common/Hash: small cleanup 2017-05-03 06:40:52 +01:00
Tillmann Karras 25f61f0329 Common/Hash: use __crc32d() intrinsic on ARM64 2017-05-03 06:40:47 +01:00
Léo Lam f8fb9e2d03 IOS: Implement IOSC-like API
This prevents the IOS crypto code and keys from being spread over
the codebase. Things only have to be implemented once, and can be
used everywhere from the IOS code.

Additionally, since ES exposes some IOSC calls directly (DeleteObject
and Encrypt/Decrypt), we need this for proper emulation.

Currently, this only supports AES key objects.
2017-05-02 23:49:22 +02:00
Anthony d4e424fad5 Merge pull request #5272 from spycrab/master
Convert VolumeDirectory names back to SHIFT-JIS (issue #9988)
2017-05-02 11:41:53 -07:00
Pierre Bourdon e9349cf029 Merge pull request #5283 from spycrab/issue_9622
Make ENABLE_ANALYTICS=0 do something (Issue #9622)
2017-05-01 21:09:55 +02:00
spycrab e66ad018f4 Convert VolumeDirectory names back to SHIFT-JIS (issue #9988) 2017-05-01 14:08:47 +02:00
Stenzek 12bde06dc3 GLExtensions: Add GL_EXT_texture_compression_s3tc 2017-04-29 00:14:23 +10:00
spycrab 366aeeb488 Make ENABLE_ANALYTICS=0 do something 2017-04-26 23:27:13 +02:00
MerryMage 73cdf9ecb5 ArmCPUDetect: Add missing include
<cstring> is required for strncpy
2017-04-21 11:03:40 +01:00
Michael Maltese c63925dc21 AGL: small style fixes 2017-04-15 20:54:19 -07:00
Michael Maltese 4770e66811 AGL: refactor some functions 2017-04-15 20:53:47 -07:00
Michael Maltese 5298328cb1 Add headless support on macOS 2017-04-15 19:34:42 -07:00
JosJuice 2f9df072d6 Rename Misc.cpp to CommonFuncs.cpp
Because its only function is declared in CommonFuncs.h.
2017-04-15 00:41:09 +02:00
Markus Wick 60d8ee4916 Merge pull request #5250 from MerryMage/psq_st
Jit_LoadStorePaired: Make psq_st PIE-compliant
2017-04-12 20:52:59 +02:00
MerryMage a95010bc72 x64Emitter: Allow code alignment to arbitrary power of 2 2017-04-12 08:41:51 +01:00
MerryMage 6df8343e72 MathUtil: References can be const 2017-04-12 06:15:18 +01:00
MerryMage f7ed979e30 Jit64AsmCommon: Make frsqrte and fres PIE-compliant 2017-04-11 20:25:18 +01:00
Mat M 59d93f3a0d Merge pull request #5219 from lioncash/common
FileSearch: Namespace functions under the Common namespace
2017-04-08 17:19:00 -04:00
Mat M f09d17f40f Merge pull request #5161 from leoetlino/es-formats-tests
Add unit tests for IOS/ESFormats
2017-04-08 17:10:57 -04:00
Lioncash f7a2f6ad01 FileSearch: Namespace functions under the Common namespace 2017-04-07 01:02:14 -04:00
Sepalani c170659189 StringUtil: Fix a ctype assertion 2017-04-06 15:02:21 +01:00
Léo Lam c4d5076696 Common: Add missing set(LIBS ...) for mbedtls 2017-04-05 20:54:11 +02:00
Markus Wick 3bd184a255 Merge pull request #4467 from stenzek/gpu-texture-decoding
VideoBackends: GPU Texture Decoding
2017-04-03 10:46:13 +02:00
Markus Wick fd7f7c5541 Merge pull request #5159 from ligfx/arm64warnings
Arm64: a slew of warning fixes
2017-04-02 17:07:17 +02:00
Stenzek c8cbbd831d GLExtensions: Seperate GL_ARB_compute_shader from GL 4.3
Allows the usage of glDispatchCompute from GLES (requires GLES 3.1).
2017-04-01 12:31:40 +10:00
Stenzek 4e24bfd0ce GLExtensions: Seperate GL_ARB_shader_image_load_store from GL 4.2
Allows the usage of glBindImageTexture and glMemoryBarrier from GLES
(requires GLES 3.1).
2017-04-01 12:31:40 +10:00
Stenzek bd15d0352a GLExtensions: Seperate GL_ARB_texture_storage from GL 4.2
This allows us to use glTexStorage on GL3.3 implementations that support
the extension.
2017-04-01 12:31:40 +10:00
Léo Lam e1020cb674 Common: Remove dead code in NandPaths 2017-03-30 18:48:50 +02:00
Anthony 2c531889b2 Merge pull request #5139 from lioncash/bitfield
BitField: Minor cleanup
2017-03-28 09:15:37 -07:00
Matthew Parlane 85d74a506f Merge pull request #4951 from waddlesplash/haiku-2
Initial support for Haiku.
2017-03-28 17:19:35 +13:00
Augustin Cavalier 0831dad467 Initial support for Haiku. 2017-03-27 23:46:19 -04:00
Léo Lam 32a1b5068a Revert "Use a single libusb context"
This reverts commit c8a6dc6c23.

libusb on Windows isn't really safe to use from different threads
with a single context.
2017-03-26 15:58:30 +02:00
Michael Maltese 3f8a471d64 EGL: Fix missing-braces warning
Fixes warning:

```
../Source/Core/Common/GL/GLInterface/EGL.cpp:57:7: warning: suggest braces around initialization of subobject [-Wmissing-braces]
      EGL_OPENGL_BIT, (1 << 6), /* EGL_OPENGL_ES3_BIT_KHR */
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2017-03-25 17:09:50 -07:00
Michael Maltese 3d7bace9da Arm64Emitter: extract lambda to AddImmediate()
Fixes warning:

```
Source/Core/Common/Arm64Emitter.cpp:4108:31: error: declaration shadows a local variable [-Werror,-Wshadow]
    auto addi = [this](ARM64Reg Rd, ARM64Reg Rn, u64 imm, bool shift, bool negative, bool flags) {
                                ^
  /var/lib/buildbot/slave/pr-android/build/Source/Core/Common/Arm64Emitter.cpp:4105:46: note: previous declaration is here
  void ARM64XEmitter::ADDI2R_internal(ARM64Reg Rd, ARM64Reg Rn, u64 imm, bool negative, bool flags,
                                               ^
```
2017-03-25 14:21:19 -07:00
Michael Maltese c58ba93503 Arm64: Use PRIi64/PRIx64 for printf 2017-03-25 14:20:44 -07:00
Anthony b099a1c02a Merge pull request #5135 from lioncash/ini
IniFile: Minor changes
2017-03-24 19:33:09 -07:00
Lioncash b711daee5f BitField: Get rid of a C-style cast
This can simply be the max value of the unsigned type.
2017-03-23 15:28:58 -04:00
Lioncash e43c495ce5 BitField: Convert typedefs to using aliases 2017-03-23 15:28:50 -04:00
Lioncash caef08988e BitField: Make mostly constexpr capable
Makes the constructor and retrieval functions constexpr.
2017-03-23 11:45:45 -04:00
Lioncash a7ec2d3831 Arm64Emitter: Get rid of pointer casts in PoisonMemory
The previous code invokes undefined behavior.
2017-03-23 07:10:21 -04:00
Lioncash 29ca22905b IniFile: Replace a character erase with pop_back()
Same thing, more straightforward.
2017-03-22 19:32:10 -04:00
Lioncash 35959bdaf9 IniFile: Replace string joining code with JoinString 2017-03-22 19:30:15 -04:00
Lioncash b92871111a IniFile: std::move a std::string in GetLines
Also gets rid of an unnecessary string copy.
2017-03-22 19:09:25 -04:00
Lioncash dbdf693c81 IniFile: Use character literals instead of string literals where applicable
Character overloads are generally better overall (range checks aren't
necessary, etc).
2017-03-22 19:03:17 -04:00
Lioncash d8998b6392 IniFile: Provide an rvalue reference overload for SetLines
Allows moving in vectors instead of performing an unnecessary copy.
2017-03-22 18:49:13 -04:00
Lioncash 46d74a7760 IniFile: Make Section's string constructor instances take strings by value
As the name is immediately stored into a class member, a move here is a
better choice.

This also moves the constructor implementations into the cpp file to
avoid an otherwise unnecessary inclusion in the header. This is also
likely a better choice as Section contains several non-trivial members,
so this would avoid potentially inlining a bunch of setup and teardown
code related to them as a side-benefit.
2017-03-22 18:47:19 -04:00
Lioncash 99adc73383 IniFile: Make Section constructor explicit 2017-03-22 18:07:23 -04:00
MerryMage da434e1a1c ConstantPool: Externalize memory allocation 2017-03-21 20:16:12 +00:00
MerryMage 615fcc621d CodeBlock: Add support for multiple children 2017-03-21 20:16:12 +00:00
Anthony d2690568f9 Merge pull request #5110 from MerryMage/const-pool
Jit64: Implement a constant pool
2017-03-20 13:29:57 -07:00
MerryMage ff441efc26 EmuCodeBlock: Use ConstantPool 2017-03-20 20:21:42 +00:00
aldelaro5 8bf27cf42f Fix memory breakpoint when checking the middle of the data
If the delimiters of a memory aren't exactly the same as an address, but their size includes the memory breakpoint delimiter, the break will not go through.  This makes it so that you can specify a search for a memory breakpoint with a data size and will check if the data fits with that size on all memory breakpoints so the breaks go through.
2017-03-18 22:48:57 -04:00
Markus Wick 7b19475911 Merge pull request #4548 from stenzek/gcc-sse
Support SSSE3 texture decoders and CRC32 hashing on non-native builds (gcc)
2017-03-13 14:28:01 +01:00
Matthew Parlane b1bd231421 Merge pull request #5020 from leoetlino/es-safer-import
IOS/ES: Implement ES_AddTitleCancel (and slightly safer import process)
2017-03-12 16:14:17 +13:00
Léo Lam 9c31d6f5c5 IOS/ES: Handle personalised tickets properly
IOS unpersonalises device-specific ("personalised") tickets prior to
storing them on the NAND.
2017-03-11 21:14:26 +01:00
Léo Lam e656258949 IOS/ES: Write import files to /import first
This is slightly safer than writing contents to /title directly.
We still cannot rename everything in one go atomically, but this allows
implementing AddTitleCancel very easily.

Also, this ensures that when a title import fails, no incomplete files
will be left in the title directory, which can mess up the system menu.
2017-03-10 22:44:26 +01:00
Michael Maltese 418a7723c8 GLExtensions: remove NV_depth_buffer_float from OpenGL 3.0
Regression introduced in e99cd57 / 4935: VideoBackends: Set the maximum
range when the depth range is oversized[1]. The NV_depth_buffer_float
extension is not part of OpenGL 3.0, and requiring it causes a hard
crash when it's not supported (e.g. macOS).

[1]: https://github.com/dolphin-emu/dolphin/pull/4935
2017-03-10 12:54:46 -08:00
Markus Wick e99cd57eb3 Merge pull request #4935 from Armada651/depth-range-fix
VideoBackends: Set the maximum range when the depth range is oversized.
2017-03-10 18:05:52 +01:00
Anthony dc42f7fb28 Merge pull request #4991 from leoetlino/config-loaders
New config loaders
2017-03-09 16:56:14 +00:00
Florent Castelli b69d3f13cb common: Don't include intrin.h in a namespace
Fixes compilation with VS2017
2017-03-08 06:55:06 +01:00
Ryan Houdek ead8be9d19 Move IniFile section chunk handling to IniFile::Section 2017-03-05 15:47:23 +01:00
Léo Lam b7a1c6f504 Logging: Add CORE type 2017-03-05 15:47:23 +01:00
Mat M 7fa14169e9 Merge pull request #5007 from lioncash/swap
Common: Move byte swapping utilities into their own header
2017-03-05 09:45:29 -05:00
Lioncash 0e5a367ca3 SysConf: const-correctness 2017-03-04 19:19:42 -05:00
Lioncash 1ebd2cd7c3 SysConf: Get rid of pointer casts 2017-03-04 19:06:22 -05:00
Lioncash 552c0d8404 Common: Move byte swapping utilities into their own header
This moves all the byte swapping utilities into a header named Swap.h.

A dedicated header is much more preferable here due to the size of the
code itself. In general usage throughout the codebase, CommonFuncs.h was
generally only included for these functions anyway. These being in their
own header avoids dumping the lesser used utilities into scope. As well
as providing a localized area for more utilities related to byte
swapping in the future (should they be needed). This also makes it nicer
to identify which files depend on the byte swapping utilities in
particular.

Since this is a completely new header, moving the code uncovered a few
indirect includes, as well as making some other inclusions unnecessary.
2017-03-03 17:18:18 -05:00
Lioncash ee61bd6f2e CMakeLists: Normalize whitespace
Normalizes tabs to spaces to follow our codebase's indentation style.
2017-03-01 14:53:23 -05:00
Anthony 63c5230d9b Merge pull request #4959 from lioncash/ini
IniFile: Handle s64/u64 values
2017-02-27 10:02:53 -08:00
Matthew Parlane d666363ac4 Merge pull request #4966 from RisingFog/remove_traversal_server_debug_mode
Turn Off Debug Mode for Traversal Server
2017-02-27 16:18:13 +13:00
Matthew Parlane 48aeb5bf4b Merge pull request #4896 from leoetlino/esformats
Use ESFormats for tickets, TMDs and views
2017-02-27 16:15:05 +13:00
Anthony 7bcff99d89 Merge pull request #4963 from leoetlino/sysconf
SysConf: Use vectors instead of raw pointers
2017-02-26 16:09:17 -08:00
Anthony 0dde642b7d Merge pull request #4917 from leoetlino/config
New configuration namespace
2017-02-26 15:54:25 -08:00
Anthony 722ff4c020 Merge pull request #4915 from leoetlino/ini-changes
Expose some ways to manage an INI file
2017-02-26 15:48:53 -08:00
Léo Lam 5104caf6a6 Move AES code to Common/Crypto 2017-02-26 19:46:30 +01:00
Chris Burgener 4669b50e0b Turn Off Debug Mode for Traversal Server 2017-02-25 23:41:12 -05:00
Léo Lam a1e16c47db SysConf: Use vectors instead of raw pointers 2017-02-26 00:39:50 +01:00
Lioncash beec40f178 IniFile: Handle s64/u64 values 2017-02-25 00:03:20 -05:00
Jules Blok 94522d4cf3 OGL: Add support for glDepthRangedNV to handle oversized depth ranges. 2017-02-24 14:54:16 +01:00
Léo Lam 88a21dd2b9 Fix things mentioned during code review
Ref: https://github.com/dolphin-emu/dolphin/pull/4917
2017-02-23 18:15:12 +01:00
Léo Lam abe6f8766a Config: Add a few helper functions for repetitive tasks
Getting and setting configuration from the base config layer are common
and repetitive tasks. This commit adds some simpler to use functions to
make the new system easier to work with.

Config::Get and Config::Set are intended to make switching from
SConfig a bit less painful. They always operate on the main system.

Example usage:

    // before
    auto base_layer = Config::GetLayer(Config::LayerType::Base);
    auto core = base_layer->GetOrCreateSection(Config::System::Main, "Core");
    u8 language;
    core->Get("Language", &language, 0);
    SetData("IPL.LNG", language);

    // now
    auto base_layer = Config::GetLayer(Config::LayerType::Base);
    auto core = base_layer->GetOrCreateSection(Config::System::Main, "Core");
    SetData("IPL.LNG", core->Get<u8>("Language", 0));

    // or simply
    SetData("IPL.LNG", Config::Get<u8>("Core", "Language", 0));
2017-02-23 18:15:12 +01:00
Léo Lam 7bd34ac0b5 Config: Trigger callbacks on layer save
And remove an extraneous callback trigger in Config::Load.
2017-02-23 18:15:12 +01:00
Léo Lam 9c3265f1ef Config: Keep track of deleted keys
This allows deleted keys to be deleted from INIs properly.
2017-02-23 18:15:12 +01:00
Léo Lam b51c6023ba Config: Only save settings if they have been changed 2017-02-23 18:15:12 +01:00
Ryan Houdek 8360e358ee New configuration namespace 2017-02-23 18:15:11 +01:00
Lioncash 2f2aab963d SymbolDB: Simplify GetSymbolsFromHash
Given a std::map can't have duplicate keys, iterating over the map
explicitly isn't necessary, and find() can just be used instead.

Also, instead of manually calling push_back() for every entry to
be added, the range constructor of std::vector can be used instead to add
the whole range all at once.
2017-02-18 06:30:20 -05:00
Ryan Houdek 85c3e677da Expose some ways to manage an INI file.
This is required for our later INI file loaders and savers
2017-02-16 09:34:25 +01:00
Ryan Houdek a2f5c3dbe0 Add some missing INI files to FileUtil 2017-02-16 09:33:50 +01:00
Phil Christensen 2ed61b0ee1 C++ conformance fixes (MSVC /permissive-)
We (the Microsoft C++ team) use the dolphin project as part of our "Real world code" tests.
I noticed a few issues in windows specific code when building dolphin with the MSVC compiler
in its conformance mode (/permissive-).  For more information on /permissive- see our blog
https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/.

These changes are to address 3 different types of issues:

1) Use of qualified names in member declarations

    struct A {
        void A::f() { } // error C4596: illegal qualified name in member declaration
                        // remove redundant 'A::' to fix
    };

2) Binding a non-const reference to a temporary

    struct S{};
  
    // If arg is in 'in' parameter, then it should be made const.
    void func(S& arg){}
  
    int main() {
      //error C2664: 'void func(S &)': cannot convert argument 1 from 'S' to 'S &'
      //note: A non-const reference may only be bound to an lvalue
      func( S() );
   
      //Work around this by creating a local, and using it to call the function
      S s;
      func( s );
    }

3) Add missing #include <intrin.h>

Because of the workaround you are using in the code you will need to include
this.  This is because of changes in the libraries and not /permissive-
2017-02-15 20:37:04 -08:00
degasus 6aa54a029e JitArm64: Optimize GPR register push/pop. 2017-02-11 00:59:12 +01:00
JosJuice 99492c22a6 Merge pull request #4839 from leoetlino/better-warnings
Be less annoying when usbdk is not installed
2017-02-08 14:00:12 +01:00
Matthew Parlane f838d16b0c Merge pull request #4546 from RisingFog/tas_wii_nand
Copy Wii save for current game for Netplay and TAS
2017-02-08 18:58:28 +13:00
Matthew Parlane dac6a66252 Merge pull request #4769 from lioncash/settingshandler
SettingsHandler: Minor cleanup
2017-02-08 18:15:37 +13:00
Léo Lam db7ee668ff Notify user that USB won't work if libusb init fails 2017-02-07 00:47:21 +01:00
Matthew Parlane d244597b42 Merge pull request #4408 from leoetlino/usb
IOS: USB support (OH0, USB_VEN, USB_HID)
2017-02-07 09:17:05 +13:00
Michael Maltese acc8dae2b3 CMake: use configure_file to generate scmrev.h
The built-in `configure_file` command correctly handles the case where
none of the variables change and scmrev.h doesn't need to be rebuilt.
This saves a full re-link of Dolphin any time CMake is re-run.
2017-02-05 22:26:49 -08:00
Chris Burgener 5224771dac Copy Wii save for current game for Netplay and TAS 2017-02-05 13:17:05 -05:00
Léo Lam c9f4889437 IOS: Re-implement USB_HIDv4 (/dev/usb/hid)
This reimplements the USB HID v4 IOS device using the new common
USB code (to reuse more code and allow emulated HIDs to be added
more easily in the future).

The main difference is that HIDs now have to be whitelisted, like
every other USB device for OH0 and VEN.
2017-02-05 11:36:49 +01:00
Léo Lam c8a6dc6c23 Use a single libusb context
libusb on Windows is limited to only a single context. Trying to open
more than one can cause device enumerations to fail randomly.

libusb is thread-safe and we don't use the manual polling support (with
`poll()`) so this should be safe.
2017-02-05 11:36:48 +01:00
JosJuice bc2b9f4c3c Translate Swedish in example strings to English 2017-02-04 22:51:01 +01:00
degasus f31b25fe39 Jit64: Enable branch following. 2017-01-28 02:48:56 +01:00
Lioncash c748158182 SettingsHandler: Make GenerateSerialNumber static
This doesn't depend on class internals.
2017-01-27 10:29:57 -05:00
Lioncash 98291cd843 SettingsHandler: Add Open and Save member functions 2017-01-27 10:29:49 -05:00
Stenzek 0f978227f5 Common: Use function-level targeting for CRC32 (SSE4.2) 2017-01-24 20:04:55 +10:00
Stenzek 0f1b5a05ea Common: Support for function-specific instruction set target on x64 2017-01-24 20:04:55 +10:00
Florent Castelli a917d247ed DolphinWX: Remove HAVE_WX preprocessor define
I think we don't have to double check it when building the WX target.
2017-01-24 05:48:08 +01:00
Florent Castelli 0baf1c78c0 vs: Move defines out of Common.h to the build system 2017-01-24 03:55:46 +01:00
Florent Castelli a7bf9271b5 Fix missing includes 2017-01-24 03:31:51 +01:00
Florent Castelli c649bf104b cmake: Prevent HAVE_OPENAL and HAVE_PORTAUDIO to be redefined 2017-01-24 03:22:03 +01:00
Michael Maltese 713ec5ffd5 Add includes for building on Windows without PCH 2017-01-23 01:37:41 -08:00
Florent Castelli 2ff10ad021 cmake: Add missing Windows file to common 2017-01-21 00:35:55 +01:00
Florent Castelli 5540cda820 cmake: Don't build traversal_server on Windows, it requires posix platform 2017-01-21 00:35:55 +01:00
Léo Lam 954c41d6e9 IOS: Move out common USB structures
Some structures will be reused and shared between several IOS USB
device implementations. This prepares for the upcoming USB PR.

I've also removed GetPointer calls in the trivial case (BT passthrough)
2017-01-20 18:29:21 +01:00
Léo Lam ef5a855b8e Update log types names from IPC_HLE to IOS
For consistency with the other changes.

WII_IPC_DVD was changed to IOS_DI, as this describes what the log type
is used for in a more specific way.
2017-01-18 21:43:37 +01:00
Lioncash f1542c8e5a Common: Namespace Network.h/.cpp
Necessary to avoid namespace clashes with IOS HLE's namespace name.
2017-01-17 20:46:48 -05:00
Pierre Bourdon 28f0d8e8a7 Merge pull request #4658 from lioncash/bits
Common: Add bit utility header
2017-01-15 17:23:30 +01:00
Pierre Bourdon dd9e6760c4 Merge pull request #4659 from leoetlino/chunkfile-set
Fix ChunkFile for std::set
2017-01-14 20:11:00 +01:00
Léo Lam ea0335f7c1 Fix ChunkFile for std::set
Without this, attempts to savestate std::set will fail with an error
about dropping the const qualifier.

<Lioncash> leoetlino: I'll try to break it down: So, when you do a
 ranged-for on a container, it's essentially syntactic sugar over begin
 and end iterators. std::set is an associative container where the key
 type is the same as the value type, and so it's required that all
 iterator functions return constant iterators. If this wasn't a
 requirement, it would allow changing the ordering of elements from
 outside of the set's API (this is bad).
2017-01-14 19:00:19 +01:00
Lioncash 0a6f0dfb74 Common: Add bit utility header
This attempts to make some bit arithmetic more self-documenting and also
make it easier during review to identify potential off-by-one errors by
making it possible to just specify which bits are being extracted.

Functions both support the case where bits being extracted can vary and
fixed bit extraction. In the case the bits are fixed, compile-time asserts
are present to prevent accidental API usage at compile-time.

e.g. Instead of shifting and masking to get bits 10 to 15,
Common::ExtractBits<10, 15>(value) can just be done instead.
2017-01-14 11:16:02 -05:00
Pierre Bourdon 45d27f7fc7 CommonPaths: Add D_WFSROOT_IDX.
Defaults to $USERDIR/WFS. Used to store the contents normally stored on
WFS mass storage devices.
2017-01-14 17:06:40 +01:00
Lioncash 45415e1057 ColorUtil: Make decodeCI8image's pal parameter const 2017-01-13 17:07:26 -05:00
Matthew Parlane 5790f15be8 Merge pull request #4299 from sepalani/hle_symbols
SymbolDB: Multiple symbols detection allowed
2017-01-13 10:05:32 +13:00
Léo Lam 64101137cd Remove pre-generated SYSCONF
Dolphin is able to generate one with all correct default settings, so
we don't need to ship with a pre-generated SYSCONF and worry about
syncing default settings.

Additionally, this commit changes SysConf to work with session SYSCONFs
so that Dolphin is able to generate a default one even for Movie/TAS.
Which SYSCONF needs to be touched is explicitly specified to avoid
confusion about which file SysConf is managing.

(Another notable change is that the Wii root functions are moved into
Core to prevent Common from depending on Core.)
2017-01-12 21:30:11 +01:00
Lioncash 6f08ef9a25 IOFile: Get rid of IOFile's ReleaseHandle function
Transfer of handles should be done via std::move.
2017-01-12 12:34:06 -05:00
Lioncash ea8fc594a5 Common: Move BreakPoints into Core
BreakPoints utilizes the jit global variable, so this was making Core and
Common cyclical dependencies on one another.
2017-01-10 05:24:44 -05:00
Lioncash 1dab2c8816 IOFile: Correct explicit operator bool semantics
The operator void* variant was m_good ? m_file : nullptr;
so this was leaving out the file handle check.
2017-01-08 22:52:44 -05:00
Lioncash 00baf193ac CodeBlock: Const correctness for IsInSpace 2017-01-08 18:40:09 -05:00
Matthew Parlane 7a5fe4b7ed Merge pull request #4624 from leoetlino/jit-warning-fixes
Add the g_ prefix to the jit global
2017-01-08 13:19:16 +13:00
Lioncash 9d8e8652fb CodeBlock: Get rid of implicit sign-conversion in AllocCodeSpace
Size is internally stored as a size_t, so having an int parameter
would cause implicit sign-conversion from a signed value to an
unsigned value to occur.
2017-01-07 19:05:06 -05:00
Léo Lam 8bef7259e3 Add the g_ prefix to the jit global
Jan 04 22:55:01 <leoetlino>   fwiw, it looks like there are new warnings in the RegCache code
Jan 04 22:55:04 <leoetlino>   Source/Core/Core/PowerPC/Jit64/FPURegCache.cpp:13:33: warning: declaration shadows a variable in the global namespace [-Wshadow]
Jan 04 22:56:19 <@Lioncash>   yeah, the jit global should have a g_ prefix.

This fixes shadowing warnings and adds the g_ prefix to a global.
2017-01-07 23:19:49 +01:00
JosJuice 5e2b2f059f Don't use generic byteswapping on Android
This seems to work fine nowadays.
2017-01-06 13:56:53 +01:00
BhaaL 23d99f2f2c specify custom brace style to fix unions
BreakBeforeBraces: Allman apparently includes all styles,
except for AfterUnion (which is false) when using clang-format -dump-config
2017-01-05 12:55:13 +01:00
Lioncash 045a8400e6 IOFile: Make the move constructor and move assignment operator noexcept
Certain parts of the standard library try to determine whether or not a
transfer operation should either be a copy or a move. The prevalent notion
of move constructors/assignment operators is that they should not throw,
they simply move an already existing resource somewhere else.

This is typically done with 'std::move_if_noexcept'. Like the name says,
if a type's move constructor is noexcept, then the functions retrieves an
r-value reference (for move semantics), or an l-value (for copy semantics)
if it is not noexcept.

As IOFile deletes the copy constructor and copy assignment operators,
using IOFile with certain parts of the standard library can fail in
unexcepted ways (especially when used with various container
implementations). This prevents that.
2017-01-04 18:37:48 -05:00
Lioncash 9b8f5bce22 IOFile: Change 'operator void*' into 'explicit operator bool'
'operator void*' is basically a pre-C++11-ism that was used, as C++03
only had the notion of implicit type-conversion operators, but not explicit type
conversion operators (allowing implicit conversion of a file handle to
bool can go downhill pretty quickly).
2017-01-04 18:10:21 -05:00
Lioncash c541e1099e IOFile: Make class variables private
Internals shouldn't be directly exposed.
2017-01-04 17:48:46 -05:00
Lioncash c21dad9e83 IOFile: Get rid of unnecessary unimplemented copy constructor/assignment operator.
IOFile already inherits NonCopyable.
2017-01-04 17:47:40 -05:00
JosJuice 0f1ce0e1f4 Remove incorrect usage of "ASCII" and "ANSI"
Windows-1252 was sometimes being referred to as ASCII or ANSI
in Dolphin, which is incorrect. ASCII is only a subset of
Windows-1252, and ANSI is (rather improperly) used in Windows
to refer to the current code page (which often is 1252 on
Western systems, but can also be something entirely different).

The commit also replaces "SJIS" with "Shift JIS". "SJIS"
isn't misleading, but "Shift JIS" is more commonly used.
2016-12-26 15:49:39 +01:00
Mat M 40e36ebd1e Merge pull request #4550 from linkmauve/no-readdir_r
Common: Replace deprecated readdir_r with readdir
2016-12-25 17:34:50 -05:00
JosJuice e56bec9c87 Fix outdated comments in ScanDirectoryTree 2016-12-25 21:57:33 +01:00
Emmanuel Gil Peyrot 495dfdb16c Common: Replace deprecated readdir_r with readdir
Fixes a warning under recent glibc.
2016-12-24 16:18:47 +01:00
Sepalani 8d812db9ad SymbolDB: Use set to map hash with symbols 2016-12-19 21:03:29 +00:00
Sepalani 7e974f1064 SymbolDB: GetSymbolsFromHash added 2016-12-19 21:03:28 +00:00
Sepalani d778b8a820 SymbolDB: GetSymbolsFromName added 2016-12-19 21:02:23 +00:00
Sepalani a6114bad34 Import/Export signature files as CSV 2016-12-18 00:27:10 +00:00
Markus Wick d64c9dd5c9 Merge pull request #4419 from degasus/master
Jit64: Fix a few trivial PIE issues.
2016-12-12 10:58:16 +01:00
Léo Lam 31ccfffd38 Common: Add alignment header
Gets rid of duplicated alignment code.
2016-12-06 20:33:53 +01:00
degasus 21f3e97435 Jit64: Avoid pointer casts if possible. 2016-12-04 13:09:16 +01:00
JosJuice 3cfc49a613 Merge pull request #4472 from JosJuice/revert-absolute-path
IOS HLE: Replace broken path traversal prevention
2016-11-29 18:34:22 +01:00