Commit Graph

44796 Commits

Author SHA1 Message Date
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
Jordan Woyak
991ba0e09f
Merge pull request #14124 from JosJuice/android-dont-delete-resources
Android: Ship Sys/Resources/
2025-11-16 11:14:06 -06: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