Commit Graph

28252 Commits

Author SHA1 Message Date
Sintendo 363f3f82bb DSPJitRegCache: Simplify WriteReg
The intent here is to generate a more compact instruction if a 32-bit
immediate can be zero-extended to the desired 64-bit immediate.

Nowadays the emitter is smart enough to do this for us, so this logic is
redundant.
2020-08-05 10:23:28 +02:00
Sintendo 618d261b91 DSPJitMultiplier: addpaxz - AND constant directly
There's no need to load the 64-bit immediate into a temporary register.
x64 will sign-extend 32-bit immediates to 64 bits, giving us the exact
value we need in this case.

48 C7 C0 00 00 FF FF    mov         rax,0FFFFFFFFFFFF0000h
48 21 C2                and         rdx,rax

48 81 E2 00 00 FF FF    and         rdx,0FFFFFFFFFFFF0000h
2020-08-05 10:22:51 +02:00
Sintendo 49a4e09719 DSPJit: Replace/optimize LEAs
- LEA is a bit silly when the source and the destination are the same. A
simple ADD or SHL will do in those cases.

66 8D 04 45 00 00 00 00 lea         ax,[rax*2]
66 03 C0                add         ax,ax

48 8D 04 00             lea         rax,[rax+rax]
48 03 C0                add         rax,rax

66 8D 14 D5 00 00 00 00 lea         dx,[rdx*8]
66 C1 E2 03             shl         dx,3

- When scaling by 2, consider summing the register with itself instead.
The former always needs a 32-bit displacement, so the sum is more
compact.

66 8D 14 45 00 00 00 00 lea dx,[rax*2]
66 8D 14 00             lea dx,[rax+rax]
2020-08-05 10:22:50 +02:00
OatmealDome 5c1693587f DolphinQt: Ignore "-psn" command line option on macOS 2020-08-04 15:55:51 -04:00
OatmealDome fae8f8d68b MainWindow: Attach quit emulation sheet to RenderWidget on macOS 2020-08-03 05:48:57 -04:00
Ryan Meredith 6020133f5b LogManager: Add missing include 2020-08-02 19:52:10 -04:00
Admiral H. Curtiss cdf2a29b5e Qt/IOWindow: Add a handful of math functions to the function dropdown. 2020-08-02 22:09:09 +02:00
Admiral H. Curtiss 2281cde28b InputCommon: Add a handful of math functions to the expression parser. 2020-08-02 22:09:09 +02:00
JosJuice 7414020563
Merge pull request #8966 from Ebola16/WP
Android: Clear game profiles and GameSettings
2020-08-02 22:06:16 +02:00
JosJuice e33876fbe2
Merge pull request #8978 from Ebola16/RS
Android: Settings and Emulation activities skip (Tv)MainActivity library rescan
2020-08-02 22:05:38 +02:00
JosJuice 234eaa0ff9
Merge pull request #7252 from Ebola16/Log
Android: Add Log Configuration to UI
2020-08-02 22:00:48 +02:00
JosJuice bf3d1fa2d8
Merge pull request #8858 from Ebola16/PUP
Android: Add Pause / Unpause Emulation Toggle
2020-08-02 21:56:25 +02:00
Sintendo 08bdeefe05 Jit64AsmCommon: Use AVX in ConvertDoubleToSingle
Using AVX we can eliminate another MOVAPS instruction here.

Before:
0F 28 C8                movaps      xmm1,xmm0
66 0F DB 0D CF 2C 00 00 pand        xmm1,xmmword ptr [1F8D283B220h]

After:
C5 F9 DB 0D D2 2C 00 00 vpand       xmm1,xmm0,xmmword ptr [271835FB220h]
2020-08-02 18:07:47 +02:00
Felk f775e9b99d OnScreenDisplay: fix names rgba -> argb 2020-08-02 01:37:20 +02:00
Tilka dbacffd75d
Merge pull request #8731 from Pokechu22/dsp-lle-cpu-int-crash
Fix crash when using DSP LLE with CPU interpreter (or fastmem off)
2020-08-01 15:26:27 +01:00
JosJuice 13f20ecd34 DolphinQt: Don't capture local pointer by reference
This may be the cause of a crash that has been reported on the
forums, but I'm not sure since I can't reproduce it myself.
2020-07-31 11:33:48 +02:00
LC 0f4cf4a84d
Merge pull request #8991 from JosJuice/android-rumble-without-touchscreen
Android: Remove touchscreen check for rumble
2020-07-30 21:45:56 -04:00
LC 0aaddf8b19
Merge pull request #8990 from JosJuice/wia-conversion-warning
DiscIO: Fix conversion warning
2020-07-30 21:45:24 -04:00
JosJuice 9be5fe5996 CMake: Add -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
The CMake Windows build was broken because of me adding a usage
of std::codecvt_utf8_utf16 to StringUtil.cpp. Kinda silly to have
a warning for an API with no standard replacement available...
2020-07-30 20:22:57 +02:00
Pokechu22 9183c0c482 Bump state version 2020-07-29 16:57:37 -07:00
Pokechu22 e5e23c6b27 Mark several DVDInterface functions as static 2020-07-29 16:57:36 -07:00
Pokechu22 4415df463f Remove DVDInterface::Reset
It only resets the registers, which isn't something that needs to be done except for in DVDInterface::Init
2020-07-29 16:57:36 -07:00
Pokechu22 0fa96df818 Remove DriveState::DiscChangeDetected hack
Since both GameCube and Wii resets now work correctly, this hack is not needed anymore.
2020-07-29 16:57:36 -07:00
Pokechu22 a73eaf5712 Fix DVDLowReset spinup flag being read incorrectly 2020-07-29 16:57:35 -07:00
Pokechu22 9a8d426645 Implement PI_RESET_CODE resetting DI 2020-07-29 16:57:35 -07:00
Pokechu22 b8715b42d2 Only reset drive chip state (not DI registers) when changing discs
Resetting the DI registers disables interrupts, which means any errors reported (for instance) are just not sent though.
2020-07-29 16:57:35 -07:00
Pokechu22 537e40afb5 Only update DIMAR and DILENGTH if transfer completed without error
Turns out, Gamecube games actually do check DILENGTH, and if DILENGTH is at 0, they'll think the transfer completed successfully even if DEINT is used, since after all, surely that means everything was sent.  That caused all sorts of issues, from audio looping when a disc is removed since it's re-using the same buffer to just flat-out crashing instead of showing the disc removed screen.
2020-07-29 16:57:35 -07:00
Pokechu22 fba51b2956 Split drive state and drive error into 2 fields, and fix some inaccuracies
In particular:
- Trying to play audio in a non-ready state returns the state-specific error, not an audio buf error
- Audio status cannot be requested in non-ready states
- The audio buffer cannot be configured in states other than ReadyNoReadsMade
- Using the stop motor command while the motor is already stopped doesn't change states

Additionally, the internal state IDs are used (which distinguish ReadyNoReadsMade and Ready), instead of the state IDs exposed in request error.  This makes some of the weird behavior a bit more obvious.

State and error behavior of the seek command was not implemented in this commit.
2020-07-29 16:57:34 -07:00
JosJuice 2e8c5b4521 DolphinQt: Show a warning when launching an NKit disc image
It is my opinion that nobody should use NKit disc images without
being aware of the drawbacks of them. Since it seems like almost
nobody who is using NKit disc images knows what NKit is (hmm, now
how could that have happened...?), I am adding a warning to Dolphin
so that you can't run NKit disc images without finding out about the
drawbacks. In case someone really does want to use NKit disc images,
the warning has a "Don't show this again" option. Unfortunately, I
can't retroactively add the warning where it's most needed:
in Dolphin 5.0, which does not support Wii NKit disc images.
2020-07-29 21:05:57 +02:00
Ryan Meredith 12d277b4a0 Android: Add Pause / Unpause Emulation Toggle 2020-07-29 13:03:52 -04:00
JosJuice 709031bb1d Android: Remove touchscreen check for rumble
That a device doesn't have a touchscreen doesn't necessarily mean
that it doesn't support rumble (though it is usually the case).
setPhoneVibrator already contains a check for whether the device
supports rumble, so we can simply remove the touchscreen check.
2020-07-29 17:48:56 +02:00
Sintendo 31755bc13a Jit64: fselx - Optimize SSE4.1 packed
Pretty much the same optimization we did for AVX, although slightly more
constrained because we're stuck with the two-operand instruction where
destination and source have to match.

We could also specialize the case where registers b, c, and d are all
distinct, but I decided against it since I couldn't find any game that
does this.

Before:
66 0F 57 C0          xorpd       xmm0,xmm0
66 41 0F C2 C1 06    cmpnlepd    xmm0,xmm9
41 0F 28 CE          movaps      xmm1,xmm14
66 41 0F 38 15 CC    blendvpd    xmm1,xmm12,xmm0
44 0F 28 F1          movaps      xmm14,xmm1

After:
66 0F 57 C0          xorpd       xmm0,xmm0
66 41 0F C2 C1 06    cmpnlepd    xmm0,xmm9
66 45 0F 38 15 F4    blendvpd    xmm14,xmm12,xmm0
2020-07-29 17:28:48 +02:00
Sintendo afb86a12ab Jit64: fselx - Optimize AVX packed
For the packed variant, we can skip the final MOVAPS and write the
result directly into the destination register.

Before:
66 0F 57 C0          xorpd       xmm0,xmm0
66 41 0F C2 C1 06    cmpnlepd    xmm0,xmm9
C4 C3 09 4B CC 00    vblendvpd   xmm1,xmm14,xmm12,xmm0
44 0F 28 F1          movaps      xmm14,xmm1

After:
66 0F 57 C0          xorpd       xmm0,xmm0
66 41 0F C2 C1 06    cmpnlepd    xmm0,xmm9
C4 43 09 4B F4 00    vblendvpd   xmm14,xmm14,xmm12,xmm0
2020-07-29 17:06:52 +02:00
JosJuice a05b1f9ab9 DiscIO: Fix conversion warning
Should fix https://bugs.dolphin-emu.org/issues/12208.
2020-07-29 10:55:02 +02:00
LC b354e343a7
Merge pull request #8988 from JosJuice/no-refresh-rate-round
VideoCommon: Don't round the refresh rate
2020-07-28 17:17:34 -04:00
Sintendo a52774ca63 Jit64: fselx - Add AVX path
AVX has a four-operand VBLENDVPD instruction, which allows for the first
input and the destination to be different. By taking advantage of this,
we no longer need to copy one of the inputs around and we can just
reference it directly, provided it's already in a register (I have yet
to see this not be the case).

Before:
66 0F 57 C0          xorpd       xmm0,xmm0
F2 41 0F C2 C6 06    cmpnlesd    xmm0,xmm14
41 0F 28 CE          movaps      xmm1,xmm14
66 41 0F 38 15 CA    blendvpd    xmm1,xmm10,xmm0
F2 44 0F 10 F1       movsd       xmm14,xmm1

After:
66 0F 57 C0          xorpd       xmm0,xmm0
F2 41 0F C2 C6 06    cmpnlesd    xmm0,xmm14
C4 C3 09 4B CA 00    vblendvpd   xmm1,xmm14,xmm10,xmm0
F2 44 0F 10 F1       movsd       xmm14,xmm1
2020-07-28 23:17:18 +02:00
LC 5066d4d239
Merge pull request #8989 from JosJuice/android-minimal-post-processing
Android: Set preferMinimalPostProcessing="true"
2020-07-28 17:16:47 -04:00
JosJuice 9c44ad11e3 Android: Set preferMinimalPostProcessing="true"
When using the combination of Android 11 and HDMI 2.1,
this will send a signal to the TV suggesting it to switch to
a low latency mode ("game mode").
2020-07-28 22:21:57 +02:00
JosJuice f72b756778 VideoCommon: Don't round the refresh rate
We now provide a double to the FPS counter and exact values
to FIFO recording and frame dumping.
2020-07-28 21:01:38 +02:00
Jordan Woyak bdfb320b3d WiimoteEmu: Don't check extension button press for wii remote reconnection. A real remote doesn't. We won't either. 2020-07-26 11:20:23 -05:00
Pokechu22 1ca3710bd2 DSPLLE: Use Memory functions isntead of directly using Memory::physical_base
Fixes bug 11980
2020-07-24 15:06:39 -07:00
Pokechu22 59dc7cfe7d Use size_t in some DSP code code 2020-07-24 15:06:39 -07:00
Lioncash f9b856aeda WiimoteEmu: Mark several getters as const
These don't modify internal class state, so they can be made const.
2020-07-24 15:48:27 -04:00
Ryan Meredith fdcc6a436b Android: Add Log Configuration to UI 2020-07-24 13:59:13 -04:00
Ryan Meredith e7d53224b2 Android: Clear game profiles and GameSettings 2020-07-24 13:36:38 -04:00
Tillmann Karras 062dd5ab0a DolphinQt: fix -Wunused-variable warning 2020-07-24 17:44:32 +01:00
Tillmann Karras 5bd2b2699c DolphinQt: fix -Wsign-compare warning 2020-07-24 17:44:32 +01:00
Tillmann Karras 750cb1f830 DolphinQt: fix -Wunused-but-set-variable warning 2020-07-24 17:41:37 +01:00
Tillmann Karras bf5b1092b2 DiscIO: fix -Wreorder warning 2020-07-24 17:41:37 +01:00
Tillmann Karras 04b31e7eee IOS: work around incorrect -Wunused-but-set-variable warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96311
2020-07-24 16:38:54 +01:00
Tillmann Karras fbd34f72ad EXI: fix -Wunused-variable warning 2020-07-24 15:35:35 +01:00
Tillmann Karras 7b2e93eea8 EXI: fix -Wreorder warning 2020-07-24 15:35:24 +01:00
Ryan Meredith a0ab90f4c6 Android: Settings and Emulation activities skip (Tv)MainActivity library rescan 2020-07-24 04:04:31 -04:00
JMC47 781662c6ad
Merge pull request #8793 from iwubcode/dump-texture-options
DolphinQt / VideoCommon: Add additional texture dumping options
2020-07-24 01:38:10 -04:00
JosJuice 213c1841f7
Merge pull request #8903 from AdmiralCurtiss/gcmemcard-file-identity-check
GCMemcard: Change behavior of TitlePresent() to more closely resemble how saves are actually identified.
2020-07-23 17:44:16 +02:00
iwubcode 9c8338ec4c DolphinQt / VideoCommon: Add additional texture dumping options. Specifically, this enables users to choose whether to dump mip maps, base level textures, or both. 2020-07-22 19:30:27 -05:00
LC d7a91316da
Merge pull request #8974 from Filoppi/patch-4
Fix disc image conversion button not being clear #3
2020-07-22 17:24:23 -04:00
LC bf49849f88
Merge pull request #8971 from JosJuice/simplify-issettingsaveable
Config: Simplify IsSettingSaveable
2020-07-22 16:27:34 -04:00
Filippo Tarpini f6ba54b74e
Fix disc image conversion button not being clear #3
It wasn't clear whether the conversion would create a new file or replace the old one

Recreated #8952 directly from github
2020-07-22 23:00:20 +03:00
Ryan Meredith 9ac24a0580 Android: Some simple Clang-Tidy suggestions 2020-07-22 15:38:45 -04:00
JosJuice 26536832c3 Config: Simplify IsSettingSaveable
Should make it both easier to edit and faster to run.
2020-07-22 11:46:47 +02:00
JosJuice e9cc89af83 Android: Remove hacks for Wii Remote extension and video backend settings 2020-07-20 15:25:53 +02:00
LC ae2348023b
Merge pull request #8964 from JosJuice/list-wad-file-type
DolphinQt: Show WAD as "WAD" instead of "" in file format column
2020-07-19 17:35:34 -04:00
JosJuice fe5e92f706 DolphinQt: Show WAD as "WAD" instead of "" in file format column
https://bugs.dolphin-emu.org/issues/12190
2020-07-19 21:30:48 +02:00
Jordan Woyak ae44f17667 HW/GCPadEmu: Adjust gate radius values to more closely match the real hardware. 2020-07-19 09:45:33 -05:00
LC 487cd7abd9
Merge pull request #8905 from JosJuice/jni-encoding
Android: Use correct encoding when converting strings
2020-07-18 22:13:14 -04:00
Filip Gawin 0ede5d1537 Use range loop (if possible) 2020-07-18 18:29:16 -05:00
iwubcode 97c9cf3e21 DolphinQt / InputCommon - add DSU string validator to avoid crashes, limited backwards compatibility support 2020-07-17 14:53:39 -05:00
iwubcode 58aa0150e1 DolphinQt / InputCommon: Support multiple DSU servers 2020-07-17 14:53:39 -05:00
JosJuice aa4896fb3f DolphinQt: Add i18n comment for "Surround" 2020-07-17 19:10:31 +02:00
Jordan Woyak 8b3e9e6a81 DolphinQt: Replace unusual Qt::InitialSortOrderRole usage with a custom role. 2020-07-16 20:27:07 -05:00
LC a7e475e57b
Merge pull request #8958 from jordan-woyak/sort-fix
DolphinQt: Fix default sort direction of game list.
2020-07-16 21:20:43 -04:00
Jordan Woyak ecf016e80a DolphinQt: Fix default sort direction of game list. 2020-07-16 19:21:14 -05:00
Techjar 037aa2192f NetPlay: Limit nickname length
Ridiculously long nicknames cause UI silliness, so 30 characters seems
like a reasonable limit, as it's the same as the forum.
2020-07-16 19:03:54 -04:00
Techjar 92812d0b0b QtUtils: Add UTF8CodePointCountValidator 2020-07-16 19:03:46 -04:00
LC c59648337a
Merge pull request #8955 from JosJuice/android-no-ashmem
Android: Don't access /dev/ashmem on newer Android versions
2020-07-16 14:23:51 -04:00
JosJuice 00cde7cbbd Android: Don't access /dev/ashmem on newer Android versions
Fixes a critical regression where 95945a0 made us unable to
start emulation on Android 10 and newer. Android is restricting
direct access to /dev/ashmem starting with the new SDK version,
but we can use the new (and simpler) ASharedMemory API instead.
We have to keep using the /dev/ashmem approach on old versions
of Android, though.
2020-07-16 20:06:58 +02:00
JosJuice f2cc3a2948 Add Android check for strerror_r variant
I don't know why Android does it like this, but at least
it's easy to fix. (We are currently at __ANDROID_API__ == 21.)
2020-07-16 18:51:58 +02:00
Admiral H. Curtiss 556e93f357 GCMemcard: Change behavior of TitlePresent() to more closely resemble how saves are actually identified.
This modifies GCMemcard::TitlePresent() to match my findings of how the GC BIOS and various games behave when you alter the fields in the directory entry.

It looks like for a save to be recognized by a game, the following have to be true:
- Game code and maker code must exactly match what the game expects.
- Filename is only checked up to the first null byte. All bytes afterwards can be whatever.

The BIOS itself does a full compare of the filename when checking for whether it should allow copying a file from one card to another, but behaves oddly in some cases when there's non-null bytes after the first null. See the big comment in `HasSameIdentity()` for details.
2020-07-15 19:17:22 +02:00
LC b6ee3228be
Merge pull request #8953 from JosJuice/android-target-sdk-29
Android: Increase targetSdkVersion to 29
2020-07-14 12:51:44 -04:00
Tilka a98df567b1
Merge pull request #8949 from JosJuice/android-cache
Android: Use system cache directory as cache directory
2020-07-13 12:21:21 +01:00
Tilka 695a96498a
Merge pull request #8922 from Filoppi/timer-fixes
Timer fixes
2020-07-13 00:16:45 +01:00
JMC47 3c70fb7277
Merge pull request #8950 from jordan-woyak/double-time-fix
Common/Timer: Fix integer underflow in Timer::GetDoubleTime for dates before ~2008.
2020-07-12 15:52:15 -04:00
Jordan Woyak eab07866a3 Common/Timer: Fix integer underflow in Timer::GetDoubleTime for dates before ~2008. 2020-07-12 12:55:02 -05:00
LC 4d36f6a5b0
Merge pull request #8936 from jordan-woyak/wiimote-extension-calibration-fix
ControllerInterface/Wiimote: Provide fallback values for extensions with bad calibration.
2020-07-12 12:46:15 -04:00
JosJuice 05da2e30ad Android: Use system cache directory as cache directory
This lets Android automatically delete data in the cache
directory when the device is running low on space or
when Dolphin is uninstalled.
2020-07-12 13:33:07 +02:00
JosJuice 95945a000e Android: Increase targetSdkVersion to 29
Since updating to 28 took us so long that Google Play started
requiring updates to target 28 before we actually merged the PR that
made us target 28, I'm trying to get the update to 29 done early.

Setting targetSdkVersion to 28 would normally force scoped storage
on us, which we do not support yet. However, we can easily
avoid this by setting android:requestLegacyExternalStorage="true".
There will be no such luxury with targetSdkVersion 30, however...
2020-07-12 12:02:37 +02:00
Jordan Woyak d9e7d0514c WiimoteEmu: Allow writes of the i2c bus to play speaker data. 2020-07-11 21:19:16 -05:00
Jordan Woyak 5299e902aa ControllerInterface/Wiimote: Provide fallback values for extensions with bad calibration data. 2020-07-11 19:55:14 -05:00
Rena Kunisaki a553f22385 Add Break On Hit and Log On Hit for instruction breakpoints 2020-07-11 13:38:58 -04:00
LC ed32a2a1fe
Merge pull request #8946 from jordan-woyak/unbreak-mayflash
InputCommon/GCAdapter: Unbreak Mayflash GCAdapters by allowing libusb_control_transfer call to fail.
2020-07-11 11:56:30 -04:00
JosJuice f7c32bc04e RVZ: Fix split seed reads
This could cause read errors if chunks were laid out a certain
way in the file and the whole chunk wasn't being read at once.
Should fix https://bugs.dolphin-emu.org/issues/12184.
2020-07-11 17:45:16 +02:00
Jordan Woyak b350d3cca3 InputCommon/GCAdapter: Unbreak Mayflash GCAdapters by allowing libusb_control_transfer call to fail. 2020-07-09 17:17:44 -05:00
JosJuice 9c7704c0ac DolphinQt: Attempt to fix ParallelProgressDialog constantly reopening
I believe the value returned by value() resets when we call
setValue() with the maximum (due to auto-reset). I have been
unable to test this because I can't reproduce the issue, which is
described at https://bugs.dolphin-emu.org/issues/12158#note-9.
2020-07-09 15:45:29 +02:00
JosJuice aeeb85aa3a DolphinQt: Replace QTBUG-10561 workaround with better workaround
This workaround is not timing sensitive, unlike the old one.

Hopefully fixes https://bugs.dolphin-emu.org/issues/12158
and https://bugs.dolphin-emu.org/issues/12180.
2020-07-08 20:29:26 +02:00
JosJuice f5da6e07d7 Android: Use correct encoding when converting strings
The functions with "UTF" in the name use "modified UTF-8" rather
than the standard UTF-8 which Dolphin uses, at least according
to Oracle's documentation, so it is incorrect for us to use them.
This change fixes the problem by converting between UTF-8 and
UTF-16 manually instead of letting JNI do it for us.
2020-07-08 14:52:05 +02:00
JosJuice 38791eec18 Common: Never convert from UCS-2 in WStringToUTF8
Probably not something we would run into in practice since
Windows uses a separate implementation, but let's do it
for the sake of correctness.
2020-07-08 14:51:35 +02:00
JosJuice 15d9fab0bb Common: Rename UTF16ToUTF8
This function does *not* always convert from UTF-16. It converts
from UTF-16 on Windows and UTF-32 on other operating systems.

Also renaming UTF8ToUTF16 for consistency, even though it
technically doesn't have the same problem since it only was
implemented on Windows.
2020-07-08 14:51:35 +02:00
LC 87287181dd
Merge pull request #8907 from JosJuice/android-overlay-stick-gate
Android: Use octagonal stick gate in overlay
2020-07-08 08:50:47 -04:00
LC a5166be995
Merge pull request #8896 from JosJuice/android-game-details-scroll
Android: Wrap game details dialog in ScrollView
2020-07-08 08:48:42 -04:00