Commit Graph

38022 Commits

Author SHA1 Message Date
Jordan Woyak
1a71f0fa2e SDIO: Remove file "good" checks so errors are properly produced. 2025-11-19 21:05:57 -06:00
Naim2000
f1f8b0a825 SDIO: the CID/CSD are sent a bit differently 2025-11-19 21:05:54 -06:00
Naim2000
227c4e0515 SDIO: report actual error if writes are disabled 2025-11-19 20:11:05 -06:00
Naim2000
2e340ab160 SDIO: report write lock status 2025-11-19 18:58:13 -06:00
Jordan Woyak
2acb49544c
Merge pull request #13539 from tygyh/DiscIO-Remove-redundant-casts
DiscIO: Remove redundant casts
2025-11-19 17:40:42 -06:00
Jordan Woyak
41b6ab40e1
Merge pull request #13619 from y21/usbv5_getversion_size
Check buffer out/size in HID_USBv5/USB_VEN GetVersion Ioctl
2025-11-19 17:32:33 -06:00
Jordan Woyak
2d7ebe46e3
Merge pull request #14111 from Simonx22/android/native-library-kotlin
Android: Convert NativeLibrary to Kotlin
2025-11-19 15:27:41 -06:00
Jordan Woyak
d0341b3bfc
Merge pull request #14127 from jordan-woyak/movie-cpu-thread-guard
Movie: Replace a blocking RunOnCPUThread call with a CPUThreadGuard.
2025-11-19 13:43:05 -06:00
LillyJadeKatrin
ddced1a070 RetroAchievements - Android login callback
Modify the RetroAchievements login code in Android to pass in a callback, pop a message if login fails, close the login box if it succeeds.
2025-11-18 20:40:15 -05: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
5a6fce31b2 DolphinQt/QtUtils: Simplify RunOnObject and eliminate Common::Event race. 2025-11-18 14:19:21 -06: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
bd07d9dfd3
Merge pull request #14136 from Simonx22/android/compress-callback-kotlin
Android: Convert CompressCallback to Kotlin
2025-11-18 14:15:12 -06:00
JosJuice
9cc4d1b835
Merge pull request #13748 from Dentomologist/autoupdatechecker_delete_old_updater_log_file
AutoUpdateChecker: Delete old Updater.log file
2025-11-18 18:12:47 +01:00
JosJuice
48d9a04383
Merge pull request #14132 from JosJuice/jitarm64-bindtoregister-getimm
JitArm64: Call GetImm before BindToRegister in subfcx
2025-11-18 17:53:13 +01:00
Simonx22
d83c7c1a70 Android: Update Kotlin serialization plugin
I forgot to update this, which broke installing GPU drivers

Co-Authored-By: OatmealDome <OatmealDome@users.noreply.github.com>
2025-11-17 23:56:39 -05:00
Simonx22
0f7ee5b40f Android: Convert CompressCallback to Kotlin 2025-11-17 22:44:50 -05:00
Jordan Woyak
1514c0f256 Bluetooth/RealtekFirmwareLoader: Add Mercusys MA530 to list. 2025-11-17 19:31:59 -06:00
Jordan Woyak
27f5c91624
Merge pull request #14131 from Simonx22/android/stereo-float-settings
Android: Convert stereo settings to floats
2025-11-17 15:45:24 -06:00
Simonx22
123b242e9b Android: Convert BooleanSupplier to Kotlin 2025-11-17 15:31:30 -05:00
Simonx22
a3e7a47ded Android: Convert stereo settings to floats to match C++ definitions
These settings were recently changed with 113c86f1b4 to be floats instead of ints.

This commit also changes the Android UI to use the direct convergence value instead of the percentage to match the Qt UI.
2025-11-17 15:01:00 -05:00
JosJuice
0d22dc0392
Merge pull request #14106 from Simonx22/android/dependency-updates-11102544758
Android: Update dependencies
2025-11-17 20:29:21 +01:00
JosJuice
f966c55e0c
Merge pull request #14097 from Simonx22/android/network-helper-kotlin
Android: Convert NetworkHelper to Kotlin
2025-11-17 20:28:20 +01:00
JosJuice
49e9cd42d4 JitArm64: Call GetImm before BindToRegister in subfcx
When BindToRegister is called, the register cache marks the relevant
guest register as no longer containing an immediate. However, subfcx was
calling GetImm after BindToRegister. This led to a lot of panic alerts
after 2995aa5be4 added an assert to GetImm to check that the passed-in
register is an immediate.

Both before and after 2995aa5be4, the actual value of the immediate
wasn't overwritten by BindForRegister, only the fact that the register
is an immediate. Because of this, the emitted code happened to work
correctly.
2025-11-17 20:00:36 +01:00
Jordan Woyak
6380ad6abb Movie: Replace a blocking RunOnCPUThread call with a CPUThreadGuard. 2025-11-17 11:57:43 -06:00
LillyJadeKatrin
1e0f6a557e Android Achievements - Hardcore disables
Disables state loading and emulation speeds below 100% when RetroAchievements hardcore mode is enabled.
2025-11-16 22:05:54 -05:00
LillyJadeKatrin
f4f26a26d2 Add login to achievement settings 2025-11-16 22:05:54 -05:00
LillyJadeKatrin
98678e9a8b AchievementManager - Add Android to user agent
If the build is an Android build, identify it as such in the AchievementManager user agent so that android builds can be tracked separately for debug purposes.
2025-11-16 22:05:53 -05:00
LillyJadeKatrin
b662cd93ce Add Achievements submenu to Android settings 2025-11-16 22:05:53 -05:00
JosJuice
56532c850f
Merge pull request #14023 from JosJuice/android-overlay-ok
Android: Treat EmulationActivity dialog dismiss the same as OK
2025-11-16 18:36:08 +01:00
JosJuice
b6e062f2e3
Merge pull request #13689 from JosJuice/lock-core-any-thread
Core: Let any thread call previously host-thread-only functions
2025-11-16 18:35:17 +01:00
JosJuice
3ff4985120
Merge pull request #12134 from JosJuice/jit-constprop
Jit: Extract immediate handling to separate ConstantPropagation class
2025-11-16 18:34:49 +01:00
Simonx22
3fcc0427c9 Android: Convert NativeLibrary to Kotlin 2025-11-16 10:26:09 -05:00
JosJuice
41ab5c0ead Android: Ship Sys/Resources/
We were previously excluding this folder from Android builds because it
didn't contain any files that were used on Android. However, we now have
an OSD font file that we do want to use on Android, and there's also a
few PNG files that will be needed by the RetroAchievements integration.

In terms of file size, this is what gets added:

OSD font: 48.1 KiB
RetroAchievements graphics: 3.5 KiB
Unused graphics: 116.8 KiB

We're still excluding Sys/Themes/, which is 1.1 MiB and entirely unused.
2025-11-16 15:33:22 +01:00
JosJuice
91c3a58889
Merge pull request #13922 from TryTwo/imgui_add_default_font
OSD/Imgui: Add a better default font
2025-11-16 13:58:18 +01:00
JosJuice
e0f52e5799
Merge pull request #14104 from Simonx22/android/remove-extract-native-libs
Android: Remove deprecated extractNativeLibs manifest flag
2025-11-16 12:10:16 +01:00
JosJuice
b9d9f36ce5 JitArm64: Replace dirty flag and partially replace RegType enum
Like Jit64, JitArm64 now keeps track of the location of a guest register
using three booleans: Whether it is in ppcState, whether it is in a host
register, and whether it is a known immediate. The RegType enum remains
only for the purpose of keeping track of what format FPRs are stored in
in host registers.
2025-11-16 09:52:09 +01:00
JosJuice
2995aa5be4 JitArm64: Don't store immediate values in register cache
Like the previous commit did for Jit64, JitArm64 can now handle the
combination of a value simultaneously being in a host register and being
a known immediate.

Unlike with Jit64, I've put the codegen-affecting changes in this commit
and the move away from the RegType enum in a follow-up commit. This is
in part because the design of JitArm64 made it easy to implement the
codegen-affecting changes without combining it with a big bang
refactorization, and in part because we need to keep RegType around for
keeping track of different float formats in Arm64FPRCache, complicating
the refactorization a bit.
2025-11-16 09:52:09 +01:00
JosJuice
817bb9d94c Jit64: Don't store immediate values in register cache
They're now stored in ConstantPropagation instead.

I've also removed the LocationType enum. The location of each guest
register is now tracked using three booleans: Whether it is in ppcState,
whether it is in a host register, and whether it is a known immediate.
The first two of these booleans are stored in the register cache, and
the last one is stored in ConstantPropagation. This new model allows us
to handle the combination of a value simultaneously being in a host
register and being a known immediate. It also keeps track of which
registers are dirty, which was previously kept track of in X64CachedReg.

The old model maps to the new model as follows:

                                default    host_reg    immediate

Default                         true       false       false
Discarded                       false      false       false
Bound                           (!dirty)   true        false
Immediate                       false      false       true
SpeculativeImmediate            true       false       true
[previously unrepresentable]    (!dirty)   true        true
2025-11-16 09:52:09 +01:00
JosJuice
4114a0b506 Jit: Update constant propagation during instruction
This commit makes the JIT set/clear the individual registers of
ConstantPropagation immediately instead of at the end of the
instruction. This is needed to prevent Jit64::ComputeRC, which reads
from a register written to earlier during the same instruction, from
reading back stale register values from ConstantPropagation in the next
commit.
2025-11-16 09:52:07 +01:00
JosJuice
502b48a690 JitArm64: Make FlushRegisters unlock condition more robust
To find out whether a host register needs to be unlocked, FlushRegisters
checks if the guest register is known to be a zero immediate. This works
right now, but it will stop working correctly once we gain the ability
to have a guest register be a known immediate and be in a host register
at the same time, because a register that's known to be a zero immediate
may have had a host register allocated prior to the call to
FlushRegisters. Instead, we should check whether the register is
RegType::Register after we're done calling BindForRead.
2025-11-16 09:50:31 +01:00
JosJuice
7065b93ba5 JitArm64: Pass index to more Arm64GPRCache functions
This refactorization is needed for upcoming commits.
2025-11-16 09:50:31 +01:00
JosJuice
502317a485 Jit: Move rlwimix to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
bac911aac4 Jit: Move srawx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
c136fd9807 Jit: Move srwx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
bb645e6cbb Jit: Move slwx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
45760841b2 Jit: Move divwx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
fc6c278007 Jit: Move divwux to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
c7d8a0b276 Jit: Move subfic to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
204a8fbd53 Jit: Move subfx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
2134991be8 Jit: Move multiplication by 0 optimization to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
7456ba3d3d Jit: Move mullwx, mulhwx, mulhwux to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
b469981c72 Jit: Move mulli to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
1eea610375 Jit: Move addicx to ConstantPropagation
Note: Jit64 didn't support immediate handling for addic before.
2025-11-16 09:50:31 +01:00
JosJuice
a3797778ff Jit: Move srawix to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
1a22bda0a7 Jit: Move rlwinmx and rlwnmx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
4c8995fae5 Jit: Move negx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
92a5a46b2c Jit: Move cntlzwx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
b506cb2ad8 Jit: Move extsXx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
f04417eb5a Jit: Move addx to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
77b46c30ad Jit: Move boolX to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
3a6eea74dd Jit: Move addix to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
20332f441b Jit: Move reg_imm to ConstantPropagation 2025-11-16 09:50:31 +01:00
JosJuice
f9601dc38c Jit: Extract immediate handling to separate ConstantPropagation class
Restructuring things in this way brings two immediate benefits:

* Code is deduplicated between Jit64 and JitArm64.
* Materializing an immediate value in a register no longer results in us
  forgetting what the immediate value was.

As a more long-term benefit, this lets us also run constant propagation
as part of PPCAnalyst, which could let us do cool stuff in the future
like statically determining whether a conditional branch will be taken.
But I have nothing concrete planned for that right now.
2025-11-16 09:50:31 +01:00
JosJuice
e8060bd169 JitArm64: Add function for setting constant overflow 2025-11-16 09:50:30 +01:00
JosJuice
2dead5009b Jit64: Extract handling of immediate Rc 2025-11-16 09:50:30 +01:00
JosJuice
060f792560 Android: Rate limit refreshInputOverlay calls from sliders
Sliders can trigger change listeners very rapidly, so let's add some
rate limiting so dragging a slider doesn't cause the whole UI to lag.
(Now the input overlay looks laggy when dragging a slider, though.)
2025-11-16 09:49:08 +01:00
JosJuice
a026a0d5e4 Android: Treat EmulationActivity dialog dismiss the same as OK
In the dialog where you can choose what controller the input overlay
should be controlling, there's an OK button. If you change controller
but don't press OK, your selection will be saved, but the input overlay
won't refresh to show the new controller unless you perform some other
action that would cause it to refresh. This is not good UX.

This commit changes the behavior not only of this dialog but also other
dialogs spawned by EmulationActivity so that everything is properly
updated when dismissing a dialog, as if you had pressed OK.
2025-11-16 09:46:00 +01:00
JosJuice
b74c3faa48
Merge pull request #13992 from JosJuice/android-register-for-activity-result
Android: Replace deprecated startActivityForResult
2025-11-16 09:43:04 +01: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
e630b0692e VideoCommon/FramebufferManager: Silence warning:
warning: virtual method '~FramebufferManager' is inside a 'final' class and can never be overridden [-Wunnecessary-virtual-specifier]
2025-11-15 20:32:10 -06:00
Jordan Woyak
a3b1445e04 HW/SI: Adjust logging verbosity in RunSIBuffer and minor cleanups. 2025-11-15 16:09:29 -06:00
Jordan Woyak
cd45dcea94 HW/SI: Fix CMD_STATUS response lengths. They are supposed to be 3, not 4. 2025-11-15 16:09:29 -06:00
JosJuice
0fdf1cc386
Merge pull request #14112 from Simonx22/android/remove-unused-bimap-class
Android: Remove unused BiMap class
2025-11-15 16:22:17 +01:00
JosJuice
999e13b3b3
Merge pull request #14109 from OatmealDome/analytics-deadlock
DolphinAnalytics: Only call ReloadConfig in config changed callback when analytics enabled value changes
2025-11-15 14:44:54 +01:00
JosJuice
f823a06814
Merge pull request #14105 from cscd98/achievement-bugfix
Fix cheats always enabled without USE_RETRO_ACHIEVEMENTS
2025-11-15 14:44:16 +01:00
cristian64
71e15c2875 DolphinQt: Add Fusion-based styles.
Fusion is one of the built-in styles that Qt ships with, and that is
generally supported in all platforms and handles custom color palettes
properly.

The color palettes have been borrowed from the Dolphin Memory Engine
buddy application.

The new styles are:

- **Fusion Light**
- **Fusion Dark Gray**
- **Fusion Dark**

A demo of each style on Windows:

| System | Light | Dark | Fusion Light | Fusion Dark Gray | Fusion Dark |
| ------ | ----- | ---- | ------------ | ---------------- | ----------- |
| <img width="1920" height="1080" alt="Dolphin Emulator  System style" src="https://github.com/user-attachments/assets/7f55a19d-d9a1-43d1-a435-1e1d5b29abe2" /> | <img width="1920" height="1080" alt="Dolphin Emulator  Light style" src="https://github.com/user-attachments/assets/4c70f2f9-16b8-4777-b72b-55b2dffcd1e4" /> | <img width="1920" height="1080" alt="Dolphin Emulator  Dark style" src="https://github.com/user-attachments/assets/5e669477-d2a5-4d19-b2c5-a2ed9bb1e6fe" /> | <img width="1920" height="1080" alt="Dolphin Emulator  Light Fusion style" src="https://github.com/user-attachments/assets/b1f95c47-0691-4809-bd74-99e913c17684" /> | <img width="1920" height="1080" alt="Dolphin Emulator  Dark Gray Fusion style" src="https://github.com/user-attachments/assets/c9d30aa3-f941-4fc5-806f-d3fbd2cae0cc" /> | <img width="1920" height="1080" alt="Dolphin Emulator  Dark Fusion style" src="https://github.com/user-attachments/assets/123d2125-e126-4e8c-aa42-793ded8ffacc" /> |

> [!NOTE]
> Notice that the **Light** and **Dark** styles remain available only on
> Windows due to limitations on how styles in the various platforms
> handle (or mishandle) custom color palettes.

> [!IMPORTANT]
> Due to [`KDE-511547`](https://bugs.kde.org/show_bug.cgi?id=511547),
> after having used Breeze (default style in Plasma systems), top tool
> bars in tools areas will lose their correct background color; a
> restart will be required in order to get the updated color in the main
> window.
>
> UPDATE: The issue has been fixed upstream and should be available in
> KDE Plama 6.5.3 and newer.
2025-11-14 19:21:58 +00:00
cristian64
ff9b8c4b9c DolphinQt: Define tool tip padding as factor of font size. 2025-11-14 19:12:02 +00:00
Jordan Woyak
6d5e8b9ed8 Externals: Update mGBA to latest master.
Co-authored-by: Joshua Vandaële <joshua@vandaele.software>
2025-11-13 17:03:31 -06:00
Jordan Woyak
c08fda96ca
Merge pull request #14100 from AndrewGDX/master
Improved stereoscopic 3D settings
2025-11-12 16:43:21 -06:00
Simonx22
d1526157df Android: Remove unused BiMap class 2025-11-12 17:26:05 -05:00
Simonx22
cd0e40ba97 Android: Update Gradle Wrapper 2025-11-12 08:13:30 -05:00
AndrewGDX
113c86f1b4 Improved stereoscopic 3D settings 2025-11-12 12:29:03 +03:00
Craig Carnell
f1fb550bf1 Fix cheats always enabled without USE_RETRO_ACHIEVEMENTS 2025-11-12 08:33:49 +00:00
OatmealDome
df5f351add
DolphinAnalytics: Only call ReloadConfig in config changed callback when analytics enabled value changes
Co-authored-by: Simonx22 <simon@oatmealdome.me>
2025-11-12 00:09:41 -05:00
Jordan Woyak
bf61c890ca VideoCommon/PerformanceMetrics: Display current offset between the latest frame presentation time and the intended presentation time in the "Show Frame Times" box. 2025-11-11 20:01:52 -06:00
Jordan Woyak
c2a1dce246 VideoCommon: Add "Smooth Early Presentation" setting to improve frame pacing with ImmediateXFB and/or RushFramePresentation. 2025-11-11 20:01:52 -06:00
Jordan Woyak
cc331feb02 VideoCommon: Make Presenter aware of the next swap time to eliminate unsafe usage of GetTicks() with ImmediateXFB + DualCore. 2025-11-11 20:01:52 -06:00
Jordan Woyak
d4f68cb164 HW/VideoInterface: Selectively throttle on "VBlank" based on "Immediate XFB" being enabled. 2025-11-11 20:01:52 -06:00
Jordan Woyak
16260040e0 CoreTiming: Add "Rush Frame Presentation" setting to throttle only once after each presentation for lower input latency. 2025-11-11 20:01:52 -06:00
JMC47
8495e01668
Merge pull request #14096 from jordan-woyak/state-changed-hookable-event
Core: Make AddOnStateChangedCallback use HookableEvent.
2025-11-11 20:58:45 -05:00
JMC47
f63796c480
Merge pull request #14071 from iwubcode/avoid_config_framebuffer_manager
VideoCommon: pass the EFB buffer scale into the FramebufferManager
2025-11-11 20:58:35 -05:00
JMC47
b8236d4662
Merge pull request #14070 from VampireFlower/master
Debugger: Ignore bctr when stepping out
2025-11-11 20:57:45 -05:00
JMC47
c44ea1389a
Merge pull request #13236 from JosJuice/jit-set-msr-on-fallback
Call JitInterface::UpdateMembase from PowerPC::MSRUpdated
2025-11-11 20:55:24 -05:00
JMC47
099ea79c43
Merge pull request #14098 from Simonx22/android/dolphin-application-kotlin
Android: Convert DolphinApplication to Kotlin
2025-11-11 16:58:27 -05:00
Simonx22
220315737f Android: Update dependencies
Note: This also updates Kotlin to 2.2.21 which requires small adjustments in our Kotlin code.
2025-11-11 16:48:12 -05:00
Simonx22
cdc21490e4 Android: Convert NetworkHelper to Kotlin 2025-11-11 15:58:07 -05:00
Jordan Woyak
731849c239
Merge pull request #14103 from Simonx22/android/agp-8.11.0-to-8.13.0
Android: Upgrade AGP dependency from 8.11.0 to 8.13.0
2025-11-11 14:33:05 -06:00