Commit Graph

30723 Commits

Author SHA1 Message Date
Léo Lam 1b9617c85c Externals: Update libusb to 1.0.23-rc1
Now has support for isochronous transfers in the WinUSB backend,
which may or may not work better than the UsbDk backend.
2019-05-27 20:09:55 +02:00
Léo Lam 42de5b9a10
Merge pull request #8126 from lioncash/todo
Core/GCMemcard: Remove obsolete TODO
2019-05-27 19:04:06 +02:00
Léo Lam 525c65dd19
Merge pull request #8125 from lioncash/verify
DiscIO/VolumeVerifier: Make use of unused variable (+ minor other changes)
2019-05-27 19:03:13 +02:00
Léo Lam e3be168328
Merge pull request #8124 from lioncash/http
Common/HttpRequest: Minor changes and simplifications
2019-05-27 18:59:23 +02:00
Lioncash b2b5b01eda Core/GCMemcard: Remove obsolete TODO
Now that we assume C++17, the in-file definition of the std::array can
be removed. This is all that's necessary, as constexpr used on a static
member variable implies inline (and so, automatically has C++17's static
inline behavior).
2019-05-27 11:48:38 -04:00
Lioncash d220e33862 DiscIO/VolumeVerifier: Make no-argument overload of GetBiggestUsedOffset() const
The overload taking a partition is already a const member function, so
this one can be turned into one as well.
2019-05-27 10:40:41 -04:00
Lioncash bf6948c1d4 DiscIO/VolumeVerifier: Use structured bindings where applicable
Allows providing better names than "first" or "second".
2019-05-27 10:40:38 -04:00
Lioncash fa57396e97 DiscIO/VolumeVerifier: In-class initialize members where applicable
Removes redundant initializers from the constructor and provides
initializers for all members that don't already have one for consistency
(and deterministic initial state).
2019-05-27 10:40:17 -04:00
Lioncash 52eb2d0d82 DiscIO/VolumeVerifier: Default destructor within the cpp file
Given the volume verifier has quite a few non-trivial object within it,
it's best to default the destructor within the cpp file to prevent
inlining complex destruction logic elsewhere, while also making it nicer
if a forward-declared type is ever used in a member variable.
2019-05-27 10:19:51 -04:00
Lioncash 0ccaa2b5d6 DiscIO/VolumeVerifier: Take std::string by value in AddProblem()
This allows both std::moving into the function and moving the parameter
from within the function, potentially avoiding an unnecessary copy.
2019-05-27 10:17:11 -04:00
Lioncash a1f77fd14b DiscIO/VolumeVerifier: Make use of unused variable in CheckMisc()
This variable wasn't being utilized when comments indicate that it
probably should be.
2019-05-27 10:09:55 -04:00
Lioncash ab2adfb0a7 Common/HttpRequest: Simplify cURL initialization
std::call_once is guaranteed to execute the given callable object
exactly once. This guarantee holds even if the function is called
concurrently from several threads.

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

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

std::pair<const Key, Value>

but the loop was declaring it as:

std::pair<Key, Value>

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

Using structured bindings avoids this (as would plain auto or correcting
the explicit type), while also allowing the use of more appropriate
names compared to first and second.
2019-05-27 09:36:31 -04:00
Lioncash 8dc8cf8019 Common/HttpRequest: std::move callback in constructor
std::function is allowed to heap allocate in order to hold any necessary
bound data in order to execute properly (e.g. lambdas with captures), so
this avoids unnecessary reallocating.
2019-05-27 09:26:28 -04:00
Connor McLaughlin 204af41e73
Merge pull request #8122 from Pokechu22/dx11-dxgi_factory
DX11: Fix access violation on closing dolphin
2019-05-27 18:48:52 +10:00
Pokechu22 69d9d9f87a Also free when initialization fails, and move to end 2019-05-26 19:59:29 -07:00
Pokechu22 19fb3bb4fe DX11: Fix access violation on closing dolphin 2019-05-26 15:01:05 -07:00
Léo Lam f92c17e76f
Merge pull request #7799 from Tilka/mapping
DolphinQt/Mapping: red = error, don't flash
2019-05-26 18:10:06 +02:00
Léo Lam f819ea687a
Merge pull request #7448 from RolandMunsil/improve-cheat-search
Improve performance of cheat searching & add input validation
2019-05-26 18:07:49 +02:00
Tillmann Karras 2195ef30f3 DolphinQt/Mapping: red = error, don't flash 2019-05-26 17:59:30 +02:00
Roland Munsil 4ce7079098 CheatsManager: Improve performance of searching & add input validation
The previous implementation of cheat search would reconvert the input
string for every single memory value. Now we do it once and construct
a comparison lambda which we pass to the search code.

In addition, I also added input validation. So, for example, if you've
selected Decimal input and you try to compare against "FF",
it won't search and will instead let the user know they've entered an
invalid value. Similar logic for if you enter "1.2" in a search for
bytes. Before, it would just use 0 if it failed to convert the value.
2019-05-26 17:32:48 +02:00
Léo Lam 526698d2fc
Merge pull request #8104 from AdmiralCurtiss/memcard-folder-small
GCMemcardDirectory: Improve logic for initial load of GCI files.
2019-05-26 11:07:43 +02:00
Admiral H. Curtiss 15abb1c92d GCMemcardDirectory: Improve logic for which files are loaded into the virtual memory card.
- Files for the current game are now guaranteed to be loaded, space and validity permitting.
- Avoid showing PanicAlerts for every problem encountered, most of them aren't really important enough and will probably just annoy the user.
- And for the only error the user will definitely care about, when the save of the game they're trying to play fails to load, show an imgui message instead.
2019-05-25 21:51:36 +02:00
Admiral H. Curtiss 5af05f6714 GCMemcard/GCIFile: Implement LoadHeader(). 2019-05-25 21:49:09 +02:00
Admiral H. Curtiss 884af05589 GCMemcardDirectory: Move GCIFile class to its own file. 2019-05-25 21:49:09 +02:00
Léo Lam 9136abf07e
Merge pull request #8106 from 8times9/memcard-menubar
Qt/MenuBar: Reorder Tools menu
2019-05-25 21:19:38 +02:00
8times9 00855552e9 Qt/MenuBar: Reorder Tools menu 2019-05-25 20:22:52 +02:00
Léo Lam edf988b465
Merge pull request #8019 from AdmiralCurtiss/gcmemcard-header-cleanup
GCMemcard: A little cleanup.
2019-05-25 19:20:43 +02:00
Admiral H. Curtiss e390fd0f4e GCMemcard: Remove unused ability of ImportGci() to write a GCI file to disk. 2019-05-25 17:58:05 +02:00
Admiral H. Curtiss 018572018e GCMemcard: Dismantle the global return value enum into a few function specific enum classes. 2019-05-25 17:58:05 +02:00
Admiral H. Curtiss d09303683c GCMemcard: Convert a few enums into constexprs. 2019-05-25 17:58:05 +02:00
Admiral H. Curtiss cbc5acb8cd GCMemcard: Get rid of stray signed length in ImportGciInternal(). 2019-05-25 17:58:05 +02:00
Admiral H. Curtiss 2d38364410 GCMemcard: Remove memsets that don't do anything in GCMemcard::Format(). 2019-05-25 17:58:05 +02:00
Admiral H. Curtiss 88a0773309 GCMemcard: Rewrite checksum calculation without undefined behavior. 2019-05-25 17:58:05 +02:00
Admiral H. Curtiss fcd75841ca GCMemcard: Rewrite Header::CalculateSerial() without undefined behavior. 2019-05-25 17:58:05 +02:00
Léo Lam 5fb56505b2
Merge pull request #8109 from leoetlino/ios-usb-fixes
IOS: USB fixes
2019-05-24 22:03:46 +02:00
Léo Lam 6dd0fe21f2 IOS/USB: Claim all interfaces ahead-of-time
To avoid having to claim/release interfaces all the time, and having to
trigger interface changes from several places, all interfaces are now
claimed ahead of time.

This commit also makes us avoid changing the active interface when it's
not necessary.

Changing the active interface has side effects such as resetting the
active alternate setting -- which is extremely undesirable because it
would require the emulated software to change the alternate setting
again, which isn't supposed to be necessary at all.

This fixes Your Shape, which submits isochronous transfers on an
endpoint that only exists in alt setting 6 right after submitting
control transfers (which would have reset to alt setting 0 prior to
this fix).
2019-05-24 20:47:46 +02:00
Léo Lam e07b514b62
Merge pull request #8115 from booto/powerpc_pvr
PowerPC: Add Broadway's PVR (retail Wii)
2019-05-24 14:51:06 +02:00
Léo Lam 9373bc3aa9
Merge pull request #8102 from dreamsyntax/debug-mousefix
Qt/Debugger CodeWidget navigation unification
2019-05-24 14:49:05 +02:00
dreamsyntax e06a62d9d1 Qt: Fix CodeWidget navigation
Changed itemSelectionChanged and itemClicked signal to itemPressed in CodeWidget.
Holding mouse down and moving will only travel up/down the stack one time.
This fixes the common occurrence of unintentionally traveling deeper down the stack or higher up the callstack than intended.
2019-05-24 14:39:15 +02:00
Léo Lam 6eb7c525b2
Merge pull request #7801 from GerbilSoft/feature/Discord-PPCTitleChanged
Update Discord rich presence when the PPC title changes
2019-05-24 14:30:52 +02:00
David Korth 8417c78b7a Update Discord rich presence when the title changes
This allows us to update the rich presence description if a channel
is launched from the Wii Menu. It also handles other PPC title
launches, e.g. Smash Bros. Masterpieces.

Host.h: Added Host_TitleChanged().

DolphinNoGUI/MainNoGUI.cpp: Implemented Host_TitleChanged().
DolphinQt/Host.cpp: Implemented Host_TitleChanged().

Android/jni/MainAndroid.cpp: Stubbed Host_TitleChanged().
DSPTool/StubHost.cpp: Stubbed Host_TitleChanged().
UnitTests/StubHost.cpp: Stubbed Host_TitleChanged().
2019-05-24 14:12:48 +02:00
booto 27cb407ecf PowerPC: Add Broadway's PVR (retail Wii) 2019-05-23 19:56:41 -04:00
Léo Lam 702344ba9c
Merge pull request #8105 from 8times9/render-window
Qt/InterfacePane: Rename "In-Game" to "Render Window"
2019-05-23 13:06:36 +02:00
Léo Lam 617747e905
Merge pull request #8113 from lioncash/ini-key
Common/IniFile: Simplify Set()
2019-05-23 12:15:30 +02:00
Léo Lam 67c2aa0701
Merge pull request #8114 from lioncash/ini-line
IniFile: Prevent potential out-of-bounds access in ParseLine()
2019-05-23 12:12:41 +02:00
JosJuice 3132839113
Merge pull request #8116 from booto/clang-format-revert
clang-format: revert 'AfterCaseLabel' setting
2019-05-23 10:56:51 +02:00
booto c5a9a77684 clang-format: revert 'AfterCaseLabel' setting 2019-05-23 00:42:42 -04:00
Lioncash 2ae370fc37 IniFile: Prevent potential out-of-bounds access in ParseLine()
While current usages of ParseLine aren't problematic, this is still a
public function that can be used for other purposes. Essentially makes
the function handle potential external inputs a little nicer.
2019-05-22 21:09:11 -04:00
Lioncash 869acb96c6 Common/IniFile: Simplify Set()
We can just utilize map's insert_or_assign() function and check the
return value to determine whether or not we need to insert the key into
the keys_order vector.
2019-05-22 20:58:49 -04:00