Commit Graph

34955 Commits

Author SHA1 Message Date
Admiral H. Curtiss fff538e563
Core/Boot: Check bounds in Load_BS2(). 2023-12-05 22:34:35 +01:00
LillyJadeKatrin 2bf6ebcb90 Added achievement hash to non-disc boot paths. 2023-12-05 16:17:18 -05:00
LillyJadeKatrin ebf2ef1d82 Refactored hash process to check prior game ID
If the new game ID is a different title than the previous game ID, the achievement manager is compromised.
2023-12-05 16:17:18 -05:00
LillyJadeKatrin c8d8ca2ff7 Added Disabled flag to Achievement Manager
The Disabled state sits between Game Closed and completely Shutdown - stronger than the former, as it refuses to let a game be opened again until AchievementManager is restored (which only happens upon a fresh core boot) but it isn't completely shut down and will still allow the player to be logged in and access the achievement settings and their (global) achievement header.
2023-12-05 16:17:17 -05:00
LillyJadeKatrin 148c2f3c0d Refactored AchievementManager hash code to take a volume.
This change splits LoadGameAsync into three methods: two HashGame methods to accept either a string filepath or a volume, and a common LoadGameSync that both HashGames call to actually process the code. In the process, some minor cleanup, and the hash resolution now takes place on the work queue asynchronously.
2023-12-05 16:17:11 -05:00
Mai a65246ec3f
Merge pull request #11988 from JosJuice/jit-feature-flags
Jit: Replace "msrBits" with "featureFlags" and use for performance monitor
2023-12-05 03:13:50 -05:00
Mai 2199dd26bb
Merge pull request #12345 from minhaferzz/startup-handler
Android: Fix issue when launching a game when Dolphin is not open
2023-12-05 03:10:41 -05:00
Mai 6e6695c24b
Merge pull request #11904 from LillyJadeKatrin/retroachievements-hardcore-v2
RetroAchievements - Hardcore Mode (V2)
2023-12-05 01:31:54 -05:00
Tilka 7dfea144b9
Merge pull request #12324 from Pokechu22/vertex-loader-dummy-tex-coords
VertexLoader: Fixes and cleanup related to skipped components
2023-12-04 13:06:19 +00:00
Pokechu22 1c62ebc9fb Use ExtensionNumber in Movie.cpp 2023-12-03 11:36:54 -08:00
JosJuice 8368a397ee JitArm64: Flush in the middle of lmw/stmw/mfcr
Normally we only flush registers right at the end of each PPC
instruction. However, for PPC instructions that use a lot of registers
one at a time, it's beneficial to do this flushing work in the middle
of the instruction instead, reducing the risk of register starvation
and improving pipelining.
2023-12-03 18:42:42 +01:00
Mai 27be8c087e
Merge pull request #12295 from sepalani/arp-check
BBA/HLE: Fix GC homebrew if_config not working
2023-12-03 11:26:00 -05:00
Mai 98eda4dc9f
Merge pull request #12351 from TryTwo/bugfix_data_symbols
PPCSymbolDB. Bugfix. Fix .data symbols not loading
2023-12-03 11:17:44 -05:00
JosJuice 05864ceddd PPCAnalyst: Clear crInUse on HLE
This should have been done when rebasing 6cc4f593e5 after the merge of
3a00ff625e. There are no correctness implications as far as I know,
only very minor performance implications.
2023-12-03 14:20:45 +01:00
TryTwo 92532c8d3a PPCSymbolDB. Bugfix. Fix .data symbols not loading, unless they were aligned to 4 bytes.
.data symbols point to memory values and can be any byte or length of bytes (such as a string).
2023-12-03 00:03:28 -07:00
Pokechu22 69cf8b3470 VertexLoader: Use Common::SmallVector 2023-12-02 15:54:52 -08:00
Pokechu22 4116344785 VertexLoader: Remove unnecessary calls to VertexLoader_TextCoord::GetDummyFunction 2023-12-02 15:54:52 -08:00
Pokechu22 36796abc08 VertexLoader: Fix wrong array being used if color 1 is present but color 0 isn't
This worked correctly on the JIT vertex loaders, and for the equivalent case with texture coordinates. I'm not aware of any games this affects (but libogc does mention a semi-related scenario at 6bc0317c7d/gc/ogc/gx.h (L1855-L1857).)
2023-12-02 15:54:52 -08:00
Pokechu22 1ee6824324 VertexLoaderTest: Add test for skipped texture coordinates
Jimmie Johnson's Anything with an Engine is known to use texture coordinate 7 (and only texture coordinate 7) in some cases. There are a lot of possible edge-cases, so this test brute-forces all combinations with coordinates 0, 1, and 2.
2023-12-02 15:54:52 -08:00
Pokechu22 530590d162 VertexLoaderTest: Add test for skipped colors
This test fails with the non-JIT vertex loader due to an issue fixed in a later commit in this PR. (Note that the non-JIT vertex loader is only used on machines where no JIT is available or if COMPARE_VERTEXLOADERS is enabled in VertexLoaderBase.cpp.)
2023-12-02 15:53:59 -08:00
Mai 4f3f208fe4
Merge pull request #12348 from JosJuice/jitarm64-imm-msr-fastmem
JitArm64: Fix updating MEM_REG with imm MSR without fastmem
2023-12-02 17:53:28 -05:00
LillyJadeKatrin 2cb14edafa Add Hardcore switch to Achievement Settings dialog
This adds the actual switch to turn on Hardcore Mode to the settings tab of the Achievements dialog. It is accompanied by a large tooltip warning explaining what it does and when it can be enabled.
The switch is only enabled to be turned on when no game is running, so that games are started in hardcore mode and can only be loaded via the console's memory card, as in the original hardware. Hardcore may be turned off while a game is running, but cannot be turned back on until the game is disabled.
The toggle trigger for hardcore mode also automatically disables the settings that are not allowed during hardcore mode.
Finally, the original flag in AchievementSettingsWidget to set whether things are enabled in hardcore mode (primarily Leaderboards) is replaced with the actual Hardcore Mode setting.
2023-12-02 16:41:17 -05:00
LillyJadeKatrin 6f7e02e201 Disable TAS recording playback in hardcore mode
Play Input Recording would potentially unlock achievements without any player input and needs to be disabled. If a recording is already playing, hardcore mode cannot be enabled.
2023-12-02 16:41:17 -05:00
LillyJadeKatrin 3aebbbb3e7 Disable cheats in hardcore mode
RetroAchievements does not allow cheats such as Action Replay or Gecko in hardcore mode, for fairness.
2023-12-02 16:41:17 -05:00
LillyJadeKatrin 0abfa94bc8 Disable Freelook in hardcore mode
The player getting a better view of their surroundings than the game would normally allow could possibly give the player an advantage over the original hardware, so Freelook is disabled in hardcore mode. To do this, I disable the config flag for Freelook when it is accessed, to make sure that it is disabled whether it was enabled before or after hardcore mode was enabled.
2023-12-02 16:41:16 -05:00
LillyJadeKatrin 1a19a92943 Disable memory patches in hardcore mode
Memory patches would be an easy way to manipulate the memory needed to calculate achievement logic, so they must be disabled. Riivolution patches that do not affect memory are allowed, as they will be hashed with the game file.
2023-12-02 16:41:16 -05:00
LillyJadeKatrin cb2fa9a1f2 Disable Debug Mode in hardcore mode
Debug Mode gives players direct read and write access to memory, which could be used to completely manipulate RetroAchievements logic and therefore is not allowed in hardcore mode.
2023-12-02 16:41:16 -05:00
LillyJadeKatrin c20258d782 Disable slowdown in hardcore mode
Slowing down the emulator would artificially improve reaction times and is therefore disallowed in hardcore mode. Speeds faster than 1x are allowed, but any speed below 1x is scaled back up to 1x.
2023-12-02 16:41:16 -05:00
LillyJadeKatrin 45105822f3 Disable frame advance in hardcore mode
Frame advancing is easily exploitable for slowing down a game and artificially improving reaction times and is not allowed in RetroAchievements hardcore mode.
2023-12-02 16:41:16 -05:00
LillyJadeKatrin 2c40d6ba31 Disable loading state in hardcore mode
While saving states is allowed (especially for the purpose of debugging), RetroAchievements does not allow loading saved states when hardcore mode is on.
2023-12-02 16:41:15 -05:00
LillyJadeKatrin 71f3039f96 Added Hardcore Warning Widget
This widget will be used in several places to notify the player that a feature has been disabled because hardcore mode is on. It includes a button to open the Achievement Settings so that Hardcore Mode may be turned off. Also included is the framework required to open AchievementsWindow specifically on the Settings tab.
2023-12-02 16:41:15 -05:00
LillyJadeKatrin 138e68ef9f Added Hardcore flag to Achievement Settings
Hardcore Mode is a RetroAchievements feature for enabling as close to original hardware as possible, to keep a fair, challenging, and competitive playing field for achievements (which get tallied differently and emphasized more in hardcore) and leaderboards (where it is mandatory) at the cost of several common emulator features that provide advantages, such as state loading and slower emulation speeds.
This commit just adds the flag to the AchievementSettings, with more to come.
2023-12-02 16:41:15 -05:00
JosJuice 253afee315 JitArm64: Fix updating MEM_REG with imm MSR without fastmem
Dolphin would crash when running with a fastmem arena but without
fastmem. This regression was caused by merging 9192128c50 without
adapting it after the merge of 0606433404.
2023-12-02 17:26:33 +01:00
Admiral H. Curtiss 85f4a460f9
Merge pull request #12184 from noahpistilli/kd-mail-send
IOS/KD: Implement Send Mail
2023-12-02 17:15:56 +01:00
Admiral H. Curtiss a753022aa7
Merge pull request #12344 from noahpistilli/kd-download-time-fix
IOS/KD: Set download span if download task not found
2023-12-02 17:13:45 +01:00
Sketch e07087e43c IOS/KD: Set download span if download task not found 2023-12-01 23:15:27 -05:00
Minh Truong 4b91bf48f5 Finish parent activity after directory initializer completes
Add frontIntent flag to control activity.finish()

Moved parent activity finish inside of performLaunchChecks
2023-12-01 15:12:10 -06:00
JosJuice b1987d0187 JitArm64: Use ADDI2R for psq_lXX/psq_stXX immediate offsets
This simplifies the source code, and slightly improves the emitted code
in some cases.
2023-12-01 21:31:11 +01:00
JosJuice 67791d227c JitArm64: Add special zero case to ADDI2R
This normally doesn't reduce the instruction count, but is nonetheless
useful on CPUs that can do 0-cycle moves.
2023-12-01 21:31:11 +01:00
JosJuice 25ffb0dbfc JitArm64: Mask input to 32-bit ADDI2R
In case the input was a s32 that got sign extended as part of conversion
to u64.
2023-12-01 21:26:37 +01:00
Sketch b46fcf9032
IOS/KD: Implement Send Mail 2023-12-01 19:55:32 +01:00
Sketch 2c3d05423d
IOS/KD/VFF: Implement reading from VFF 2023-12-01 19:53:01 +01:00
Sketch 0d908a83e7
Common/HTTP: Implement Multiform 2023-12-01 19:52:21 +01:00
Mai 5f7e9d3bf1
Merge pull request #12320 from JosJuice/jitarm64-mmu-order
PowerPC: Unify "FromJit" MMU functions
2023-11-30 18:34:32 -05:00
Mai d85cb749c0
Merge pull request #11382 from skyfloogle/traversal-fix-2
Traversal: Use low TTL for probe packet
2023-11-30 18:03:50 -05:00
Mai d67f54b175
Merge pull request #12186 from TellowKrinkle/MultiTextureComputeMetal
VideoBackends:Metal: Support multiple compute textures
2023-11-30 17:46:02 -05:00
JosJuice 94b31eb4f4 Jit: Replace MSR/MMCR access with feature_flags access
This has the same effect in the end, but in my opinion, doing it this
way makes it more clear for the reader why we can read from ppcState at
JIT time, something that makes no sense for everything else in ppcState.
2023-11-30 22:40:36 +01:00
JosJuice 62787085e1 Jit: Add feature flag for performance monitor
By making the JIT cache check if the current state of MMCR0 and MMRC1
matches the state they had at the time the JIT block was compiled, we
solve a correctness issue (marked in a comment as a speed hack).

Not known to affect any games.
2023-11-30 22:40:36 +01:00
JosJuice ca7e05bbc4 Jit: Replace "msrBits" with "featureFlags"
Preparation for the next commit.
2023-11-30 22:40:32 +01:00
JosJuice 4b50a38cf6 JitArm64: Fix JitAsm without entry points map
This must have broken in a rebase of one of my recently merged PRs.

Dolphin still worked correctly with this bug, for two reasons:

1. Most AArch64 users are not on Windows, and therefore normally do have
   the entry points map.
2. When the bug was triggered, Dolphin would fall back to the slower
   path rather than crashing.
2023-11-30 20:11:02 +01:00
TellowKrinkle 394dd02d0a VideoBackends:Metal: Support multiple compute textures 2023-11-29 18:45:11 -06:00
TellowKrinkle a399dc43a1 VideoBackends:Metal: Align utility uniform sizes
Prevents complaining from validation layers
2023-11-29 18:45:11 -06:00
Mai 89963c287c
Merge pull request #11958 from JosJuice/jitarm64-dispatcher-microopt
JitArm64: Dispatcher optimizations
2023-11-29 16:54:09 -05:00
JosJuice bddcf60673 PPCAnalyst: Don't discard CR before gather pipe interrupt check
This fixes a frequently occurring JitArm64 assert caused by merging
6cc4f593e5 without adapting it to the changes made in 5902b5b113.
2023-11-29 21:53:13 +01:00
JosJuice 06c7862160 JitArm64: Rearrange dispatcher instructions to improve scheduling
Loads can take a little while to complete.
2023-11-29 19:13:09 +01:00
JosJuice 9e970bcb30 JitArm64: Optiming shifting and masking PC in slow dispatcher
Instead of shifting left by 1, we can first shift right by 2 and then
left by 3. This is both faster and smaller, because we get the right
shift for free with the masking and the left shift for free with the
address calculation. It also happens to match the pseudocode more
closely, which is always nice for readability.
2023-11-29 19:13:09 +01:00
JosJuice c9347a2a19 JitArm64: Use LDP in slow dispatcher
With one LDP instruction, we can replace two LDR instructions.
2023-11-29 19:13:09 +01:00
JosJuice 4a4e7d9b8a Jit: Swap locations of effectiveAddress and msrBits
This slightly improves instruction-level parallelism in Jit64's slow
dispatcher by shifting the PC left instead of the MSR.

In the past, this also enabled an optimization in JitArm64's fast path
where we could use LDP to load normalEntry and msrBits in one
instruction, but this was superseded by fd9c970.
2023-11-29 19:13:09 +01:00
JosJuice 3df09f349d JitArm64: Prefer X8 and up for temporary registers in JitAsm
Just to make the code easier to understand at a glance. I especially
found it a bit annoying to reason about whether callee-saved registers
like W28 were being used because we needed a callee-saved register or
just for no reason in particular.

X8 and up is what compilers normally use when they're not register
starved.
2023-11-29 19:13:03 +01:00
Mai 0a62b30cd4
Merge pull request #11906 from noahpistilli/request-register-user-id
IOS/KD: Implement Request Register User ID
2023-11-29 03:31:59 -05:00
Mai 02de58eb2c
Merge pull request #12337 from Tilka/imm16
Jit64: fix invalid instruction encoding
2023-11-29 01:10:22 -05:00
Tillmann Karras f6131e9703 Jit64: fix invalid instruction encoding
This is a recent regression introduced in
c70dcf99dd.
2023-11-29 05:49:02 +00:00
Mai a7216a3035
Merge pull request #9857 from JosJuice/jitarm64-cr-analysis
PPCAnalyst: Allow more reordering of CR operations
2023-11-28 21:01:07 -05:00
Sketch f2607cdd74 IOS/KD: Implement Request Register User ID 2023-11-28 20:40:15 -05:00
Mai b7435be90a
Merge pull request #12298 from Shoegzer/master
Update default IP for HLE BBA
2023-11-28 22:45:17 +01:00
Mai d095bddbe7
Merge pull request #12141 from JosJuice/jit-blr-msr
Jit: Check MSR state in BLR optimization
2023-11-28 22:35:35 +01:00
JosJuice fc95d59805 JitArm64: Further optimize NaN handling in ps_sumX
So short that using farcode is pointless!
2023-11-28 21:45:44 +01:00
JosJuice 8274dcbfe4 JitArm64: Skip checking last input for NaN for non-SIMD operations
AArch64's handling of NaNs in arithmetic instructions matches PowerPC's
as long as no more than one of the operands is NaN. If we know that all
inputs except the last input are non-NaN, we can therefore skip checking
the last input. This is an optimization that in principle only works for
non-SIMD operations, but ps_sumX effectively is non-SIMD as far as the
arithmetic part of it is concerned, so we can use it there too.
2023-11-28 21:45:40 +01:00
Mai 95f06ef231
Merge pull request #12122 from JosJuice/jit-imm-msr
Jit: Handle imm msr in EmitStoreMembase
2023-11-28 21:34:23 +01:00
Mai 8cf0597d5f
Merge pull request #12091 from JosJuice/jitarm64-skip-quiet-bit
JitArm64: Use one instruction for making NaNs quiet
2023-11-28 21:33:25 +01:00
Mai e99ead0a68
Merge pull request #12124 from JosJuice/jitarm64-mfsrin-mtsrin-addr
JitArm64: Optimize mfsrin/mtsrin address calculations
2023-11-28 21:30:30 +01:00
Mai b53ecd73fb
Merge pull request #12143 from JosJuice/jitarm64-loadstore-pc
JitArm64: Write PC when calling MMU.cpp
2023-11-28 21:29:37 +01:00
Mai 1df685b2d7
Merge pull request #12123 from JosJuice/jit-mcrxr
Jit: Some mcrxr optimizations
2023-11-28 19:32:47 +01:00
Mai 20b13df507
Merge pull request #12179 from JosJuice/jitarm64-gp-deduplicate
JitArm64: Deduplicate the gather pipe exception check
2023-11-28 19:21:58 +01:00
Mai ac53766058
Merge pull request #12215 from JosJuice/android-si-devices
Android: Add more GameCube controller types
2023-11-28 19:21:29 +01:00
JosJuice 80171adf1e PPCTables: Retire FL_EVIL
FL_EVIL is only used for blocking instructions from being reordered.
There are three types of instructions which have FL_EVIL set:

1. CR operations. The previous commits improved our CR analysis
   and removed FL_EVIL from these instructions.
2. Load/store operations. These are always blocked from reordering
   due to always having canCauseException set.
3. isync. I don't know if we actually need to prevent reordering
   around this one, since as far as I know we only do reorderings
   that are guaranteed to not change the behavior of the program.
   But just in case, I've renamed FL_EVIL to FL_NO_REORDER instead of
   removing it entirely, so that it can be used for this instruction.
2023-11-28 18:59:34 +01:00
JosJuice f494a3d9e8 PPCAnalyst: Remove CanSwapAdjacentOps's OPCD check
Other than the CR instructions, which we now analyze properly,
all the covered instructions are not integer operations and also
have either FL_ENDBLOCK or FL_EVIL set, so there are two other
checks in CanSwapAdjacentOps that will reject them.
2023-11-28 18:59:34 +01:00
JosJuice 96d622bb61 PPCAnalyst: Run cror reordering after cmp reordering
We would rather have cror be close to the cmp than the branch.
2023-11-28 18:59:34 +01:00
JosJuice 40e0dd93be PPCAnalyst: Allow more reordering of CR operations
This is possible with the improved CR analysis implemented
in the previous commits.
2023-11-28 18:59:34 +01:00
JosJuice da63cee711 PPCAnalyst: More strict a_flags checks in CanSwapAdjacentOps
If for instance instruction a sets OE and instruction b
reads it, we shouldn't permit reordering.
2023-11-28 18:59:34 +01:00
JosJuice 8e9609df6e JitArm64: Add flush/discard support for condition registers
By flushing the condition registers as soon as we no longer
need them, we reduce the register pressure.
2023-11-28 18:59:31 +01:00
JosJuice 6cc4f593e5 PPCAnalyst: Add in-register/discard analysis for CR
This brings the analysis done for condition registers
more in line with the analysis done for GPRs and FPRs.

This gets rid of the old wantsCR member, which wasn't actually
used anyway. In case someone wants it again in the future, they
can compute the bitwise inverse of crDiscardable.
2023-11-28 18:58:47 +01:00
JosJuice d6987b98be PPCAnalyst: Perform CR analysis for crXXX 2023-11-28 18:51:03 +01:00
JosJuice 4ecdb9e57e JitArm64: Use one instruction for making NaNs quiet
Instead of materializing the quiet bit in a register and ORing the NaN
with it, we can perform an arithmetic operation on the NaN. This is a
cycle or two slower on some CPUs in cases where generating the quiet bit
pipelined well, but this is farcode that rarely runs, so instruction
fetch latency is the bigger concern. And for non-SIMD cases, we also
save a register.
2023-11-28 18:49:30 +01:00
JosJuice d5ec5c005a JitArm64: Some more FPRF optimization
By using MOVI2R+MOVI2R+CSEL in the zero case instead of doing bitwise
operations on the output of the other MOVI2R+MOVI2R+CSEL, we avoid using
BFI, an instruction that takes two cycles on most CPUs. The instruction
count is the same and the pipelining should be at least equally good.
2023-11-28 18:30:55 +01:00
JosJuice 255ee3fdce JitArm64: Use LSL+CLS for classifying floats
This is a little trick I came up with that lets us restructure our float
classification code so we can exit earlier when the float is normal,
which is the case more often than not.

First we shift left by 1 to get rid of the sign bit, and then we count
the number of leading sign bits. If the result is less than 10 (for
doubles) or 7 (for floats), the float is normal. This is because, if the
float isn't normal, the exponent is either all zeroes or all ones.
2023-11-28 18:30:45 +01:00
Zopolis4 481bc76d8e
Remove redundant 32-bit code 2023-11-28 23:03:26 +11:00
Zopolis4 f0d2ce4683
Remove _M_X86 in favour of _M_X86_64 2023-11-28 23:03:20 +11:00
Tilka ac4da97159
Merge pull request #12075 from JosJuice/gpr-block-inputs
PPCAnalyst: Fix gprBlockInputs calculation
2023-11-28 09:23:23 +00:00
Lexi Larkin 71dfa66d8b Tool/Header: Add JSON output mode; game data 2023-11-28 08:49:28 +00:00
Dentomologist becbaf50c4 OGLConfig: Only use Warn Log if OGL extensions are missing 2023-11-27 20:52:04 -08:00
Mai 9d415c1dbc
Merge pull request #12192 from JosJuice/jitarm64-nan-check
JitArm64: Check packed NaNs without using extra register
2023-11-28 04:22:27 +01:00
Mai 99cf862596
Merge pull request #12317 from JosJuice/setting-saveable-cleanup
Config: Clean up IsSettingSaveable
2023-11-28 04:20:21 +01:00
Mai 7e9c19fdb1
Merge pull request #12231 from JosJuice/jitarm64-frsqrte-optimization
JitArm64: Optimize frsqrte routine
2023-11-28 04:19:27 +01:00
Mai 731013c316
Merge pull request #12263 from Dentomologist/realtime_cheatsearch_update
CheatSearch: Automatically update Current Values
2023-11-28 04:17:06 +01:00
Mai 2869a4c168
Merge pull request #12278 from JosJuice/jitarm64-gpr-loop
JitArm64: Optimize Arm64GPRCache::FlushRegisters/FlushCRRegisters
2023-11-28 04:14:34 +01:00
Mai 6be8e63b23
Merge pull request #12306 from JosJuice/hle-discard
PPCAnalyst: Don't discard registers across HLE'd functions
2023-11-28 04:05:31 +01:00
Tilka b8a897fda7
Merge pull request #12328 from iwubcode/xf_state_manager
VideoCommon: move xf state management to its own class
2023-11-28 02:04:26 +00:00
TryTwo e5f5722497 Callstack: Bugfix. Remove double counting in loop to allow for more callstack items to be reported. 2023-11-27 14:18:25 -07:00
JosJuice 3a00ff625e PPCAnalyst: Don't discard registers across HLE'd functions
Not sure if this was causing correctness issues – it depends on whether
the HLE code was actually reading the discarded registers – but it was
at least causing annoying assert messages in one piece of homebrew.
2023-11-27 21:40:42 +01:00