4253 Commits

Author SHA1 Message Date
JMC47
4b086b1256 Merge pull request #14223 from jordan-woyak/wmreal-windows-device-enumeration
HW/WiimoteReal: Cache the enumerated Wii remote HID interface list between calls to FindWiimoteHIDDevices.
2025-12-23 17:01:44 -05:00
Jordan Woyak
c55218200a WindowsDevice: Add DeviceChangeNotification class. 2025-12-23 00:02:36 -06:00
JMC47
b1f0d883cf Merge pull request #14174 from JoshuaVandaele/minizips-cmake
Use minizip-ng's CMakeLists instead of relying on our own implementation
2025-12-22 13:36:52 -05:00
JMC47
8a64bc499f Merge pull request #14154 from jordan-woyak/result-parameter-order
Common/Result: Swap order of template parameters to match C++26's std::expected.
2025-12-22 13:34:11 -05:00
JMC47
cd99d48859 Merge pull request #14056 from jordan-woyak/cached-blob-reader
Core/DiscIO: Add a setting to load games into memory.
2025-12-22 13:29:05 -05:00
JMC47
05a204edc6 Merge pull request #14016 from jordan-woyak/usbutils-CfgMgr32
USBUtils: Replace GetDeviceNameUsingSetupAPI with GetDeviceNameUsingCfgMgr32
2025-12-22 13:28:12 -05:00
Sintendo
558cee8dcf StringUtils: Drop TabsToSpaces
This function is unused.
2025-12-15 13:41:54 +01:00
Dentomologist
448d61f262 Windows/DirectIOFile: Don't request DELETE access for read-only Open
Aside from being unnecessary, on Windows the flag prevents two instances
of Dolphin (one instance from before 2509-371 when the flag was
introduced and the other after) from running the same ROM
simultaneously.

Attempting to do so generated the false error `"[Rom]" is an invalid
GCM/ISO file, or is not a GC/Wii ISO.` followed by `Failed to init core`
and emulation shutdown on the second instance to start the game. Fixing
the incorrect error message is a task I'm deferring to another PR.

The problem didn't happen when both instances were 2509-371 or later,
but I ran into it while bisecting an issue and it'd be nice to avoid
that problem in the future.
2025-11-29 14:02:24 -08:00
Joshua Vandaële
025ff87a27 Use minizip-ng's CMakeLists instead of relying on our own implementation
This is a carry over from back when we used `minizip` and had our own CMakeLists for it.
2025-11-27 00:18:31 +01:00
Jordan Woyak
fbb864a0b5 MemArena/LazyMemoryRegion: Add EnsureMemoryPagesWritable function to ensure a region of bytes is writable without the caller needing to be aware of the windows-only BLOCK_SIZE value. 2025-11-23 05:17:22 -06:00
JosJuice
490615c72a Merge pull request #14142 from JosJuice/directiofile-cant-create-saf
Common: Treat DirectIOFile as unable to create SAF files
2025-11-23 09:50:44 +01:00
Jordan Woyak
151d295b2c Merge pull request #14148 from jordan-woyak/hookable-event-add-remove-inside-trigger
HookableEvent: Allow hooks to be added and removed from within a Trigger callback.
2025-11-23 02:20:47 -06:00
JosJuice
30dbcb2f80 Merge pull request #14128 from jordan-woyak/fix-run-on-object-race
DolphinQt/QtUtils: Simplify RunOnObject and eliminate Common::Event race. Introduce Common::OneShotEvent class.
2025-11-22 21:52:17 +01:00
Jordan Woyak
127e068e51 Common/Result: Swap order of template parameters to match C++26's std::expected, make all member functions constexpr, and add moving "unexpected" conversion constructor for consistency. 2025-11-21 19:24:48 -06:00
Jordan Woyak
11318e0be5 HookableEvent: Allow hooks to be added and removed from within a Trigger callback. This fixes a deadlock in FIFOFifoRecorder. 2025-11-21 16:58:20 -06:00
JosJuice
9883235c0c Common: Treat DirectIOFile as unable to create SAF files
In 405baed805, we made the assumption that whether OpenAndroidContent
is able to create a new file depends on the open mode, the document
provider, and the positions of the celestial bodies. However, I'm
fairly sure that it can't create files at all as currently implemented.

First, ContentResolver.openFileDescriptor is documented as throwing
FileNotFoundException if the file doesn't exist. Now, the SAF
documentation is notoriously unreliable on matters like these, and
document providers can do whatever they want anyway, so we can't
actually trust this to mean that FileNotFoundException will always
be thrown if the file doesn't exist. But second, the Dolphin function
ContentHandler.unmangle is also unable to handle files that don't
already exist (unless the passed-in URI isn't mangled to begin with,
but to the best of my knowledge, there's no way to get a non-mangled URI
for a file that doesn't exist (unless you make assumptions about how the
document provider's URI scheme works, which we don't do in Dolphin)).
Summed up, it looks a lot like OpenAndroidContent can't create files,
or at the very least can't do so reliably.

Therefore I'm making DirectIOFile throw an assertion and return false
in situations where it's being asked to create a file under SAF. For
reference, there's no code in Dolphin that actually tries to create a
file under SAF. In all instances where we use SAF to write to files, the
file is created by the system file picker before it returns the URI of
the file to us.

What does this change gain us? First, if someone in the future tries to
use DirectIOFile to create a file under SAF, they'll be immediately
informed that this isn't supported rather than discovering it doesn't
work and chalking it up to SAF being bad for unpredictable reasons.
Second, we get rid of a call to File::Exists, which is a notable
performance improvement for game list scanning due to SAF and Dolphin's
"unmangling" being bad for reasons that unfortunately are entirely
predictable to those of us who have stared into the SAF void.

I've tested that game list scanning and game conversion still works.
2025-11-18 23:17:03 +01:00
Jordan Woyak
d25742fe8b Common: Introduce a OneShotEvent class. Unlike Common::Event, OneShotEvent is safe in situations when being immediately destructed. 2025-11-18 14:19:21 -06:00
Jordan Woyak
605cc579a4 Common/Functional: Add InvokerOf template which can convert function pointers to functor types. 2025-11-18 14:19:21 -06:00
Jordan Woyak
1b63776f2d Common/ScopeGuard: Fix move constructor. 2025-11-18 14:19:21 -06:00
Jordan Woyak
9dea0859eb Common/BitField: Silence two warnings:
warning: definition of implicit copy constructor for 'BitField<2, 2, ColorChannel>' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
Redundant access specifier has the same accessibility as the previous access specifier.
2025-11-15 20:32:14 -06:00
Jordan Woyak
f51eaf3282 Merge pull request #14052 from jordan-woyak/DirectIOFile
Common and DiscIO: Introduce a thread safe DirectIOFile and make BlobReader implementations use it.
2025-11-10 17:29:43 -06:00
JosJuice
cd4902f0ed Merge pull request #13875 from JosJuice/jitarm64-orr-base-without-mirror
JitArm64: Add missing ORR pattern in MOVI2RImpl
2025-11-10 20:16:21 +01:00
Admiral H. Curtiss
6435ee1d20 Merge pull request #14026 from jordan-woyak/move-only-function-fix
Common/Functional: Fix MoveOnlyFunction from inadvertently creating references from lvalues.
2025-11-09 14:49:20 +01:00
Jordan Woyak
9e2fc7f4dd Common/IOFile: Remove the Duplicate function. The duplicate handles shared a read/write position making them effectively not thread-safe. 2025-11-09 03:08:14 -06:00
Jordan Woyak
b98acb9a37 Common/BitUtils: Add overloads of AsU8Span/AsWritableU8Span that handle conversions from contiguous ranges. 2025-11-09 03:08:14 -06:00
Jordan Woyak
405baed805 Common: Add a DirectIOFile class that allows for copies which are entirely thread safe. 2025-11-09 03:08:14 -06:00
OatmealDome
02ad041866 Merge pull request #14086 from Simonx22/android/use-native-analytics
Android: Use the shared HTTP analytics backend
2025-11-08 14:03:06 -05:00
OatmealDome
a459dc0d25 Merge pull request #14082 from Simonx22/analytics/reload-on-setting-change
DolphinAnalytics: Reload backend when config changes
2025-11-08 14:00:03 -05:00
Simonx22
82f658a28f Android: Use the shared HTTP analytics backend
We can now route Android analytics through Common::HttpAnalyticsBackend, drop the Volley sender, and keep the JNI layer limited to only transfer metadata since https://bugs.dolphin-emu.org/issues/11772 has been fixed.
2025-11-08 12:14:40 -05:00
JosJuice
958db7c78c Merge pull request #14020 from jordan-woyak/string-util-cleanups
StringUtil: Cleanups and add some character encoding conversion unit tests.
2025-11-08 17:36:54 +01:00
Simonx22
f67691d564 Config: Use maximum value of size_t instead of -1 as default value in ConfigChangedCallbackID
Co-authored-by: OatmealDome <julian@oatmealdome.me>
2025-11-08 11:35:31 -05:00
JosJuice
ba14222a2b Merge pull request #13939 from Dentomologist/logging_avoid_overwriting_debug_verbosity_in_release_builds
Logging: Don't overwrite LDEBUG level in Release builds
2025-11-08 14:47:27 +01:00
Jordan Woyak
da6c65bf3b Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
Jordan Woyak
28be9dc64f WindowsDevice: Remove GetDeviceProperty function in favor of the CfgMgr32 versions. SetupAPI seems to be no longer recommended. 2025-11-05 04:05:36 -06:00
Jordan Woyak
5e65536376 WindowsDevice: Add GetDeviceInterfaceList function and NullTerminatedStringList template. 2025-11-04 22:51:26 -06:00
Jordan Woyak
2170080f53 Merge pull request #14061 from jordan-woyak/config-info-spin-mutex
ConfigInfo: Cleanups and change mutex to a spin lock.
2025-11-04 14:09:35 -06:00
Jordan Woyak
999333c0a1 Config: Make ConfigInfo use Common::SpinLock to protect the CachedValue. These locks are nearly always uncontested and this makes Config::Get faster. 2025-11-02 20:45:55 -06:00
Jordan Woyak
46369ef1b1 Common: Add AtomicMutex and SpinMutex classes as faster alternatives to std::mutex. 2025-11-02 20:45:55 -06:00
Jordan Woyak
fc9f25a418 Config/ConfigInfo: Cleanups. 2025-11-02 20:30:35 -06:00
Jordan Woyak
f289b06e0d Common: Make HookableEvent use non-static data.
Co-authored-by: Dentomologist <dentomologist@gmail.com>
2025-11-02 17:30:43 -06:00
Jordan Woyak
5650b2ef37 StringUtil: Replace strerror with Common::LastStrerrorString. 2025-11-02 00:36:04 -05:00
Jordan Woyak
da7c813edf StringUtil: Make non-Windows WStringToUTF8 implementation use iconv instead of deprecated std::codecvt features. 2025-11-02 00:36:04 -05:00
Jordan Woyak
b073b5303b StringUtil: Fix many clang-tidy warnings. 2025-11-02 00:36:04 -05:00
JosJuice
828e72d604 Merge pull request #14034 from JoshuaVandaele/byeprofile
JitRegister: Remove OProfile profiler
2025-11-01 10:05:11 +01:00
Joshua Vandaële
2383e68fd8 x64Emitter: Fix missing-declarations warning 2025-10-30 12:35:22 +01:00
Joshua Vandaële
33fd06d7f3 AdvancedPane: Add a button to restore default settings 2025-10-27 15:59:33 +01:00
Joshua Vandaële
713dfb41df JitRegister: Remove OProfile profiler
OProfile is not used at all these days, most major distributions do not ship it anymore (Debian, Fedora, and Alpine to name the few I've checked) and following a discussion on Discord, nobody is apparently using it, most devs not even being aware of it. This removes an optional dependency from Dolphin.
2025-10-26 20:48:15 +01:00
Jordan Woyak
ba5edce2af Common/Functional: Fix MoveOnlyFunction from inadvertently creating references from lvalues. 2025-10-22 05:06:41 -05:00
JMC47
2e490cefa0 Merge pull request #13978 from JoshuaVandaele/libiconv-1.18
Externals: Update libiconv to 1.18
2025-10-17 18:45:48 -04:00
Dentomologist
4e359cf1c5 WindowsDevice: Silence missing property log spam
Don't log a warning in GetPropertyHelper when the property isn't
present. The function returns an optional, so any callers that want to
log a warning when nullopt is returned can do so themselves.

This prevents plugged-in devices (an Xbox One controller in my case)
from spamming the message "W[COMMON]: CM_Get_DevNode_Property returned:
37" twice per second (that value being CR_NO_SUCH_VALUE).
2025-10-13 11:55:12 -07:00