Commit Graph

4287 Commits

Author SHA1 Message Date
Dentomologist
1b6a45df69
Merge pull request #14214 from JoshuaVandaele/cmake-nonbreaking-improvements
CMake: Various improvements
2026-01-25 18:33:46 -08:00
Martino Fontana
a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00
Sintendo
f2e1c71803 Common/FileSearch: Refactor DoFileSearch 2026-01-24 16:50:10 +01:00
JosJuice
3221e982d3
Merge pull request #13900 from JosJuice/jit-fma-double-rounding
Jit: Implement error-free transformation for single-precision FMA
2026-01-23 21:43:18 +01:00
Dentomologist
f4b88af71e JitRegister: Check Open return code
If the call to `Open` a perf map fails don't set `s_is_enabled` (though
it could already be true if you're also using VTUNE) and don't call
`std::setvbuf` with a null stream.

Also fix a typo in a comment (`if` -> `in`)
2026-01-18 17:26:26 -08:00
Dentomologist
7490dea278 JitRegister: Verify IOFile IsGood
Use IOFile's bool operator to check that it's not just open but good.
2026-01-18 17:26:26 -08:00
Dentomologist
935f537a80 JitRegister: Fix IsEnabled when using VTune without perf
Set `s_is_enabled` to `true` in `Init` when `USE_VTUNE` is defined so
that `IsEnabled` returns true even if perf isn't being used.
2026-01-18 17:26:26 -08:00
Admiral H. Curtiss
710905138c
Merge pull request #14290 from Dentomologist/jitregister_remove_redundant_open_file_check
JitRegister: Remove redundant check for open file
2026-01-19 02:06:57 +01:00
JosJuice
58487f1633 Jit: Implement error-free transformation for single-precision FMA
This implements the equivalent of 07443e2d41 in Jit64 and JitArm64.
Aims to fix https://bugs.dolphin-emu.org/issues/13865.
2026-01-18 20:02:49 +01:00
JosJuice
84261cfc23 Arm64Emitter: Fix Q bit of vector SHL/URSHR encoding
This doesn't affect any existing callers, because all existing callers
use quad registers.
2026-01-18 20:02:49 +01:00
iwubcode
373e35ed5b
Merge pull request #14267 from jordan-woyak/std-expected
Common: Replace Result with std::expected.
2026-01-17 22:33:15 -06:00
iwubcode
6d40f4e897
Merge pull request #14265 from JoshuaVandaele/std-unreachable
c++23: Replace Common::Unreachable with std::unreachable
2026-01-17 22:32:53 -06:00
Dentomologist
3424983a65 JitRegister: Remove redundant check for open file
The check only happened if `USE_VTUNE` wasn't defined, and in that case
it was immediately followed by the same check again.

The check used to avoid an unnecessary call to `StringFromFormatV` in
certain circumstances, but that call was removed in
be81fe86e1.
2026-01-17 16:39:04 -08:00
JMC47
035bcffc63
Merge pull request #14289 from Sintendo/typos
Fix various typos and spelling mistakes
2026-01-17 19:10:50 -05:00
JMC47
d098f2bba9
Merge pull request #14274 from JosJuice/jitregister-check-enabled
JitRegister: Check IsEnabled before constructing string
2026-01-17 18:23:43 -05:00
JMC47
a5b34d43fc
Merge pull request #14215 from Tilka/disasm
GekkoDisassembler: fix multiple issues
2026-01-17 18:21:09 -05:00
Jordan Woyak
dffc7a650d Common: Replace Result with C++23's std::expected. 2026-01-17 16:58:45 -06:00
Joshua Vandaële
e822cc3715
c++23: Replace Common::Unreachable with std::unreachable
Requires at least GCC 12, Clang 15, MSVC 19.32, or AppleClang 14.0.3.
2026-01-17 23:53:21 +01:00
iwubcode
b556bd99d7
Merge pull request #14268 from JoshuaVandaele/std-tounderlying
c++23: Replace Common::ToUnderlying with std::to_underlying
2026-01-17 16:49:57 -06:00
Dentomologist
3042918952
Merge pull request #14213 from cscd98/readvalue
mingw: move ReadValue definitions into cpp to fix visibility
2026-01-17 11:37:27 -08:00
Sintendo
1e0473e44f Fix various typos and spelling mistakes 2026-01-17 20:11:38 +01:00
Jordan Woyak
5162608df9 Revert "Externals: Update zlib-ng to v2.3.2"
This reverts commit 34b402b631.
2026-01-11 20:29:05 -06:00
Jordan Woyak
dc8f2995ef
Merge pull request #14273 from JosJuice/x64-oparg-padding
Jit64: Make OpArg and TrampolineInfo smaller
2026-01-11 16:14:50 -06:00
JMC47
28a8fa5de6
Merge pull request #14229 from JoshuaVandaele/zlib-ng
Externals: Update zlib-ng to v2.3.2
2026-01-11 16:03:18 -05:00
JosJuice
c54dc9db60 JitRegister: Check IsEnabled before constructing string
Without this, every time we finalize a JIT block, we have to allocate
memory for a string and format the string.
2026-01-11 21:01:49 +01:00
JosJuice
283218bc29 x64Emitter: Reduce padding in OpArg
By moving members of the OpArg struct around, we can cut down on how
much padding the struct needs. Now it has a size of 16 bytes, small
enough for function calls to pass it in two registers instead of on the
stack.
2026-01-11 19:07:08 +01:00
Joshua Vandaële
55f0715ad4
c++23: Replace Common::ToUnderlying with std::to_underlying
Requires at least GCC 11, Clang 13, MSVC 19.30 (VS2022 17.0), or AppleClang 13.1.6 (XCode 13.3).
2026-01-09 23:49:10 +01:00
Craig Carnell
e4f6d9bad4 mingw: move ReadValue instantiations in cpp for compatibility 2026-01-04 21:16:30 +00:00
iwubcode
c9ef05c4b3 Common: update Flags to allow const object usage
Co-authored-by: Jordan Woyak <jordan.woyak@gmail.com>
2025-12-25 21:07:45 -06:00
Joshua Vandaële
34b402b631
Externals: Update zlib-ng to v2.3.2 2025-12-24 11:44:37 +01:00
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
Tillmann Karras
c52dd23c58 GekkoDisassembler: drop unsupported opcodes 2025-12-12 01:37:19 +00:00
Tillmann Karras
df7caeab3f GekkoDisassembler: fix ps_sel operands 2025-12-12 01:14:16 +00:00
Tillmann Karras
1c157d1fc8 GekkoDisassembler: fix conditional twi opcode 2025-12-12 01:14:09 +00:00
Joshua Vandaële
43564d4130
CMake: Only copy build_info.txt if autoupdate is enabled 2025-12-11 04:23:04 +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