Commit Graph

29588 Commits

Author SHA1 Message Date
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
Léo Lam 06439a2d40
Merge pull request #9610 from CookiePLMonster/fix-shortcut-creation
Fix shortcut creation
2021-03-30 17:30:37 +02:00
LC 7a16231e98
Merge pull request #9614 from JosJuice/okay-fine-i-give-in
Android: Add "Synchronize GPU Thread" setting (SyncOnSkipIdle/SyncGPU)
2021-03-28 09:29:08 -04:00
LC 18e7009db2
Merge pull request #9613 from JosJuice/android-delete-game-ini-more
Android: Expand the game INI deletion prompt
2021-03-28 09:28:26 -04:00
JosJuice ed5e61a250 Android: Add "Synchronize GPU Thread" setting (SyncOnSkipIdle/SyncGPU)
Many Android users want to disable SyncOnSkipIdle as a performance
hack, to the point where it's often suggested as something to
paste into Dolphin.ini (if not to use a fork). If adding it as
a setting in the GUI gives us an opportunity to explain what the
setting actually does and stops people from pasting stuff they
don't understand into INI files, I think it can be worth adding
despite how it can make games unstable. It not being in the GUI
doesn't seem to be stopping people from disabling it anyway.

The added setting in the GUI is a three-way setting called
"Synchronize GPU Thread" with the following alternatives:

"Never":            SyncGPU = False, SyncOnIdleSkip = False
"On Idle Skipping": SyncGPU = False, SyncOnIdleSkip = True
"Always":           SyncGPU = True,  SyncOnIdleSkip = True
2021-03-28 15:10:57 +02:00
JosJuice 3a2fcf9fc6 Android: Expand the game INI deletion prompt
See PR 8203 for background on the game INI deletion prompt.

It's been almost two years since PR 8203 was merged, so you
would think that people are no longer creating game INIs that
contain a copy of every global setting, right? Unfortunately,
MMJ was forked not too long before that and never backported the
change, so right now there's a not insignificant number of people
online posting game INIs full of this garbage for others to use.

One thing that's been missing from the game INI deletion prompt
is a description of what the problem with having tons of extra
lines in a game INI actually is. This change adds that, in the
the hope that it will make people ignore the warning less often.
2021-03-28 14:11:09 +02:00
JosJuice e677f641a0 Android: Rename "Enable Logging" to "Write Logs to File"
This option does in fact not enable and disable logging as a whole.
You can get logs through logcat regardless of this setting.

Also taking the opportunity to remove the reference to
the "dolphin-emu" folder name since we will no longer be
using that folder once scoped storage is applied to Dolphin.
2021-03-28 13:57:52 +02: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
LC 210ddcf5ee
Merge pull request #9592 from JosJuice/android-launch-rescan
Android: Fix rescanning on first app launch after cache clear
2021-03-22 14:34:02 -04:00
LC 14cff8dc3a
Merge pull request #9599 from JosJuice/android-gfx-hacks-settings
Android: Add some missing settings to Hacks section of Graphics
2021-03-22 14:33:32 -04:00
LC 3bedede928
Merge pull request #9601 from JosJuice/android-scrollbar-width
Android: Minor design tweaks to the in-game menu
2021-03-22 14:30:05 -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 1a88656cce Android: Limit the height of the in-game menu's game title
If the title is too long, there may not be much space left
for the actual menu items.
2021-03-19 21:51:17 +01:00
JosJuice 8fa5f67277 Android: Make the in-game menu scrollbar wider
It was still rather hard to notice, even with autohide disabled.
2021-03-19 21:38:04 +01:00
JosJuice e2c8b3a317 Android: Add some missing settings to Hacks section of Graphics
This brings the available settings in the Hacks section
in line with DolphinQt.
2021-03-19 21:01:26 +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
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
JosJuice ac65c7970c Android: Fix rescanning on first app launch after cache clear
GameFileCacheService.startRescan (in MainPresenter.onResume)
does nothing if called before GameFileCacheService.startLoad.
Fixes a 3f71c36 regression where already added games would not
show up after app launch under specific circumstances.

Unfortunately the loading indicator still doesn't show up
during a rescan initiated by app launch, but that would
be more annoying to fix, so I will leave it for now.
2021-03-16 22:58: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 064a00634e
Merge pull request #9590 from JosJuice/android-recreate-main
Android: Fix recreating main activity
2021-03-16 09:42:31 +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 fcb19a228b Android: Fix recreating main activity
4752ec8 broke this because I wasn't aware that a fragment
has to have a constructor with no parameters in order for
activity recreation to work.
2021-03-15 21:44:09 +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