Commit Graph

29508 Commits

Author SHA1 Message Date
JosJuice 3a8793f93f Android: Refactor MainActivity, add forEachPlatformGamesView 2021-02-20 17:55:31 +01:00
Sepalani a8dc1e3f1c NetworkWidget: Reorganise SSL options group box
Create "Dump options" and "Security options" group boxes.
Add "Network dump format" combo box.
Add "Open dump folder" button.
2021-02-20 18:19:37 +04:00
Léo Lam 985ede9ca0
Core: Fix time base unit mixup
And add a strongly typed integer type so that making this kind of
mistake is more difficult
2021-02-20 14:18:21 +01:00
InusualZ caf140dea9 Fix issue were loaded memory breakpoints were not being triggered
This was caused, because we were saving the `break_on_hit` flag with the letter `p`. Then while loading the breakpoints, we read the flag with the letter `b`, resulting in the `break_on_hit` flag being always false
2021-02-19 16:09:50 +00:00
Léo Lam 93f9d67d2f
Merge pull request #9511 from leoetlino/es-content-timings
IOS: Emulate FS timings for ES content IPC commands
2021-02-19 16:08:24 +01:00
Léo Lam 9957d6c106
Merge pull request #9516 from iwubcode/dynamic_input_textures_improved
InputCommon: move some dynamic input texture logic and add specification option
2021-02-19 16:06:13 +01:00
iwubcode 55ba1c7c9c InputCommon: Move initial dynamic input texture configuration logic to a 'specification 1' function and load in a 'specification' attribute that defaults to 1 if not present (with 1 being the only valid value at the moment) 2021-02-19 00:02:15 -06:00
Léo Lam 34c9e0dece
Merge pull request #9521 from sepalani/watches
Debugger: Fix "Add to watch" not working
2021-02-19 01:30:14 +01:00
Léo Lam e3bf5fca93
IOS: Deduplicate IPC_OVERHEAD_TICKS timing constant 2021-02-18 21:10:55 +01:00
Léo Lam f750208aa3
IOS/ES: Emulate FS timings for content wrapper IPC commands
Filesystem accesses aren't magically faster when they are done by ES,
so this commit changes our content wrapper IPC commands to take FS
access times and read operations into account.

This should make content read timings a lot more accurate and closer
to console. Note that the accuracy of the timings are limited to the
accuracy of the emulated FS timings, and currently performance
differences between IOS9-IOS28 and newer IOS versions are not emulated.

Part 1 of fixing https://bugs.dolphin-emu.org/issues/11346
(part 2 will involve emulating those differences)
2021-02-18 18:53:33 +01:00
Léo Lam 5eca82a6f2
IOS/ES: Allow various utility functions to return timing info 2021-02-18 18:53:33 +01:00
Léo Lam f214df5d2c
IOS/FS: Allow IPC interface to be used internally from IOS HLE
This makes it more convenient to emulate timings for IPC commands that
perform internal IOS <-> IOS IPC, for example ES relying on FS
for filesystem access.
2021-02-18 18:53:32 +01:00
Léo Lam 1073463d35
IOS/ES: Log content reads for debugging
We log FS reads already, might as well log ES content reads.
2021-02-18 18:52:35 +01:00
Léo Lam 41e2fab54c
IOS/ES: Log content ID and index when opening contents for debugging
The content ID/index is what actually matters..
2021-02-18 18:52:35 +01:00
Léo Lam 5e79b6acb7
Merge pull request #9515 from leoetlino/fs-timings-redux
IOS/FS: Implement timings for older IOS versions as well
2021-02-18 18:50:15 +01:00
Sepalani e3d85ffe35 MemoryWidget: Add "Add to watch" action 2021-02-17 21:32:36 +04:00
Sepalani bbcaede389 RegisterWidget: Fix add to watch action 2021-02-17 21:25:29 +04:00
iwubcode 10127a0451 InputCommon: Move DynamicInputTextureData to DynamicInputTextures::Data 2021-02-16 22:43:10 -06:00
iwubcode 28a911ae6b InputCommon: Move DynamicInputTextureConfiguration to DynamicInputTextures::Configuration 2021-02-16 22:37:59 -06:00
JosJuice 1e500d96b0 JitArm64: Workaround for GCC ICE 2021-02-15 23:46:08 +01:00
Léo Lam d0c91380c7
IOS/FS: Implement timings for older IOS versions as well
According to hwtests, older versions of IOS are slower at performing
various filesystem operations:

https://docs.google.com/spreadsheets/d/1OKo9IUuKCrniz4m0kYIaMP_qFtOCmAzHZ_zAmobvBcc/edit

(courtesy of JMC)

A quick glance at IOS9 reveals that older versions of IOS have a
simplistic implementation of memcpy that does not optimize large copies
by copying 16 bytes or 32 bytes per chunk, which makes cached reads
and writes noticeably slower -- the difference was significant enough
that the OoT speedrunning community noticed that IOS9 (the IOS that
is used for the OoT VC title) was slower.
2021-02-15 18:41:22 +01:00
Léo Lam 7097a7b3af
Qt: Re-add IOS version to the game info tab
This was accidentally removed during the Qt migration:
https://github.com/dolphin-emu/dolphin/pull/4734
2021-02-15 18:34:09 +01:00
Léo Lam f9deb68aee
Merge pull request #9514 from JosJuice/jitarm64-offsetof
JitArm64: Fix improper uses of offsetof
2021-02-15 00:59:11 +01:00
JosJuice f2f3a59dbf JitArm64: Fix improper uses of offsetof
Using a non-constant array index inside offsetof is not
standards compliant, and is rejected by GCC 11.
https://bugs.dolphin-emu.org/issues/12409#note-5
2021-02-14 20:47:41 +01:00
Léo Lam f79e629119
Merge pull request #9499 from sepalani/pcap-ssl-raw
PCAP: Add raw SSL packets logging support
2021-02-14 18:39:33 +01:00
Sepalani d3dd830e8f PCAP: Add raw SSL packets logging support 2021-02-14 20:24:28 +04:00
Léo Lam efab17c025
Merge pull request #9498 from leoetlino/offsetof-constant
Core/DSP: Fix improper uses of offsetof
2021-02-14 16:34:39 +01:00
Léo Lam be2cd2272d
Merge pull request #9507 from leoetlino/device-prepareforstate
IOS: Remove unnecessary and unused PrepareForState
2021-02-14 16:30:34 +01:00
Léo Lam 6944eaa003
Merge pull request #9512 from sepalani/func-update
CodeViewWidget: Add WithDetailedUpdate to update CodeWidget
2021-02-14 16:30:05 +01:00
Léo Lam c33d944961
Merge pull request #9412 from JosJuice/jitarm64-movi2r
Arm64Emitter: Improve MOVI2R
2021-02-14 16:25:52 +01:00
Sepalani 5f629abd8b CodeViewWidget: Add WithDetailedUpdate to update CodeWidget
This used to also update the function calls and callers.
2021-02-14 16:01:32 +04:00
Léo Lam 8f25b0426e
Merge pull request #9509 from sepalani/net-tab
NetworkWidget: Add hostname to SSL table
2021-02-14 02:00:25 +01:00
Léo Lam effd918837
Merge pull request #9508 from leoetlino/ipc-reply-cleanup
IOS: Clean up the way IPC replies are constructed
2021-02-14 01:59:41 +01:00
Pokechu22 fcd3efa1ae Software: Implement points 2021-02-13 15:59:40 -08:00
Pokechu22 8e348b87e9 Software: Fix line-width effects 2021-02-13 15:59:39 -08:00
JosJuice eff66c2adc Arm64Emitter: Expand the MOVI2R unit test a little
This tests for a bug with ADRP which was present in an
earlier version of this pull request.

Also adding the MOVI2R unit test to the VS build.
2021-02-13 21:04:16 +01:00
JosJuice 9ad4f724e4 Arm64Emitter: Use ORR in MOVI2R 2021-02-13 21:04:13 +01:00
Léo Lam e62c33c413
Merge pull request #9500 from sepalani/pcap-log-session
PCAP: Improve TCP session logging
2021-02-13 20:50:58 +01:00
Sepalani aab78b88ab NetworkWidget: Add hostname to SSL table 2021-02-13 23:45:22 +04:00
JosJuice 0d5ed06daf Arm64Emitter: Improve MOVI2R
More or less a complete rewrite of the function which aims
to be equally good or better for each given input, without
relying on special cases like the old implementation did.

In particular, we now have more extensive support for
MOVN, as mentioned in a TODO comment.
2021-02-13 20:23:03 +01:00
Léo Lam d0136dd7c2
IOS: Clean up the way IPC replies are constructed
Instead of constructing IPCCommandResult with static member functions
in the Device class, we can just add the relevant constructors to the
reply struct itself. Makes more sense than putting it in Device
when the struct is used in the kernel code and doesn't use any Device
specific members...

This commit also changes the IPC command handlers to return an optional
IPCCommandResult rather than an IPCCommandResult. This removes the need
for a separate boolean that indicates whether the "result" is actually
a reply, and also avoids the need to set dummy result values and ticks.

It also makes it really obvious which commands can result in no reply
being generated.

Finally, this commit renames IPCCommandResult to IPCReply since the
struct is now only used for actual replies. This new name is less
verbose in my opinion.

The diff is quite large since this touches every command handler, but
the only functional change is that I fixed EnqueueIPCReply to
take a s64 for cycles_in_future to match IPCReply.
2021-02-13 20:15:30 +01:00
Léo Lam f52aa3d041
HW: Add a UDL for timebase ticks to cycles conversions 2021-02-13 18:24:23 +01:00
Léo Lam 6e8881a426
IOS: Remove unnecessary and unused PrepareForState
PrepareForState is now unnecessary with the new implementation of
HostFileSystem::DoState, which does what the old implementation
(CWII_IPC_HLE_Device_FileIO::PrepareForState) used to do.
2021-02-13 16:56:29 +01:00
Léo Lam 2f85b80b7b
Merge pull request #9333 from Pokechu22/sw-always-divide-by-q
Software: Always divide the texture coordinates by q.
2021-02-13 13:24:18 +01:00
JosJuice 4e107935ac Arm64Emitter: Allow specifying 21th bit of ADRP imm 2021-02-13 11:33:27 +01:00
JosJuice d226b8f825 Arm64Emitter: Remove optimize parameter from MOVI2R
I don't really see the use of this. (Maybe in the past it
was used for when we need a constant number of instructions
for backpatching? But we don't use MOVI2R for that now.)
2021-02-13 11:33:27 +01:00
Pokechu22 7d5ae03219 Software: Always divide the texture coordinates by q.
Equivalent to da43f9a15 for the software renderer.
2021-02-12 16:37:47 -08:00
Léo Lam 99fc1c682a
IOS: Simplify unnecessarily qualified names
Now that the ES class (now called ESDevice) and the ES namespace do
not conflict anymore, "IOS::" can be dropped in a lot of cases.

This also removes "IOS::HLE::" for code that is already in that
namespace. Some of those names used to be explicitly qualified
only for historical reasons.

There are no functional changes.
2021-02-13 01:36:09 +01:00
Léo Lam a2fa89b15e
Merge pull request #9502 from JosJuice/android-dol-elf-details
Android: Adjust logic for DOL/ELF long press
2021-02-13 01:03:26 +01:00
Léo Lam 3e1646adae
Merge pull request #9504 from leoetlino/ios-class-name-cleanup
IOS: Use less ambiguous names for classes
2021-02-13 01:00:16 +01:00
Léo Lam 522cb6b137
IOS: Use less ambiguous names for classes
Some of the device names can be ambiguous and require fully or partly
qualifying the name (e.g. IOS::HLE::FS::) in a somewhat verbose way.

Additionally, insufficiently qualified names are prone to breaking.
Consider the example of IOS::HLE::FS:: (namespace) and
IOS::HLE::Device::FS (class). If we use FS::Foo in a file that doesn't
know about the class, everything will work fine. However, as soon as
Device::FS is declared via a header include or even just forward
declared, that code will cease to compile because FS:: now resolves
to Device::FS if FS::Foo was used in the Device namespace.

It also leads to having to write IOS::ES:: to access ES types and
utilities even for code that is already under the IOS namespace.

The fix for this is simple: rename the device classes and give them
a "device" suffix in their names if the existing ones may be ambiguous.
This makes it clear whether we're referring to the device class or to
something else.

This is not any longer to type, considering it lets us get rid of the
Device namespace, which is now wholly unnecessary.

There are no functional changes in this commit.

A future commit will fix unnecessarily qualified names.
2021-02-12 21:40:31 +01:00
Léo Lam 09c9fdf71c
Merge pull request #9505 from Pokechu22/bitfield-natvis
Restore BitField Natvis
2021-02-12 12:36:59 +01:00
Sepalani fabf6f51cd PCAP: Improve TCP session logging 2021-02-12 13:42:18 +04:00
Pokechu22 0102914323 Restore BitField Natvis
It was lost in #9092.
2021-02-11 23:31:27 -08:00
iwubcode ce7db2e32b InputCommon: When using dynamic input textures, only call force reload textures once for packs that have multiple configurations 2021-02-11 19:18:38 -06:00
iwubcode 0a9c764dc4 VideoCommon: Join the prefetch thread before clearing to avoid a potential crash that can occur by multiple threads touching a single resource 2021-02-11 19:18:38 -06:00
JosJuice 296efad2e3 Android: Add missing "World" entry in country list
Fixes an IndexOutOfBoundsException. (Yeah, attempts at having
cross-language enums are kinda fragile...)
2021-02-11 22:35:18 +01:00
JosJuice 606e6ca3ba Android: Adjust logic for DOL/ELF long press
Android follow-up for 83c1277. Removes some now unnecessary code
and disables "Set as Default ISO" for DOL, ELF and WAD files.
2021-02-11 22:32:20 +01:00
Léo Lam bf758fbe7c
Merge pull request #9490 from Dentomologist/fix_expression_scroll_wheel_spam
Config: Fix expression window scroll wheel spam
2021-02-11 21:42:00 +01:00
Léo Lam 3ce72d4005
Merge pull request #9408 from sepalani/sni
SSL: Workaround to remove SNI from ClientHello
2021-02-11 21:38:41 +01:00
Sepalani 2a15bc6ab2 SSL: Workaround to remove SNI from ClientHello 2021-02-11 23:13:59 +04:00
Léo Lam a354814240
Merge pull request #9424 from Pokechu22/sw-no-special-case
Software: Remove normalization special case
2021-02-11 19:36:45 +01:00
Léo Lam 1fc6fbc2c0
Merge pull request #6075 from sepalani/pcap-log
PCAP logging with fake TCP/UDP packet
2021-02-11 00:15:37 +01:00
Léo Lam ddacbf83f6
Merge pull request #9461 from cbartondock/master
Working Game IDs for Elf/Dol files
2021-02-10 22:50:40 +01:00
Léo Lam 1e71904cb9
Merge pull request #9495 from leoetlino/wiki-redirect
Qt: Fix "open wiki" option not using the wiki redirect script
2021-02-10 13:14:47 +01:00
Léo Lam 118b2a3580
Core/DSP: Fix improper uses of offsetof
According to the C standard, an offsetof expression must evaluate to an
address constant, otherwise it's undefined behavior.

Fixes https://bugs.dolphin-emu.org/issues/12409

See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95942

There are still improper uses of offsetof (mostly in JitArm64) but
fixing that will take more effort since there's a PPCSTATE_OFF wrapper
macro that is sometimes used with non-array members and sometimes used
with arrays and variable indices... Let's keep that for another PR.
2021-02-10 02:03:16 +01:00
Dentomologist 43b389410a Config: Fix expression window scroll wheel spam
Fixes the expression window being spammed with the first entry in the
Operators or Functions select menus when scrolling the mouse wheel while
hovering over them.

Fixes https://bugs.dolphin-emu.org/issues/12405
2021-02-09 08:55:01 -08:00
JosJuice 3e4bf57c69
Merge pull request #9423 from MerryMage/arm64-movi2r-test
UnitTests: Add MOVI2R test
2021-02-08 10:58:09 +01:00
Markus Wick 9a2d908aba
Merge pull request #9400 from JosJuice/jitarm64-imm
JitArm64: More constant propagation optimizations
2021-02-08 10:53:01 +01:00
Léo Lam 7ef8e53c4a
Qt: Fix "open wiki" option not using the wiki redirect script
The dolphin-redirect.php script seems to have been present since 2012
at least, but we accidentally stopped using it when the "open wiki"
feature was reimplemented in DolphinQt2 in 2016.

    <@delroth> dolphin-redirect.php is slightly smarter and tries to find gameid aliases for e.g. same region
    <@delroth> uh, I mean different region
2021-02-08 02:52:29 +01:00
JosJuice 761d7748b6 JitArm64: Fix mistaken use of LSL imm 2021-02-07 13:55:55 +01:00
JosJuice efeda3b759 JitArm64: More constant propagation optimizations
PR 9262 added a bunch of Jit64 optimizations, some of
which were already in JitArm64 and some which weren't.
This change ports the latter ones to JitArm64.
2021-02-07 13:55:35 +01:00
Errorcodebin 8a3fe6e24a Fix mapping window title bar becoming unresponsive 2021-02-04 14:32:03 +01:00
Markus Wick b6e9cca64f
Merge pull request #9485 from JosJuice/jitarm64-pc-stp
JitArm64: Use STP for pc/npc
2021-02-03 12:22:37 +01:00
iwubcode 77c68a3142 DolphinQt: Fix regression that caused the regex expression to be evaluated incorrectly. If an input expression has a non-alpha character in it, we want to quote it with backticks 2021-02-02 20:36:54 -06:00
MerryMage 1ab7657120 MovI2R: Do not exhaustively test 2021-01-31 13:17:31 +00:00
MerryMage fe9207bb56 UnitTests: Add MOVI2R test 2021-01-31 13:17:19 +00:00
MerryMage f65c1df094 Random: Add seeded PRNG 2021-01-31 13:16:45 +00:00
MerryMage a0b8956f22 JitArm64_Integer: Add optimizations for rlwimix
* Check for case when source field is at LSB
* Use BFXIL if possible
* Avoid ROR where possible
2021-01-31 12:05:43 +00:00
MerryMage 8aa2013a2d Arm64Emitter: Add additional assertions to BFI/UBFIZ 2021-01-31 12:04:57 +00:00
MerryMage 75d92ad628 Arm64Emitter: Prefer BFM/UBFM to EncodeBitfieldMOVInst 2021-01-31 12:04:57 +00:00
MerryMage be6aec9932 Arm64Emitter: Add BFXIL 2021-01-31 12:04:57 +00:00
Sepalani 82bb5d9915 NetworkCaptureLogger: PCAP support added
Log TCP/UDP read/write with fake packet.
2021-01-30 19:35:09 +04:00
cbartondock 83c127784b Working Game IDs for Elf/Dol files 2021-01-30 09:51:37 -05:00
JosJuice dd8e504c80 JitArm64: Use STP for pc/npc 2021-01-30 11:56:25 +01:00
Markus Wick b22073ef59
Merge pull request #9484 from JosJuice/jitarm64-ps-stp
JitArm64: Use STP for (parts of) ppcState.ps
2021-01-30 08:51:56 +01:00
JosJuice 91b55824f9 JitArm64: Use STP for (parts of) ppcState.ps
The savestate incompatibility problem mentioned in a comment
was solved by d266be5.
2021-01-30 01:01:01 +01:00
JosJuice 2d9ea42df2 Arm64Emitter: Add asserts for LDP/STP imm out of range 2021-01-30 00:25:33 +01:00
Admiral H. Curtiss dc2d234284 GCMemcardUtils: Fix typo in comment. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss e47eb16641 GCMemcardManager: Detect attempt to import multiple save files with the same internal name. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 74b56a8c7f GCMemcardManager: Add filename column. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 9acbe1aced GCMemcardManager: Make columns sortable. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 42f4ee629b GCMemcardManager: Make columns resizable by the user. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 7cf991bd8a GCMemcardManager: Small cleanups. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss e00e6e1a8c GCMemcardManager: Replace remaining panic alert with ModalMessageBox. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss daa76183ed GCMemcard: Let ImportFile() take a Savefile instead of a direntry and a vector of blocks. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss c95f3cbb61 GCMemcard: Remove obsolete methods. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 645cb2f3d1 GCMemcardDirectory: Rewrite migration logic without ExportGci(). 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss e8b99d3afd GCMemcardManager: Rewrite file deleting logic to provide a better user experience. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 6e96f95432 GCMemcardManager: Rewrite file copying logic to provide a better user experience. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 08dccb8727 GCMemcardManager: Rewrite file importing logic to provide a better user experience. 2021-01-28 22:01:33 +01:00
Admiral H. Curtiss 3286d2df3d Common/VariantUtil: Add 'overloaded' helper struct for use with std::variant. 2021-01-28 22:01:32 +01:00
Admiral H. Curtiss 87ae7ccd75 GCMemcardManager: Rewrite file exporting logic to provide a better user experience. 2021-01-28 22:01:32 +01:00
Admiral H. Curtiss 7bb7aa16c2 GCMemcardManager: Relayout file table for a more compact design. 2021-01-28 22:01:32 +01:00
Admiral H. Curtiss ec4fc7171f GCMemcardUtils: Implement GenerateFilename() as a cleaner variant of GCMemcard::GCI_FileName(). 2021-01-28 22:01:30 +01:00
Admiral H. Curtiss 3e7f537a9d GCMemcard: Implement ExportFile() to get a file on a card with a single method call. 2021-01-28 22:00:33 +01:00
Admiral H. Curtiss 9b14cc8ea2 GCMemcard: Implement utility functions to read saves from and write saves to files, without involving a memory card. 2021-01-28 22:00:28 +01:00
Sepalani b363962757 BreakpointWidget: Remove unnecessary code
PPCDebugInterface.Clear() is called by Core on shutdown instead
2021-01-28 21:23:18 +04:00
Sepalani 289637f92f NetworkCaptureLogger: Move SSL logging 2021-01-28 21:23:18 +04:00
Shawn Hoffman 6829775fac msbuild: re-enable HAS_OPENGL and HAS_VULKAN 2021-01-27 19:10:53 -08:00
Léo Lam c386c5acc2
Merge pull request #9366 from iwubcode/freelook_camera_quaternion
VideoCommon: allow Free Look to be manipulated by a quaternion
2021-01-28 01:34:09 +01:00
Léo Lam 9ca24ae8e0
Merge pull request #9092 from shuffle2/vshack
msbuild: Merge "Core" libs into single DolphinLib
2021-01-28 01:33:46 +01:00
iwubcode 586c689d63 VideoCommon: use Quaternion for Free Look orientation 2021-01-27 18:22:10 -06:00
iwubcode d35287b6e4 Common: update Quaternion to allow rotating pitch, yaw, and roll all at once 2021-01-27 18:22:10 -06:00
iwubcode 544692f96a Common: add convenience function to convert a Quaternion to a Matrix44 2021-01-27 18:22:10 -06:00
SirMangler 9f6d88880e
MemoryWidget: Add 'Offset' and General Improvements 2021-01-28 01:04:09 +01:00
Shawn Hoffman 500a694ca8 msbuild: bundle all dolphin "core" code into single library 2021-01-27 14:29:49 -08:00
Shawn Hoffman 5770ff01f3 rename D3DCommon/Common to D3DCommon/D3DCommon 2021-01-27 14:29:48 -08:00
Shawn Hoffman 527b5a9761 normalize common filenames in VideoBackends/D3D12 2021-01-27 14:29:48 -08:00
Shawn Hoffman a0aeb5b0b9 normalize common filenames in VideoBackends/D3D 2021-01-27 14:29:48 -08:00
Shawn Hoffman d7fd892fde normalize common filenames in VideoBackends/Vulkan 2021-01-27 14:29:48 -08:00
Shawn Hoffman ef70fe05bf normalize common filenames in VideoBackends/Null 2021-01-27 14:29:48 -08:00
Shawn Hoffman ff4f67492b normalize common filenames in VideoBackends/OGL 2021-01-27 14:29:48 -08:00
Shawn Hoffman 3193f3d5c4 rename Core/IOS/FS/FileSystem.cpp to FileSystemCommon.cpp 2021-01-27 14:29:48 -08:00
Shawn Hoffman 7e1df34735 rename InputCommon/ControllerInterface/Device to CoreDevice 2021-01-27 14:29:48 -08:00
Shawn Hoffman 0be1491ef0 rename ciface::Wiimote to ciface::WiimoteController 2021-01-27 14:29:48 -08:00
Shawn Hoffman 84128d9532 rename Common/File to Common/IOFile 2021-01-27 14:29:48 -08:00
Shawn Hoffman 07fd02f207 rename Core/Analytics to Core/DolphinAnalytics 2021-01-27 14:29:47 -08:00
Léo Lam 96e3360f05
Merge pull request #9452 from JosJuice/android-wii-saves
Android: Add "Import Wii Save"
2021-01-27 23:00:47 +01:00
Markus Wick 7290cd0032
Merge pull request #9478 from JosJuice/double-assert-attempt-2
JitArm64: Fix false positive "turned singles into doubles" asserts
2021-01-27 20:20:59 +01:00
Markus Wick b1fdd14ed1
Merge pull request #9314 from smurf3tte/dcbx
Jit: Fix correctness issue in dcbf/dcbi/dcbst
2021-01-27 20:12:21 +01:00
JosJuice 12aa1071cb Android: Re-implement a subset of CompletableFuture
Imagine if Android phones actually got updates
2021-01-27 20:10:07 +01:00
JosJuice 347551a01d Android: Implement save overwrite confirmation 2021-01-27 20:10:07 +01:00
JosJuice cd4ccda51c Android: Add "Import Wii Save" 2021-01-27 20:10:06 +01:00
JosJuice b08306d0b8 Android: Refactor MainPresenter.installWad
Also replacing a toast with a dialog so that you have proper
time to read the message.
2021-01-27 20:10:06 +01:00
JosJuice 4a394ffc9c Android: Merge launchInstallWad into launchOpenFileActivity 2021-01-27 20:10:05 +01:00
JosJuice 80b56b6575 Android: Move InstallWAD to a new WiiUtils class
I'm trying to move away from dumping every native method
in NativeLibrary.
2021-01-27 20:10:05 +01:00
Markus Wick 2ada5b422d
Merge pull request #9448 from JosJuice/blr-x30
JitArm64: Avoid using X30 with BLR
2021-01-27 20:07:24 +01:00
Léo Lam 8c127a612f
Merge pull request #9416 from Filoppi/patch-9
InputCommon: Wrap remaining invalid default input expressions around ``
2021-01-27 19:54:20 +01:00
Léo Lam 6dc0f0dfe6
Merge pull request #9438 from shuffle2/add-shortcut-to-desktop
DolphinQT: Gives option to add desktop shortcut
2021-01-27 19:41:09 +01:00
Léo Lam b597b16f63
Merge pull request #9439 from Darwin-Rist/master
Added Opacity settings for touchscreen controls
2021-01-27 19:35:58 +01:00
Léo Lam 28cd6f6520
Merge pull request #9440 from lioncash/qt6
DolphinQt: Qt 6.0 forward-compatibility changes
2021-01-27 19:28:43 +01:00
Léo Lam 6086111566
Merge pull request #9467 from iwubcode/gamecube_controllers_widget
DolphinQt: Move gamecube controller ui logic to its own widget
2021-01-27 19:24:06 +01:00
Léo Lam 84ad550c19
Merge pull request #9449 from Filoppi/patch-11
Qt: Fix Shake Mapping Indicator not showing deadzone
2021-01-27 19:19:58 +01:00
Léo Lam 42b55e8fa3
Merge pull request #9450 from Filoppi/patch-12
Qt: Fix stock input profiles being deletable
2021-01-27 19:18:51 +01:00
iwubcode 780360b921 DolphinQt: Move gamecube controller ui logic to its own widget 2021-01-27 12:02:39 -06:00
Léo Lam 920dd812ad
Merge pull request #9468 from iwubcode/wiimote_controllers_widget
DolphinQt: Move wiimote controller ui logic to its own widget
2021-01-27 18:54:29 +01:00
iwubcode f3b6c9723c DolphinQt: Move wiimote controller ui logic to its own widget 2021-01-27 11:27:05 -06:00
Léo Lam fb09acd01f
Merge pull request #9453 from JosJuice/state-metadata-osd
Android: Don't show OSD messages when opening savestate menu
2021-01-27 18:22:39 +01:00
Léo Lam 70447d0281
Merge pull request #9454 from JosJuice/android-ingame-settings-save
Android: Fix in-game settings changes not getting saved
2021-01-27 18:17:27 +01:00
JosJuice 5d19558623 JitArm64: Fix false positive "turned singles into doubles" asserts
Fixes a regression from 88f3fec.
2021-01-27 16:11:39 +01:00
Léo Lam b886c70a43
Merge pull request #9456 from trevor403/breakpoint-loading
Breakpoint from string flag parsing using token
2021-01-27 15:53:24 +01:00
Léo Lam 4ba9bb26e9
Merge pull request #9455 from lioncash/traversal
TraversalProto: Minor cleanup
2021-01-27 15:51:29 +01:00
Shawn Hoffman a02a629958 windows: fix unregistering VEH 2021-01-27 05:15:54 -08:00
Léo Lam 305faa73ec
Merge pull request #9436 from shuffle2/asan
msvc: enable asan compat
2021-01-27 13:24:26 +01:00
Léo Lam 2537ea77ee
Merge pull request #9460 from jordan-woyak/wiimote-dc-crash-fix
WiimoteReal: Fix crash on real Wii Remote disconnect on Windows.
2021-01-27 13:14:52 +01:00
Léo Lam bc14e4a0f0
Merge pull request #9463 from Dentomologist/fix_CreateTempDir_calls
UnitTests: Add setup error checking
2021-01-27 13:12:05 +01:00
Léo Lam 093978b2e0
Merge pull request #9466 from iwubcode/common_controllers_widget
DolphinQt: Move common controller interface logic to its own widget
2021-01-27 13:06:20 +01:00
JosJuice d00430470b JitArm64: Update registers last used before start of instruction
Let's reset m_last_used for each register that will be used
in an instruction before we start allocating any of them,
so that one of the earlier allocations doesn't spill a
register that we want in a later allocation. (We must still
also increment/reset m_last_used in R and RW, otherwise we
end up in trouble when emulating lmw/stmw since those access
more guest registers than there are available host registers.)

This should ensure that the asserts added earlier in this
pull request are never triggered.
2021-01-26 22:53:33 +01:00
JosJuice f17cd3750a JitArm64: Remove default parameters from Arm64FPRCache::R/RW
It obscures more than it helps in my opinion.
2021-01-26 22:53:33 +01:00
JosJuice 88f3fec04e JitArm64: Add asserts for unexpected single to float conversions
If the register pressure is high when allocating registers,
Arm64FPRCache may spill a guest register which we are going to
allocate later during the current instruction, which has the
side effect of turning it into double precision. This will have
bad consequences if we are assuming that it is single precision,
so let's add some asserts to detect if that ever happens.
2021-01-26 22:53:33 +01:00
smurf3tte 66b992cfe4 Jit: Fix correctness issue in dcbf/dcbi/dcbst
PR #2663 added a Jit64 implementation of dcbX and a fast path to skip JIT cache invalidation. Unfortunately, there is a mismatch between address spaces in this optimization. It tests the effective address (with the top 3 bits cleared) against the valid block bitset which is intended to be indexed by physical address. While this works in the common case, it fails (for example) when the effective address is in the 7E... region (a.k.a. "fake VMEM"). This may also fall apart under more complex memory mapping scenarios requiring full MMU emulation.

The good news is that even without this fast path, the underlying call to JitInterface::InvalidateICache() still does very little work in the common case. It correctly translates the effective address to a physical address which it tests against the valid block bitset, skipping invalidation if it is not necessary. As such, the cost of removing the fast path should not be too high.

The Jit64 implementation is retained, though all it does now is emit a call. This is marginally more efficient than simple interpreter fallback, which involves an extra call. The JitArm64 implementation has also been fixed.

The game Happy Feet is fixed by this change, as it loads code in the 7E... address region and depends upon JIT cache invalidation in reponse to dcbf.

https://bugs.dolphin-emu.org/issues/12133
2021-01-23 15:17:09 -08:00
iwubcode 67b9e94e4d DolphinQt: Move common controller interface logic to its own widget 2021-01-23 15:17:38 -06:00
JosJuice 67491979ab JitArm64: Avoid using X30 with BLR
At least on some CPUs (I found out about this from the
Arm Cortex-A76 Software Optimization Guide), using X30
with BLR is one cycle slower than using another register.
2021-01-23 10:32:44 +01:00
Dentomologist 83f912b58a UnitTests: Add setup error checking
Check return value of calls to File::CreateTempDir() from CoreTiming,
FileSystem, and MMIO test classes to verify the test user directory
exists, and fail the tests otherwise.
2021-01-22 11:49:59 -08:00
Trevor Rudolph 59058bae0a Breakpoint from string flag parsing using token
Since the string includes hex, the break_on_hit 'b' flag can be pulled from the address by accident

istringstream for BreakPoint parsing
2021-01-21 12:33:42 -05:00
Jordan Woyak bb2c50ac94 WiimoteReal: Fix crash on real Wii Remote disconnect on Windows caused by dangling pointer. 2021-01-20 17:33:43 -06:00
iwubcode af7384002f FreeLookManager: acquire global input lock before accessing individual FreeLook control states 2021-01-20 12:25:21 -06:00
Lioncash b425250a7b TraversalClient: Make use of std::string_view with ConnectToClient()
Same behavior, but allows the use of non-allocating string types with
the interface.
2021-01-20 12:24:06 -05:00
Lioncash cb4ca7837a TraversalClient: Prevent uninitialized values from occurring in MakeENetAddress
Previously, eaddr would only be partially initialized in the ipv6 case.
Even if there's no support for it, we may as well ensure that the
variable always has deterministic initialization.

While we're at it, we can make the parameter a const reference, given no
members are modified.
2021-01-20 12:24:05 -05:00
Lioncash f0c6e696fd TraversalProto: Convert typedefs into using aliases
Same behavior, more straightforward reading.
2021-01-20 12:24:05 -05:00
Lioncash d48b5615ae TraversalProto: Collapse version enum into a typed variable
Same behavior, less code.
2021-01-20 12:24:05 -05:00
Lioncash d2ea94195c TraversalProto: Convert TraversalPacketType into an enum class
Makes for strong typing and prevents namespace pollution.
2021-01-20 12:24:05 -05:00
Lioncash 2f0fb2056e TraversalProto: Convert TraversalConnectFailedReason into an enum class 2021-01-20 12:24:05 -05:00
Lioncash 2021175809 TraversalClient: Convert state enum into an enum class
Prevents implicit conversions and prevents identifiers from polluting
the class scope.
2021-01-20 12:24:03 -05:00
JosJuice ebf3b5faf4
Merge pull request #9451 from Sintendo/jit64boolxrw
Jit64: boolx - Eliminate read dependency
2021-01-19 15:40:43 +01:00
JosJuice 5978550b2f Android: Fix in-game settings changes not getting saved
EmulationActivity has an instance of Settings. If you go to
SettingsActivity from EmulationActivity and change some settings,
the changes get saved to disk, but EmulationActivity's Settings
instance still contains the old settings in its map of all
settings (assuming the EmulationActivity was not killed by the
system to save memory). Then, once you're done playing your
game and exit EmulationActivity, EmulationActivity calls
Settings.saveSettings. This call to saveSettings first overwrites
the entire INI file with its map of all settings (which is
outdated) in order to save any legacy settings that have changed
(which they haven't, since the GUI doesn't let you change legacy
settings while a game is running). Then, it asks the new config
system to write the most up-to-date values available for non-legacy
settings, which should make all the settings be up-to-date again.
The problem here is that the new config system would skip writing
to disk if no settings changes had been made since the last time
we asked it to write to disk (i.e. since SettingsActivity exited).

NB: Calling Settings.loadSettings in EmulationActivity.onResume
is not a working solution. I assume this is because
SettingsActivity saves its settings in onStop and not onPause.
2021-01-18 15:27:16 +01:00
JosJuice abd069ada3 Check return value when calling ReadArray for savestates
Just in case we have a 0-byte file or something.
2021-01-18 14:32:19 +01:00
JosJuice 4597d53307 Android: Don't show OSD messages when opening savestate menu 2021-01-18 14:28:43 +01:00
Dentomologist e3237661ec Arm64Emitter: Convert ShiftType to enum class 2021-01-17 16:21:38 -08:00
Filippo Tarpini 396e2f5e8b InputCommon: Wrap remaining invalid default input expressions around `` 2021-01-17 17:37:13 -06:00
Sintendo 8964612577 Jit64: boolx - Eliminate read dependency
For certain occurrences of nandx/norx, we declare a ReadWrite constraint
on the destination register, even though the value of the destination
register is irrelevant. This false dependency would force the RegCache
to generate a redundant MOV when the destination register wasn't already
assigned to a host register.

Example 1:
BF 00 00 00 00       mov         edi,0
8B FE                mov         edi,esi
F7 D7                not         edi

Example 2:
8B 7D 80             mov         edi,dword ptr [rbp-80h]
8B FE                mov         edi,esi
F7 D7                not         edi
2021-01-17 21:32:28 +01:00
Filippo Tarpini c1ab89cf2c Qt: Fix stock input profiles being deletable
Also avoid files without a name before the extension (name: ".ini")
from being added to the list because then they wouldn't be saveable
and it would appear with an empty name anyway.
2021-01-17 20:51:01 +02:00
Bankaimaster999 d1c3d4f419 Added Opacity settings for touchscreen controls
Added Opacity controls for the user to customize the opacity of their touchscreen controls. Also, placed both Scale and Opacity settings into one window/option called Adjust Controls.
2021-01-17 17:25:00 +01:00
JosJuice f383397c9c
Merge pull request #9447 from Dentomologist/convert_indextype_to_enum_class
Arm64Emitter: Convert IndexType to enum class
2021-01-17 12:23:53 +01:00
Filippo Tarpini 43223aadc8
Qt: Fix Shake Mapping Indicator not showing deadzone
QRectF was missing from drawRect which meant the deazone was casted to an int, flooring its value (it goes from 0 to 1).
2021-01-16 23:10:35 +02:00
LC be74e35a0a
Merge pull request #9443 from Simonx22/update-gradle
Android: Update Gradle Plugin to 4.1.1
2021-01-16 06:55:10 -05:00
LC 1476c10a87
Merge pull request #9445 from Simonx22/update-dependencies
Android: Update dependencies to the latest version
2021-01-16 06:54:45 -05:00
Dentomologist 70c54065ab Arm64Emitter: Convert IndexType to enum class 2021-01-15 23:27:11 -08:00
Simonx22 5b98336e54 Android: Update dependencies to the latest version 2021-01-15 19:55:57 -05:00
Simonx22 8f2a2f3cda Android: Update Gradle Plugin to 4.1.1 2021-01-15 19:53:08 -05:00
Simonx22 67bc2f9f76 gradle.properties: Remove duplicate property keys 2021-01-16 01:12:31 +01:00
LC aba179e4ba
Merge pull request #9385 from MerryMage/more-bmi2
Jit_Integer: Use SHLX, SHRX, SARX
2021-01-14 21:40:45 -05:00
LC 0c2bc3582d
Merge pull request #9425 from Sintendo/jit64subfx
Jit64: subfx optimizations
2021-01-14 21:40:05 -05:00
Lioncash 5b4fced2ba DolphinQt: Resolve deprecated usages of setTime_t and toTime_t
These have been replaced with setSecsSinceEpoch() and
toSecsSinceEpoch(), respectively within Qt 5.8, so we can migrate over
to them.
2021-01-13 05:07:32 -05:00
Lioncash 892154f7ea DolphinQt: Resolve deprecated usage of margin()
This function has been marked as obsolete. In Qt 6.0 it's removed
entirely, so we must use getContentsMargin() explicitly instead
(margin() would do this for us).

Ditto for setMargin(), in which case we use setContentsMargin instead.
setMargin() would just pass its argument to all four parameters of
setContentsMargin(), so we can do the same.
2021-01-13 05:07:32 -05:00
Lioncash 46ca371ef3 DolphinQt: Migrate QRegExp over to QRegularExpression
Qt 5.0 introduced QRegularExpression to replace QRegExp. In Qt 6.0,
QRegExp is removed entirely in favor of it.
2021-01-13 05:07:29 -05:00
Lioncash 765a1b3c09 DolphinQt: Explicitly include <QActionGroup> where applicable
An indirect inclusion scenario that breaks on Qt 6.0
2021-01-13 04:46:11 -05:00
Lioncash f647ca4620 DolphinQt: Replace usages of QLatin1Literal with QStringLiteral
This literal was deprecated in 5.14.0. Not to mention it wasn't
documented as part of the API either: see the 5.14.0 changelog here:

https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.14.0?h=v5.14.0

On Qt 6.0 this define is removed entirely. To stay forward compatible,
we can make use of QStringLiteral instead.
2021-01-13 03:50:42 -05:00
Silent cb854d7832
AudioCommon/WASAPI: Construct std::thread with invoke semantics instead of a lambda 2021-01-12 19:25:40 +01:00
Silent 11c5150c16
AudioCommon/WASAPI: Factorize device enumeration logic into a function to greatly reduce code duplication 2021-01-12 19:25:38 +01:00
Silent c373890505
AudioCommon/WASAPI: Do volume adjustment only when really needed
This skips a potentially costly loop if volume is 100% or 0%,
as for former there is no need for volume adjustment,
while latter can be solved by specifying a AUDCLNT_BUFFERFLAGS_SILENT flag
2021-01-12 19:24:49 +01:00
Silent 991b3ba8c2
AudioCommon/WASAPI: Remove thread unsafe nullptr checks giving a false sense of safety 2021-01-12 19:24:49 +01:00
Silent 5dbbf36563
AudioCommon/WASAPI: Use std::string_view where applicable 2021-01-12 19:24:46 +01:00
Silent 7d59ad262f
AudioCommon/WASAPI: Use leaner memory model on m_running, no need for a full barrier 2021-01-12 19:21:54 +01:00
Silent ee60be4501
AudioCommon/WASAPI: Simplify thread synchronization model by not detaching WASAPI handler thread 2021-01-12 19:21:54 +01:00
Silent c5a372ab2a
AudioCommon/WASAPI: Use WRL/WIL whenever possible
This fixes numerous resource leaks, as not every return path cleaned every created resource
Now they are all managed automatically and "commited" to WASAPIStream class fields only
after it's certain they initialized properly
2021-01-12 19:21:22 +01:00
Silent 374629ef30
AudioCommon: Make HandleWinAPI handle all success return values properly, not just S_OK 2021-01-12 19:18:48 +01:00
Aminoa 23e565d94c DolphinQT: Gives option to add desktop shortcut
When a game is selected, the option to add a shortcut of the game to the desktop is given. Uses native Windows API since Qt lacks support for adding shortcuts.
2021-01-11 20:41:13 -08:00
Pokechu22 d55f9369c7 Use GX_CMD_UNKNOWN_METRICS instead of magic number 0x44 2021-01-11 12:41:04 -08:00
Shawn Hoffman 2ba4fd960e small prettification 2021-01-10 15:11:18 -08:00
Shawn Hoffman 49b9deeb03 msvc: add asan support (disabled by default) 2021-01-10 15:11:18 -08:00
Shawn Hoffman fc65f65891 BitUtils: cleanup constexpr usage for msvc clz 2021-01-10 10:06:30 -08:00
Shawn Hoffman 65ecf1e43e BitUtils: loosen clz to inline on msvc/arm64 2021-01-09 23:44:00 -08:00
LC a613c2a5e4
Merge pull request #9429 from Sintendo/jit64fixoverflow
Jit64: Fix FinalizeCarryOverflow XER[OV/SO]
2021-01-10 01:58:06 -05:00
LC 59fa613020
Merge pull request #9431 from shuffle2/msvc-gdbstub
msbuild: enable USE_GDBSTUB
2021-01-10 01:56:46 -05:00
LC 75e19a0c29
Merge pull request #9430 from shuffle2/vsupdate
Bump msvc version check and revert a msvc workaround
2021-01-10 01:46:28 -05:00
Shawn Hoffman f0a6244768 msbuild: enable USE_GDBSTUB
this does nothing about it actually being usable
2021-01-09 22:26:55 -08:00
Shawn Hoffman 1e5e5ea855 BitUtils: initialize variables
fixes C3615 on some msvc/cmake configs
2021-01-09 22:18:29 -08:00
Shawn Hoffman cce275c16e Revert "msvc: temporary workaround for C4789 false positive"
This reverts commit deb73d0167.
2021-01-09 19:22:36 -08:00
Shawn Hoffman c8316f70a4 msvc: bump _MSC_FULL_VER check to 192829335 2021-01-09 19:21:03 -08:00
Sintendo 305cd31bd9 Jit64: Fix FinalizeCarryOverflow XER[OV/SO]
FinalizeCarryOverflow didn't maintain XER[OV/SO] properly due to an
oversight. Here's the code it would generate:

0:  9c                      pushf
1:  80 65 3b fe             and    BYTE PTR [rbp+0x3b],0xfe
5:  71 04                   jno    b <jno>
7:  c6 45 3b 03             mov    BYTE PTR [rbp+0x3b],0x3
000000000000000b <jno>:
b:  9d                      popf

At first glance it seems reasonable. The host flags are carefully
preserved with PUSHF. The AND instruction clears XER[OV]. Next, an
conditional branch checks the host's overflow flag and, if needed, skips
over a MOV that sets XER[OV/SO]. Finally, host flags are restored with
POPF.

However, the AND instruction also clears the host's overflow flag. As a
result, the branch that follows it is always taken and the MOV is always
skipped. The end result is that XER[OV] is always cleared while XER[SO]
is left unchanged.

Putting POPF immediately after the AND would fix this, but we already
have GenerateOverflow doing it correctly (and without the PUSHF/POPF
shenanigans too). So let's just use that instead.
2021-01-09 22:52:18 +01:00
Léo Lam 0776263c5e
Merge pull request #9428 from JosJuice/tv-folder-picker
Android: Use old folder picker on Android TV
2021-01-09 11:54:02 +01:00
JosJuice 116a5a79da Android: Use old folder picker on Android TV
See the comment I added to the code. This is a rather serious
issue for Android TV users from what I've heard.
2021-01-08 16:27:33 +01:00
Léo Lam 4cdcbb6ab2
Merge pull request #9308 from smurf3tte/re23_patch
Patches for Resident Evil 2/3 audio issues
2021-01-06 01:52:15 +01:00
Léo Lam 0b1db65aa1
Merge pull request #9405 from Filoppi/patch-7
Rename "Use Fullscreen" setting to "Start in Fullscreen"
2021-01-06 01:44:46 +01:00
Pierre Bourdon 27013e8d18
Merge pull request #9300 from leoetlino/ncd-wd-fixes
IOS: WD and NCD fixes
2021-01-06 00:51:33 +01:00
Sintendo df70077e6b JitArm64: subfx - Special case a == b 2021-01-05 18:52:24 +01:00
Léo Lam eafb9de047
Merge pull request #9323 from waddlesplash/haiku
Rehabilitate Haiku support.
2021-01-05 16:09:43 +01:00
Léo Lam 840ecfb32f
Merge pull request #9409 from AdmiralCurtiss/wii-save-import-tmd
Make WiiSave::Import() behave closer to the Wii System Menu's SD Card save copying.
2021-01-05 15:36:36 +01:00
Filippo Tarpini a5a6ef8512
Fix a couple of typos
[committer note: fixed commit message style]
2021-01-05 15:24:21 +01:00
Filippo Tarpini 0805b58302
DolphinQt: Remove some useless includes
[committer note: fixed commit message style]
2021-01-05 15:24:13 +01:00
Filippo Tarpini 3acd1726b9
Core: Fix variable naming conventions
[committer note: squashed two commits]
2021-01-05 15:23:40 +01:00
Léo Lam ee25f03ff9
Merge pull request #9418 from Filoppi/patch-10
Fix DualShockUDP not adding/removing devices correctly
2021-01-05 15:15:53 +01:00
Pierre Bourdon bd89523e63
Merge pull request #9392 from smurf3tte/audio_wmask
DSP: Fix write masks on AUDIO_*/AR_* MMIO registers
2021-01-05 15:08:06 +01:00
Sintendo c0be34aa81 Jit64: subfx - Special case a == b
Soul Calibur II does this.

Before:
2B F6                sub         esi,esi

After:
Nothing!
2021-01-05 00:26:26 +01:00
Sintendo b0be20560f Jit64: subfx - Special case b == 0
Happens in Super Mario Sunshine. You could probably do something similar
for b == -1 (like we do for subfic), but I couldn't find any titles that
do this.

- Case 1: d == a

Before:
41 8B C7             mov         eax,r15d
41 BF 00 00 00 00    mov         r15d,0
44 2B F8             sub         r15d,eax

After:
41 F7 DF             neg         r15d

- Case 2: d != a

Before:
BF 00 00 00 00       mov         edi,0
41 2B FD             sub         edi,r13d

After:
41 8B FD             mov         edi,r13d
F7 DF                neg         edi
2021-01-05 00:11:16 +01:00
Sintendo 57548b456b Jit64: subfx - Special case a == 0
Occurs a bunch of times in Super Mario Sunshine.

Before:
41 83 EE 00          sub         r14d,0

After:
Nothing!
2021-01-04 23:54:15 +01:00
Sintendo b805223108 Jit64: subfx - Optimize more constant a cases
Consider the case where d and a refer to the same PowerPC register,
which is known to hold an immediate value by the RegCache. We place a
ReadWrite constraint on this register and bind it to an x86 register.
The RegCache then allocates a new register, initializes it with the
immediate, and returns a RCX64Reg for both d and a.

At this point information about the immediate value becomes unreachable.
In the case of subfx, this generates suboptimal code:

Before 1:
BF 1E 00 00 00       mov         edi,1Eh       <- done by RegCache
8B C7                mov         eax,edi
8B FE                mov         edi,esi
2B F8                sub         edi,eax

Before 2:
BE 00 AC 3F 80       mov         esi,803FAC00h <- done by RegCache
8B C6                mov         eax,esi
8B 75 EC             mov         esi,dword ptr [rbp-14h]
2B F0                sub         esi,eax

The solution is to explicitly handle the constant a case before having
the RegCache allocate registers for us.

After 1:
8D 7E E2             lea         edi,[rsi-1Eh]

After 2:
8B 75 EC             mov         esi,dword ptr [rbp-14h]
81 EE 00 AC 3F 80    sub         esi,803FAC00h
2021-01-04 23:02:22 +01:00
Pokechu22 e825af7b1b Software: Remove normalization special case
The special case doesn't appear to make a significant difference in any games, and the current implementation has a (minor, fixable) issue that breaks Super Mario Sunshine (both with a failed assertion (https://bugs.dolphin-emu.org/issues/11742) and a rendering issue (https://bugs.dolphin-emu.org/issues/7476)).  Hardware testing wasn't able to reproduce the special case, either, so it may just not exist.

PR #9315 contains a fixed implementation of the special case on all video backends, and can serve as a basis for it being reintroduced if it is found to exist under more specific circumstances.  For now, I don't see a reason to keep it present.
2021-01-03 23:22:48 -08:00
Filippo Tarpini 1e4a1bee43 Fix DualShockUDP not adding/removing devices correctly
-If adding 2 devices with the same name, they their unique id wouldn't be increased, causing a conflict.
-Removing a device wouldn't actually remove it from the internal devices list because the list of devices had already been updated when going through it.
-It was possible to remove devices belonging to other sources by adding a device with the same name and then removing it.
2021-01-03 21:06:06 +02:00
MerryMage 6106d6481f BitUtils: __builtin_clz is undefined when value == 0 2021-01-03 17:35:15 +00:00
LC 4b9259d691
Merge pull request #9415 from Filoppi/patch-8
Fix cursor going to +infinite if the window size was 0
2021-01-03 11:26:11 -05:00
MerryMage 8ae0bf93e7 JitArm64: Do not use offsetof on non-standard-layout types
Applying PR #8687 to Arm64 JIT.
2021-01-03 15:26:01 +00:00
waddlesplash 2df11d3911 Rehabilitate Haiku support. 2021-01-02 16:54:24 -05:00
Filippo Tarpini 8813ba69f5 Fix Quartz cursor going to +infinite if the window size was 0 2021-01-02 19:55:19 +02:00
Admiral H. Curtiss 2932b5f8cd Qt: Give better error messages when Wii save importing fails. 2021-01-02 17:46:12 +01:00
Admiral H. Curtiss d9c686db30 WiiSave: Delete existing save, if any, before importing one. 2021-01-02 17:46:12 +01:00
Admiral H. Curtiss 700d53e00f WiiSave: In Import(), make sure the TMD exists or can be reinstalled before allowing save to be imported. 2021-01-02 17:46:11 +01:00
Admiral H. Curtiss 46e4c17db3 WiiUtils: Add utility functions to handle prep-work for importing 'SD-card export' style Wii saves. 2021-01-02 17:46:11 +01:00