Continues the migration over to using fmt. Given fmt is also compatible
with std::string and std::string_view, we can convert some parameters
over to std::string_view, such as the message parameter for
StopMessage() and the name parameter for an overload of SaveScreenShot()
The old implementation of this was not able to distinguish between
a title that had the common key index set to 1 because it actually
was Korean and a title that had the common key index set to 1 due to
fakesigning. This new implementation solves the problem by
decrypting a content with each possible common key and checking
which result matches the provided SHA-1 hash.
The problem that the old implementation causes has only been reported
to affect a certain pirated WAD of Chronos Twins DX (WC6EUP), but it's
possible that the problem would start affecting more WADs if we add
support for the vWii common key (which uses index 2). Adding support
for the vWii common key would also prevent us from using the simpler
solution of always forcing the index to 0 if the title is not Korean.
...in addition to the existing function CreateVolume
(renamed from CreateVolumeFromFilename).
Lets code easily add constraints such as not letting the user
select a WAD file when using the disc changing functionality.
This header doesn't actually make use of MathUtil.h within itself, so
this can be removed. Many other source files used VideoCommon.h as an
indirect include to include MathUtil.h, so these includes can also be
adjusted.
While we're at it, we can also migrate valid inclusions of VideoCommon.h
into cpp files where it can feasibly be done to minimize propagating it
via other headers.
This lets us convert CalculateVertexElementSizes() from a function using
an out pointer into one that simply returns the array data as a return
value.
It also lets us dehardcode some values, as we can just query
std::array's size() member function instead.
Fix up the calculation of the length fields and check that the returned
response is the expected length. This touches many files because it
converts a parameter name from the SI_Device interface from 'length' to
'request_length'. Prior, this field seemed to be used as request length
sometimes, as response length sometimes, and usually just totally ignored.
This isn't used anywhere, so it can be removed. This also potentially
fixes an underlying compilation error waiting to happen, given DECSTAT
could have potentially been used, someone disables statistics (for
whatever reason), then gets a compilation error due to the #else case
not containing an empty definition of DECSTAT.
Makes the global variable follow our convention of prefixing g_ on
global variables to make it obvious in surrounding code that it's not a
local variable.
Rather than making Statistics' member functions operate on the global
variable instance of itself, we can make these functions member
functions and operate on a by-instance state, removing the direct
dependency on the global variable itself.
This also makes for less reading, as there's no need to repeat "stats."
for all variable accesses.
Normalizes all variables related to statistics so that they follow our
coding style.
These are relatively low traffic areas, so this modification isn't too
noisy.
At its only usage point, its return value is stored into a u32, and the
default implementation returns 0xFFFFFFFF (-1), which would be an
unsigned integer. Given all of the bits are used to determine a color,
it makes slightly more sense to treat this as an unsigned value as
opposed to a signed one.
We're allowed (by the standard) to forward declare types within
std::vector, so we can replace direct includes with forward declarations
and then include the types where they're directly needed.
While we're at it, we can remove an unused inclusion of <cstring>, given
nothing in the header uses anything from it. This also revealed an
indirect inclusion, which this also resolves.
Previously u32 was being used for part of the interface and unsigned int
was being used for other parts. This makes the interface fully consistent by
using only one type.
We opt for u32 here given they communicate the same thing (for platforms
we care about where int is 32-bit), while also being less to read.
While we're at it, we can also default the constructor and destructor of
inheriting classes in their respective cpp file to prevent the
construction and destruction of non-trivial types being inlined into
other regions of code.
This was in DolphinWX but not DolphinQt. It's useful for telling if
users who post screenshots have an up-to-date version of Dolphin.
The old implementation of this prepended the version in DolphinWX code
rather than Core code, but I thought it'd be simpler to do it in Core.
IOLinux.cpp should include <sys/select.h> as it uses select() functionality.
On certain platforms it's included implicitly by other headers, which is why
it compiled before. This makes it also work on musl platforms.
libusb transfer callbacks might be called immediately during transfer
submission in some cases. (libusb doesn't even specify what thread
the callback is invoked on.) In other words, it is possible to reach
the transfer callback from the CPU thread, and not just from the
USB event handling thread.
So CoreTiming::FromThread::NON_CPU is incorrect and should instead
be ANY.
Unfortunately, it appears that using libusb's synchronous transfer API
from several threads causes nasty race conditions in event handling and
can lead to deadlocks, despite the fact that libusb's synchronous API
is documented to be perfectly fine to use from several threads (only
the manual polling functionality is supposed to require special
precautions).
Since usbdk was the only real reason for using a single libusb context
and since usbdk (currently) has so many issues with Dolphin, I think
dropping support for it in order to fix other backends is acceptable.
Now that the floating point members are assigned in bulk, we can remove
their setter macro. While we're at it, we can also remove the setter for
unsigned int, given it's not used.
We were doing quite a bit of unnecessary work within CMake to handle and
make sure the necessary libraries were copied over. That approach has
several downsides:
1. It's not possible to handle multi-configuration generators (like
Visual Studio) in an easy manner. The existing script would fail to
copy over the necessary libraries if one configuration was built, and
then another one was built.
2. If you have Qt already installed (properly) by the official binary,
the existing script would copy *all* dlls even if they weren't
necessary. This is pretty bad, since it can waste quite a bit of
space.
Instead, we can just delegate off to the official deployment application
bundled with Qt's libraries that determines what the necessary libraries
are and copies them over as necessary. This also means we can properly
support both release and debug binaries in the same directory, like how
the old handcrafted Visual Studio project files allowed.
Its sufficient to simply specify a debug postfix instead of using an
separate variable. What's nice about this approach is that it will
actually work :p
Previously the code wouldn't work for multi-configuration generators
like Visual Studio.
When the bluetooth adapter device is opened/closed by dolphin, the
kernel driver is automatically detached/reattached.
This enables transparent sharing of the same bluetooth wiimotes and
bluetooth adapters between the hosts system and the emulated one using
the same.