Commit Graph

30135 Commits

Author SHA1 Message Date
JMC47 6042df71d9
Merge pull request #9853 from Bonta0/sinocancel
SI: Don't cancel transfer with TSTART=0
2021-06-29 22:00:13 -04:00
JMC47 04a1c2e1b2
Merge pull request #9847 from JosJuice/dvd-pitfall
DVDInterface: Don't evict cache block i unless block i + 2 was read
2021-06-29 21:58:20 -04:00
JMC47 6a46d35c73
Merge pull request #9839 from OatmealDome/bluetooth-scanning
WiimoteScannerDarwin: fix hang on quit and clean up
2021-06-29 21:07:47 -04:00
JosJuice e581d970d6 JitArm64: Fix MSVC warning '~': zero extending 'u32' to 'u64'
While the third parameter of ANDI2R is u64, the upper half of
it does not get read if we're emitting a 32-bit instruction
(which we are doing here).
2021-06-29 10:44:41 +02:00
Shawn Hoffman 30f9f31a69 DiscIO: Add workaround for MSVC ARM64 ICE 2021-06-29 10:24:09 +02:00
Tilka 3b3fb9d4c3
Merge pull request #9852 from Pokechu22/wii-change-disc
DVDInterface: Fix decrypting reads clearing the drive state
2021-06-29 04:09:28 +01:00
Tilka 901a4fb5f4
Merge pull request #9811 from JosJuice/fprf-denormal-singles
Fix FPRF handling of denormal singles
2021-06-29 03:18:18 +01:00
Tilka 856c82aa24
Merge pull request #9851 from JosJuice/jitarm64-mfcr
JitArm64: Handle SO and LT simultaneously in mfcr
2021-06-29 02:01:31 +01:00
Pokechu22 e440b21640 DVDInterface: Fix decrypting reads clearing the drive state
This broke ejecting Wii discs while the game is running, as the drive state was set to Ready even when no disc was present, but other code still reported the missing disc, which confused games as you can't be both ready to read and have no disc.  That would cause games to show an unrecoverable error screen, instead of a "please insert the game disc" screen.

This only affected Wii games; the GameCube games used regular disc reads which worked fine.
2021-06-28 10:38:03 -07:00
JosJuice 1df1f20c44 JitArm64: Handle SO and LT simultaneously in mfcr 2021-06-28 19:22:46 +02:00
Tilka bb2d576ecc
Merge pull request #9849 from Tilka/x87
x64Emitter: remove unused x87 instructions
2021-06-28 17:53:54 +01:00
Bonta aaea38be46 SI: Don't cancel transfers 2021-06-28 17:59:30 +02:00
JosJuice 2ef2eee2e0
Merge pull request #9464 from Sintendo/jit64addxreloaded
Jit64: addx revisited
2021-06-28 13:53:44 +02:00
JosJuice 4648e1a035 DVDInterface: Fix small backwards seek after non-cached seek
If we seek to a block that isn't in the cache, the block prior
to it doesn't end up getting read into the buffer.
2021-06-28 11:02:05 +02:00
JosJuice c6ede09035 DVDInterface: Don't evict cache block i unless block i + 2 was read
Intends to fix https://bugs.dolphin-emu.org/issues/12279.
I have hardware tested the behavior, but I haven't tested the game.
2021-06-28 09:48:04 +02:00
Tillmann Karras a68c1bf648 PowerPC: add enum values for emulator SO and LT shifts 2021-06-28 03:30:07 +01:00
Tillmann Karras 25a701aa1b PowerPC: move SO bit to a more convenient location
Spacing the LT and SO bits like in the native PowerPC format makes it easier to
convert to that format (see mfcr).
2021-06-28 03:06:45 +01:00
Tillmann Karras afb9398059 x64Emitter: remove unused x87 instructions 2021-06-28 02:56:37 +01:00
JosJuice ccd8233ea3 Jit64: Fix FPRF handling of denormal singles 2021-06-27 20:37:18 +02:00
JosJuice 8d2c069c34 Interpreter: Return float from ForceSingle
Performance optimization, along with making the code a little
neater. Saves us from performing a single -> double -> single
conversion when calling UpdateFPRFSingle.
2021-06-27 20:34:49 +02:00
JosJuice d56721ebb9 Interpreter: Fix FPRF handling of denormal singles 2021-06-27 20:34:49 +02:00
JosJuice def5666419 JitArm64: Fix FPRF handling of denormal singles
The interpreter was wrong after all. Hardware verified.
2021-06-27 20:34:49 +02:00
Tilka aff39af5fb
Merge pull request #9810 from JosJuice/fprf-cmp-mask
Jits: Fix fcmpX FPRF mask
2021-06-27 19:32:19 +01:00
Tilka 4166567f92
Merge pull request #9812 from JosJuice/fprf-x64-neg-zero
Jit64: Fix FPRF non-SSE4.1 handling of negative zero
2021-06-27 19:21:51 +01:00
Jordan Woyak a2acd0b92e Config: Add an ini setting to control real Wii Remote report duplication and decouple it from the speaker data setting.
It is enabled by default.
2021-06-26 17:45:50 -05:00
Sintendo 7de4623d48 Jit64: mtfsfx - Optimized masking
The masking logic can be eliminated when the mask is known to be all
ones. This case is very common.

Before:
66 48 0F 7E F0       movq        rax,xmm6
8B 55 5C             mov         edx,dword ptr [rbp+5Ch]
83 E0 FF             and         eax,0FFFFFFFFh
83 E2 00             and         edx,0
0B C2                or          eax,edx
89 45 5C             mov         dword ptr [rbp+5Ch],eax
48 8D 15 C3 3C FE 01 lea         rdx,[19520020h]
83 E0 07             and         eax,7
0F AE 14 82          ldmxcsr     dword ptr [rdx+rax*4]

After:
66 48 0F 7E F0       movq        rax,xmm6
89 45 5C             mov         dword ptr [rbp+5Ch],eax
48 8D 15 2A D1 FD 01 lea         rdx,[19440000h]
83 E0 07             and         eax,7
0F AE 14 82          ldmxcsr     dword ptr [rdx+rax*4]
2021-06-26 17:31:31 +02:00
JosJuice 36798b18e8 JitArm64: Improve fctiwzx constant generation in double case
If we already have to use a GPR, we might as well take advantage
of the nice immediate encodings provided by GPR ORR. This is
faster, smaller, and saves a register.
2021-06-26 15:41:23 +02:00
JosJuice 515d02fe26 Android: Add Fallback Region setting to GUI 2021-06-26 11:45:22 +02:00
OatmealDome 156ffef98c WiimoteScannerDarwin: Fix lint 2021-06-24 17:59:58 -04:00
JosJuice 8cd37e040a JitArm64: Implement mffsx
Part 2 of implementing the FPSCR system register instructions.
2021-06-24 12:00:58 +02:00
OatmealDome b494d109d4 WiimoteScannerBackend: Allow StopThreads to request that any Wiimote searching stops
Used by WiimoteScannerDarwin to know when to exit its runloop.
2021-06-23 23:09:01 -04:00
OatmealDome 0de30fa0bb WiimoteScannerDarwin: Initialize IOBluetoothHostController in constructor 2021-06-23 22:55:15 -04:00
Léo Lam c77a5f7e32
Merge pull request #9825 from JosJuice/jitarm64-mcrfs
JitArm64: Implement mcrfs
2021-06-24 03:05:15 +02:00
Léo Lam 0087eed235
Merge pull request #9793 from sepalani/template-mmio
MMIOHandlers: Move method definitions to MMIO.cpp
2021-06-24 02:42:52 +02:00
thyrc 7a1922fd8f
Fix includes for musl libc 2021-06-24 02:01:07 +02:00
Léo Lam 4979974a57
Merge pull request #9828 from JosJuice/android-pressed-opacity
Android: Apply opacity setting to pressed buttons too
2021-06-24 01:36:02 +02:00
Léo Lam 9476733a80
Merge pull request #9829 from sepalani/ai-samples
AudioInterface: Fix sample counter
2021-06-24 01:35:29 +02:00
Léo Lam cf26846225
Merge pull request #9830 from skylersaleh/m1-unit-tests
Apple M1: Add support for running unit tests on universal builds
2021-06-24 01:15:02 +02:00
Léo Lam a632a6a404
Merge pull request #9833 from Pokechu22/ubershaders-tevcoord
UberShaderPixel: always set tevcoord, even if the stage has no texture
2021-06-24 01:05:17 +02:00
Léo Lam b66e88e4b9
Merge pull request #9837 from AdmiralCurtiss/mysterious-voodoo-performance-fix
VideoCommon/Fifo: Move SConfig::GetInstance() outside the GPU loop.
2021-06-24 00:41:43 +02:00
JMC47 46120a6108
Merge pull request #9742 from Pokechu22/sw-resolution
Software: Fix bad backbuffer size
2021-06-23 18:36:04 -04:00
JMC47 63c028c5df
Merge pull request #9832 from Pokechu22/software-color-asserts
Software: Remove texinfo.sourcerow == SourceRow::Colors assert
2021-06-23 18:34:19 -04:00
JMC47 95ecb73b11
Merge pull request #9826 from Techjar/fix-tmem-mips
VideoCommon/TextureInfo: Fix mipmap loading from tmem
2021-06-23 18:21:55 -04:00
Admiral H. Curtiss 1183fb3d2d VideoCommon/Fifo: Move SConfig::GetInstance() outside the GPU loop. 2021-06-23 23:52:26 +02:00
OatmealDome eb7b70b48d WiimoteScannerDarwin: Don't attempt to scan if inquiry doesn't start 2021-06-23 14:31:16 -04:00
OatmealDome 6794532abe IOdarwin_private: Remove hack for bug fixed in newer macOS SDKs 2021-06-23 04:03:28 -04:00
OatmealDome 74755e5939 WiimoteScannerDarwin: Rename stopScanning for code style compliance 2021-06-23 04:01:42 -04:00
Mai M be2ec728e4
Merge pull request #9836 from JosJuice/android-getemulationactivity
Android: Don't use getEmulationActivity in GCAdapter/Wiimote code
2021-06-22 11:59:25 -04:00
Mai M a904cb846a
Merge pull request #9835 from JosJuice/android-hardcoded-strings
Android: Clean up some hardcoded strings
2021-06-22 11:57:41 -04:00
JosJuice 1a47780ab4 Android: Don't use getEmulationActivity in GCAdapter/Wiimote code
The app context should work just as well as an activity context.

Also moving a hardcoded string to strings.xml.
2021-06-22 15:25:51 +02:00
JosJuice 0cfd36495b Android: Store HomeScreenChannel's appLinkIntentUri as Uri
Cleanup of some code touched by the previous commit.
2021-06-22 15:12:03 +02:00
JosJuice cbc4989095 Android: Clean up hardcoded platform names
The same kind of change as the changes made in the previous
commit, but this change is more involved, in particular because
of how SyncProgramsJobService was using display names as keys.
2021-06-22 15:12:03 +02:00
JosJuice 5b8fe1e748 Android: Clean up some hardcoded strings
These would lead to problems if we ever add translation support.
2021-06-22 15:12:03 +02:00
JosJuice 1b3f05628b Android: Remove check for missing game ID
Now that DOL and ELF files are assigned game IDs, all games have
game IDs. (Unless you intentionally craft an ISO file that has
the first bytes set to null, but if you do that I think you can
live with Dolphin creating a file in GameSettings called ".ini")
2021-06-22 14:01:06 +02:00
Pokechu22 2f1726e3f3 UberShaderPixel: always set tevcoord, even if the stage has no texture
This fixes NES game graphics when UberShaders are in use.
2021-06-21 13:01:25 -07:00
Pokechu22 51862135d6 Software: Remove texinfo.sourcerow == SourceRow::Colors assert
These asserts were removed for the hardware renderer in #3684.
2021-06-20 18:05:57 -07:00
Techjar 2d59dcb95d VideoCommon/TextureInfo: Fix mipmap loading from tmem
Even address needs to be offset to the first mipmap entry.
2021-06-20 16:49:39 -04:00
iwubcode df53a5f880 VideoCommon: enhance hi res texture support by having exact matches be picked before wildcard matches. Additionally, add the ability to ignore the texture hash portion of the texture name when loading a hi res texture 2021-06-19 21:15:38 -05:00
iwubcode 8fb0f91331 VideoCommon: split the texture hash from the base name when generating the texture name 2021-06-19 21:15:38 -05:00
Skyler Saleh 655ed37983 Unit Tests: Added W^X Support for PowerPC test 2021-06-19 10:40:51 -07:00
JosJuice d33efc37af Android: Apply opacity setting to pressed buttons too 2021-06-19 16:28:25 +02:00
Sepalani 0a7627d74e AudioInterface: Fix sample counter 2021-06-19 14:19:22 +04:00
JosJuice b11b5955ae Jit64: Optimize mcrfs when mask == 0 2021-06-18 18:26:49 +02:00
JosJuice 79a610b4b4 JitArm64: Implement mcrfs 2021-06-18 18:22:20 +02:00
JosJuice 93d2fd19e8 JitArm64: Use SBC/SBCS for emulating subfzex
I missed this one in fac8420.
2021-06-17 17:30:08 +02:00
JosJuice 752c4898b1 JitArm64: Simplify addex/subfex
Some of the code used when the carry flag is known to be a
constant value is really not much better than just setting
the carry flag and then using the normal code, and with how
rarely this code runs, it isn't well tested either.
Might as well get rid of some of this code and simplify things.
2021-06-17 16:47:55 +02:00
Markus Wick 503c62ec00
Merge pull request #9819 from JosJuice/jitarm64-sbc
JitArm64: Use SBC/SBCS for emulating subfex
2021-06-17 16:15:57 +02:00
JosJuice fac842021c JitArm64: Use SBC/SBCS for emulating subfex
SBC/SBCS does the same thing as subfex, except with the source
operands in the opposite order.
2021-06-17 15:30:17 +02:00
Sintendo 18aaf488b0 Jit64: subfic - Optimize constants for d != a
These optimizations were already present, but only when d == a. They
also make sense when this condition does not hold.

- imm == 0
Before:
41 BB 00 00 00 00    mov         r11d,0
45 2B DF             sub         r11d,r15d

After:
45 8B DF             mov         r11d,r15d
41 F7 DB             neg         r11d

- imm == -1
Before:
41 BD FF FF FF FF    mov         r13d,0FFFFFFFFh
44 2B EE             sub         r13d,esi
0F 93 45 68          setae       byte ptr [rbp+68h]

After:
44 8B EE             mov         r13d,esi
41 F7 D5             not         r13d
C6 45 68 01          mov         byte ptr [rbp+68h],1
2021-06-16 20:33:02 +02:00
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
JMC47 8f9bb5612a
Merge pull request #9798 from JosJuice/android-wad-crash
Android: Fix WAD import crashing
2021-06-07 17:32:23 -04:00
JosJuice d42cec0d19 Android: Fix WAD import crashing
progressMessage can have the invalid value of 0. That
progressMessage was being used for the thread name was
a typo anyway – it's supposed to use progressTitle.
2021-06-07 23:09:29 +02: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
Shawn Hoffman d19d2ce2bd msvc: use external header feature solution-wide
Add external include paths to ExternalIncludePath instead of
AdditionalIncludeDirectories. msbuild appends these paths to
EXTERNAL_INCLUDE env var, which is passed to /external:env:.

Specify /external:W0 and /external:templates-, with override for
DolphinQt for the template flag, since Qt 5.15.0 causes some warnings
in qmap.h
2021-06-03 15:42:23 -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
Léo Lam 8dc87ef698
Merge pull request #9752 from JosJuice/android-unit-tests-off
Android: Disable building unit tests by default
2021-06-02 01:04:40 +02: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 82e9c1c68a Android: Disable building unit tests by default
This reduces the build time for incremental builds from about
2 minutes to about 20 seconds. Most people never run the
unit tests on Android anyway (I'm not aware of anyone other
than me ever having done it).
2021-05-25 22:54:13 +02: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
JosJuice 90cf0d60f8 Android: Use VectorToJStringArray in GameFileCache.cpp 2021-05-24 22:07:31 +02:00
JosJuice c1c17339ff Android: Use DeleteLocalRef more in AndroidCommon
Any local references get cleaned up when returning to the JVM,
but some of the functions in AndroidCommon return to C++ rather
than the JVM, and functions with loops risk running into the
limit of how many simultaneous local references are allowed.
2021-05-24 22:01:49 +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