Commit Graph

36379 Commits

Author SHA1 Message Date
Tilka 35ec2e97a8
Merge pull request #13079 from JosJuice/android-16k
Android: Add 16 KiB page size support
2024-10-12 10:11:33 +01:00
Tilka c5ce90b786
Merge pull request #13080 from JosJuice/androidx-edge-to-edge
Android: Use enableEdgeToEdge
2024-10-12 10:11:11 +01:00
Tilka 2024d9f8ff
Merge pull request #13126 from jordan-woyak/no-big-banner
DolphinQt: Restrict size of banner image in game properties info tab.
2024-10-12 09:40:20 +01:00
Tilka f635c71f28
Merge pull request #13125 from jordan-woyak/mapping-tab-bar-auto-hide
DolphinQt: Auto hide the mapping window tab bar.
2024-10-12 09:36:19 +01:00
Tilka 9eb0429c2e
Merge pull request #13124 from jordan-woyak/trigger-threshold-99
ControllerEmu: Change trigger threshold check to prevent user error.
2024-10-12 09:34:53 +01:00
Jordan Woyak 23ba1c9133 DolphinQt: Restrict size of banner image in game properties info tab. 2024-10-11 22:56:33 -05:00
Jordan Woyak 3d762c20ee DolphinQt: Auto hide the mapping window tab bar. 2024-10-11 22:03:05 -05:00
Jordan Woyak ccdce615ec ControllerEmu: Change trigger threshold check to >= instead of > and set minimum threshold in UI to 1% to prevent user error. 2024-10-11 19:38:38 -05:00
Jordan Woyak 863889a34e DolphinQt/MappingIndicator: Use Settings::IsThemeDark instead of reimplementing it. 2024-10-11 18:50:32 -05:00
Tilka d6e10e586a
Merge pull request #13076 from robxnano/dbus-inhibit
Linux: Use D-Bus to inhibit screensaver
2024-10-12 00:31:58 +01:00
Tilka f4e0a42cfc
Merge pull request #13075 from robxnano/qt-color-scheme
Remove unneeded Win32 code for color scheme
2024-10-11 22:20:42 +01:00
Tilka 8679d6c334
Merge pull request #13120 from Sintendo/mtspr
JitArm64: Optimize mtspr
2024-10-11 21:42:12 +01:00
Tilka d2a56b321f
Merge pull request #13095 from mitaclaw/ranges-modernization-6-n
Ranges Algorithms Modernization - N
2024-10-11 20:28:06 +01:00
Tilka c1832d17f6
Merge pull request #13117 from mitaclaw/ranges-modernization-9-trivial-find
Ranges Algorithms Modernization - Find
2024-10-11 20:27:18 +01:00
mitaclaw 203923b267 JitArm64_RegCache: Simplify `std::find` using ranges and projections 2024-10-11 12:09:00 -07:00
mitaclaw 8b1975ab18 GraphicsMod: Simplify `std::sort` using ranges and projections 2024-10-11 12:08:22 -07:00
mitaclaw 2edf6c6419 CoreTiming: Simplify algorithms using ranges and three-way comparison 2024-10-11 12:08:22 -07:00
mitaclaw e8d5fb89e4 C++20: Synthesize `operator!=` From `operator==`
The inequality operator is automatically generated by the compiler if `operator==` is defined.
2024-10-10 20:23:55 -07:00
mitaclaw d296b2613c Modernize `std::adjacent_find` with ranges 2024-10-10 15:28:11 -07:00
mitaclaw e4fb837f4b Modernize `std::find_if` with ranges
In BTEmu.cpp, `std::mem_fn` was not necessary for the predicate to compile.
2024-10-10 15:28:11 -07:00
mitaclaw 6ca7e2856b Modernize `std::find` with ranges 2024-10-10 15:28:11 -07:00
Sintendo a9a779a6b9 JitArm64_Integer: Use IsImm helper more 2024-10-10 22:21:31 +02:00
Sintendo 0d9984b299 JitArm64_SystemRegisters: Optimize mtspr
No need to materialize the immediate if it is zero, we can just use WZR.

Before:
mov    w27, #0x0                 ; =0
str    w27, [x29, #0x1178]

After:
str    wzr, [x29, #0x1178]
2024-10-10 22:16:28 +02:00
Sintendo 8304ae3361 JitArm64_RegCache: Add IsImm helper
Because checking if a register is a specific immediate is a rather
common operation.
2024-10-10 22:13:34 +02:00
mitaclaw e572081ac3 Modernize `std::min_element` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw c99a0c25e0 Modernize `std::max_element` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 88a1a5b4f2 Modernize `std::set_intersection` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 728663bdc0 Modernize `std::binary_search` with ranges
In VolumeVerifier.cpp, constructing a `std::string_view` of the volume's GameID is unnecessary, as `std::`(`ranges::`)`binary_search` supports heterogeneous lookup. The usage in GameFile.cpp is a perfect example.
2024-10-10 00:53:48 -07:00
mitaclaw 01d0bdf1bb Modernize `std::is_sorted` with ranges
In OGLConfig.cpp, `std::views::reverse` is used rather than sorting using `std::ranges::greater` in order to parallel other instances of reverse iteration in the function.
2024-10-10 00:53:48 -07:00
mitaclaw ebf7cebc32 Modernize `std::sort` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw bcaf665d14 Modernize `std::reverse_copy` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 78440ca335 Modernize `std::reverse` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 9bd1dae41d Modernize `std::fill` with ranges
In DSPCore.cpp, there were two `std::fill` uses that could be simplified using `std::fill_n`. Due to their proximity with other `std::fill` algorithms being modernized with ranges, I chose to make these examples into the rare `std::ranges::fill_n`.
2024-10-10 00:53:48 -07:00
mitaclaw a7160c7b38 Modernize `std::replace_if` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 0a80243a92 Modernize `std::replace` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 72436a0d1f Modernize `std::transform` with ranges
In StringUtil.h, the lambdas wrapping `Common::ToLower(char)` and `Common::ToUpper(char)` were only necessary due to the function names being overloaded.
2024-10-10 00:53:48 -07:00
mitaclaw 7ce170f138 Modernize `std::copy` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 249defa72b Modernize `std::equal` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 4cc5e1972a Modernize `std::count_if` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw c46060e298 Modernize `std::count` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw ed5eb49d47 Modernize `std::for_each` with ranges 2024-10-10 00:53:48 -07:00
Tillmann Karras e96960e2a6 VideoCommon: fix common opcode decoding errors
Many games call GXSetGPFifo() without first waiting for the GP to finish
consuming outstanding commands in the previous GP fifo. Normally,
Dolphin runs OpcodeDecoding in 1000-cycle time slices. In that time
frame, GXSetGPFifo() has probably completed and the GP read pointer now
points to entirely new memory. If the last GP fifo copy ended in an
incomplete command, the new GP fifo would most likely desync for a
while. To avoid all this, give the GP a time slice right now to copy the
remaining data from the previous GP fifo.
2024-10-10 04:07:44 +01:00
mitaclaw 519da8297c Simplify `std::stable_sort` with `std::ranges::stable_partition` 2024-10-09 17:26:10 -07:00
mitaclaw e6f93efac4 Simplify `std::transform` with `std::ranges::transform_view` 2024-10-09 17:26:10 -07:00
mitaclaw 809766a439 Simplify `std::fill` with `std::array::fill` 2024-10-09 17:26:10 -07:00
Tillmann Karras 3c11360335 IOS: log cIOS device checks as warnings, not errors
Some games do this to detect piracy.
2024-10-09 21:18:36 +01:00
Jules Blok 7db13d23c9
Merge pull request #13086 from Tilka/gameini
GameSettings: safe texture cache for "Winter Sports 3: The Great Tournament"
2024-10-09 02:06:51 +02:00
mitaclaw b6ec8ddc20 Simplify `std::fill` with `std::fill_n` 2024-10-07 15:34:56 -07:00
mitaclaw 7c96762f5f Simplify `std::copy` with `std::copy_n`
+ a surprise `std::memcpy` in VolumeVerifier.cpp.
2024-10-07 15:34:56 -07:00
Tilka 2b22e6ffc9
Merge pull request #13109 from Pokechu22/fifo-player-wii-bats
FifoPlayer: Set up additional BATs in Wii mode
2024-10-07 17:42:54 +01:00
Pokechu22 929bcbdde9 Fifo analyzer: Fix indexed XF loads showing "bytes" instead of "words"
Indexed XF loads specify the number of 32-bit words (generally floats, but light data has some integers) to load, not the number of bytes. This was only a mistake in the fifo analyzer text; the actual implementation already loaded words.
2024-10-06 21:56:48 -07:00
Pokechu22 de61430dae FifoPlayer: Set up additional BATs in Wii mode
The light LIT fifolog from https://bugs.dolphin-emu.org/issues/13635 has position data at physical address 11ae3180. This works fine when using the memory viewer in physical mode, but the corresponding virtual address (91ae3180) previously didn't show anything in effective mode. It works fine now though.

This shouldn't affect playback of fifologs as everything in there uses physical addresses; this only impacts the memory viewer.

This logic was copied from CBoot::SetupBAT.
2024-10-06 21:48:34 -07:00
JMC47 339f9311fb
Merge pull request #12918 from JosJuice/revert-revert-audit-get-state
Partially revert "Revert "Audit uses of IsRunning and GetState""
2024-10-06 11:26:06 -04:00
JMC47 d78b76790d
Merge pull request #13105 from lycheefox/skylanders
Skylanders: Fix Head Rush (Nitro)
2024-10-06 11:21:32 -04:00
TellowKrinkle 1454934a07 VideoBackends:Metal: Use standardized C++ features over clang builtins 2024-10-06 02:13:48 -05:00
TellowKrinkle 32fd10bd08 VideoBackends:Metal: Log file on failed pipeline compile 2024-10-06 02:13:48 -05:00
lycheefox ad1109e191 Skylanders: Fix Head Rush (Nitro) 2024-10-05 22:14:17 -04:00
TellowKrinkle 9244cded9f VideoBackends:Vulkan: Increase VMA Vulkan Version to 1.2
We now use Vulkan 1.2 if available
2024-10-05 16:51:14 -05:00
Tilka d1ac40a72b
Merge pull request #13101 from JosJuice/gametdbid-partition
Core: Include partition when calling GetGameTDBID for non-game partition
2024-10-05 22:31:58 +01:00
Jules Blok b191c0f7d8
Merge pull request #12208 from PatrickFerry/add-vertex-depth-range-case
Use Vertex Depth Range when zRange Exceeds farZ
2024-10-05 14:14:11 +02:00
JosJuice 6798f63a2e Core: Include partition when calling GetGameTDBID for non-game partition
This problem was introduced in 8842a0f402
and is likely a copy-paste error.

Fixes the problem mentioned in the issue comment
https://bugs.dolphin-emu.org/issues/13640#note-2.
2024-10-05 13:04:50 +02:00
JMC47 2d9f789940
Merge pull request #13050 from TellowKrinkle/HKIsNotMVK
Vulkan: Don't do MoltenVK things on Asahi Linux
2024-10-05 00:51:27 -04:00
OatmealDome ae14abb2fa
Merge pull request #13088 from TellowKrinkle/iOSFixes
VideoBackends:Metal: Fix bbox on newer iOS devices
2024-10-04 17:32:44 -04:00
JosJuice 6ca2da53e8 Partially revert "Revert "Audit uses of IsRunning and GetState""
This reverts the revert commit bc67fc97c3,
except for the changes in BaseConfigLoader.cpp, which caused the bug
that made us revert 72cf2bdb87. PR 12917
contains an improved change to BaseConfigLoader.cpp, which can be merged
(or rejected) independently.

A few changes have also been made based on review comments.
2024-10-04 18:35:41 +02:00
JosJuice 2da3e49b1e
Merge pull request #13078 from Dentomologist/videobackendbase_only_populate_backend_info_when_uninitialized
VideoBackendBase: Only populate backend info when uninitialized
2024-10-04 18:31:06 +02:00
JosJuice 76287f3810
Merge pull request #13097 from Tilka/vidpid
Bluetooth: show vid:pid in error message
2024-10-03 19:05:56 +02:00
LillyJadeKatrin a36746a79a Turn off debug mode if hardcore is active on emulator start
Found this bug while testing; if I manually edit the config files while Dolphin is closed I was able to get debug and hardcore on at the same time, this resolves that.
2024-10-03 09:01:00 -04:00
LillyJadeKatrin 72f682ab13 Add Confirm Popups for Achievements Logout and Hardcore Off 2024-10-03 08:59:54 -04:00
LillyJadeKatrin 415fa3c6a5 Migrate Hardcore Toggle Code to Achievement Manager
AchievementManager::SetHardcoreMode now handles the (non-Qt) settings disabled by hardcore mode, instead of doing this on the Qt layer. Also ensured Init/Enable Achievements paths run this code, fixing the bug wherein the player can manipulate things when achievements are disabled that persist when turned back on.
2024-10-03 07:52:07 -04:00
JMC47 e259831bcf
Merge pull request #13087 from TellowKrinkle/PresentSkip
VideoBackends:Vulkan: Prevent freezes during window resize on Linux
2024-10-02 21:09:25 -04:00
TellowKrinkle a267c56412 VideoBackends:Vulkan: Wait until we've confirmed a successful AcquireNextImage before marking semaphores used 2024-10-02 19:22:16 -05:00
TellowKrinkle 7e1a9490c0 VideoBackends:Vulkan: Don't try to present if swapchain acquire failed 2024-10-02 19:22:16 -05:00
Tillmann Karras e455833ea4 Bluetooth: show vid:pid in error message 2024-10-02 21:50:25 +01:00
JMC47 122bce08de
Merge pull request #12953 from LillyJadeKatrin/retroachievements-fail-messaging
Achievements Fail Messaging
2024-10-02 14:50:21 -04:00
LillyJadeKatrin 2f40bc25ae Properly Notify when Achievements Login Fails 2024-10-01 18:03:46 -04:00
TellowKrinkle 70f69c3213 VideoBackends:Metal: subgroup_ops requires Apple7, not Apple6
SIMD-scoped permute operations are Apple6, but reduction operations are Apple7
2024-09-30 23:38:23 -05:00
Tillmann Karras a02cbc9b78 WII_IPC: rewrite multiply as 100_tbticks literal (NFC) 2024-10-01 01:42:16 +01:00
TellowKrinkle fd94ff252d VideoCommon: Dirty pixel shader manager on efb scale changes 2024-09-30 01:12:55 -05:00
TellowKrinkle 14feaf4ba8 VideoBackends:Metal: Use ios_use_simdgroup_functions with SPIRV-Cross
It defaults to trying to emulate simdgroup functions on iOS
2024-09-29 23:58:54 -05:00
Tilka c7cbac538a
Merge pull request #13083 from Tilka/apploader
Boot: write Apploader version into memory
2024-09-29 14:40:43 +01:00
mitaclaw c60accc96d VolumeVerifier: Promote `DEBUG_ASSERT` to `static_assert`
This runtime assertion was added before `std::is_sorted` became constexpr in the codebase.
2024-09-28 23:12:12 -07:00
Tillmann Karras b168a8092f Boot: write Apploader version into memory
When HLE-ing the apploader, this is necessary to avoid "Error #002"
errors. Homebrew doesn't care.
2024-09-29 03:57:44 +01:00
JosJuice d0e6573ac7 Android: Use enableEdgeToEdge
Dolphin has been using edge-to-edge rendering for a little while now,
but it has required a bit of manual work. Now that edge-to-edge is
becoming something expected of apps in Android 15, there's a nicer API
we can use.

Tested on Android 8, 11 and 13, with no changes in behavior noted.
2024-09-28 18:20:31 +02:00
JosJuice 14a802b58b Android: Add 16 KiB page size support
So far, Dolphin hasn't been able to run on Android devices that use a
16 KiB page size. 16 KiB page sizes are a very new Android feature that
no phones have shipped with so far, so we're still compatible with the
phones that exist out there, but let's get this fixed before phones
start shipping with 16 KiB page sizes.

Because I couldn't get Android Studio's emulator to work, I haven't been
able to confirm that this change actually makes Dolphin fully compatible
with devices that use a 16 KiB page size. But I have confirmed that this
doesn't break anything on a regular 4 KiB page size device.
2024-09-28 13:43:49 +02:00
robxnano 2748771cb3
linux: Use D-Bus to inhibit screensaver 2024-09-27 21:22:57 +01:00
Dentomologist dc1b961c09 VideoBackendBase: Only populate backend info when uninitialized
Prevent potential issues when creating the Graphics window (and thus
calling PopulateBackendInfo) while the core state is Stopping, like we
already do while it's Starting or Running.
2024-09-27 12:20:48 -07:00
robxnano 5e8f5afb52
DolphinQt: Remove unneeded Win32 code
Dolphin already uses QStyleHints::colorScheme to detect dark mode,
so this code is now redundant.
2024-09-27 10:41:01 +01:00
Tilka 2cb124bd3a
Merge pull request #13062 from Dentomologist/graphics_clarify_relationship_between_incompatible_settings
Graphics: Clarify relationship between incompatible settings
2024-09-27 05:40:30 +01:00
Tilka 61836e5d8e
Merge pull request #13077 from Dentomologist/graphicswindow_fix_first_opening_during_emulation_startup_crash
GraphicsWindow: Fix crash when opening for the first time during emulation startup
2024-09-27 05:38:37 +01:00
Dentomologist 0a1084fad5 VideoBackendBase: Check Core state in PopulateBackendInfo
Remove the PopulateBackendInfoFromUI function, which had a single caller
(GraphicsWindow::OnBackendChanged) and checked that the core wasn't
running or starting before calling PopulateBackendInfo.

Move the core state check into PopulateBackendInfo and have
OnBackendChanged call that instead. This guarantees the check is
performed by all callers of PopulateBackendInfo, preventing
potential reintroduction of the crash fixed in 3d4ae63f if another call
to PopulateBackendInfo is added.

As of the previous commit the only other caller of PopulateBackendInfo
is Core::Init shortly before s_state is set to Starting, so it will
always pass the check and so maintain its current behavior.
2024-09-26 17:12:26 -07:00
Dentomologist 2b82c34ea8 Core: Remove redundant call to PopulateBackendInfo
Remove the second of two calls to PopulateBackendInfo during emulation
startup. This call was originally the only one, but b214e0e added an
earlier call to handle the backend being changed by the GameINI.

The PR discussion doesn't explain why the original call was left in; I
suspect it was just overlooked.

As a bonus, this removes one of the extra copies of the "Video Info" On
Screen Display message at startup when using OpenGL.
2024-09-26 17:12:26 -07:00
Dentomologist 91f7b776ca GraphicsWindow: Fix crash when opening during emulation startup
Fix a crash when opening the Graphics window for the first time during
emulation startup when the backend is Vulkan, D3D11, or D3D12.

Don't call PopulateBackendInfo() from the Host thread when the core is
starting up. First, the function has already been called in Core::Init()
so we don't need to again. More importantly, PopulateBackendInfo() calls
g_video_backend->InitBackendInfo(), and the Vulkan and D3D
implementations of those functions load and then unload libraries (and
their associated function pointers) which are potentially in use by
other threads.

This crash was reliably reproducible with the following steps:
1) Select an affected backend.
2) Enable "Compile Shaders Before Starting"
3) Delete the cached shaders (but not the .uidcache file) for the game
   you're testing.
4) Close and reopen Dolphin.
5) Start the game.
6) While the game is still booting or compiling shaders, open the
   Graphics window for the first time in that Dolphin session.

Fixes https://bugs.dolphin-emu.org/issues/13634.
2024-09-26 17:12:26 -07:00
JMC47 b1cd4a6690
Merge pull request #13068 from mitaclaw/redundant-case-insensitive
IniFile: Migrate `Common::CaseInsensitiveLess` to StringUtil
2024-09-26 18:24:36 -04:00
JMC47 d4d3acb796
Merge pull request #13065 from mitaclaw/ppc-breakpoints-signal
DolphinQt: A Ubiquitous Signal For When Breakpoints Change
2024-09-26 18:20:43 -04:00
JMC47 0d7e94e8b3
Merge pull request #13070 from mitaclaw/remove-join-strings
StringUtil: Remove `JoinStrings`
2024-09-26 18:20:14 -04:00
JMC47 4bc1546596
Merge pull request #13071 from Pokechu22/cheat-search-crash
Fix random crash when using the cheat search
2024-09-25 15:05:19 -04:00
Tillmann Karras 0a299a4e1e Sw/Tev: drop unused macro 2024-09-24 22:00:03 +01:00
Tillmann Karras 98add9faf0 Sw/Rasterizer: fix two elder typos, AD 2009 2024-09-24 22:00:03 +01:00
Pokechu22 b34b7f63ee Fix random crash when using the cheat search
Before, Dolphin would randomly crash when updating the cheat search when automatic refresh was enabled. (Having a large number of addresses listed, e.g. by starting with an "any value" search, may contribute). The crash was due to QTableWidget::item returning nullptr in RefreshGUICurrentValues, presumably due to the table being resized on the UI thread while the emulated CPU thread was updating the values. I've fixed this by pausing the CPU thread for the entirety of OnNextScanClicked; this eliminated crashes in my testing.
2024-09-23 22:47:44 -07:00
mitaclaw 5f90673686 StringUtil: Remove `JoinStrings`
With 12 uses of `JoinStrings` in the codebase vs 36 uses of `fmt::join`, fmtlib's range adapter for string concatenation with delimiters is clearly the preferred option.
2024-09-22 21:09:36 -07:00