Commit Graph

24210 Commits

Author SHA1 Message Date
JosJuice 8a9597e32e DiscIO: Allow converting from formats other than ISO and GCZ
The constant DESIRED_BUFFER_SIZE was determined by multiplying the
old hardcoded value 32 with the default GCZ block size 16 KiB.
Not sure if it actually is the best value, but it seems fine.
2020-04-24 15:10:35 +02:00
JosJuice 432f342bc8 DiscIO: Use a struct for Wii hashes 2020-04-24 14:44:29 +02:00
JosJuice da9e0fb598 DiscIO: Parallelize the re-encryption code 2020-04-24 14:44:26 +02:00
JosJuice 319c508978 DiscIO: Implement re-encryption of Wii partition data 2020-04-24 14:24:12 +02:00
JosJuice a4c7100bcc DiscIO: Use partition data offset for ReadWiiDecrypted parameter
Instead of the partition offset (which is usually 0x20000 less).
2020-04-24 14:16:55 +02:00
Markus Wick 7e94d6ed37
Merge pull request #8740 from JosJuice/fix-decompress
DiscIO: Fix decompressing writing the wrong number of bytes sometimes
2020-04-24 10:42:46 +02:00
Markus Wick 703f7d4fc0
Merge pull request #8755 from Sintendo/jit64intopts
Jit64: More addx and subfx optimizations
2020-04-24 07:40:07 +02:00
Sintendo 523954e03a Analytics: Report correct quirk for mismatched xf/bp colors
Looks like a copy-paste error. The quirk for mismatched xf/bp texgens
was used twice.
2020-04-24 02:22:51 +02:00
Léo Lam 2673280614
Merge pull request #8389 from sepalani/fix-so
Socket: Abort pending ops on close
2020-04-22 07:19:25 +02:00
Sepalani 5ec80a554c Socket: Abort pending operations on close 2020-04-22 08:48:37 +04:00
JMC47 a5bd263dfb
Merge pull request #8714 from JosJuice/progress-dialog-thread
DolphinQt: Run tasks that use progress dialogs on separate threads
2020-04-21 23:59:37 -04:00
Sintendo 19dda51a0d Jit64: subfx - Use LEA when possible
Similar to what we do for addx. Since we're calculating b - a and
because subtraction is not communitative, we can only apply this when
source register a holds the constant.

Before:
45 8B EE             mov         r13d,r14d
41 83 ED 08          sub         r13d,8

After:
45 8D 6E F8          lea         r13d,[r14-8]
2020-04-21 22:45:47 +02:00
Sintendo 89646c898f Jit64: addx - Skip ADD after MOV when possible
We can get away with skipping the addition when we know we're dealing
with a constant zero. Just a MOV will suffice in this case.

Once again, we don't bother to add separate handling for when overflow
is needed, because no titles would ever hit that path during my testing.

Before:
8B 7D F8             mov         edi,dword ptr [rbp-8]
83 C7 00             add         edi,0

After:
8B 7D F8             mov         edi,dword ptr [rbp-8]
2020-04-21 22:45:47 +02:00
Sintendo 50f7a7d248 Jit64: addx - Prefer smaller MOV+ADD sequence
ADD has a smaller encoding for immediates that can be expressed as an
8-bit signed integer (in other words, between -128 and 127). MOV lacks
this compact representation.

Since addition allows us to swap the source registers, we can always get
the shortest sequence here by carefully checking if we're dealing with a
small immediate first. If we are, move the other source into the
destination and add the small immediate onto that. For large immediates
the reverse is preferrable.

Before:
41 BE 40 00 00 00    mov         r14d,40h
44 03 75 A8          add         r14d,dword ptr [rbp-58h]

After:
44 8B 75 A8          mov         r14d,dword ptr [rbp-58h]
41 83 C6 40          add         r14d,40h

Before:
44 8B 7D F8          mov         r15d,dword ptr [rbp-8]
41 81 C7 00 68 00 CC add         r15d,0CC006800h

After:
41 BF 00 68 00 CC    mov         r15d,0CC006800h
44 03 7D F8          add         r15d,dword ptr [rbp-8]
2020-04-21 22:42:02 +02:00
Sintendo 2481660519 Jit64: addx - Emit MOV when possible
When the source registers are a simple register and a constant zero and
overflow isn't needed, emitting LEA is kinda silly.

This will occasionally save a single byte for certain registers due to
how x86 encoding works. More importantly, LEA takes up execution
resources while MOV does not.

Before:
41 8D 7D 00          lea         edi,[r13]

After:
41 8B FD             mov         edi,r13d
2020-04-21 22:36:20 +02:00
Sintendo 1c25e6352a Jit64: addx - Emit nothing when possible
When the destination register matches a source register, the other
source register contains zero, and overflow isn't needed, the
instruction becomes a nop and we don't need to emit anything.

We could add specialized handling for the case where overflow is needed,
but none of the titles I tried would hit this path.

Before:
83 C7 00             add         edi,0

After:
2020-04-21 22:35:17 +02:00
Sintendo f1c3ab359d Jit64: addx - Deduplicate branches part 2
No functional change, just simplify some repeated logic in the case
where we're dealing with exactly one immediate and one simple register
when overflow isn't needed.
2020-04-21 22:06:46 +02:00
Sintendo 72fbdf1a6b Jit64: addx - Deduplicate branches part 1
No functional change, just simplify some repeated logic for the cases
where the destination register matches one of the sources.
2020-04-21 22:06:39 +02:00
Mat M c33565295d
Merge pull request #8713 from sepalani/dbg-printf
HLE: Add more debug functions
2020-04-21 12:58:34 -04:00
JMC47 d845b31579
Merge pull request #8717 from stenzek/mismatched-xf-bp
VertexManagerBase: Skip drawing objects with mismatched xf/bp stages
2020-04-21 10:07:36 -04:00
Léo Lam b2cf106ae9 IOS/FS: Fix FST write failure on some platforms
On some platforms (like Windows), the temporary file must be closed
before it can be renamed.

I guess nobody noticed this for so long because (1) the FS code has a
failsafe for missing FST entries (because existing users do not have
a FST), and most games do not care about file metadata;
(2) the write failures can only be seen in the logs.

Because we don't want this to break, I have turned the ERROR_LOGs into
PanicAlerts.
2020-04-18 12:42:12 +02:00
JMC47 9de3717c50
Merge pull request #8340 from stenzek/max-res
DolphinQt: Don't overwrite >8x IR scale in ini, add maximum internal res option
2020-04-16 21:01:14 -04:00
JMC47 935b12d785
Merge pull request #8730 from JosJuice/frame-advance-duplicate-frame
Core: Skip duplicate frames when using frame advance
2020-04-16 18:29:16 -04:00
JMC47 85a8325701
Merge pull request #8733 from JosJuice/di-baten-kaitos
Adjust s_DIMAR/s_DILENGTH behavior (fixes Baten Kaitos music)
2020-04-16 18:28:09 -04:00
JMC47 19fc43f190
Merge pull request #8708 from Ebola16/Wii
Android: Add Insert SD Card and update the description
2020-04-16 18:27:51 -04:00
JMC47 55ed980620
Merge pull request #8711 from Ebola16/SDDE
Set Insert SD Card default value to true
2020-04-16 18:25:47 -04:00
JosJuice 3629e75dd2
Merge pull request #8716 from Pokechu22/properties-leak
Delete properties dialog on close
2020-04-16 13:53:37 +02:00
JosJuice 19e9a9c945 DiscIO: Clean up decompression size calculation
We can use subtraction and std::min instead of
modulo and explicit if statements.

This commit does not change the behavior.
2020-04-15 22:15:40 +02:00
JMC47 744abab478
Merge pull request #8741 from cristian64/add_checkbox_to_filter_ingame_netplay_sessions
DolphinQt: Added checkbox to filter out NetPlay sessions that are already in-game.
2020-04-13 08:52:23 -04:00
JMC47 c0ae9cbc45
Merge pull request #8584 from jordan-woyak/widescreen-heuristic-fix
VideoCommon: Tweak widescreen heuristic.
2020-04-13 05:57:19 -04:00
Techjar bb99062f18 IOS/USBHost: Skip starting threads when determinism is enabled
The threads can't actually be started when determinism is enabled, as
the behavior would not be deterministic, but Open() still tries to
start the threads and wait, resulting in a deadlock when booting
certain games and homebrew in NetPlay.
2020-04-12 23:44:53 -04:00
Christian Aguilera dab4f8b36e DolphinQt: Added checkbox to filter out NetPlay sessions that are already in-game. 2020-04-13 00:42:03 +02:00
JosJuice 3aa463cdae DiscIO: Fix decompressing writing too much sometimes
This issue cannot happen with good dumps due to their size,
but it can happen with trimmed dumps.
2020-04-12 21:47:10 +02:00
JosJuice 26b21e3186 DiscIO: Fix decompressing writing too little sometimes
This issue cannot happen with good dumps due to their size,
but it can happen with trimmed dumps.
2020-04-12 21:45:55 +02:00
Pokechu22 d3dc81ba74 Fix bug 11920
DSP LLE Interpreter does not have a DSP thread, so trying to wait would hang. (DSP LLE recompiler also has no thread when in determinism mode).
2020-04-10 12:15:06 -07:00
JosJuice b2c9149cf8 Remove outdated comment from Movie::FrameUpdate
9c5c3c0 made this function be called on the CPU thread.
2020-04-10 00:18:53 +02:00
JosJuice 94f83db2b5 Adjust s_DIMAR/s_DILENGTH behavior (fixes Baten Kaitos music)
https://bugs.dolphin-emu.org/issues/11997

The problem seemed to be that s_DILENGTH would get set to 0
at times when it shouldn't. Simply not changing it in case
of NoReply or DTK seems to fix the problem. However, we can
actually go one step further in accuracy and use data.size()
to change s_DIMAR and s_DILENGTH as partial reads (NoReply
commands) complete, instead of jumping directly to 0 when
the whole read completes.
2020-04-09 22:13:45 +02:00
JosJuice 812ad4257c Core: Skip duplicate frames when using frame advance
It used to be the case that frame advance skipped duplicate frames
(i.e. it would take 30 frame advances to get through one second
of emulated time in a 30 fps game), but this broke in 9c5c3c0.
Skipping duplicate frames making TASing less annoying.
2020-04-09 11:39:29 +02:00
JosJuice 1a42355f96 Core: Clarify Callback_VideoCopiedToXFB and FrameUpdate 2020-04-09 00:21:04 +02:00
Mat M 9a2d8a9623
Merge pull request #8715 from JosJuice/panic-alert-deadlock
DolphinQt: Fix the panic alert deadlock (a.k.a. "Question" issue)
2020-04-08 17:20:32 -04:00
Stenzek a2f4fafe86 Vulkan: Switch from vkCreateMacOSSurfaceMVK() to vkCreateMetalSurfaceEXT()
Since we are calling this off the UI thread, we can't use anything which
accesses the underlying NSView object. We create and set the Metal layer
on the UI thread before the video backend is initialized. This extension
is both compatible with MoltenVK and gfx-portability for accepting a
layer at surface creation.
2020-04-07 18:56:55 +10:00
JosJuice 55f787b898 Remove unused function Host_UpdateProgressDialog 2020-04-03 12:53:38 +02:00
JosJuice c6ee767851 DolphinQt: Run tasks that use progress dialogs on separate threads 2020-04-03 12:53:38 +02:00
Pokechu22 e11a2bda56 Delete properties dialog on close
Fixes the game file being locked until Dolphin closes.
2020-04-02 16:14:37 -07:00
Stenzek ff7180cac4 Analytics: Add quirk for mismatched xf/bp texgens/colors 2020-04-02 12:52:16 +10:00
Stenzek a9c1dcf656 VertexManagerBase: Skip drawing objects with mismatched xf/bp stages
Hardware tests have shown that if the number of texgens/channels do not
match, you get garbage rendering. Presumably because the output
registers from the XF stage are fed into the incorrect input registers
for TEV/BP.

Currently, this causes Dolphin to crash/generate invalid shaders with an
assertion failure in the hardware backends. Instead, we log an error.

Perhaps in the future we should just spit out all texgens/colors anyway
from both stages, and let cross-stage optimization take care of DCE'ing
it away. But doing so would require changing the UIDs and invalidating
everyone's shader caches.
2020-04-02 12:51:41 +10:00
JosJuice ef778723a2 DolphinQt: Fix the panic alert deadlock (a.k.a. "Question" issue) 2020-03-31 21:00:32 +02:00
Ryan Meredith a3ff20a5f9 Android: Add Insert SD Card and update description 2020-03-31 14:58:00 -04:00
Sepalani 85cd59c585 HLE: Add more debug functions 2020-03-30 17:46:50 +04:00
Ryan Meredith fdc9ea6ca0 Set Insert SD Card default value to true 2020-03-30 06:15:17 -04:00