Commit Graph

26122 Commits

Author SHA1 Message Date
Lioncash adebc499f9 Jit64: Indicate explicit [[fallthrough]] within load helper 2021-04-19 17:37:44 -04:00
Lioncash e1dfcda8a6 BlockingLoop: Add explicit [[fallthrough]] annotations 2021-04-19 17:34:46 -04:00
Lioncash b21d62116d DataReport: Amend conditional test for data reports in IsValidMode
This particular range is kind of bizarre, and would only interpret
interleave mode 2 as a valid mode, while rejecting interleave mode 1 and
the extension byte mode.

As far as I know, based off the information on Wiibrew, we should be
considering all three values within this range as valid.
2021-04-19 16:43:29 -04:00
Patrick A. Ferry f6a4368192 SW: Fix alignedWidth in TextureEncoder
This was causing issues in Software Renderer. Look at bug 11487
2021-04-19 02:06:52 +01:00
ash!! 43ceba4fef optimize TextureCacheBase::SerializeTexture, ::DeserializeTexture
texture serialization and deserialization used to involve many memory
allocations and deallocations, along with many copies to and from
those allocations. avoid those by reserving a memory region inside the
output and writing there directly, skipping the allocation and copy to
an intermediate buffer entirely.
2021-04-18 13:40:42 -07:00
JMC47 821e51cda4
Merge pull request #7214 from stenzek/cp-access-sync
Fifo: Run/sync with the GPU on command processor register access
2021-04-18 11:17:25 -04:00
JosJuice dbd39ab2a0
Merge pull request #9642 from CrunchBite/xlink-bba-fix
Fix crash when stopping a game that does not use the BBA when XLink Kai BBA is selected in configuration
2021-04-18 10:43:32 +02:00
JosJuice 92308f5e34
Merge pull request #9645 from leoetlino/fifoplayer-optimization
FifoPlayer: Copy data with memcpy instead of one byte at a time
2021-04-18 10:43:26 +02:00
Léo Lam 5f355690e0
Make it possible to enable auto-updates by default with CMake builds
This adds a CMake option (DOLPHIN_DEFAULT_UPDATE_TRACK) to allow
configuring SCM_UPDATE_TRACK_STR. This is needed to enable auto-updates
in Windows CMake builds by default.
2021-04-17 19:45:43 +02:00
Stenzek e3ac5dca32 Fifo: Run/sync with the GPU on command processor register access 2021-04-18 03:24:01 +10:00
Léo Lam cc32fa91af
FifoPlayer: Copy data with memcpy instead of one byte at a time
Copying with memcpy/std::copy is a lot faster than writing one byte
at a time. And the behavior should be fully equivalent.
2021-04-17 16:02:43 +02:00
Connor McLaughlin edeb6bcdb7
Merge pull request #9635 from stenzek/amd-exclusive-fullscreen
Vulkan: Work around AMD exclusive fullscreen bug (21.3+)
2021-04-17 16:09:09 +10:00
CrunchBite d6b2fe2c0a Fix crash when stopping a game that does not use the BBA 2021-04-15 09:01:52 -04:00
JMC47 14959a1087
Merge pull request #9636 from sspacelynx/mali-broken-and
DriverDetails: Fix broken vector bitwise AND on Mali drivers
2021-04-14 07:04:16 -04:00
Dentomologist e0a8d931fc Updater: Add code documentation Markdown file
Add docs/autoupdate_overview.md which gives an overview of the update
process, and comments pointing to it in autoupdate related files.
2021-04-13 15:37:31 -07:00
Valeri b3b1518f91
Allow shaders to query reciprocal of window resolution 2021-04-13 20:14:17 +03:00
Léo Lam 336518049d
WiiUtils: Add helper functions to get emulated/real Bluetooth device
This adds a function to get the emulated or real Bluetooth device for
an active emulation instance. This lets us deduplicate all the
`ios->GetDeviceByName("/dev/usb/oh1/57e/305")` calls that are currently
scattered in the codebase and ensures Bluetooth passthrough is being
handled correctly.

This also fixes the broken check in WiimoteCommon::UpdateSource.
There was a confusion between "emulated Bluetooth" (as opposed to
"real Bluetooth" aka Bluetooth passthrough) and "emulated Wiimote".
2021-04-12 18:16:56 +02:00
Léo Lam 136f59b434
DolphinQt: Fix latent build error on Windows 2021-04-12 18:16:56 +02:00
Connor McLaughlin b24e3f2f1a Vulkan: Work around AMD exclusive fullscreen bug (21.3+) 2021-04-12 12:41:17 +10:00
sspacelynx aba9cae5ab
DriverDetails: Fix broken vector bitwise AND on Mali drivers 2021-04-11 15:15:02 +02:00
JosJuice 05a37746b6 Change the names for shader compilation settings 2021-04-10 12:46:49 +02:00
JMC47 5322256065
Merge pull request #9625 from leoetlino/mmu-sdr-update
MMU: Fix SDR updates being silently dropped in some cases
2021-04-06 20:23:13 -04:00
Léo Lam 3b6fdb74f6
Merge pull request #9628 from Dentomologist/wiiutils_fix_reference_to_temporary_subobject
WiiUtils: Remove reference qualifier
2021-04-07 01:46:45 +02:00
Léo Lam f18743ab89
Merge pull request #9576 from Pokechu22/invalid-gfx-reg-quirk
Add game quirks for unknown BP/CP/XF commands
2021-04-07 01:46:21 +02:00
Léo Lam c1617460a1
Merge pull request #9480 from leoetlino/saturating-cast
MathUtil: Add SaturatingCast to cast floats more safely
2021-04-07 01:43:39 +02:00
Léo Lam 1a9e72c9bb
DiscIO: Use MathUtil::SaturatingCast 2021-04-06 23:27:23 +02:00
Léo Lam 48712168b8
MathUtil: Add SaturatingCast to cast floats more safely 2021-04-06 23:27:23 +02:00
Pokechu22 dad309d365 Disable ICache emulation for some games
Specifically, 'Scooby-Doo! Mystery Mayhem', 'Scooby-Doo! Unmasked', 'Ed, Edd n Eddy: The Mis-Edventures', and the Wii version of 'Happy Feet'.

The JIT cache causes problems with emulated icache invalidation in these games, resulting in areas failing to load.
2021-04-06 12:44:10 -07:00
Pokechu22 f32b771f7a Skip loading unknown XF registers in the FIFO player
This avoids some warnings, which were originally fixed by ignoring loads with a value of zero (see 636bedb207 / #3242).

Note that FifoCI will report some changes, but only on the first frame; these seem to be timing related as they don't happen if a different write is used to replace skipped ones.
2021-04-06 11:54:49 -07:00
Pokechu22 cde6cf2ab5 Track and log CP commands 0x00/0x10/0x20 differently from other unknown commands
They appear to relate to perf queries, and combining them with truely unknown commands would probably hide useful information.  Furthermore, 0x20 is issued by every title, so without this every title would be recorded as using an unknown command, which is very unhelpful.
2021-04-06 11:54:49 -07:00
Pokechu22 193f6a67a7 Log a warning for inexact uses of MATINDEX or VCD commands 2021-04-06 11:54:48 -07:00
Pokechu22 7fe1292c62 Add game quirks for unknown BP/CP/XF commands 2021-04-06 11:44:31 -07:00
Léo Lam 49edd5f482
MMU: Remove a bunch of useless swaps
The swaps are confusing and don't accomplish much.

It was originally written like this:

u32 pte = bswap(*(u32*)&base_mem[pteg_addr]);

then bswap was changed to Common::swap32, and then the array access
was replaced with Memory::Read_U32, leading to the useless swaps.
2021-04-06 18:25:29 +02:00
Léo Lam 960d957f4f
MMU: Fix SDR updates being silently dropped in some cases
While 6xx_pem.pdf §7.6.1.1 mentions that the number of trailing
zeros in HTABORG must be equal to the number of trailing ones
in the mask (i.e. HTABORG must be properly aligned), this is actually
not a hard requirement. Real hardware will just OR the base address
anyway. Ignoring SDR changes would lead to incorrect emulation.

Logging a warning instead of dropping the SDR update silently is a
saner behaviour.
2021-04-06 18:25:09 +02:00
Dentomologist c892c27259 WiiUtils: Remove reference qualifier
Remove & to avoid reference to a temporary subobject.  Fixes error C2131
on upcoming version of msbuild.
2021-04-06 08:35:03 -07:00
Léo Lam ac250f7c20
Merge pull request #9623 from Techjar/pauseandlock-fix
Core: Fix PauseAndLock segfaulting under certain circumstances
2021-04-06 12:45:35 +02:00
Léo Lam e89ae71cec
Merge pull request #9388 from JosJuice/default-locale
Set console's default language/country/region based on computer settings
2021-04-06 12:34:58 +02:00
Léo Lam a1ee6ace71
Merge pull request #9620 from Dentomologist/convert_gamelist_col_to_enum_class
Convert GameList col enum to enum class
2021-04-06 12:08:15 +02:00
JMC47 5222a4b7e5
Merge pull request #9585 from JosJuice/jitarm64-skip-carry
JitArm64: Skip calculating carry flag when not needed
2021-04-06 04:41:16 -04:00
JMC47 99d43362e6
Merge pull request #9351 from JosJuice/discard-registers
Jits: Discard registers which we know will be overwritten
2021-04-06 04:40:26 -04:00
Techjar 9235a9035b Core: Fix PauseAndLock segfaulting under certain circumstances
This can happen if it's called before the core has fully initialized.
2021-04-03 17:52:03 -04:00
Léo Lam 6d1eb6ae5a
Merge pull request #9621 from Pokechu22/cassert
Replace uses of cassert with Common/Assert.h
2021-04-03 12:46:21 +02:00
Pokechu22 004dfd1586 Replace uses of cassert with Common/Assert.h 2021-04-02 10:18:18 -07:00
Dentomologist 601dcfaefd GameList: Rename Column enum members
Remove COL_ prefix and change to TitleCase
2021-04-02 09:17:27 -07:00
Dentomologist b8bd877a41 GameList: Convert columns to enum class 2021-04-02 09:14:31 -07:00
blåhaj f339bc69c8 VertexShaderGen: Sonic epsilon hack for OpenGL ES
debaf63fe8 moved the "Sonic epsilon hack"
to vertex shaders. However, it was only done for targets with depth
clamping. If this is not available, for example the target is OpenGL ES,
the Sonic problem appears (https://bugs.dolphin-emu.org/issues/11897).

A version of the "Sonic epsilon hack" is added for targets without
depth clamping.
2021-04-02 15:12:30 +02:00
Léo Lam 391644dbb5
IOS/FS: Add a scoped FD class to make it harder to leak FDs
This changes FileSystemProxy::Open to return a file descriptor wrapper
that will ensure the FD is closed when it goes out of scope.

By using such a wrapper we make it more difficult to forget to close
file descriptors.

This fixes a leak in ReadBootContent. I should have added such a class
from the beginning... In practice, I don't think this would have caused
any obvious issue because ReadBootContent is only called after an IOS
relaunch -- which clears all FDs -- and most titles do not get close
to the FD limit.
2021-04-01 21:34:58 +02:00
Markus Wick a2fa9aab5b
Merge pull request #9618 from JosJuice/jitarm64-pc-0
JitArm64: Allow DoJit at address 0 (fix launching Wii titles)
2021-04-01 12:43:23 +02:00
JosJuice b3f71f7cdc JitArm64: Allow DoJit at address 0 (fix launching Wii titles)
JitArm64::DoJit contains a check where it prints a warning and tries
to pause emulation if instructed to compile code at address 0. I'm
assuming this was done in order to provide a nicer error behavior
in cases where PC was accidentally set to null. Unfortunately, it
has started causing us problems recently, as 688bd61 writes and runs
some code at address 0 to simulate the PPC being held in reset.
What makes this worse is that calling Core::SetState from the CPU
thread is actually not allowed and will cause a deadlock instead of
the intended behavior. I don't believe there is anything on a real
console that would stop you from executing code at address 0 (as
long as the MMU has been set up to allow it), and Jit64::DoJit
doesn't contain any check like this, so let's remove the check.
2021-04-01 11:28:53 +02:00
JMC47 ce8e87c64b
Merge pull request #8747 from iwubcode/map-freelook
Support controlling Free Look via input bindings (motion controls, gamepad, etc!)
2021-04-01 01:05:00 -04:00
Silent d4b7ed4e38
GameList: Use titles from the Title Database for shortcut creation
Makes titles consistent with Dolphin's game list
2021-03-27 19:02:27 +01:00
Silent 0fb8f735e5
GameList: Remove invalid characters when creating a desktop shortcut
Fixes shortcut creation for games that have e.g. : in names.
2021-03-27 19:02:27 +01:00
JosJuice 27ddf6382b Set console's default language/country/region based on computer settings 2021-03-27 10:05:26 +01:00
JosJuice a1000afacc Add utility functions for GameCube language codes 2021-03-27 09:46:46 +01:00
Léo Lam 8d2b0fff8a
Merge pull request #9545 from leoetlino/es-launch-timings
IOS: Improve timing accuracy for title launches (both ARM and PPC)
2021-03-27 01:47:28 +01:00
Léo Lam 8fab253212
Merge pull request #9609 from Pokechu22/fix-WriteVertexArray
Fix PanicAlert when recording FIFOs
2021-03-27 01:39:53 +01:00
Léo Lam da534c7d75
Merge pull request #9571 from JosJuice/netplay-sync-more-settings
NetPlay: Sync more settings
2021-03-27 01:38:33 +01:00
Pokechu22 4008b2aca0 Fix PanicAlert when recording FIFOs 2021-03-26 17:27:21 -07:00
Pokechu22 51de3d0fd1 Refactor CP array constants slightly 2021-03-26 17:27:21 -07:00
Léo Lam c915b780cf
Merge pull request #9596 from Minty-Meeo/apply-moar-RunAsCPUThread
Apply More Core::RunAsCPUThread
2021-03-27 01:11:34 +01:00
Léo Lam cd6ee13320
Merge pull request #9608 from Bonta0/swapucode
DSPHLE: Don't restore the last UCode when the crc doesn't match
2021-03-27 01:02:47 +01:00
Bonta-kun b7f62b7a37 DSPHLE: Don't restore the last UCode when the crc doesn't match 2021-03-27 00:42:43 +01:00
Léo Lam f29c8b83c0
Merge pull request #9597 from Pokechu22/alt-enter
Open the properties window when alt+enter is used on the game list
2021-03-27 00:39:42 +01:00
JosJuice 9e21f6f7f7
Merge pull request #9582 from endrift/gba-sync
SI/DeviceGBA: Improve link stability
2021-03-26 20:19:31 +01:00
JosJuice 62ce1c7653 Jits: Discard registers which we know will be overwritten
This commit adds a new "discarded" state for registers.
Discarding a register is like flushing it, but without
actually writing its value back to memory. We can discard
a register only when it is guaranteed that no instruction
will read from the register before it is next written to.

Discarding reduces the register pressure a little, and can
also let us skip a few flushes on interpreter fallbacks.
2021-03-24 20:48:44 +01:00
JosJuice 901170e299 PPCTables: Use u64 for instruction flags
We've run out of space :(
2021-03-24 20:48:36 +01:00
JosJuice fa04e5a7d3
Merge pull request #9603 from Bonta0/audio-init
AudioCommon: Split Initialization
2021-03-24 14:18:15 +01:00
Bonta-kun 66e39de1ab AudioCommon: Initialize before HW 2021-03-24 14:11:49 +01:00
JosJuice 1845c5948d PPCAnalyst: Rework the store-safe logic
The output of instructions like fabsx and ps_sel is store-safe
if and only if the relevant inputs are. The old code was always
marking the output as store-safe if the output was a single,
and never otherwise.

Also, the old code was treating the output of psq_l/psq_lu as
store-safe, which seems incorrect (if dequantization is disabled).
2021-03-24 12:02:09 +01:00
JosJuice 3bd920638d JitArm64: Use STP for pc/npc, part 2
I missed one place in dd8e504.
2021-03-23 21:27:07 +01:00
JosJuice c0eb95481f VolumeVerifier: Align partition reads to groups
This improves the speed of verifying Wii WIA/RVZ files.
For me, the verification speed for LZMA2-compressed files
has gone from 11-12 MiB/s to 13-14 MiB/s.

One thing VolumeVerifier does to achieve parallelism is to
compute hashes for one chunk of data while reading the next
chunk of data. In master, when reading data from a Wii
partition, each such chunk is 32 KiB. This is normally fine,
but with WIA and RVZ it leads to rather lopsided read times
(without the compute times being lopsided): The first 32 KiB
of each 2 MiB takes a long time to read, and the remaining
part of the 2 MiB can be read nearly instantly. (The WIA/RVZ
code has to read the entire 2 MiB in order to compute hashes
which appear at the beginning of the 2 MiB, and then caches
the result afterwards.) This leads to us at times not doing
much reading and at other times not doing much computation.
To improve this, this change makes us use 2 MiB chunks
instead of 32 KiB chunks when reading from Wii partitions.

(block = 32 KiB, group = 2 MiB)
2021-03-22 21:07:01 +01:00
JosJuice bbacefeb75 VolumeVerifier: Handle contents overlapping
This can't actually happen in practice due to how WAD files work,
but it's very easy to add support for thanks to the last commit,
so we might as well add support for it.
2021-03-22 20:05:11 +01:00
JosJuice 10e1acf25c VolumeVerifier: Handle overlapping blocks more efficiently
The performance gains of doing this aren't too important since you
normally wouldn't run into any disc image that has overlapping blocks
(which by extension means overlapping partitions), but this change also
lets us get rid of things like VolumeVerifier's mutex that used to
exist just for the sake of handling overlapping blocks.
2021-03-22 20:05:11 +01:00
LC 15ebb1d9e4
Merge pull request #9566 from Sintendo/jit64divwx
Jit64: Optimize divwx
2021-03-22 14:40:02 -04:00
JosJuice d1946aded6 Avoid using panic alerts in DiscIO
Panic alerts in DiscIO can potentially be very annoying since
large amounts of them can pop up when loading the game list
if you have some particularly weird files in your game list.

This was a much bigger problem back in 5.0 with its
"Tried to decrypt data from a non-Wii volume" panic alert, but
I figured I would take it all the way and remove the remaining
panic alerts that can show up when loading the game list.

I have exempted uses of ASSERT/ASSERT_MSG since they indicate
a bug in Dolphin rather than a malformed file.
2021-03-20 12:58:54 +01:00
Vicki Pfau 9a4704f1ee SI/DeviceGBA: Improve link stability 2021-03-19 19:17:09 -07:00
JosJuice baecddd262 JitArm64: Skip calculating carry flag when not needed 2021-03-19 23:02:24 +01:00
Markus Wick bcd572a820
Merge pull request #9593 from JosJuice/jitarm64-constant-carry
JitArm64: Constant carry flag optimizations
2021-03-19 22:58:17 +01:00
JosJuice 4c2cdb61df JitArm64: Constant carry flag optimizations
If we know at compile time that the PPC carry flag definitely
has a certain value, we can bake that value into the emitted code
and skip having to read from PPCState.
2021-03-19 22:40:19 +01:00
JosJuice c5abcba77a JitArm64: Fix broken format strings in Arm64RegCache 2021-03-19 16:14:20 +01:00
Pokechu22 e6bd7a8cd5 Open the properties window when alt+enter is used on the game list 2021-03-18 21:51:24 -07:00
Dentomologist 1cc035eb05 VertexLoaderTest: Fix memset assignment warning
Initialize and assign members of TVtxDesc and VAT structs directly
instead of using memset.

Fixes -Wclass-memaccess warning from gcc on Debian.
2021-03-18 21:10:29 -07:00
Minty-Meeo db7f3f8f25 Apply More Core::RunAsCPUThread
In places where applicable, Core::RunAsCPUThread has replaced Core::SetState workarounds to pause and resume emulation for thread-sensitive operations.
 - void Core::SaveScreenShot()
 - void Core::SaveScreenShot(std::string_view name)
 - void JitInterface::GetProfileResults(Profiler::ProfileStats *prof_stats)
 - void MainWindow::OnExportRecording()
2021-03-18 22:31:28 -05:00
iwubcode 28e880efb6 DolphinQt: update hotkeyscheduler to run at 200hz, giving more precision for FreeLook motion devices 2021-03-18 17:54:12 -05:00
iwubcode 425ee13d35 FreeLook: update camera and manager to use a delta time for movement (in case we decide to move this somewhere else in the future) 2021-03-18 17:54:12 -05:00
JosJuice 74343b4276 Boot: Move initial UpdateWantDeterminism call earlier
Just to make the InitializeWiiRoot call a bit neater.
2021-03-18 22:59:59 +01:00
iwubcode f1ce921844 DolphinQt: update FreeLook to use relative input 2021-03-17 20:58:33 -05:00
iwubcode ddba5a3dfa DolphinQt: Add separate Free Look tab for rotation 2021-03-17 20:58:33 -05:00
iwubcode d53ab32506 FreelookManager: Add gyro to support either keyboard/gamepad binding or motion based controllers 2021-03-17 20:58:33 -05:00
iwubcode 80cf87158e VideoCommon: update FreeLook camera to add quaternion based rotation, fix orbital and fps implementations 2021-03-17 20:58:33 -05:00
iwubcode 8055919905 InputCommon: Allow for partial gyro mapping; for Free Look, this allows you to only pitch or only yaw 2021-03-17 20:58:33 -05:00
iwubcode db4b4e40cb InputCommon / DolphinQt / Core: Add a "RelativeMouse" input which provides the raw delta mouse input
Co-authored-by: Jordan Woyak <jordan.woyak@gmail.com>
2021-03-17 20:58:33 -05:00
iwubcode 679d51c289 RenderWidget: Remove mouse based Free Look since it has moved to the HotkeyScheduler 2021-03-17 20:58:33 -05:00
iwubcode 602cb39101 Common: Add function to get Euler angles from a Quaternion 2021-03-17 20:58:33 -05:00
JosJuice 621b5b8e1a JitArm64: Optimize general case of srawx
Same approach as Jit64. A lot simpler, don't you think? :)
2021-03-17 00:15:23 +01:00
JosJuice a45a0a2066
Merge pull request #9494 from Dentomologist/convert_arm64reg_to_enum_class
Arm64Gen: Convert ARM64Reg to enum class
2021-03-17 00:05:23 +01:00
Léo Lam f44f20560d
Merge pull request #9573 from JosJuice/volumeverifier-cancel-crash
VolumeVerifier: Fix potential crash when cancelling
2021-03-16 11:10:47 +01:00
Léo Lam b7f931fc6b
Merge pull request #9570 from JosJuice/wia-partial-exception-list
DiscIO: Fix reading certain WIA chunks with many exceptions
2021-03-16 11:10:12 +01:00
Léo Lam c8d8f9ef85
Merge pull request #9577 from JosJuice/di-unknown-size-hack
DVDInterface: Make the WBFS/CISO hack only affect WBFS/CISO
2021-03-16 11:03:36 +01:00
Léo Lam 3fcc018fa7
Merge pull request #9588 from JosJuice/jitarm64-srawx-a-s
JitArm64: Improve srawx special case carry calculation
2021-03-16 10:40:10 +01:00
Léo Lam f36b1cbb2a
Merge pull request #9541 from InusualZ/detecting-rso
Symbols: Fix RSO Modules detection algorithm
2021-03-16 10:33:58 +01:00
Léo Lam b980dd1385
Merge pull request #9580 from MetroidPrimeModding/redundant-update-trigger-check
[Updater] Check whether we've already had an update triggered
2021-03-16 10:19:54 +01:00
Léo Lam 646bdc9459
Merge pull request #9583 from michaelszubartowicz/master
Fix loading save states with bluetooth passthrough
2021-03-16 10:12:49 +01:00
Léo Lam 9a3e752021
Merge pull request #9558 from iwubcode/dsu-multi-server-avoid-blocking
InputCommon: block on DSU servers collectively instead of individually
2021-03-16 10:12:32 +01:00
Léo Lam 5cea85f008
Merge pull request #9579 from Dentomologist/fix_open_containing_folder
Gamelist: Fix 'Open Containing Folder'
2021-03-16 09:52:46 +01:00
michaelszubartowicz 2eb6e21a61
Fix loading save states with bluetooth passthrough
When a save state is loaded, the IOS device serving bluetooth
is cast as BluetoothEmuDevice. If, however, a real Wiimote
with BT passthrough is used, this caused the game to crash.
Now the proper device class is used.
2021-03-16 09:48:54 +01:00
Léo Lam 13f79321f7
Merge pull request #9574 from Pokechu22/enumformatter-warnings
EnumFormatter: fix signed/unsigned comparison warnings
2021-03-16 09:39:42 +01:00
Léo Lam 3b0b221fcf
Merge pull request #9567 from Dentomologist/fix_various_warnings
Fix various build warnings
2021-03-16 09:33:01 +01:00
JosJuice c0f840525f JitArm64: Improve srawx special case carry calculation
At a first glance it may look like a part of the code I added to
srawx in efeda3b has a bug when a == s. The code actually happens
to work correctly, but in the interest of making the code easier
to reason about, I'd like to change the way it's implemented. This
change should improve the pipelining a little in the a == s case too.
2021-03-14 18:55:42 +01:00
Dentomologist f0f206714f Arm64Gen: Convert ARM64Reg to enum class
Most changes are just adding ARM64Reg:: in front of the constants.
2021-03-13 10:10:59 -08:00
Dentomologist 48273b401e Gamelist: Fix 'Open Containing Folder'
Fix Gamelist context menu item 'Open Containing Folder' opening wrong
target on Windows when game parent folder is [foobar] and grandparent
folder contains file [foobar].bat or [foobar].exe

Add trailing directory separator to parent folder path to force Windows
to interpret path as directory.

Fixes https://bugs.dolphin-emu.org/issues/12411
2021-03-11 12:45:16 -08:00
JosJuice 18d95dfcca
Merge pull request #8316 from CookiePLMonster/wasapi-code-improvements
WASAPI code improvements
2021-03-11 21:18:16 +01:00
Phillip Stephens 1dc015cc65 [Updater] Check whether we've already had an update triggered 2021-03-11 02:48:46 -08:00
JosJuice e47c9764de DVDThread: Set ReadError instead of BlockOOB for failed reads
With DVDInterface catching out-of-bounds reads, we can let
DVDThread use a more accurate error code for situations like
a disk failure.
2021-03-10 00:16:40 +01:00
JosJuice e2b3aadad7 DVDInterface: Make the WBFS/CISO hack only affect WBFS/CISO
21c152f added a small hack to DVDInterface to keep WBFS and CISO
files working with Nintendo's "Error #001" anti-piracy check.
Unfortunately I don't think it's possible to support WBFS and
CISO without any kind of hack or heuristic, but what we can do
is replace the 21c152f hack (which applies regardless of file
format) with a hack that only is active when using WBFS or CISO.

This change is similar to 2a5a399, but the disc size is
calculated in a different way.
2021-03-10 00:16:40 +01:00
JosJuice 7d570f1edb DiscIO: Move magic constants for discs to DiscUtils 2021-03-10 00:16:37 +01:00
JosJuice b14bf82732 DiscIO: Move some code from VolumeVerifier to DiscUtils 2021-03-10 00:16:12 +01:00
JosJuice 49ccc77ebb DiscIO: Move some code from DiscExtractor to new file DiscUtils 2021-03-09 20:34:24 +01:00
InusualZ c37d826715 Display a progress bar to notify the user, about the work is being done 2021-03-08 16:22:26 +00:00
InusualZ 490db42e44 Fix detecting rso modules 2021-03-08 16:22:26 +00:00
Pokechu22 fa124e657f EnumFormatter: fix signed/unsigned comparison warnings 2021-03-07 13:54:13 -08:00
Dentomologist 486a25dd2b Touchscreen: Add override specifiers
Fix -Winconsistent-missing-override warnings on Android
2021-03-07 10:10:02 -08:00
Dentomologist 1fd332d3b7 ControllerInterface: Fix unused-result warning
Add ! before unused variables to 'use' them.

Ubuntu-x64 emits warnings for unused variables because gcc decides
it should ignore the void cast around them. See thread for discussion:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
2021-03-07 10:10:02 -08:00
Dentomologist 7ff8e3367f GraphicsWidget: Remove unused field
Fixes warning on freebsd-x64
2021-03-07 10:10:02 -08:00
Dentomologist fa61fc4f9c Fix shadowing warnings
Fixes type/variable shadowing warnings on debian and ubuntu
2021-03-07 10:10:02 -08:00
Dentomologist 636bf38824 IOS: Add maybe_unused attribute to variables
Fixes Wunused-const-variable warning on freebsd-x64 and android
2021-03-07 10:10:00 -08:00
Dentomologist 95c86ee48b FreeLookCamera: Add override specifiers 2021-03-07 10:10:00 -08:00
Dentomologist 1c71d33ed5 FreeLookCamera: Remove unused variable 2021-03-07 10:10:00 -08:00
Dentomologist 692aaed60c FreeLookController: Fix signed/unsigned warning
Loop index int i was being compared against GetControllerCount() which
returned a size_t.  This was the only place GetControllerCount() was
called from so the change of return type doesn't disturb anything else.

Changing the loop index to size_t wouldn't work as well since it's
passed into GetController(), which takes an int and is called from many
places, so it would need a cast anyway on an already busy line.
2021-03-07 10:09:59 -08:00
Dentomologist 686314b548 Arm64Gen: Move constant and make constexpr
Namespace-scope variable was only used in one function so move it there
2021-03-07 10:09:59 -08:00
Dentomologist dffcbcc6c4 Arm64Gen: Remove unused constant 2021-03-07 10:09:59 -08:00
Sintendo defe7162f5 Jit64: divwx - Simplify divisor == -1 case
Suggested by @MerryMage. Thanks!

Co-authored-by: merry <MerryMage@users.noreply.github.com>
2021-03-07 18:29:12 +01:00
Sintendo 83f38388a1 Jit64: divwx - Micro-optimize default case
Both the normal path and the overflow path end with the same
instruction, so their tails can be merged.

Before:
41 8B C7             mov         eax,r15d
45 85 C0             test        r8d,r8d
74 0D                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0E                jne         normal_path
41 83 F8 FF          cmp         r8d,0FFFFFFFFh
75 08                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
44 8B F0             mov         r14d,eax
EB 07                jmp         done
normal_path:
99                   cdq
41 F7 F8             idiv        eax,r8d
44 8B F0             mov         r14d,eax
done:

After:
41 8B C7             mov         eax,r15d
45 85 C0             test        r8d,r8d
74 0D                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0B                jne         normal_path
41 83 F8 FF          cmp         r8d,0FFFFFFFFh
75 05                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
EB 04                jmp         done
normal_path:
99                   cdq
41 F7 F8             idiv        eax,r8d
done:
44 8B F0             mov         r14d,eax
2021-03-07 18:29:12 +01:00
Sintendo 1865035798 Jit64: divwx - Optimize division by 2
...and let's optimize a divisor of 2 ever so slightly for good measure.
I wouldn't have bothered, but most GameCube games seem to hit this on
launch.

- Division by 2
Before:
41 BE 02 00 00 00    mov         r14d,2
41 8B C2             mov         eax,r10d
45 85 F6             test        r14d,r14d
74 0D                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0E                jne         normal_path
41 83 FE FF          cmp         r14d,0FFFFFFFFh
75 08                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
44 8B F0             mov         r14d,eax
EB 07                jmp         done
normal_path:
99                   cdq
41 F7 FE             idiv        eax,r14d
44 8B F0             mov         r14d,eax
done:

After:
45 8B F2             mov         r14d,r10d
41 C1 EE 1F          shr         r14d,1Fh
45 03 F2             add         r14d,r10d
41 D1 FE             sar         r14d,1
2021-03-07 18:29:12 +01:00
Sintendo 0637a7ec59 Jit64: divwx - Optimize power-of-two divisors
Power-of-two divisors can be done more elegantly, so handle them
separately.

- Division by 4
Before:
41 BD 04 00 00 00    mov         r13d,4
41 8B C0             mov         eax,r8d
45 85 ED             test        r13d,r13d
74 0D                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0E                jne         normal_path
41 83 FD FF          cmp         r13d,0FFFFFFFFh
75 08                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
44 8B E8             mov         r13d,eax
EB 07                jmp         done
normal_path:
99                   cdq
41 F7 FD             idiv        eax,r13d
44 8B E8             mov         r13d,eax
done:

After:
45 85 C0             test        r8d,r8d
45 8D 68 03          lea         r13d,[r8+3]
45 0F 49 E8          cmovns      r13d,r8d
41 C1 FD 02          sar         r13d,2
2021-03-07 18:29:12 +01:00
Sintendo 530475dce8 Jit64: divwx - Micro-optimize certain divisors
When the multiplier is positive (which is the most common case), we can
generate slightly better code.

- Division by 30307
Before:
49 63 C5             movsxd      rax,r13d
48 69 C0 65 6B 32 45 imul        rax,rax,45326B65h
4C 8B C0             mov         r8,rax
48 C1 E8 3F          shr         rax,3Fh
49 C1 F8 2D          sar         r8,2Dh
44 03 C0             add         r8d,eax

After:
49 63 C5             movsxd      rax,r13d
4C 69 C0 65 6B 32 45 imul        r8,rax,45326B65h
C1 E8 1F             shr         eax,1Fh
49 C1 F8 2D          sar         r8,2Dh
44 03 C0             add         r8d,eax
2021-03-07 18:29:12 +01:00
Sintendo 95698c5ae1 Jit64: divwx - Optimize constant divisor
Optimize division by a constant into multiplication. This method is also
used by GCC and LLVM.

We also add optimized paths for divisors 0, 1, and -1, because they
don't work using this method. They don't occur very often, but are
necessary for correctness.

- Division by 1
Before:
41 BF 01 00 00 00    mov         r15d,1
41 8B C5             mov         eax,r13d
45 85 FF             test        r15d,r15d
74 0D                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0E                jne         normal_path
41 83 FF FF          cmp         r15d,0FFFFFFFFh
75 08                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
44 8B F8             mov         r15d,eax
EB 07                jmp         done
normal_path:
99                   cdq
41 F7 FF             idiv        eax,r15d
44 8B F8             mov         r15d,eax
done:

After:
45 8B FD             mov         r15d,r13d

- Division by 30307
Before:
41 BA 63 76 00 00    mov         r10d,7663h
41 8B C5             mov         eax,r13d
45 85 D2             test        r10d,r10d
74 0D                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0E                jne         normal_path
41 83 FA FF          cmp         r10d,0FFFFFFFFh
75 08                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
44 8B C0             mov         r8d,eax
EB 07                jmp         done
normal_path:
99                   cdq
41 F7 FA             idiv        eax,r10d
44 8B C0             mov         r8d,eax
done:

After:
49 63 C5             movsxd      rax,r13d
48 69 C0 65 6B 32 45 imul        rax,rax,45326B65h
4C 8B C0             mov         r8,rax
48 C1 E8 3F          shr         rax,3Fh
49 C1 F8 2D          sar         r8,2Dh
44 03 C0             add         r8d,eax

- Division by 30323
Before:
41 BA 73 76 00 00    mov         r10d,7673h
41 8B C5             mov         eax,r13d
45 85 D2             test        r10d,r10d
74 0D                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0E                jne         normal_path
41 83 FA FF          cmp         r10d,0FFFFFFFFh
75 08                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
44 8B C0             mov         r8d,eax
EB 07                jmp         00000000161737E7
normal_path:
99                   cdq
41 F7 FA             idiv        eax,r10d
44 8B C0             mov         r8d,eax
done:

After:
49 63 C5             movsxd      rax,r13d
4C 69 C0 19 25 52 8A imul        r8,rax,0FFFFFFFF8A522519h
49 C1 E8 20          shr         r8,20h
44 03 C0             add         r8d,eax
C1 E8 1F             shr         eax,1Fh
41 C1 F8 0E          sar         r8d,0Eh
44 03 C0             add         r8d,eax
2021-03-07 18:29:01 +01:00
Sintendo 5bb8798df6 JitCommon: Signed 32-bit division magic constants
Add a function to calculate the magic constants required to optimize
signed 32-bit division.

Since this optimization is not exclusive to any particular architecture,
JitCommon seemed like a good place to put this.
2021-03-07 18:27:36 +01:00
Sintendo c9adc60d73 Jit64: divwx - Special case dividend == 0
Zero divided by any number is still zero. For whatever reason, this case
shows up frequently too.

Before:
B8 00 00 00 00       mov         eax,0
85 F6                test        esi,esi
74 0C                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0C                jne         normal_path
83 FE FF             cmp         esi,0FFFFFFFFh
75 07                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
8B F8                mov         edi,eax
EB 05                jmp         done
normal_path:
99                   cdq
F7 FE                idiv        eax,esi
8B F8                mov         edi,eax
done:

After:
Nothing!
2021-03-07 18:27:30 +01:00
Sintendo c081e3f2b3 Jit64: divwx - Optimize constant dividend
When the dividend is known at compile time, we can eliminate some of the
branching and precompute the result for the overflow case.

Before:
B8 54 D3 E6 02       mov         eax,2E6D354h
85 FF                test        edi,edi
74 0C                je          overflow
3D 00 00 00 80       cmp         eax,80000000h
75 0C                jne         normal_path
83 FF FF             cmp         edi,0FFFFFFFFh
75 07                jne         normal_path
overflow:
C1 F8 1F             sar         eax,1Fh
8B F8                mov         edi,eax
EB 05                jmp         done
normal_path:
99                   cdq
F7 FF                idiv        eax,edi
8B F8                mov         edi,eax
done:

After:
85 FF                test        edi,edi
75 04                jne         normal_path
33 FF                xor         edi,edi
EB 0A                jmp         done
normal_path:
B8 54 D3 E6 02       mov         eax,2E6D354h
99                   cdq
F7 FF                idiv        eax,edi
8B F8                mov         edi,eax
done:

Fairly common with constant dividend of zero. Non-zero values occur
frequently in Ocarina of Time Master Quest.
2021-03-07 18:25:08 +01:00
JosJuice 1dfeb73589 Force RTC bias to 0 when custom RTC is disabled too
Whether the custom RTC setting is enabled shouldn't in itself
affect determinism (as long as the actual RTC value is properly
synced). Alters the logic added in 4b2906c.

I'm not entirely certain that this is correct, but the current
code doesn't really make sense to me... If we need to force the
RTC bias to 0 when custom RTC is enabled, why don't we need to
do it when custom RTC is disabled? The code for getting the
host system's current time doesn't contain any special handling
for the guest's RTC bias as far as I can tell.
2021-03-07 14:22:54 +01:00
JosJuice 46dbb455e1 Boot: Initialize Wii root before saving SYSCONF file
Fixes netplay and movie overrides of SYSCONF settings not applying.
2021-03-07 14:22:53 +01:00
JosJuice 359ed5348a Config: Give Movie and Netplay higher priority than CommandLine
Avoiding desyncs is more important than honoring what the user
specified on the command line.
2021-03-07 14:22:53 +01:00
JosJuice a9862b5395 NetPlay: Sync more settings 2021-03-07 14:22:53 +01:00
JosJuice 14bfc0be78 DiscIO: Fix reading certain WIA chunks with many exceptions
The loop in WIARVZFileReader::Chunk::Read could terminate
prematurely if the size argument was smaller than the size
of an exception list which had only been partially loaded.
2021-03-07 14:14:45 +01:00
JosJuice 96ebf01ea8 VolumeVerifier: Fix potential crash when cancelling
The async operations may contain references to class members, so
any running async operations must end before destroying the class.
2021-03-07 13:56:06 +01:00
Léo Lam 61198541a0
Merge pull request #9562 from sepalani/dis-icons
Breakpoints: Change icon when disabled
2021-03-07 12:14:12 +01:00
Pokechu22 5b1c632862 Software: Invert backface test when viewport is positive
Fixes Jimmie Johnson's Anything with an Engine.
2021-03-06 22:00:16 -08:00
Pokechu22 058c7db80b Software: Fix out of bounds accesses in CopyRegion
Fixes issue 11393.

The problem is that left and top make no sense for a width by height array; they only make sense in a larger array where from which a smaller part is extracted.  Thus, the overall size of the array is provided to CopyRegion in addition to the sub-region.  EncodeXFB already handles the extraction, so CopyRegion's only use there is to resize the image (and thus no sub-region is provided).
2021-03-06 21:58:28 -08:00
Pokechu22 df81210e96 Use formatters in GetBPRegInfo; add missing commands
BPMEM_TEV_COLOR_ENV + 6 (0xC6) was missing due to a typo.  BPMEM_BP_MASK (0xFE) does not lend itself well to documentation with the current FIFO analyzer implementation (since it requires remembering the values in BP memory) but still shouldn't be treated as unknown.  BPMEM_TX_SETMODE0_4 and BPMEM_TX_SETMODE1_4 (0xA4-0xAB) were missing entirely.
2021-03-06 19:27:20 -08:00
Pokechu22 70f9fc4e75 Convert BPMemory to BitField and enum class
Additional changes:
- For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare.  (Shift has also been renamed to scale)
- In TexMode0, min_filter has been split into min_mip and min_filter.
- In TexImage1, image_type is now cache_manually_managed.
- The unused bit in GenMode is now exposed.
- LPSize's lineaspect is now named adjust_for_aspect_ratio.
2021-03-06 19:27:19 -08:00
Pokechu22 db8ced7e4e Add FogParam0::FloatValue and FogParam3::FloatValue
This value will be used in the register description; so expose it in a way that can be re-used instead of calculating it in 2 places later.
2021-03-06 19:27:18 -08:00
Pokechu22 f2bea67709 Fix typo with ztex2 op in UseVertexDepthRange 2021-03-06 19:27:17 -08:00
Pokechu22 762fe33a3d Rename BPMEM_EFB_BR to BPMEM_EFB_WH 2021-03-06 19:27:16 -08:00
Pokechu22 81b84a5ebe Use XFMEM_REGISTERS_START/END in XFRegWritten and LoadXFReg 2021-03-06 19:27:15 -08:00
Pokechu22 8c80369373 Add names and descriptions for regular XF memory 2021-03-06 19:27:15 -08:00
Pokechu22 2d6ec7457d Add names and descriptions for XF registers to the FIFO analyzer 2021-03-06 19:27:14 -08:00
Pokechu22 aab81d5aa0 Convert XFMemory to BitField and enum class
Additionally a new ClipDisable union has been added (though it is not currently used by Dolphin).
2021-03-06 19:27:14 -08:00
Pokechu22 953e09428f Add names and descriptions for CP registers to the FIFO analyzer 2021-03-06 19:27:14 -08:00
Pokechu22 f749fcfa9f Convert CPMemory to BitField and enum class
Additionally, VCacheEnhance has been added to UVAT_group1.  According to YAGCD, this field is always 1.

TVtxDesc also now has separate low and high fields whose hex values correspond with the proper registers, instead of having one 33-bit value.  This change was made in a way that should be backwards-compatible.
2021-03-06 19:27:08 -08:00
Pokechu22 c27efb3f1f Create constants for CP registers and masks 2021-03-06 17:34:05 -08:00
Pokechu22 d702f3b4ad DolphinNoGUI/PlatformX11: Work around X.h's None being undefined 2021-03-06 17:34:04 -08:00
Pokechu22 f697e17dd1 Create BitFieldArray 2021-03-06 17:34:03 -08:00
Pokechu22 1273c5e395 Add fmt support to BitField 2021-03-06 14:58:32 -08:00
Pokechu22 cf95deaf6d Allow specifying StorageType for BitField
This is useful for BitFields that are bools.
2021-03-06 14:57:44 -08:00
Pokechu22 6653bd7199 Create EnumFormatter 2021-03-06 14:57:42 -08:00
iwubcode dbb0b72cc5 InputCommon: instead of blocking on individual DSU server sockets, block on a selector built up from all server sockets 2021-03-05 12:05:38 -06:00
Sintendo 2454bd5ba6 Jit64: Add optional argument to GenerateOverflow
This allows setting the overflow flag based on any condition code.
Defaults to NO (no overflow).
2021-03-05 17:14:45 +01:00
Léo Lam 5f7d935b0a
Merge pull request #9533 from sepalani/mmu-is-ram
MMU: Fix IsRAMAddress not working
2021-03-05 11:49:55 +01:00
JMC47 fc86e554e0
Merge pull request #9559 from iwubcode/gdb-stub-raii
Common / Core: add raii object that cleans up WSA on destruction in gdb-stub
2021-03-05 05:28:31 -05:00
Léo Lam adcdeda372
Merge pull request #9565 from sepalani/qt-blocker
BreakpointWidget: Use QSignalBlocker
2021-03-05 10:44:44 +01:00
Léo Lam a4de2502c5
Merge pull request #9550 from endrift/gba-flush
SI/DeviceGBA: Ensure data socket isn't backed up
2021-03-05 10:38:55 +01:00
Sepalani 1e6dfc6b91 BreakpointWidget: Use QSignalBlocker 2021-03-05 13:35:33 +04:00
Sepalani fd7eeb7221 BreakpointWidget: Fix delete deleting both MBP and BP at address 2021-03-05 13:01:32 +04:00
Sepalani 359a539f25 Breakpoints: Change icon when disabled 2021-03-05 11:21:37 +04:00
Léo Lam 1e3e5680db
Merge pull request #9561 from sepalani/fix-watches
Watches: Fix Save and Load from strings
2021-03-05 00:57:40 +01:00
iwubcode 7d5052896d IOS: update network/ip/top to use the RAII winsock context 2021-03-04 13:55:20 -06:00
iwubcode e4f74bea42 Core: Use RAII winsock object to cleanly create and destroy WSA in gdb-stub 2021-03-04 13:47:32 -06:00
iwubcode 00bc7e6b38 Common: Add RAII object that initializes and cleans up winsock 2021-03-04 13:44:12 -06:00
Léo Lam aef0760efe
IOS/ES: Emulate /sys/launch.sys for more accurate timings
Also gets rid of one static variable
2021-03-04 18:41:13 +01:00
Léo Lam bdaac718ac
IOS/FS: Expose some more ioctls for internal Dolphin use 2021-03-04 18:41:13 +01:00
Léo Lam 93f0d122c0
IOS: Hang PPC when reloading IOS for a PPC title launch
The PPC is supposed to be held in reset when another version of IOS is
in the process of being launched for a PPC title launch.

Probably doesn't matter in practice, though the inaccuracy was
definitely observable from the PPC.
2021-03-04 18:41:13 +01:00
Léo Lam 19667cb801
Fix symbol map being loaded too early during title changes
We should only try to load a symbol map for the new title *after* it
has been loaded into memory, not before. Likewise for applying HLE
patches and loading new custom textures.

In practice, loading/repatching too early was only a problem for
titles that are launched via ES_Launch. This commit fixes that.
2021-03-04 18:41:13 +01:00
Léo Lam a658cbce16
IOS: Emulate IOS boot timings 2021-03-04 18:41:13 +01:00
Léo Lam 820c4836d7
IOS: Simplify IPC initialisation
The extra IPC ack is triggered by a syscall that is invoked in ES's
main function; the syscall literally just sets Y2, IX1 and IX2 in
HW_IPC_ARMCTRL -- there is no complicated ack queue or anything.
2021-03-04 18:41:13 +01:00
Léo Lam 0da5ea86a3
IOS: Emulate ES boot timings 2021-03-04 18:41:13 +01:00
Léo Lam 688bd6141a
IOS: Emulate BootstrapPPC syscall delays
Reading the boot content from the NAND takes a non-negligible amount of
time and the PPC should be held in reset while the DOL is being read.
2021-03-04 18:41:12 +01:00
Léo Lam 011f7789e0
IOS: Clear 0-0x3fff when setting up low MEM1 constants
Low MEM1 is cleared by IOS before all the other constants are written.

This will overwrite the Gecko code handler but it should be fine
because HLE::Reload (which will set up the code handler hook again)
will be called after a title change is detected.
2021-03-04 18:41:12 +01:00
Sepalani ef977123d5 BreakpointWidget: Emit BreakpointsChanged to update views 2021-03-04 21:10:37 +04:00
Sepalani 6786340a7c Watches: Fix Save and Load from strings 2021-03-04 17:55:52 +04:00
Léo Lam be500a98e2
Merge pull request #8779 from sepalani/open-dump
NetworkWidget: Reorganise SSL options group box
2021-03-04 13:37:10 +01:00
Léo Lam 511e9dcd2f
Merge pull request #9542 from InusualZ/toggle-bp
BreakpointWidget: Allow breakpoints to be toggled between enable/disable
2021-03-04 12:34:03 +01:00
Léo Lam 48a5846aee
Merge pull request #9548 from AdmiralCurtiss/fastmem-active-regions
Core/Memmap: Memory mapping logic fixes.
2021-03-04 12:18:59 +01:00
Léo Lam 9c6c77351f
Merge pull request #9556 from JosJuice/cmake-msvc-latest
CMake: Build with -std:c++latest for MSVC
2021-03-04 12:12:06 +01:00
Léo Lam 00db622d50
Merge pull request #9560 from JosJuice/cmake-msvc-wil
CMake: Include WIL headers
2021-03-04 12:08:05 +01:00
JosJuice 2cb3f663bc CMake: Include WIL headers
MSBuild does this, so CMake should too. Fixes a Windows build error.
2021-03-04 10:26:31 +01:00
JosJuice 0cb71d3f47 CMake: Disable warning C5054 on DolphinQt
Same as 33c0abd.

Also removing -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING
to match MSBuild. Qt is no longer triggering that warning.
2021-03-04 09:29:30 +01:00
Dentomologist 6e13d35026 DolphinQt: Removed unused this capture in lambda
The Host constructor sets a callback on a lambda that in turn calls
Host_UpdateDisasmDialog. Since that function is not a member function
capturing this is unnecessary.

Fixes -Wunused-lambda-capture warning on freebsd-x64.
2021-03-03 13:18:17 -08:00
JMC47 d2eb846e6a
Merge pull request #9549 from Dentomologist/ppcstate_off_to_s32
JitArm64: Fix unsigned/signed argument/parameter mismatch
2021-03-03 14:56:40 -05:00
JMC47 9843412440
Merge pull request #8996 from AdmiralCurtiss/memcard-save-import-export-refactor
Various improvements for the Memory Card Manager.
2021-03-03 14:51:31 -05:00
JMC47 a0be1c93ea
Merge pull request #9352 from Pokechu22/sw-line-point-width
Software: Implement line-width and point-width
2021-03-03 14:15:28 -05:00
InusualZ 5e1b3514f6 Allow to disable/enable from the BreakpointWidget
Added a context menu, for when a breakpoint is right-clicked
Removed the `itemClicked` behavior, since it would clash with the context menu
2021-03-03 15:55:22 +00:00
Vicki Pfau f6e9003ddc SI/DeviceGBA: Ensure data socket isn't backed up
When reading a reply from a message sent to the data socket there is
the possibility that the other side gets sent multiple messages
before replying to any of them, which can lead to multiple replies
sent in a row. Though this only happens when things time out, it's
quite possible for these timeouts to happen or build up over time,
especially when initiating the connection.

This change makes sure to flush any pending bytes that have not been
read yet out of the socket after a successful POLL reply is received,
since that is the most common time when backups occur, and as well as
using the exact number of bytes in an expected reply, to ensure
the received data and the message it's replying to do not get out of
sync.
2021-03-02 18:53:44 -08:00
Dentomologist 4807cb77fd JitArm64: Fix unsigned/signed arg/param mismatch
The result of calls to PPCSTATE_OFF_PS0/1 were being cast to u32 and
passed to functions expecting s32 parameters. This changes the casts
to s32 instead.

One location was missing a cast and generated a warning with VS which
is now fixed.
2021-03-02 13:38:54 -08:00
InusualZ 4935e9b560 Allow to disable/enable breakpoints
Added `ToggleBreakPoint` to both interface BreakPoints/MemChecks. this would allow us to toggle the state of the breakpoint.

Also the TMemCheck::is_ranged is not longer serialized to string, since can be deduce by comparing the TMemCheck::start_address  and TMemCheck::end_address
2021-03-02 21:11:53 +00:00
Admiral H. Curtiss 4b784576d9 Core/Memmap: Don't try to map logical memory from inactive physical regions. 2021-03-02 18:41:33 +01:00
Admiral H. Curtiss 8199825c6f Core/Memmap: Store and check which physical regions are actually mapped instead of relying on SConfig staying the same. 2021-03-02 18:41:33 +01:00
Léo Lam 7712f0831f
Merge pull request #9535 from sepalani/threads-freeze
DebugInterface: Check visited addresses in GetThreads
2021-03-02 16:38:02 +01:00
Sepalani 8279613a49 DebugInterface: Check visited addresses in GetThreads 2021-03-02 19:29:47 +04:00
Léo Lam 59f4164411
Merge pull request #9539 from iwubcode/dynamic_input_tex_more_optimizations
InputCommon: dynamic input textures more optimizations
2021-03-02 02:53:22 +01:00
Léo Lam 0c9f11af47
Merge pull request #9537 from AdmiralCurtiss/fastmem-error-messages
Core/Memmap: Give more detailed error messages if memory mapping fails.
2021-03-02 02:47:12 +01:00
Admiral H. Curtiss 918f3d92e0 Core/Memmap: Give more detailed error messages if memory mapping fails. 2021-03-01 19:11:00 +01:00
Léo Lam 010279f4e6
Merge pull request #9513 from leoetlino/info-ios-version-qt
Qt: Re-add IOS version to the game info tab
2021-03-01 11:44:26 +01:00
Léo Lam 858f00b641
Merge pull request #9492 from nolange/fix_norandr_build
Cleanup X11 and XRANDR Macros
2021-03-01 11:36:39 +01:00
Léo Lam 26f0bf8f34
Merge pull request #9538 from JosJuice/qt-sw-gameid
DolphinQt: Fix <game_id> tag in SoftwareRendererWidget.cpp
2021-03-01 11:34:53 +01:00
iwubcode 32d584a0f5 InputCommon: reduce number of image loads and texture cache invalidations by only running dynamic input textures once for all controllers 2021-02-27 17:29:48 -06:00
JosJuice c98144334f DolphinQt: Fix <game_id> tag in SoftwareRendererWidget.cpp
Same problem and same fix as in e55342a. Also changing <br />
to <br> for consistency with other strings while I'm at it.
2021-02-27 20:17:28 +01:00
iwubcode 158674c274 Common: Move 'GetSection' functions to be public 2021-02-27 12:21:23 -06:00
Léo Lam 9d0983c9c9
Merge pull request #9536 from Filoppi/config_fixes
Don't call OnConfigChanged() unless config actually changed
2021-02-26 01:56:01 +01:00
Filoppi e020b2e8ea Common: don't call OnConfigChanged() unless it has actually changed
DualShock UDP Client is the only place in the code that assumed OnConfigChanged()
is called at least once on startup or it won't load up the setting, so I took care of that
2021-02-26 01:14:00 +02:00
Sepalani 6982832f82 MMU: Fix IsRAMAddress not working 2021-02-24 22:19:26 +04:00
Admiral H. Curtiss 22b300336a Core/MemoryWatcher: Use appropriate memory read function in ChasePointer(). 2021-02-24 19:02:30 +01:00
Norbert Lange d4b293e969 Simplify macro guards for HAVE_XRANDR 2021-02-22 14:32:53 +01:00
Norbert Lange 29eaf09be4 Cleanup X11 and XRANDR Macros
This fixes build with X11 enabled and XRANDR disabled.
2021-02-22 14:30:43 +01:00
Léo Lam 1fe0953bd5
Merge pull request #9524 from InusualZ/master
Debugger: Fix issue were loaded memory breakpoints were not being triggered (break)
2021-02-21 15:49:24 +01:00
Léo Lam c040b0151d
Merge pull request #8759 from sepalani/so-connect
IOS/NET: Add timeout on blocking connect
2021-02-21 15:26:59 +01:00
Sepalani bf246c36f5 IOS/NET: Add timeout on blocking connect 2021-02-21 18:15:26 +04: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
Sepalani 07f68560e6 WatchWidget: Add new/delete/clear toolbar items 2021-02-20 18:08:46 +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 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 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
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 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
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 cd4ccda51c Android: Add "Import Wii Save" 2021-01-27 20:10:06 +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 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 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
Sintendo 6a51c1564f Jit64: addx revisited
This doesn't really add any new optimizations, but fixes an issue that
prevented the optimizations introduced in #8551 and #8755 from being
applied in specific cases. A similar issue was solved for subfx as part
of #9425.

Consider the case where the destination register is also an input
register and happens to hold an immediate value. This results in a set
of constraints that forces the RegCache to allocate a register and move
the immediate value into it for us. By the time we check for immediate
values in the JIT, we're too late.

We solve this by refactoring the code in such a way that we can check
for immediates before involving the RegCache.

- Example 1
Before:
41 BF 00 68 00 CC    mov         r15d,0CC006800h
44 03 FF             add         r15d,edi

After:
44 8D BF 00 68 00 CC lea         r15d,[rdi-33FF9800h]

- Example 2
Before:
41 BE 00 00 00 00    mov         r14d,0
44 03 F7             add         r14d,edi

After:
44 8B F7             mov         r14d,edi

- Example 3
Before:
41 BD 03 00 00 00    mov         r13d,3
44 03 6D 8C          add         r13d,dword ptr [rbp-74h]

After:
44 8B 6D 8C          mov         r13d,dword ptr [rbp-74h]
41 83 C5 03          add         r13d,3
2021-01-26 21:25:00 +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
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
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
Dentomologist 70c54065ab Arm64Emitter: Convert IndexType to enum class 2021-01-15 23:27:11 -08: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 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
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 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
Filippo Tarpini 5a5c815ff0
Fix DInput cursor going to +infinite if the window size was 0 2021-01-02 18:33:13 +02:00
Filippo Tarpini 75f35393c3
Fix XInput2 cursor going to +infinite if the window size was 0 2021-01-02 18:30:14 +02:00
Lioncash 36af39853d Arm64Emitter: Remove unused OpType enum
This isn't used anywhere, so we can remove it.
2021-01-01 11:06:05 -05:00
Lioncash 95cc53edec Arm64Emitter: Convert ArithOption enums into enum classes
Makes the enums strongly typed. While we're at it, we can also make
these enums private.
2021-01-01 07:10:41 -05:00
merry 71a996e33b Jit_Integer: srawx: Handle a != b case with SARX
Suggested by @Sintendo

Co-authored-by: Sintendo <bram.speeckaert@gmail.com>
2021-01-01 10:32:01 +00:00
Léo Lam 452aad29f1
Merge pull request #9401 from lioncash/jittable
JitArm64_Tables: Construct tables at compile-time
2021-01-01 01:22:49 +01:00
Léo Lam 344a74aa11
Merge pull request #9396 from lioncash/arm
JitArm64_RegCache: Interface cleanup
2021-01-01 01:03:55 +01:00
Léo Lam f59ee87031
Merge pull request #9402 from lioncash/emitter
Arm64Emitter: Interface cleanup
2021-01-01 00:52:40 +01:00
Admiral H. Curtiss 7abe1085e3 IOS/ES: Pass relevant caller title information to ImportTmd() and ExportTitleInit(). 2020-12-31 17:13:46 +01:00
Filippo Tarpini 57c59c18d4
Rename "Use Fullscreen" setting to "Start in Fullscreen"
The name was confusing as changing it at runtime would not change the window to fullscreen, as it effectively only affects the start of the emulation.
Also blocked the ability to change it when the emulation is running, to be more inline with other similar settings, like "Render to main Window".
2020-12-31 13:39:45 +02:00
JosJuice 7bf590ee5a
Merge pull request #9403 from lioncash/guard
ArmCommon: Add missing header guard
2020-12-31 12:17:28 +01:00
Lioncash e45aa019ec ArmCommon: Mark NO_COND as constexpr
Allows it to be used in compile-time expressions if ever necessary.
2020-12-30 20:54:05 -05:00
Lioncash c9711a5eca ArmCommon: Add missing header guard
Prevents any multiple inclusion errors from occurring.
2020-12-30 20:53:31 -05:00
Lioncash cca0dffebd Arm64Emitter: Add shorthand member functions for hint instructions
Allows for more concise code.
2020-12-30 20:49:20 -05:00
Lioncash 6046a15267 Arm64Emitter: Make ShiftAmount enum an enum class
Reduces namespace pollution and makes the enum strongly typed.
2020-12-30 20:49:20 -05:00
Lioncash fab2053439 Arm64Emitter: Make RoundingMode enum an enum class
Prevents namespace pollution and makes the enum members strongly typed.
2020-12-30 20:49:20 -05:00
Lioncash d87ec71615 Arm64Emitter: Make PStateField enum an enum class
Prevents namespace pollution and makes the enum members strongly typed.
2020-12-30 20:49:20 -05:00
Lioncash 5c3f2fde22 Arm64Emitter: Make BarrierType enum an enum class
Prevents namespace pollution and enforces strong typing.
2020-12-30 20:49:20 -05:00
Lioncash f21c740919 Arm64Emitter: Make SystemHint enum an enum class
Avoids polluting the namespace and makes the members strongly typed.
2020-12-30 20:49:20 -05:00
Lioncash 5011c155ec Arm64Emitter: Make type member of FixupBranch an enum class
Eliminates some magic numbers and makes the type member strongly typed.
2020-12-30 20:49:20 -05:00
Lioncash 2fa4729815 Arm64Emitter: Annotate switch fallthrough
Silences warnings and makes intent explicit.
2020-12-30 20:49:20 -05:00
Lioncash d780ad1102 Arm64Emitter: Make use of std::optional
Allows eliminating some out variables in favor of optional, which allows
narrowing visible scope of variables.
2020-12-30 20:49:16 -05:00
Lioncash 5b5b3a9979 JitArm64_Tables: Move Instruction alias to the JIT class
Does what the comment says I should do :p
2020-12-30 19:28:37 -05:00
Lioncash c9c874d7fb JitArm64_Tables: Construct tables at compile-time
Migrates the Aarch64 JIT over to the same tabling mechanism as the x64
JIT.
2020-12-30 19:26:29 -05:00
JosJuice 31780a6059
Merge pull request #9399 from lioncash/fallthrough
JitArm64_LoadStore: Explicitly annotate switch fallthrough cases
2020-12-30 20:59:38 +01:00
Lioncash fa63367738 JitArm64_LoadStore: Explicitly annotate switch fallthrough cases
Makes it explicit that these are intentional. Also prevents compiler
warnings.
2020-12-30 14:41:37 -05:00
Lioncash fabf79e09a JitArm64_RegCache: Make RegType enum an enum class
Avoids polluting the namespace and makes the members of the enumeration
strongly typed.
2020-12-30 10:37:16 -05:00
Lioncash 4ff597cf21 JitArm64_RegCache: Mark several member functions as const
Many of these don't modify member state, so they can be marked as const.
2020-12-30 09:52:30 -05:00
Lioncash e9aaa46c2f JitArm64_RegCache: Mark register constants as constexpr
Also moves comments to make for less wonky formatting.
2020-12-30 09:44:49 -05:00
Lioncash e2bb9fd147 JitArm64_RegCache: Mark HostReg operator== as const
Also provides operator!= for logical symmetry.

We can also take the arguments by value, as the arguments are trivially
copyable enum values which fit nicely into registers already.
2020-12-30 09:42:29 -05:00
Lioncash e7538b10c6 JitArm64_RegCache: In-class initialize member variables where applicable
Same behavior, but in-place initializes all values and makes it visually
explicit at the declaration site.
2020-12-30 09:32:24 -05:00
Lioncash fe54226575 JitArm64_RegCache: Make FlushMode an enum class
Prevents namespace pollution and makes the enum members strongly typed.
This also mirrors the x64 variant as well.
2020-12-30 09:26:29 -05:00
JosJuice c1d041b888
Merge pull request #9318 from JosJuice/android-saf-games
Android: Use storage access framework for game list
2020-12-30 11:10:35 +01:00
smurf3tte c2da12ca75 DSP: Fix write masks on AUDIO_*/AR_* MMIO registers
https://bugs.dolphin-emu.org/issues/6749

This change fixes the scratchy audio in Teenage Mutant Ninja Turtles (SX7E52/SX7P52). The game starts an audio interface DMA with an unaligned address, and because Dolphin was not masking off the low 5 bits of AUDIO_DMA_START_LO, all future AI DMAs were misaligned. To understand why, it is instructive to refer to AUDIO_InitDMA() in libogc, which behaves the same as the official SDK:

_dspReg[25] = (_dspReg[25]&~0xffe0)|(startaddr&0xffff);

The implementation does not mask off the low bits of the passed in value before it ORs them with low bits of the current register value. Therefore, if they are not masked off by the hardware itself, they become permanently stuck once set.

Adding a write mask for AUDIO_DMA_START_LO is enough to fix the bug in TMNT, but I decided to run some tests on GC and Wii to find the correct write masks for the surrounding registers, as only a couple were already being masked. Dolphin has gotten away with not masking the rest because many are already A) masked on read (or never read) by the SDK and/or B) masked on use (or never used) in Dolphin.

This leaves just three registers where the difference may be observable: AR_DMA_CNT_H and AUDIO_DMA_START_HI/LO.
2020-12-30 01:34:48 -08:00
Léo Lam 8a3b14d7dc
Merge pull request #9391 from lioncash/find-str
IOS: Allow for heterogenous name lookup
2020-12-30 01:47:01 +01:00
Lioncash 0e91470828 IOS: Make use of insert_or_assign with AddDevice()
operator[] performs a default construction if an object at the given key
doesn't exist before overwriting it with the one we provide in operator=

insert_or_assign performs optimal insertion by avoiding the default
construction if an entry doesn't exist.

Not a game changer, but it is essentially a "free" change.
2020-12-29 19:32:18 -05:00
Lioncash ba0540b9c5 IOS: Allow for heterogenous name lookup
Allows lookups to be done with std::string_view or any other string
type. This allows for non-allocating strings to be used with the name
lookup without needing to construct a std::string.
2020-12-29 19:32:14 -05:00
Léo Lam 806a4f3a9a
Merge pull request #9393 from lioncash/sysconf
SysConf: Make use of std::string_view
2020-12-30 01:22:39 +01:00
Lioncash 1bbfde62d1 SysConf: std::move name in Entry constructor
Allows code to move into the constructor, avoiding copies entirely.
2020-12-29 19:09:57 -05:00
Lioncash 05094ab51f SysConf: Return emplaced reference from AddEntry()
Allows GetOrAddEntry() to be implemented in a manner that doesn't result
in a redundant lookup in the event an addition needs to be made.
2020-12-29 19:08:30 -05:00
Lioncash 74224c94a7 SysConf: Make use of std::string_view
We can allow strings to be used with the SysConf interface in
potentially non-allocating manners.
2020-12-29 19:08:25 -05:00
MerryMage d3ca5d812b Jit_Integer: Use SHLX, SHRX, SARX 2020-12-29 23:51:54 +00:00
Lioncash e527b69d54 Core: Use C++17 deduction guides with locked recursive mutexes
Cleans up some locks that explicitly specify the recursive mutex type in
it. Meant to be included with the previous commit that cleaned out
regular mutexes, but I forgot.
2020-12-29 18:31:31 -05:00
smurf3tte f4c579e720 Fix bad memory references in NewPatchDialog
This code was storing references to patch entries which could move around in memory if a patch was erased from the middle of a vector or if the vector itself was reallocated. Instead, NewPatchDialog maintains a separate copy of the patch entries which are committed back to the patch if the user accepts the changes.
2020-12-29 14:31:05 -08:00
smurf3tte f3b8a985e7 Patches for Resident Evil 2/3 audio issues
These games are erroneously zeroing buffers before they can be fully copied to ARAM by DMA. The responsible memset() calls are followed by a call to DVDRead() which issues dcbi instructions that effectively cancel the memset() on real hardware. Because Dolphin lacks dcache emulation, the effects of the memset() calls are observed, which causes missing audio.

In a comment on the original bug, phire noted that the issue can be corrected by simply nop'ing out the offending memset() calls. Because the games dynamically load different .rel executables based on the character and/or language, the addresses of these calls can vary.

To deal generally with the problem of code being dynamically loaded to fixed, known addresses, the patch engine is extended to support conditional patches which require a match against a known value. This sort of thing is already achievable with Action Replay/Gecko codes, but their use depends on enabling cheats globally in Dolphin, which is not a prerequisite shared by patches.

Patches are included for every region, character, and language combination. They are enabled by default.

The end result is an approximation of the games' behavior on real hardware without the associated complexity of proper dcache emulation.

https://bugs.dolphin-emu.org/issues/9840
2020-12-29 14:24:46 -08:00
Léo Lam 3b2e31230f
Merge pull request #9386 from leoetlino/config-cache-invalidate
Config: Fix cache not being invalidated when callbacks are suppressed
2020-12-29 22:22:15 +01:00
Jordan Woyak 92de0431a2
Merge pull request #9389 from lioncash/deduction
Core: Make use of C++17 deduction guides with locks
2020-12-29 15:18:45 -06:00
Léo Lam 9ffd345df0
Config: Fix cache not being invalidated when callbacks are suppressed
The config version should always be incremented whenever config is
changed, regardless of callbacks being suppressed or not.
Otherwise, getters can return stale data until another config change
(with callbacks enabled) happens.
2020-12-29 22:07:47 +01:00