Commit Graph

26635 Commits

Author SHA1 Message Date
Léo Lam 4c37cc7e5e
Merge pull request #9816 from JosJuice/aarch64-fma-true
Common: Set bFMA to true for AArch64
2021-06-15 13:04:21 +02:00
Léo Lam ee58f1c188
Merge pull request #9775 from dbrookman/fix-gameini-gfxbackend
GameINI: Fix GFXBackend crash
2021-06-15 12:47:55 +02:00
JosJuice 2b88a46b1a Common: Set bFMA to true for AArch64
Without this, the code added in ac28b89 misbehaves and considers
AArch64 netplay clients to not have hardware FMA support, telling
all clients to disable FMA support, which causes a desync between
x64 and AArch64 due to JitArm64 not being able to disable FMA support.
2021-06-14 15:51:59 +02:00
Daniel Brookman b214e0e71f GameINI: Fix GFXBackend crash
Fixes a regression from 5.0-12066, where setting the GFXBackend variable
to one other than the current global backend would crash Dolphin upon
launching the game.
2021-06-13 20:42:36 -04:00
Admiral H. Curtiss 360d05fe21 AudioInterface: Initialize s_cpu_cycles_per_sample to a sane value. 2021-06-13 20:41:20 +02:00
Léo Lam c2ac21c8d6
Merge pull request #9753 from mbc07/VolumeVerifier_TMD_severity
VolumeVerifier: increase problem severity for incorrectly signed TMDs
2021-06-13 16:37:38 +02:00
JosJuice be194dfc9c Jit64: Fix FPRF non-SSE4.1 handling of negative zero 2021-06-13 16:22:29 +02:00
Léo Lam d536a50878
Merge pull request #9756 from Techjar/memcard-size-config
Replace MemoryCard251 setting with generic MemoryCardSize
2021-06-13 16:09:54 +02:00
JosJuice 891a46596d Jits: Fix fcmpX FPRF mask
fcmpX only updates the FPCC bits, not the C bit.
This was already correctly implemented in the interpreter.
Not known to affect any games, but affects a hardware test.
2021-06-13 13:59:00 +02:00
Techjar 0e502062b4 Move some NetPlay-specific settings to SessionSettings 2021-06-13 06:58:05 -04:00
Léo Lam 2898cf5121
Merge pull request #9784 from PEmu2/master
Update buffer_storage warning message
2021-06-13 12:56:26 +02:00
Léo Lam 0cc1fc37b5
Merge pull request #9788 from sepalani/dsp-rate
AudioInterface: Fix AIDFR initialization
2021-06-13 12:55:31 +02:00
Léo Lam 90a994f937
Merge pull request #9802 from JosJuice/android-game-file-cache-path
Android: Stop using custom path for GameFileCache
2021-06-13 12:53:49 +02:00
Léo Lam 4e3e3bfd60
Merge pull request #9804 from JosJuice/revert-fma
NetPlay/Jit64: Avoid using software FMA
2021-06-13 12:38:09 +02:00
Léo Lam 8ef4bd682b
Merge pull request #9805 from JosJuice/rounding-mode-savestate
PowerPC: Set host CPU rounding mode on init and savestate
2021-06-13 11:49:29 +02:00
Léo Lam dd26106848
Merge pull request #9807 from Techjar/fix-glsl-any
VideoCommon: Define scalar any() and all() functions in GLSL
2021-06-13 11:15:11 +02:00
Léo Lam 38424d0c59
Merge pull request #9808 from xvrc/msghandler-label-fix
MsgHandler: Correct question and warning captions
2021-06-13 11:00:45 +02:00
Léo Lam 0a1f58ad77
Merge pull request #9730 from Dentomologist/remove_audio_pane_stretching
AudioPane: Remove main layout vertical stretching
2021-06-13 10:57:31 +02:00
Techjar 3da0976a81 VideoCommon: Define scalar any() and all() functions in GLSL
This fixes bounding box shaders failing to compile under Vulkan, due to
differences between GLSL and HLSL in the return value of vector
comparisons and what types these functions accept. I included all() for
the sake of completeness.
2021-06-13 04:50:35 -04:00
xvrc 0ad13db633 MsgHandler: Correct question and warning captions 2021-06-12 17:42:27 -04:00
JosJuice a09d9cf608
Merge pull request #9606 from Filoppi/patch-14
Qt: avoid queuing ConfigChanged() more than once
2021-06-11 18:59:39 +02:00
JMC47 0c6e00ce0c
Merge pull request #9801 from Techjar/bbox-rounding-hack
VideoCommon: Only include centered pixels in bounding box
2021-06-11 00:41:11 -04:00
Techjar b267f54259 VideoCommon: Only include centered pixels in bounding box
At higher resolutions, our bounding box dimensions end up being
slightly larger than original hardware in some cases. This is not
necessarily wrong, it's just an artifact of rendering at a higher
resolution, due to bringing out detail that wouldn't have appeared on
original hardware. It causes a texel to fall partially on what would
have been a single pixel at native resolution, resulting in the
coordinates getting bumped up to the next valid value. In many cases,
these slightly larger bounding boxes are perfectly fine, as games don't
hard-code expected dimensions. It is problematic in Paper Mario TTYD
though, for a somewhat complicated reason.

Paper Mario TTYD frequently uses EFB copies to pre-render a bunch of
animation frames for a character sprite (especially in Chapter 2), so
that it can then render 100 or more of them without bringing the
GameCube to its knees. Based on my observation, the game seems to set
aside a region of memory to store these EFB copies. This region is
obviously fairly small, as the GameCube only has 24MB of RAM. There are
2 rooms in Chapter 2 where you fight a horde of as many as 100 Jabbies,
which are also rendered using EFB copies, so in this room the game ends
up making 130(!) EFB copies just for Puni and Jabbi sprites. This seems
to nearly fill the region of memory it set aside for them.
Unfortunately, our slightly larger bounding boxes at higher resolutions
results in overflowing this memory, causing very strange behavior. Some
EFB copies partially overlap game state, resulting in reading it as a
garbage RGB5A3 texture that constantly changes. Others apparently
somehow trigger a corner case in our persistent buffer mapping, causing
them to partially overwrite earlier EFB copies.

What this change does is only include the screen coordinates that align
with the equivalent native resolution pixel centers, which generally
results in the bounding boxes being more in line with original
hardware. It isn't perfect, but it's enough to fix Paper Mario TTYD's
Jabbi rooms by avoiding the buffer overflow. Notably, it is more
accurate at odd resolutions than at even resolutions. Native resolution
is completely unaffected by this change, as should be the case. This
change may also have a small positive impact on shader performance at
higher resolutions, as there will be less atomic operations performed.
2021-06-10 21:49:52 -04:00
JosJuice 9db0ebd4b6 PowerPC: Set host CPU rounding mode on init and savestate
Not doing this can cause desyncs when TASing. (I don't know
how common such desyncs would be, though. For games that
don't change rounding modes, they shouldn't be a problem.)
2021-06-10 20:12:15 +02:00
Pokechu22 1500a0119b Eliminate TVtxDesc.GetLegacyHex 2021-06-09 20:50:50 -07:00
Pokechu22 820d9ffbfa Remove PixelShaderGen hasindstage 2021-06-09 20:50:49 -07:00
Pokechu22 c583cac568 Hack to hide debug cubes in Super Mario Sunshine
... while not breaking other games.
2021-06-09 20:50:49 -07:00
Tilka e62610e6bc
Merge pull request #9799 from Tilka/interpreter
Interpreter: deduplicate integer comparisons
2021-06-09 22:34:07 +01:00
JosJuice ac28b89fa5 NetPlay/Jit64: Avoid using software FMA
When I added the software FMA path in 2c38d64 and made us use
it when determinism is enabled, I was assuming that either the
performance impact of software FMA wouldn't be too large or CPUs
that were too old to have FMA instructions were too slow to run
Dolphin well anyway. This was wrong. To give an example, the
netplay performance went from 60 FPS to 30 FPS in one case.

This change makes netplay clients negotiate whether FMA should
be used. If all clients use an x64 CPU that supports FMA, or
AArch64, then FMA is enabled, and otherwise FMA is disabled.
In other words, we sacrifice accuracy if needed to avoid massive
slowdown, but not otherwise. When not using netplay, whether to
enable FMA is simply based on whether the host CPU supports it.

The only remaining case where the software FMA path gets used
under normal circumstances is when an input recording is created
on a CPU with FMA support and then played back on a CPU without.
This is not an especially common scenario (though it can happen),
and TASers are generally less picky about performance and more
picky about accuracy than other users anyway.

With this change, FMA desyncs are avoided between AArch64 and
modern x64 CPUs (unlike before 2c38d64), but we do get FMA
desyncs between AArch64 and old x64 CPUs (like before 2c38d64).
This desync can be avoided by adding a non-FMA path to JitArm64 as
an option, which I will wait with for another pull request so that
we can get the performance regression fixed as quickly as possible.

https://bugs.dolphin-emu.org/issues/12542
2021-06-09 22:56:26 +02:00
JMC47 0aa9e8dc9a
Merge pull request #9795 from Filoppi/fix_controller2_default_device
Fix controllers after the first one not defaulting to the default device
2021-06-09 16:09:09 -04:00
JosJuice d304d75aa5 Android: Stop using custom path for GameFileCache
Back when I wrote this code, I believe I set it to use a custom path
so that the cache would end up in a directory which Android considers
to be a cache directory. But nowadays the directory which Dolphin's
C++ code considers to be the cache directory is such a directory,
so there's no longer any reason to override the default path.
2021-06-08 18:34:40 +02:00
Connor McLaughlin c729852d72
Merge pull request #9782 from Techjar/bbox-ogl-upsidedown-fix
VideoCommon: Perform OpenGL bounding box inversion in pixel shader
2021-06-08 13:24:03 +10:00
Connor McLaughlin 1b3977990b
Merge pull request #9800 from Techjar/vulkan-subgroup-fix
Vulkan: Fix subgroup reduction
2021-06-08 13:21:41 +10:00
Techjar 58238e75a7 Vulkan: Fix subgroup reduction
It seems that we were writing values from helper invocations, which
produces wrong results.
2021-06-07 22:32:25 -04:00
JMC47 ec8257ebe1
Merge pull request #9794 from Filoppi/fix_input_focus_bug
Fix input focus checks being wrong (issue 12540)
2021-06-07 20:08:09 -04:00
Dentomologist a2e1ddc354 AudioPane: Remove main layout vertical stretching 2021-06-07 15:57:02 -07:00
Tillmann Karras 5fc3cb2379 Interpreter: deduplicate integer comparisons 2021-06-07 22:39:15 +01:00
Filoppi 702f86ccc0 InputCommon: fix 2nd+ controller not defaulting to the default device 2021-06-07 19:31:38 +03:00
Léo Lam edc18e60ad
Merge pull request #9785 from Dentomologist/fix_gamelist_grid_zoom_in
GameList: Fix grid mode zoom keybind inconsistency
2021-06-07 14:00:21 +02:00
Filoppi 7c83b745c5 Qt: fix input focus checks being wrong
When rendering to main and going full screen, we aren't using the main window handle
as the code assumed, but the other, detached, render widget.
2021-06-07 14:35:59 +03:00
Léo Lam 5e371bb4be
Merge pull request #9792 from sepalani/lint
Lint: End of namespace
2021-06-07 12:16:08 +02:00
Sepalani 1d48a33aed MMIOHandlers: Move method definitions to MMIO.cpp 2021-06-07 13:42:39 +04:00
Sepalani ce8004c9c1 Lint: End of namespace 2021-06-07 12:55:52 +04:00
Filoppi 83ea16f402 Qt: Fix IOWindow keeping a shared ptr to devices even after them being removed by the ControllerInterface
this prevented some devices from being recreated correctly, as they were exclusive (e.g. DInput Joysticks)

This is achieved by calling Settings::ReleaseDevices(), which releases all the UI devices shared ptrs.
If we are the host (Qt) thread, DevicesChanged() is now called in line, to avoid devices being hanged onto by the UI.
For this, I had to add a method to check whether we are the Host Thread to Qt.

Avoid calling ControllerInterface::RefreshDevices() from the CPU thread if the emulation is running
and we manually refresh devices from Qt, as that is not necessary anymore.

Refactored the way IOWindow lists devices to make it clearer and hold onto disconnected devices.
There were so many issues with the previous code:
-Devices changes would not be reflected until the window was re-opened
-If there was no default device, it would fail to select the device at index 0
-It could have crashed if we had 0 devices
-The default device was not highlighted as such
2021-06-07 11:48:30 +03:00
Filoppi a77e3b4a9b InputCommon: Make Wiimote rumble variable thread safe 2021-06-07 11:48:30 +03:00
Filoppi 08f8c27927 ControllerInterface: fix DSU thread safety and use PlatformPopulateDevices() 2021-06-07 11:48:29 +03:00
Filoppi 8b53af9cbc ControllerInterface: polish DInput Keyboard and Mouse (add comments and logs)
Also fix the cursor axis not being updated when the mouse device had failed aquiring,
despite them being completely unrelated
2021-06-07 11:07:06 +03:00
Filoppi 038b57fecc ControllerInterface: DInput Joystick fix non thread safe static variable
also fix devices being added to its own custom list of devices even when rejected by the CI
2021-06-07 11:07:06 +03:00
Filoppi a0ecca1a84 ControllerInterface: Implement ChangeWindow on DInput without recreating the devices
Also polished DInput code in general to try and mitigate issue 11702.
Added a lot of logging and comments.
2021-06-07 11:07:06 +03:00
Filoppi dcc345400e ControllerInterface: devices population is now async so implement devices sorting priority
This helps us keeping the most important devices (e.g. Mouse and Keyboard) on the top
of the list of devices (they still are on all OSes supported by dolphin
and to make hotplug devices like DSU appear at the bottom.
2021-06-07 11:07:06 +03:00
Filoppi 0718cfd7d7 ControllerInterface: make evdev use PlatformPopulateDevices
Also fix evdev non thread safe acces to static variables
2021-06-07 11:07:06 +03:00
Filoppi 2aa941081e ControllerInterface: make SDL use PlatformPopulateDevices()
and avoid waiting on SDL async population being finished for no reason
2021-06-07 11:07:06 +03:00
Filoppi 1d816f8f26 ControllerInterface: make real Wiimote use PlatformPopulateDevices() 2021-06-07 11:07:06 +03:00
Filoppi c238e49119 ControllerInterface: Remove OSX window handle
also make it more thread safe (avoid rare deadlock)
and fix it trying to add devices before the CI has init
2021-06-07 11:07:05 +03:00
Filoppi 2376aec135 ControllerInterface: Refactor
-Fix Add/Remove/Refresh device safety, devices could be added and removed at the same time, causing missing or duplicated devices (rare but possible)
-Fix other devices population race conditions in ControllerInterface
-Avoid re-creating all devices when dolphin is being shut down
-Avoid re-creating devices when the render window handle has changed (just the relevantr ones now)
-Avoid sending Devices Changed events if devices haven't actually changed
-Made most devices populations will be made async, to increase performance and avoid hanging the host or CPU thread on manual devices refresh
2021-06-07 11:07:05 +03:00
Filoppi f90d851e25 ControllerInterface: mixed comments 2021-06-07 11:07:05 +03:00
Filoppi c285ae57fb ControllerInterface: fix rare deadlock
A "devices changed" callback could have ended up waiting on another thread that was also populating devices
and waiting on the previous thread to release the callbacks mutex.
2021-06-07 11:07:05 +03:00
JMC47 ebe3fbe04c
Merge pull request #9771 from Filoppi/dsu_fixes
DSU improvements
2021-06-07 03:50:50 -04:00
Techjar 4866002c9b VideoCommon: Perform OpenGL bounding box inversion in pixel shader
Running the min/max operation on the upside down, quad-rounded pixel
coordinates before inverting them to the standard upper-left origin
produces wrong results. Therefore, we need to do the inversion before
rounding to pixel quads.
2021-06-06 20:55:06 -04:00
Léo Lam a208d529de
Merge pull request #9790 from AdmiralCurtiss/cheat-manager-config-change
CheatsManager: Avoid recreating child widgets on every OnStateChanged(), and take running game info directly from SConfig.
2021-06-07 02:37:11 +02:00
Admiral H. Curtiss c3560f033e UPnP: Improve error messages on initialization failure. 2021-06-07 00:36:35 +02:00
JosJuice 4ef4ac41d1 JitArm64: Fix clobbering LR in FakeLKExit
Fixes Need for Speed: Carbon accessing invalid memory when
branch following and BLR optimization are enabled simultaneously.
2021-06-06 22:43:57 +02:00
Admiral H. Curtiss 441d304317 CheatsManager: Use game information directly from SConfig, and only recreate widgets if game changes. 2021-06-06 21:56:34 +02:00
Admiral H. Curtiss 414e0f4598 GeckoCodeWidget: Take game ID and revision directly instead of through GameFile. 2021-06-06 21:25:37 +02:00
Admiral H. Curtiss 1fbe56210a ARCodeWidget: Take game ID and revision directly instead of through GameFile. 2021-06-06 21:23:17 +02:00
Léo Lam 684d09b342
Merge pull request #9789 from AdmiralCurtiss/netplay-efb-access-tile-size-bool
NetPlay: Sync the EFB access tile size as an integer instead of a boolean.
2021-06-06 19:20:38 +02:00
Admiral H. Curtiss 9fd16a93c5 NetPlay: Sync the EFB access tile size as an integer instead of a boolean. 2021-06-06 19:02:07 +02:00
Dentomologist 7a6098a7f6 GameList: Fix grid mode zoom keybind inconsistency
Add keybind to make 'control plus' zoom in as per convention, and also
'control shift minus' zoom out to maintain consistency.
2021-06-06 09:21:41 -07:00
Sepalani eaf8e30008 AudioInterface: Fix AIDFR initialization 2021-06-06 18:57:32 +04:00
Tilka 8139967768
Merge pull request #9787 from JosJuice/jitarm64-slwx-top
JitArm64: Discard top 32 bits in slwx result
2021-06-06 08:46:16 +01:00
Mai M 5470aceb63
Merge pull request #9786 from Tilka/dsp
DSP: small cleanup
2021-06-06 00:48:28 -04:00
Tilka 89af7b82f2
Merge pull request #9770 from JosJuice/jits-accidental-gt
Jits: Fix accidentally setting GT in CR when clearing EQ
2021-06-06 05:17:25 +01:00
Tilka 6c0180fc61
Merge pull request #9748 from JosJuice/fma-accuracy
Interpreter/Jit64: Emulate FMA accurately in more cases
2021-06-06 02:29:42 +01:00
Tillmann Karras f2c4041d39 DSPHLE: remove unused function 2021-06-06 01:09:30 +01:00
Tillmann Karras a13df9b251 DSP: use CR_* enum values 2021-06-06 01:08:45 +01:00
PEmu2 44206b7702
Update buffer_storage warning message 2021-06-05 15:08:47 -07:00
JosJuice 86de3df072 JitArm64: Discard top 32 bits in slwx result
srwx would like to be able to assume that the top 32 bits
are zero, and cmpl is already doing so.
2021-06-05 23:15:08 +02:00
JosJuice acc7d3710d
Merge pull request #9780 from Techjar/freelook-config-fix
Common/FileUtil: Add some missing configs to D_CONFIG_IDX
2021-06-05 13:40:37 +02:00
Techjar 7111d11161 Common/FileUtil: Add some missing configs to D_CONFIG_IDX 2021-06-05 07:34:36 -04:00
JMC47 638909aec6
Merge pull request #9751 from JosJuice/jitarm64-fcmpx-ftz
JitArm64: Make fcmpX with flush-to-zero enabled less bad
2021-06-05 05:27:52 -04:00
Techjar 83d55704aa VideoCommon: Round bounding box coordinates down and remove pixel center offset
Fragment coordinates always have a 0.5 offset from a whole integer, as
that's where the pixel center is on modern GPUs. Therefore, we want to
always round the fragment coordinates down for bounding box
calculations. This also renders the pixel center offset useless, as 0.5
vs ~0.5833333 makes no difference when rounding down.
2021-06-05 00:34:10 -04:00
Shawn Hoffman 4ce22c093c msvc: remove workarounds for old compiler issues 2021-06-03 18:33:24 -07:00
Shawn Hoffman d8cc419eb3 msvc: remove some unneeded warning disable
this was either for libusb.h or some now-removed code.
2021-06-03 16:32:54 -07:00
JosJuice b6cc3c4b6e JitArm64: Make fcmpX with flush-to-zero enabled less bad
See the added code comment for details. Fixes Pokémon Battle
Revolution not progressing past the title screen.
2021-06-02 20:15:33 +02:00
JosJuice 21ebc176fe JitArm64: Set FPCR.AH
Only tested on a CPU which does not support FEAT_AFP.
2021-06-02 20:15:24 +02:00
Dentomologist 99ed43280d Updater: Escape HTML characters in commit descriptions 2021-06-01 17:22:19 -07:00
JMC47 a12865570d
Merge pull request #9764 from Pokechu22/amd-opengl-bbox-fix
VideoCommon: Fix bounding box on AMD/OpenGL/Windows
2021-06-01 19:55:54 -04:00
Techjar 8cfe49295f VideoCommon: Add fallback handling for bounding box when disabled or unsupported
The SDK seems to write "default" bounding box values before every draw
(1023 0 1023 0 are the only values encountered so far, which happen to
be the extents allowed by the BP registers) to reset the registers for
comparison in the pixel engine, and presumably to detect whether GX has
updated the registers with real values. Handling these writes and
returning them on read when bounding box emulation is disabled or
unsupported, even without computing real values from rendering, seems
to prevent games from corrupting memory or crashing.

This obviously does not fix any effects that rely on bounding box
emulation, but having the game not clobber its own code/data or just
outright crash is a definite improvement.
2021-05-31 19:56:24 -04:00
Pokechu22 c58837964f VideoCommon: Fix bounding box on AMD/OpenGL/Windows
Co-authored-by: Techjar <tecknojar@gmail.com>
2021-05-31 16:22:50 -07:00
Techjar 2f1b639f0a VideoCommon: Restore BBox* forwarding functions 2021-05-31 18:01:47 -04:00
OatmealDome 833d5a3e9f AutoUpdate: Put updater log in the user log directory 2021-05-31 16:34:15 -04:00
OatmealDome 243c6b58fe UpdaterCommon: Replace FindOrCreateTempDir with File::CreateTempDir() 2021-05-31 16:34:11 -04:00
OatmealDome c87241479a FileUtil: Handle app translocation on macOS 2021-05-31 16:25:34 -04:00
JosJuice c404452d3e
Merge pull request #9759 from Techjar/netplay-sanitize-gci
NetPlay: Check file names when receiving GCI folder
2021-05-31 19:46:26 +02:00
Filoppi 98b00a28e4 ControllerInterface: make DSU inputs start from resting pose instead of 0. Add battery level 2021-05-31 02:24:41 +03:00
Filoppi 16e4dede72 ControllerInterface: DSU polish: avoid hanging host thread, add disconnection detection, ...
-Reworked thread waits to never hang the Host thread for more than a really small time
(e.g. when disabling DSU its thread now closes almost immediately)
-Improve robustness when a large amount of devices are connected
-Add devices disconnection detection (they'd stay there forever until manually refreshed)
2021-05-31 02:21:17 +03:00
Filoppi 83806462ec ControllerInterface: fix DSU using the same client uid between server and controllers queries
that's not the way it's supposed to work
2021-05-31 02:17:25 +03:00
JosJuice de3fed6093 Jits: Fix accidentally setting GT in CR when clearing EQ
https://bugs.dolphin-emu.org/issues/12526
2021-05-30 22:07:53 +02:00
Tillmann Karras faec77a971 Fix -Wreorder warnings 2021-05-30 17:10:20 +01:00
Techjar 1377f31cf8 NetPlay: Check file names when receiving GCI folder 2021-05-29 17:52:49 -04:00
Connor McLaughlin b3a414ea9d
Merge pull request #9766 from stenzek/ogl-bbox-memory-barrier
OGL: Force memory barrier when reading back bounding box values
2021-05-29 17:04:57 +10:00
Connor McLaughlin b31d4400e3
Merge pull request #9765 from Techjar/bbox-pixel-quads-2-electric-boogaloo
VideoCommon: Move bounding box pixel quads rounding to shader
2021-05-29 17:00:14 +10:00
Connor McLaughlin 6393f157f0 OGL: Force memory barrier when reading back bounding box values
We also need to ensure the the CPU does not receive stale values
which have been updated by the GPU. Apparently the buffer here
is not coherent on NVIDIA drivers. Not sure if this is a driver
bug/spec violation or not, one would think that
glGetBufferSubData() would invalidate any caches as needed, but
this path is only used on NVIDIA anyway, so it's fine. A point
to note is that according to ARB_debug_report, it's moved from
video to host memory, which would explain why it needs the
cache invalidate.
2021-05-29 16:57:40 +10:00
Techjar a24e78b3cf VideoCommon: Remove BBox* forwarding functions 2021-05-29 01:45:21 -04:00
Techjar e4aef0a85b VideoCommon: Move bounding box pixel quads rounding to shader
This avoids rounding values that the game writes to the bounding box
registers, especially the default values.
2021-05-28 23:30:22 -04:00
Mai M 7b2b05cc21
Merge pull request #9760 from JosJuice/jitarm64-msvc-warning
JitArm64: Fix MSVC warnings
2021-05-28 23:29:24 -04:00
JosJuice e0c81ae54a JitArm64: Fix MSVC warnings 2021-05-28 15:34:08 +02:00
Connor McLaughlin 7fd0a526e1 VideoBackends/OGL: Cache bounding box values between reads 2021-05-28 19:30:46 +10:00
Connor McLaughlin 0c11dca121 VideoBackends/D3D: Cache bounding box values between reads 2021-05-28 19:30:46 +10:00
Pokechu22 5928182a4c Skip indirect operation for out of bounds indirect stages
This fixes rendering issues in Viewtiful Joe (https://bugs.dolphin-emu.org/issues/12525), but it is not entirely hardware accurate, as hardware testing showed other, more complex behavior in this case.  However, it should be good enough for our purposes.
2021-05-27 22:13:42 -07:00
JMC47 45a5c9cc04
Merge pull request #9697 from Filoppi/cursor_locking
Implement Cursor Locking and input focus checks for it
2021-05-27 11:42:35 -04:00
Techjar 33a6701e56 Replace MemoryCard251 setting with generic MemoryCardSize
This allows for a broader range of game-specific memory card sizes to
be configured.
2021-05-27 03:50:57 -04:00
Filoppi 3c7c2dfaa1 Implement Cursor Locking and new input focus checks for it 2021-05-27 10:31:12 +03:00
Mai M 52a388af9a
Merge pull request #9754 from JosJuice/netplay-memcard-region
NetPlay: Check that memory card region is valid
2021-05-26 20:57:58 -04:00
Scott Mansell 37e532322b Port dump XFB option to Qt UI.
Looks like the option was added to the Wx UI at commit 198d3b69, which
was a few months after the advancedWidget was originally ported from
Wx to Qt, but before anyone was actually using Qt.
2021-05-27 12:48:36 +12:00
JosJuice ba7ad73e92 NetPlay: Check that memory card region is valid 2021-05-27 00:00:06 +02:00
Mateus B. Cassiano 2c598e46ab VolumeVerifier: increase problem severity for incorrectly signed TMDs 2021-05-26 05:52:21 -04:00
JosJuice 2c38d6419e Jit64: Emulate FMA accurately when determinism is enabled
When determinism is enabled, we either want all CPUs to use FMA or
we want no CPUs to use FMA. Until now, Jit64 has been been doing
the latter. However, this is inaccurate behavior, all CPUs since
Haswell support FMA, and getting JitArm64 to match the exact
inaccurate rounding used by Jit64 would be a bit annoying. This
commit switches us over to using FMA on all CPUs when determinism
is enabled, with older CPUs calling the std::fma function.
2021-05-25 12:37:52 +02:00
JosJuice 9bc5bd83a9 Interpreter: Use std::fma for emulating FMA
This is more accurate to the original hardware's rounding behavior.
2021-05-25 10:54:00 +02:00
Pokechu22 4a4244f04d Software: Fix bad backbuffer size
MAX_XFB_WIDTH/HEIGHT are the largest XFB sizes seen in practice, but do not make sense to use for the backbuffer size, which should be the size of the window.  The old code created screenshots with a size of 720x540 on NTSC games when "Dump Frames at Internal Resolution" is unchecked; now, the window size is used.
2021-05-24 12:16:39 -07:00
Léo Lam 51671921c4
Merge pull request #9441 from skylersaleh/master
Apple M1 Support for MacOS
2021-05-24 12:39:01 +02:00
JosJuice ed331291d1
Merge pull request #9747 from JosJuice/jitarm64-sync
JitArm64: Jump to dispatcher on downcount <= 0, not < 0
2021-05-24 12:02:20 +02:00
JosJuice 86d2c2a1c3 JitArm64: Jump to dispatcher on downcount <= 0, not < 0
All the other CPU emulation cores do it on <= 0.
2021-05-24 10:42:04 +02:00
Skyler Saleh 210f6e7f0d Apple M1: Update AutoUpdate PlatformID
Adds a new PlatformID for universal builds. This will allow single architecture
builds to be updated through the single architecture path, and universal builds
to be updated with universal builds.
2021-05-23 21:45:27 -07:00
Bonta-kun bb1dd31f53 SI: Fix COMERR update 2021-05-23 20:30:07 -07:00
Vicki Pfau e70193195c SI: Generate NOREP on timeout instead of generating Dolphin SDK reply 2021-05-23 20:30:07 -07:00
Filoppi 93e3e691f9 Expose Control Expression variables to mappings UI
-add a way to reset their value (from the mappings UI)
-fix "memory leak" where they would never be cleaned,
one would be created every time you wrote a character after a "$"
-fix ability to create variables with an empty string by just writing "$" (+added error for it)
-Add $ operator to the UI operators list, to expose this functionality even more
2021-05-24 02:38:06 +03:00
JMC47 975f8e2a25
Merge pull request #9700 from Filoppi/simplify_mappings_preview
Simplify the preview of control mappings by removing the device path from controls
2021-05-23 14:44:38 -04:00
Techjar a33593baf7 Qt/GeneralPane: Refresh widget state on config change
This fixes a nasty issue where you can change the Dual Core setting
during emulation, if it has been overridden by GameINI or NetPlay, by
simply changing any of the non-disabled settings. This is because
changing any of the settings will write all of them to the config.

This issue is particularly nasty because managing to disable Dual Core
during emulation, and then stopping it, results in the emulator core
being totally deadlocked. It's impossible to recover from this state,
and Dolphin will remain as a zombie process on the system, consuming
resources and holding locks, until forcibly killed.
2021-05-23 01:39:35 -04:00
Mai M 95aadff0e7
Merge pull request #9737 from Techjar/fix-textureinfo-hasmips
VideoCommon/TextureInfo: Restore old mipmap detection logic
2021-05-22 19:39:52 -04:00
Skyler Saleh 76ed9310f2 Apple M1: RAII Wrapper for JITPageWrite*Execute*()
Added RAII wrapper around the the JITPageWriteEnableExecuteDisable() and
JITPageWriteDisableExecuteEnable() to make it so that it is harder to forget to
pair the calls in all code branches as suggested by leoetlino.
2021-05-22 15:25:18 -07:00
Skyler Saleh f567fd93b9 Apple M1: Removed unavailable CPU core dialog box
Removed the unavailable CPU core dialog box that asked users to change their
selected CPU core to one that is available. Instead, Dolphin now just overrides
the core to the default, and logs that it performed the override.
2021-05-22 15:25:18 -07:00
Skyler Saleh f92ccd5058 Apple M1: Fix bug that could cause crash with MMU
Added a Common::JITPageWriteDisableExecuteEnable() that could be missed when
a memory exception is triggered by the running game.
2021-05-22 15:25:18 -07:00
Skyler Saleh 38861f6782 Apple M1: x86_64 MAP_JIT
- Enabled MAP_JIT on x86_64 after confirming that pthread_jit* calls are only
required for MAP_JIT pages on Apple Silicon
2021-05-22 15:25:18 -07:00
Skyler Saleh 4ff429266a Apple M1: MacOS 11.2 mprotect restrictions
In MacOS 11.2 mprotect can no longer change the access protection settings of
pages that were previously marked as executable to anything but PROT_NONE. This
commit works around this new restriction by bypassing the mprotect based write
protection and instead relying on the write protection provided by MAP_JIT.
2021-05-22 15:25:18 -07:00
Skyler Saleh 8cb86e7ae0 Apple M1: Enable hardened runtime
- Fixed error that was causing the hardened runtime from being enabled
- Refactored BuildMacOSUniversalBinary.py based on code style recommendations
2021-05-22 15:25:18 -07:00
Skyler Saleh 61448a9b2f Apple M1: Refactor ArmCPUDetect.cpp
Merges two nested #ifndefs into a single #if around hw cap includes.
2021-05-22 15:25:17 -07:00
Skyler Saleh 4542038cd0 Apple M1: OS version checking for MAP_JIT
- Added MacOS version checking around MAP_JIT to prepare code for x86 MAP_JIT
2021-05-22 15:25:17 -07:00
Skyler Saleh 948764d37b Apple M1: Build, Analytics, and Memory Management
Analytics:
- Incorporated fix to allow the full set of analytics that was recommended by
  spotlightishere

BuildMacOSUniversalBinary:
- The x86_64 slice for a universal binary is now built for 10.12
- The universal binary build script now can be configured though command line
  options instead of modifying the script itself.
- os.system calls were replaced with equivalent subprocess calls
- Formatting was reworked to be more PEP 8 compliant
- The script was refactored to make it more modular
- The com.apple.security.cs.disable-library-validation entitlement was removed

Memory Management:
- Changed the JITPageWrite*Execute*() functions to incorporate support for
  nesting

Other:
- Fixed several small lint errors
- Fixed doc and formatting mistakes
- Several small refactors to make things clearer
2021-05-22 15:25:17 -07:00
Skyler Saleh 4ecb3084b7 Apple M1 Support for MacOS
This commit adds support for compiling Dolphin for ARM on MacOS so that it can
run natively on the M1 processors without running through Rosseta2 emulation
providing a 30-50% performance speedup and less hitches from Rosseta2.

It consists of several key changes:

- Adding support for W^X allocation(MAP_JIT) for the ARM JIT
- Adding the machine context and config info to identify the M1 processor
- Additions to the build system and docs to support building universal binaries
- Adding code signing entitlements to access the MAP_JIT functionality
- Updating the MoltenVK libvulkan.dylib to a newer version with M1 support
2021-05-22 15:25:17 -07:00
JosJuice f9b0225b69
Merge pull request #9725 from Techjar/netplay-sync-allow-sd-write
NetPlay: Add some missing synced settings
2021-05-22 23:32:12 +02:00
Scott Mansell 610613ee76 Use correct mask for Fake VMem
Shouldn't have any behaviour change for regular usage as both masks are 32MB
by default.
But fixes theoretical buffer overrun when memory size override is used.
2021-05-23 05:54:02 +12:00
Mai M 77e5d79354
Merge pull request #9736 from Techjar/bbox-pixel-quads
VideoCommon: Account for pixel quads in bounding box calculation
2021-05-22 13:14:07 -04:00
JosJuice 68a5fc55d2 Interpreter: Fix fctiwx rounding
The interpreter implementation of fctiwx was treating rounding
mode 0 as "round to nearest, ties towards zero", which is not
an actual IEEE-754 rounding mode. The IBM document mentioned
in a comment at the top of the function, on the other hand,
treats rounding mode 0 as "round to nearest, ties to even",
which makes more sense.

This fixes one of JMC's console-recorded F-Zero GX replays on
JitArm64. (JitArm64 uses an interpreter fallback for fctiwx.)
2021-05-22 17:28:04 +02:00
Techjar be6b000bec VideoCommon: Account for pixel quads in bounding box calculation
The GC/Wii GPU rasterizes in 2x2 pixel groups, so bounding box values
will be rounded to the extents of these groups, rather than the exact
pixel. To account for this, we'll round the top/left down to even and
the bottom/right up to odd. I have verified that the values resulting
from this change exactly match a real Wii.
2021-05-22 05:58:52 -04:00
Techjar 0f17990137 VideoCommon: Split BBox* functions into common and backend implementation variants
This will allow for some aspects of bounding box to be handled in
VideoCommon instead of individual backends.
2021-05-22 01:11:57 -04:00
Techjar 42d1658c50 VideoCommon/TextureInfo: Restore old mipmap detection logic 2021-05-22 00:35:43 -04:00
JosJuice 99dc97c377 DolphinQt: AutoUpdate.cpp should use scm_rev_git_str
27cc0b5 regression.
2021-05-21 17:36:43 +02:00
Mai M 7d8c3ff7d2
Merge pull request #9732 from JosJuice/avoid-including-scmrev
Avoid including scmrev.h except in Version.cpp
2021-05-21 11:25:38 -04:00
JosJuice 27cc0b539a Avoid including scmrev.h except in Version.cpp
Any file which includes scmrev.h must be rebuilt when scmrev.h
is regenerated. By not including scmrev.h from any file other
than Version.cpp, incremental builds become a little faster.
2021-05-21 17:03:01 +02:00
JosJuice 1d3b9fdec2 Fix perf query regression
When trying to do a small optimization in 8a0f5ea, I failed to
take into account that WeakFlush and FlushOne update m_query_count.

Only D3D11 and OGL had this problem, not D3D12 and Vulkan.
2021-05-21 13:39:59 +02:00
Techjar a47fcdcbec NetPlay: Add some missing synced settings 2021-05-20 15:13:41 -04:00
Mai M 9312e45cbe
Merge pull request #9687 from Dentomologist/fix_config_descriptions_grammar
Fix config descriptions grammar
2021-05-20 11:15:25 -04:00
Mai M 1054abc9cc
Merge pull request #9712 from JosJuice/jitarm64-fmul-rounding
JitArm64: Fix fmul rounding issues
2021-05-20 10:25:02 -04:00
Mai M 5949a19fe6
Merge pull request #9714 from JosJuice/jitarm64-convert-fmov
JitArm64: Prefer using FMOV when doing single/double conversion
2021-05-20 10:24:36 -04:00
Mai M 6958df5967
Merge pull request #9695 from JosJuice/jitarm64-fres
JitArm64: Implement fres and frsqrte
2021-05-20 10:23:49 -04:00
Mai M 539c2cb00e
Merge pull request #9667 from Sintendo/jit64divwx2
Jit64: Minor divwx optimizations
2021-05-20 10:22:54 -04:00
Mai M 8b81481920
Merge pull request #9710 from JosJuice/volatile-begone
Remove all remaining volatile qualifiers
2021-05-20 10:20:22 -04:00
Mai M fb43aaf513
Merge pull request #9720 from Techjar/move-netsettings
NetPlay: Move NetSettings initialization to backend
2021-05-20 10:19:03 -04:00
JosJuice 25c4c64ae4 Fixes to translatable strings, take 2
Sorry, the fix I made to the empty string in a29660a was not
actually sufficient, as DolphinQt will call tr on the string
regardless of whether it's marked with _trans. The proper fix
is to use nullptr, which DolphinQt has a special check for.
2021-05-20 15:53:30 +02:00
JosJuice a29660a2c7 Fixes to translatable strings
Sending an empty string to the translation system will not
result in getting an empty string back, but rather a description
of the currently loaded translations file. So empty strings
should not be marked as translatable.

Also adding some i18n comments and rewording a string I thought
was hard to understand.
2021-05-20 11:35:01 +02:00
Filippo Tarpini e6057c5f62 Qt: avoid queuing ConfigChanged() more than once 2021-05-20 00:30:14 +03:00
Filoppi 379ffc268d IMUGyroscope: make GetState update optional (on by default), fix const, clean code
My future PRs will split the UI state from the Emulation State of some of these emulated
controller values and this readies the code for it.
2021-05-19 20:51:35 +03:00
Filoppi a19a0096db InputCommon: improve code that returns a controller attachment index
casting a value to a u32 when it's originally an int, and it's exposed as int to users,
could end up in cases where a negative number would result as a positive one.
This doesn't really affect the value range of the attachment enum,
still I think the code was wrong.

Heavily tested.
2021-05-19 20:51:34 +03:00
Filoppi d43a06ff6a IMUAccelerometer: consistency of BoundCount checks
Similar to the guitar, only control[0] was checked, and that felt random.
2021-05-19 20:51:34 +03:00
Filoppi 7f5b6ed788 Guitar: consistency of BoundCount check
only control[0] was checked, and not one, which seems random.
Either both or none should be checked.
2021-05-19 20:51:34 +03:00
Techjar 171aad50cc NetPlay: Move NetSettings initialization to backend
It doesn't really belong in frontend code, and this change will make it
easier to eventually support NetPlay on other UI frameworks.
2021-05-19 06:34:24 -04:00
JMC47 736de8abf6
Merge pull request #9527 from sepalani/watch-items
WatchWidget: Add new/delete/clear toolbar items
2021-05-18 04:08:58 -04:00
JMC47 93e9d8be86
Merge pull request #8923 from Filoppi/OSD-fixes
fixes for "On Display Messages"
2021-05-18 00:33:15 -04:00
JMC47 678e035126
Merge pull request #9678 from Filoppi/tooltips_style
Make all Qt ToolTips look similar to BalloonTips
2021-05-17 16:40:49 -04:00
JosJuice 1bf6762709 Fix Android controller mappings accidentally being in IsSettingSaveable
Settings.SECTION_INI_ANDROID and Settings.SECTION_BINDINGS
both have the value "Android", but we only want the former
to be marked as being handled by the new config system.

This change fixes a problem where controller settings were
not being properly saved to Dolphin.ini.
2021-05-16 17:08:51 +02:00
Mat M b4ec550782
Merge pull request #9715 from iwubcode/qt-header-warnings
DolphinQt: ignore warnings from qt headers on buildbot
2021-05-15 17:34:57 -04:00
JosJuice 11be2314fe JitArm64: Fix fmul rounding issues
This is a port of 4f18f60 to JitArm64.
2021-05-15 23:27:34 +02:00
JosJuice 66e912a252 PPCAnalyst: Treat frspx output as single 2021-05-15 23:27:33 +02:00
JosJuice 77afb0f4c3 PPCAnalyst: Apply "bitexact" analysis to fprIsSingle
This lets us set fprIsSingle to true in more cases.
2021-05-15 23:27:33 +02:00
Mat M b3bceb2c11
Merge pull request #9713 from JosJuice/ppcanalyst-bitexact-broken
PPCAnalyst: Fix broken bitexact analysis
2021-05-15 17:09:54 -04:00
iwubcode 04a635e884 DolphinQt: fix Visual Studio warning about 'assignment within conditional expression' 2021-05-15 14:39:03 -05:00
iwubcode 05b1566e3f DolphinQt: don't propagate warnings in the header to Dolphin when building with Visual Studio through CMake 2021-05-15 14:39:03 -05:00
JosJuice e5f2dcd891 JitArm64: Implement FPRF updates for fres+frsqrte 2021-05-15 19:21:17 +02:00
JosJuice 4b3fda7906 JitArm64: Implement frsqrte 2021-05-15 19:21:15 +02:00
JosJuice 85226e09f0 JitArm64: Implement fres 2021-05-15 19:16:32 +02:00
JosJuice 8c12068a03 JitArm64: Prefer using FMOV when doing single/double conversion
FMOV is faster than INS and ties UMOV. (On all CPUs I checked,
at least. It certainly shouldn't be slower, though.)
2021-05-15 18:56:40 +02:00
JosJuice b980797a16 PPCAnalyst: Fix broken bitexact analysis
`code` points to the first instruction in the block, not the
current instruction.
2021-05-15 18:19:04 +02:00
JosJuice 8a0f5ea04a Remove all remaining volatile qualifiers 2021-05-15 09:52:04 +02:00
Mat M d74a1068b8
Merge pull request #9540 from Pokechu22/better-fifo-analyzer-part-2
Fifo analyzer quality of life improvements
2021-05-14 15:51:53 -04:00
Mat M 41befc21cd
Merge pull request #9708 from JosJuice/dsp-volatile
DSP: Change external_interrupt_waiting from volatile to atomic
2021-05-14 14:34:09 -04:00
Mat M 964fed77c5
Merge pull request #9707 from JosJuice/remove-atomic-header
Remove Atomic.h
2021-05-14 14:33:24 -04:00
JMC47 16e91172b1
Merge pull request #9668 from leoetlino/windows-cmake-fixes
CMake: minor Windows fixes
2021-05-14 08:22:11 -04:00
Scott Mansell 9f91fb6447
Merge pull request #9688 from Filoppi/input_cleanup
Input cleanup
2021-05-14 20:51:33 +12:00
JosJuice d17341572d DSP: Change external_interrupt_waiting from volatile to atomic
Making this volatile accomplishes... Well, nothing in practice.
Making it atomic, on the other hand, lets us enforce a memory ordering.
2021-05-14 09:28:10 +02:00
JosJuice b93983b50a Remove Atomic.h
The STL has everything we need nowadays.

I have tried to not alter any behavior or semantics with this
change wherever possible. In particular, WriteLow and WriteHigh
in CommandProcessor retain the ability to accidentally undo
another thread's write to the upper half or lower half
respectively. If that should be fixed, it should be done in a
separate commit for clarity. One thing did change: The places
where we were using += on a volatile variable (not an atomic
operation) are now using fetch_add (actually an atomic operation).

Tested with single core and dual core on x86-64 and AArch64.
2021-05-13 18:56:27 +02:00
Mat M 7a72a5b997
Merge pull request #9703 from Filoppi/fix_expression_serialization
Fix serialization of control expressions with line breaks
2021-05-13 06:47:38 -04:00
Mat M d034c830ac
Merge pull request #9681 from iwubcode/texture-info
VideoCommon: move all texture calculations to a "TextureInfo" class
2021-05-13 06:44:08 -04:00
Mat M 0ef88d4ecb
Merge pull request #9705 from Leseratte10/master
Socket: Fix AF_INET6 on non-Windows systems
2021-05-13 06:42:44 -04:00
Mat M 24b9a64c11
Merge pull request #9690 from Sintendo/jit64divwux
Jit64: divwux - Prefer three-operand IMUL
2021-05-13 06:42:14 -04:00
Mat M 725ea3d9c1
Merge pull request #9637 from JosJuice/jitarm64-fprf
JitArm64: Implement FPRF updates
2021-05-13 06:39:28 -04:00
JosJuice bfe8b1068d JitArm64: Implement FPRF updates 2021-05-13 11:51:00 +02:00
JosJuice 749db94dec Arm64Emitter: Implement more variants of FMOV 2021-05-13 10:13:59 +02:00
Jordan Woyak bf16f77402
Merge pull request #9657 from lioncash/wiimote-mode
DataReport: Amend conditional test for data reports in IsValidMode
2021-05-12 17:23:17 -05:00
Dentomologist 5a688b74a7 GeneralWidget: Fix Backend description grammar
Unify Backend description string for Windows and other platforms.
2021-05-12 10:50:10 -07:00
Dentomologist b9c1f4921c GeneralWidget: Fix Log Rendertime description grammar 2021-05-12 10:50:10 -07:00
Filoppi f3ffac0058 Qt: add tooltip to MappingBool
Tooltip code is identical to MappingDouble and the tooltips (UI description)
are present in the underlying setting object.
2021-05-12 18:27:24 +03:00
Filoppi 26f6648421 StickGate: add custom clamp value
Works exactly as before by default.
It will be used by my upcoming input PRs.
2021-05-12 18:27:24 +03:00
Filoppi 5f74d0e08f InputCommon: follow coding conventions 2021-05-12 18:27:24 +03:00
Filoppi 4625359a4f InputCommon: clamp the attachment setting max to its actual enum max
NumericSettings support a max, so let's use it.
It might not do much now, but the max and min values will be used to give visual feeback
in the UI in one of my upcoming input PRs
2021-05-12 18:27:24 +03:00
Filoppi f4fec42165 Add mixed comments to input code, make some tooltip clearer 2021-05-12 18:27:23 +03:00
Filoppi 574477866f InputCommon: fix serialization of control expression with line breaks
The control expression editor allows line breaks, but the serialization was
losing anything after the first line break (/r /n).
Instead of opting to encode them and decode them on serialization
(which I tried but was not safe, as it would lose /n written in the string by users),
I opted to replace them with a space.
2021-05-12 18:25:56 +03:00
iwubcode 182dfc38e6 VideoCommon: move all texture calculations to a "TextureInfo" class. This ever so slightly improves readability and allows for the full texture name to be generated outside of the hires texture cache 2021-05-11 22:58:36 -05:00
Florian Bach c21e9909ab Socket: Fix AF_INET6 on non-Windows systems 2021-05-11 17:00:02 +02:00
Filoppi 0d23acc831 Qt: simplify the preview of control mappings/expressions by removing their device path
and replacing it with a ":" prefix. Also remove white spaces and \n \t \r.

bugfix: fix EmulatedController::GetStateLock() not being aquired when reading the
expression reference
bugfix: MappingButton::UpdateIndicator() calling State(0) on outputs, breaking ongoing
rumbles if a game was running
Improvement: make expressions previews appear in Italic if they failed to parse correctly
2021-05-11 12:20:37 +03:00
Filoppi e9e41b925b InputCommon: follow coding conventions and rename GetState() to UpdateState()
And remove useless include
2021-05-10 23:48:10 +03:00
Filoppi a261e61e9e InputCommon: add a ton of missing consts
fix some related grammar errors
only the ButtonManager required code changes
2021-05-10 23:48:10 +03:00
JMC47 eb5cd9be78
Merge pull request #9694 from iwubcode/xfb-tcache-hash
VideoCommon: update TextureCache logic for finding oversized XFBs
2021-05-09 15:20:53 -04:00
iwubcode 6fd7867c56 VideoCommon: simplify TextureCacheBase by comparing a xfb's hash against a newly calculated one. This fixes games like Teenage Mutant Ninja Turtles (Wii) which use oversized textures where the stride doesn't match the BytesPerRow and that resulted in a different hash algorithm being used. By not hashing the texture before, we improve performance by hashing at most once in all direct XFB lookup scenarios. 2021-05-08 01:29:48 -05:00
Pokechu22 e1d45e9ba6 UberShaderPixel: always run indirect stage logic
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
2021-05-07 16:37:47 -07:00
Pokechu22 b5844ab195 PixelShaderGen: always run indirect stage logic
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
2021-05-07 16:37:47 -07:00
Pokechu22 5e3360c2cc UberShaderPixel: Fix OOB tex coord indices
Previously we set the texture coordinate to zero, now we set
the texture coordinate *index* to zero. This fixes the ripple
effect of the Mario painting in Luigi's Mansion.
2021-05-07 16:37:47 -07:00
Pokechu22 ed02034967 UberShaderPixel: Return fixed-point values from selectTexCoord
This change should have no behavioral differences itself, but allows for changing the behavior of out of bounds tex coord indices more easily in the next commit.  Without this change, returning tex0 for out of bounds cases and then applying the fixed-point logic would use the wrong tex dimension info (tex0 with I_TEXDIMS[1] or such), which is inaccurate.
2021-05-07 16:37:10 -07:00
Pokechu22 16c17ed9ce Software: Fix OOB tex coord indices
Previously we set the texture coordinate to zero, now we set
the texture coordinate *index* to zero. This fixes the ripple
effect of the Mario painting in Luigi's Mansion.
2021-05-07 16:28:09 -07:00
Tillmann Karras f6cf85a8bc PixelShaderGen: Fix OOB tex coord indices
Previously we set the texture coordinate to zero, now we set
the texture coordinate *index* to zero. This fixes the ripple
effect of the Mario painting in Luigi's Mansion.

Co-authored-by: Pokechu22 <Pokechu022@gmail.com>
2021-05-07 16:28:09 -07:00
Pokechu22 002ff4e4dd PixelShaderGen: Remove unused num_texgens argument
It became unused in f039149198.
2021-05-07 16:28:08 -07:00
Pokechu22 c3668e179c Split TevStageIndirect::mid into matrix_index and matrix_id 2021-05-07 16:27:52 -07:00
Pokechu22 1d628d087b Add 1 when displaying the number of TEV stages 2021-05-07 16:14:19 -07:00
Pokechu22 072304404c Correct indirect stage ref typos
YAGCD uses BI0/BC0/BI1/BC1/BI2/BC2/BI3/BC3, so I'm pretty sure the BI2/BC3/BI4/BC4 names are a typo that just was propagated.
2021-05-07 16:14:18 -07:00
Pokechu22 77b1cca987 Separate vertex components by spaces 2021-05-07 15:42:26 -07:00
Pokechu22 73f4e57006 Add name and description for primitives 2021-05-07 15:42:26 -07:00
Pokechu22 df77a687e8 Add descriptions for GX_LOAD_INDX_A/B/C/D 2021-05-07 15:42:26 -07:00
Pokechu22 1a3d2c3211 Coalesce NOPs 2021-05-07 15:42:25 -07:00
Pokechu22 2ddf2c3ba2 Update and clear the description on each object change
Since the description updating is tied to the selection changing on the detail list, and the detail list is recreated on each object change, behavior was somewhat broken.  Clearing the list changed the current row to zero, but nothing else (particularly m_object_data_offsets) had been updated, so the description was not necessarily correct (this is easier to observe now since the vertex data is at the end, so it's easier to get different lengths of register updates).  Furthermore, subsequent clears did not update the current row since there was no visible selection, so it only changed the description once.  The current row is now always set to zero, which forces an update (and also scrolls the list back to the top).  The presence of FRAME_ROLE and OBJECT_ROLE are also checked so that the description is cleared if no object is selected.
2021-05-07 15:42:22 -07:00
Pokechu22 dbacf68b79 Improve FIFO analyzer search function
- Only one search result is generated per command/line, even if there are multiple matches in that line.
- Pressing enter on the edit field begins a search, just like clicking the begin button.
- The next and previous buttons are disabled until a search is begun.
- The search results are cleared when changing objects or frames.
- The previous button once again works (a regression from the previous commit), and the register updates and graphics data for the correct object are searched.
- currentRow() never returns -1, so checking that is unnecessary (and misleading).
- The 'Invalid search parameters (no object selected)' previously never showed up before because FRAME_ROLE is present if and only if OBJECT_ROLE is present.
2021-05-07 15:42:21 -07:00
Pokechu22 1dc3ff5879 Show register updates before primitive updates
This also shows the register updates for object 0, which were previously not visible(!)
2021-05-07 15:42:20 -07:00
Pokechu22 83f7c41e31 Make the FIFO Player a separate window
This way, it can be focused with the render window behind it, instead of having the main window show up and cover the render window.  This is useful for adjusting the object range, among other things.
2021-05-07 15:42:19 -07:00
Pokechu22 05bd15a928 Clear m_object_data_offsets first and require it before UpdateDescription
It still tries to update the description on clearing, potentially with bad data.
2021-05-07 15:42:19 -07:00
Pokechu22 28b71c65af Fix same object count being used for all frames in the FIFO analyzer
If the number of objects varied, this would result in either missing objects on some frames, or too many objects on some frames; the latter case could cause crashes.  Since it used the current frame to get the count, if the FIFO is started before the FIFO analyzer is opened, then the current frame is effectively random, making it hard to reproduce consistently.

This issue has existed since the FIFO analyzer was implemented for Qt.
2021-05-07 15:42:18 -07:00
Pokechu22 ef75381a84 Fix occasional deadlock when stopping FIFO playback 2021-05-07 15:42:18 -07:00
Pokechu22 a557230dea Fix crash when attempting to analyze a FIFO after stopping playback 2021-05-07 15:42:18 -07:00
Pokechu22 58333d6feb Make FIFO frame count inclusive
The 'zero frames in the range' check can be removed because now there is always at least 1 frame; of course that might be the same frame over and over again, but that's still useful for e.g. Free Look (and the 1 frame repeating effect already occurred when frame count was exclusive).
2021-05-07 15:42:18 -07:00
Pokechu22 263ca79aae Adjust FIFO player object ranges
A single object can be selected instead of 2 (it was already inclusive internally), and the maximum value is the highest number of objects in any frame (minus 1) to reduce jank when multiple frames are being played back.
2021-05-07 15:42:17 -07:00
Pokechu22 5ebe63b175 Reset the from frame/object to 0 on starting FIFO playback
Now that this is only called when playback actually starts (and not on unpausing), this change makes the experience a bit better (no more missing objects from not having reset the from object after changing FIFOs).
2021-05-07 15:42:17 -07:00
Pokechu22 3436a92ea5 Don't reset the FIFO frame/object limit when unpausing 2021-05-07 15:42:17 -07:00
Pokechu22 0a906f553f Move vertex size and component calculation to VertexLoaderBase 2021-05-07 15:42:17 -07:00
Pokechu22 fa7077763f Remove VertexLoaderBase::IsInitialized
It is no longer relevant for the current set of loaders after 7030542546.  If it becomes relevant again, a static function named IsUsable or IsCompatibleWithCurrentMachine or something would be a better approach.
2021-05-07 15:42:17 -07:00
Pokechu22 cafffff75e Eliminate TVtxAttr 2021-05-07 15:42:17 -07:00
Pokechu22 0a71ce143a Extract VertexLoaderARM64::GetLoadSize into a new function 2021-05-07 15:42:16 -07:00
Pokechu22 252ef6bb34 Use bool bitfields in VAT 2021-05-07 15:42:16 -07:00
Pokechu22 b6149623aa Remove VertexLoader::ToString 2021-05-07 15:42:13 -07:00
Pokechu22 bc7da726a5 Convert VertexLoader_Color to a table 2021-05-07 15:42:11 -07:00
Pokechu22 4cc442d7cd Use CP constants in FifoAnalyzer 2021-05-07 15:42:07 -07:00
Léo Lam a6f6211dde
Merge pull request #9633 from Pokechu22/BitfieldExtract-pointer-to-member
Change BitfieldExtract to use a pointer to the bitfield member
2021-05-08 00:21:15 +02:00
Pokechu22 0f7c9ef767 Change BitfieldExtract to use a pointer to the bitfield member 2021-05-07 15:11:17 -07:00
Léo Lam 049b92b7ef
Merge pull request #9417 from Filoppi/input-1
Fix FPS counter and Game Window speed % breaking on pause/unpause
2021-05-07 15:08:01 +02:00
Léo Lam 8547de2593
Merge pull request #9615 from Dentomologist/updater_documentation
Updater: Add code documentation
2021-05-07 15:05:14 +02:00
Léo Lam 2b632f6d5d
Merge pull request #9641 from lynlevenick/ash/texture-cache-opt
Remove spurious memory allocations in TextureCacheBase::SerializeTexture and DeserializeTexture
2021-05-07 15:01:23 +02:00
Sintendo 2cafa0a960 Jit64: divwux - Prefer three-operand IMUL
By taking advantage of three-operand IMUL, we can eliminate a MOV
instruction. This is a small code size win. However, due to IMUL sign
extending the immediate value to 64 bits, we can only apply this when
the magic number's most significant bit is zero.

To ensure this can actually happen, we also minimize the magic number by
checking for trailing zeroes.

Example (Unsigned division by 18)
Before:
41 BE E4 38 8E E3    mov         r14d,0E38E38E4h
4D 0F AF F5          imul        r14,r13
49 C1 EE 24          shr         r14,24h

After:
4D 69 F5 39 8E E3 38 imul        r14,r13,38E38E39h
49 C1 EE 22          shr         r14,22h
2021-05-06 19:54:33 +02:00
Mat M 9286b57d84
Merge pull request #9691 from JosJuice/jitarm64-register-call
JitArm64: Fix JitRegister::Register call for cstd
2021-05-05 19:44:36 -04:00
Filoppi d586163e38 Wrap some more control expression around ``
This isn't entirely necessary, as they are interpreted as barewords expressions,
but it's still nicer to have by default. And my upcoming input changes will
always put `` around single letter inputs.
2021-05-06 01:32:03 +03:00
JosJuice b305e4cfc1 JitArm64: Fix JitRegister::Register call for cstd
Seems like I made a little copy-paste error.
2021-05-06 00:20:47 +02:00
Filoppi 818672b585 Fix FPS counter and Game Window speed % breaking on pause/unpause
-Add pause state to FPSCounter.
-Add ability to have more than one "OnStateChanged" callback in core.
-Add GetActualEmulationSpeed() to Core. Returns 1 by default. It's used by my input PRs.
2021-05-06 01:10:04 +03:00
JMC47 4b827f3ae9
Merge pull request #9673 from phire/z16peeks
Implement EFB Peeks for compressed z16 formats
2021-05-04 21:07:21 -04:00
Scott Mansell ab55c948a1 Update zcompression format change TODO 2021-05-05 11:32:42 +12:00
Scott Mansell a4796e512a Implement EFB Peeks for compressed z16 formats
This fixes an issue in RS3 where engine lens flares would shine
though ships during cutscenes
2021-05-05 11:32:29 +12:00
Filoppi 81092cf7e4 InputCommon: replace SerialInterface log with ControllerInterface
where appropriate. SerialInterface was a leftover from the past,
and makes no sense to be used on actual/real controllers.
2021-05-05 00:16:08 +03:00
JMC47 a8c40eb510
Merge pull request #9682 from JosJuice/fix-wii-netplay
IOS: Don't let Kernel initialize WiiRoot if already initialized
2021-05-02 17:40:52 -04:00
JMC47 21113e5839 This removes a delay for input mapping.
It was causing more harm than good for users.  Anyone doing complex
expressions is already using the advanced editor for more control over
it.
2021-05-02 15:27:11 -04:00
Léo Lam ade9d6c954
Merge pull request #9679 from JosJuice/disable-verify
DolphinQt: Disable verify button when emulation is running
2021-05-02 10:52:46 +02:00
JosJuice 3397f49a0a IOS: Don't let Kernel initialize WiiRoot if already initialized
The SaveToSYSCONF call in BootManager.cpp was unintentionally
overriding the temporary NAND set by the preceding
InitializeWiiRoot call. Fixes
https://bugs.dolphin-emu.org/issues/12500.
2021-05-02 10:30:32 +02:00
Jordan Woyak 1daefeb20a
Merge pull request #9674 from Filoppi/fix_hotkey_suppresion_crash
Fix hotkey suppression crash
2021-04-28 18:21:07 -05:00
JosJuice 55ef1069f1 DolphinQt: Disable verify button when emulation is running
Verifying a Wii game creates an instance of IOS, and Dolphin
can't handle more than one instance of IOS at the same time.
Properly supporting it is probably more effort than it's worth.

Fixes https://bugs.dolphin-emu.org/issues/12494.
2021-04-28 21:58:07 +02:00
Filoppi 4f53adc331 Qt: make all tooltips look similar to balloon tips (and share parts of their code) 2021-04-28 21:20:39 +03:00
Léo Lam 20301592ad
Merge pull request #9677 from iwubcode/profile-drop-down
DolphinQt: fix input profile drop down not resizing
2021-04-27 14:01:12 +02:00
Léo Lam ae67a9382b
CMake: Put the *.mo files directly in the correct output dir
Avoids the need to copy the *.mo files manually *and* more importantly
this ensures that the mo files are always recreated if the build
output directory is cleared.
2021-04-27 12:54:18 +02:00
Léo Lam e71aef6768
CMake: Ask windeployqt not to copy DLLs that are unnecessary
* no-system-d3d-compiler: d3dcompiler_47.dll
* no-angle, no-opengl-sw: libEGL.dll, libGLESv2.dll
2021-04-27 12:54:18 +02:00
Léo Lam f6b8d4758e
CMake: Copy license.txt to output folder to match existing Win builds 2021-04-27 12:54:18 +02:00
iwubcode 626c686fee
DolphinQt: update device drop down size policy so that the input profile resizes properly
This also keeps the device profile at a minimum so that it doesn't
completely disappear (which was originally why it was changed to expanding)
2021-04-27 12:50:45 +02:00
Léo Lam 219f66c6e9
Merge pull request #9672 from JosJuice/jit-naming-scheme
DolphinQt/Android: Unify the JIT naming scheme
2021-04-27 12:00:23 +02:00
JMC47 4d10023727
Merge pull request #9552 from endrift/gba-timing
SI/DeviceGBA: Fix SI timings to actually closely match hardware
2021-04-26 21:20:06 -04:00
Léo Lam 08215cc975
DolphinQt: Get rid of an extraneous colon in About dialog 2021-04-27 00:24:24 +02:00
Léo Lam 51bf2dca21
Merge pull request #9675 from JosJuice/jit64-div-80000000
Jit64: Fix UB/infinite loop when compiling division by 0x80000000
2021-04-26 23:50:27 +02:00
JosJuice 7d4b87e7ae Jit64: Fix UB/infinite loop when compiling division by 0x80000000 2021-04-26 23:42:03 +02:00
Filoppi 799a368a7c InputCommon: small hotkey threshold symmetry fix 2021-04-26 19:45:13 +03:00
Filoppi ba2782e9d1 InputCommon: fix hotkey suppression crash if nullptr suppressions were added to the map
Update references was failing to update the references, causing input to stay nullptr and crashing.
I fixed the case that triggered that, though also added checks against nullptrs for safety.

(cherry picked from commit 4bdcf707555a5568eddff957fa3604975ffb6ed7)
2021-04-26 19:44:04 +03:00
Vicki Pfau 4ce3362bce SI/DeviceGBA: Fix SI timings to actually closely match hardware 2021-04-26 01:36:43 -07:00
JosJuice ac679eb24d
Merge pull request #9666 from leoetlino/jit-block-hashtable
Jit: Optimize block link queries by using hash tables
2021-04-25 18:45:41 +02:00
JosJuice a2c8050eba DolphinQt/Android: Unify the JIT naming scheme
I think the AArch64 JIT has come far enough that it doesn't have to
be called experimental anymore.

I'm also labeling the x86-64 JIT as x86-64 for consistence with the
AArch64 JIT. This will especially be helpful if we start supporting
AArch64 on macOS, as AArch64 macOS can run both the x86-64 JIT and
the AArch64 JIT depending on whether you enable Rosetta 2.
2021-04-25 17:19:50 +02:00
JosJuice 69c14d6ec3 JitArm64: Fix frspx with single precision source
I haven't observed this breaking any game, but it didn't match
the behavior of the interpreter as far as I could tell from
reading the code, in that denormals weren't being flushed.
2021-04-25 15:56:59 +02:00
JosJuice 54451ac731 JitArm64: Use ConvertSingleToDoubleLower in RW when faster 2021-04-25 15:56:59 +02:00
JosJuice 9d6263f306 JitArm64: Add unit tests for single/double conversion 2021-04-25 15:56:58 +02:00
JosJuice 2a9d88739c JitArm64: Skip accurate single/double conversion if store-safe 2021-04-25 15:56:58 +02:00
JosJuice 1d106ceaf5 JitArm64: Optimize ConvertSingleToDouble, part 2
If we can prove that FCVT will provide a correct conversion,
we can use FCVT. This makes the common case a bit faster
and the less likely cases (unfortunately including zero,
which FCVT actually can convert correctly) a bit slower.
2021-04-25 15:56:19 +02:00
JosJuice 018e247624 JitArm64: Optimize ConvertSingleToDouble, part 1 2021-04-25 15:56:19 +02:00
JosJuice 28e4869c43 JitArm64: Optimize ConvertDoubleToSingle 2021-04-25 15:56:19 +02:00
JosJuice 6e0a5876ef JitArm64: Use accurate single/double conversions
Our old conversion approach became a lot more inaccurate when
enabling flush-to-zero, to the point of obviously breaking games.
2021-04-25 15:56:19 +02:00
JosJuice 39eccf6603 JitArm64: Call RW before FCMPE in fselx
Needed because the next commit will make RW clobber flags.
2021-04-25 15:56:19 +02:00
JosJuice 949686bbe7 JitArm64: Factor out single/double conversion code to functions
Preparation for following commits.

This commit intentionally doesn't touch paired stores,
since paired stores are supposed to flush to zero.
(Consistent with Jit64.)
2021-04-25 15:56:19 +02:00
JosJuice fdf7744a53 JitArm64: Move float conversion code out of EmitBackpatchRoutine
This simplifies some of the following commits. It does require
an extra register, but hey, we have 32 of them.

Something I think would be nice to add to the register cache
in the future is the ability to keep both the single and double
version of a guest register in two different host registers
when that is useful. That way, the extra register we write to
here can be read by a later instruction, saving us from
having to perform the same conversion again.
2021-04-25 15:56:19 +02:00
JosJuice f96ee475e4 Implement ArmFPURoundMode.cpp
Fixes https://bugs.dolphin-emu.org/issues/12388. Might also fix
other games that have problems with float/paired instructions
in JitArm64, but I haven't tested any.
2021-04-25 15:56:19 +02:00
Filoppi 3492f51eaf OnScreenDisplay: a few fixes
-They might have never drawn if DrawMessages wasn't called before they actually expired
-Their fade was wrong if the duration of the message was less than the fade time

This makes them much more useful for debugging, I know there might be other means
of debugging like logs and imgui, but this was the simplest so that's what I used.
If you want to print the same message every frame, but with a slightly different value
to see the changes, it now work.

To compensate for the fact that they are now always rendered once,
so on start up a lot of old messages (printed while the emulation was off) could show up,
I've added a "drop" time, which means if a msg isn't rendered for the first
time within that time, it will be dropped and never rendered.
2021-04-25 15:45:30 +03:00
Léo Lam aa3a96f048
Merge pull request #9644 from JosJuice/jit-fallback-discard
Jits: Fix interpreter fallback handling of discarded registers
2021-04-25 13:20:41 +02:00
JosJuice b3b5016f54 Jits: Fix interpreter fallback handling of discarded registers
When the interpreter writes to a discarded register, its type
must be changed so that it is no longer considered discarded.

Fixes a 62ce1c7 regression.
2021-04-25 13:01:40 +02:00
Sintendo 47e16133e5 Jit64: divwx - Eliminate XOR for constant dividend
We normally check for division by zero to know if we should set the
destination register to zero with a XOR. However, when the divisor and
destination registers are the same the explicit zeroing can be omitted.
In addition, some of the surrounding branching can be simplified as
well.

Before:
45 85 FF             test        r15d,r15d
75 05                jne         normal_path
45 33 FF             xor         r15d,r15d
EB 0C                jmp         done
normal_path:
B8 5A 00 00 00       mov         eax,5Ah
99                   cdq
41 F7 FF             idiv        eax,r15d
44 8B F8             mov         r15d,eax
done:

After:
45 85 FF             test        r15d,r15d
74 0C                je          done
B8 5A 00 00 00       mov         eax,5Ah
99                   cdq
41 F7 FF             idiv        eax,r15d
44 8B F8             mov         r15d,eax
done:
2021-04-24 21:32:21 +02:00
Léo Lam 1c6232e95f
Merge pull request #9646 from PatrickFerry/sw-textureencoder-alignedwidth
SW: Fix alignedWidth in TextureEncoder
2021-04-24 20:13:10 +02:00
Léo Lam 18174d3ed6
Merge pull request #9649 from leoetlino/cmake-auto-update-track
Make it possible to enable auto-updates by default with CMake builds
2021-04-24 19:44:51 +02:00
Sintendo abc4c8f601 Jit64: divwx - Eliminate MOV for division by power of 2
Division by a power of two can be slightly improved when the
destination and dividend registers are the same.

Before:
8B C6                mov         eax,esi
85 C0                test        eax,eax
8D 70 03             lea         esi,[rax+3]
0F 49 F0             cmovns      esi,eax
C1 FE 02             sar         esi,2

After:
85 F6                test        esi,esi
8D 46 03             lea         eax,[rsi+3]
0F 48 F0             cmovs       esi,eax
C1 FE 02             sar         esi,2
2021-04-24 19:28:23 +02:00
Sintendo 246adf0d6d Jit64: divwx - Eliminate MOV for division by 2
When destination and input registers match, a redundant MOV instruction
can be eliminated.

Before:
8B C7                mov         eax,edi
8B F8                mov         edi,eax
C1 EF 1F             shr         edi,1Fh
03 F8                add         edi,eax
D1 FF                sar         edi,1

After:
8B C7                mov         eax,edi
C1 EF 1F             shr         edi,1Fh
03 F8                add         edi,eax
D1 FF                sar         edi,1
2021-04-24 18:53:21 +02:00
Léo Lam c812ab6a63
Jit: Optimize block link queries by using hash tables
Repeated erase() + iteration on a std::multimap is extremely slow.

Slow enough that it causes a 7 second long stutter during some
transitions in F-Zero X (a N64 VC game that triggers many, many icache
invalidations).

And slow enough that JitBaseBlockCache::DestroyBlock shows up on a
flame graph as taking >50% of total CPU time on the CPU-GPU thread:
https://i.imgur.com/vvqiFL6.png

This commit optimises those block link queries by replacing the
std::multimap (which is typically implemented with red-black trees)
with hash tables.

Master: https://i.imgur.com/vvqiFL6.png / 7s stutters
(starting from 5.0-2021 and with branch following disabled)

This commit: https://i.imgur.com/hAO74fy.png / ~0.7s stutters, which
is pretty close to 5.0 stable. (5.0-2021 introduced the performance
regression and it is especially noticeable when branch following
is disabled, which is the case for all N64 VC games since 5.0-8377.)
2021-04-24 17:20:59 +02:00
JMC47 18e84361d9
Merge pull request #9660 from ezio1900/master
VideoCommon: Fix scissorOffset, handle negative value correctly
2021-04-23 21:21:53 -04:00
ezio1900 97ea3a603e VideoCommon: Fix scissorOffset, handle negative value correctly
VideoCommon: Change the type of BPMemory.scissorOffset to 10bit signed: S32X10Y10
VideoBackends: Fix Software Clipper.PerspectiveDivide function, use BPMemory.scissorOffset instead of hard code 342
2021-04-24 08:46:21 +08:00
JosJuice be5775614c
Merge pull request #9619 from leoetlino/scoped-fd
IOS/FS: Add a scoped FD class to make it harder to leak FDs
2021-04-23 21:53:25 +02:00
JosJuice f0bd6b105f
Merge pull request #9663 from leoetlino/mios-hle-patch
Fix IPL crash when launching MIOS-patched games
2021-04-23 21:00:29 +02:00
JMC47 cfc4af76a9
Merge pull request #9321 from Pokechu22/sw-copyregion
Software: Fix out of bounds accesses in CopyRegion
2021-04-23 14:07:46 -04:00
JMC47 4ab92d4757
Merge pull request #9350 from Pokechu22/sw-viewport
Software: Invert backface test when viewport is positive
2021-04-23 14:06:02 -04:00
Léo Lam 1686b637df
MIOS: Fix SConfig::OnNewTitleLoad not being called
Oversight from #9545, which moved the "new game has been loaded" logic
to a separate OnNewTitleLoad function that has to be called explicitly
*after* a title has loaded.

Coupled with the commit that makes Dolphin not clobber 0x1800-0x3000
when using MIOS, this fixes Wind Waker and other MIOS-patched games
when they are launched from the System Menu.
2021-04-22 21:55:07 +02:00
Léo Lam 568428ca67
HLE: Do not clobber 0x1800-0x3000 when using MIOS to fix IPL crash
MIOS puts patch data in low MEM1 (0x1800-0x3000) for its own use.
Overwriting data in this range can cause the IPL to crash when
launching games that get patched by MIOS.
See https://bugs.dolphin-emu.org/issues/11952 for more info.

Not applying the Gecko HLE patches means that Gecko codes will not work
under MIOS, but this is better than the alternative of having specific
games crash.
2021-04-22 21:50:05 +02:00
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