Commit Graph
100 Commits
Author SHA1 Message Date
JosJuice 7586fc8134 Merge pull request #11608 from Dentomologist/fix_dynamicinputtextures_directory_error_logs
UICommon: Create Load/DynamicInputTextures directory on startup
2023-02-27 18:07:57 +01:00
JosJuice 9b3816c993 InputCommon: Fix ControlGroup::SaveConfig with DefaultValue::Disabled
I also changed LoadConfig, but that change doesn't affect correctness,
it's only so it looks neat by matching SaveConfig.

This bug was added in 18a4afb053, the
commit that introduced DefaultValue::Disabled. The bug can't actually be
triggered in master, but it can be triggered in the Android input
overhaul PR.
2023-02-26 17:45:09 +01:00
JosJuice 1c78604c5a Merge pull request #11604 from shuffle2/msvc-zelda-bug
workaround msvc optimizer bug
2023-02-26 10:09:09 +01:00
JosJuice 19e8569634 Merge pull request #11594 from t895/autofit-grid
Android: Responsive autofit grid
2023-02-25 17:30:40 +01:00
JosJuice ae5311d6e6 PowerPC: Rework CPUThreadGuard handling in Expression.cpp
See https://github.com/dolphin-emu/dolphin/pull/11554#discussion_r1113949572.
2023-02-25 16:13:34 +01:00
JosJuice 2aedd8f568 Merge pull request #11590 from t895/unused-layout-class
Android: Remove SettingsFrameLayout
2023-02-20 23:33:07 +01:00
JosJuice 0fb9105700 Merge pull request #11408 from t895/coil
Android: Rewrite image loading with Kotlin and Coil
2023-02-20 20:51:36 +01:00
JosJuice e65167f9cd Merge pull request #11521 from t895/adjust-grid-options
Android: Simplify the grid options dialog fragment
2023-02-18 15:42:46 +01:00
JosJuice 90b676d368 Android: Fix armeabi-v7a build
This very much isn't a build configuration that we're going to ship,
but I want to be able to tell people that they can build it on their
own if they really want to see how terribly it performs :)

Just like before, you'll need to edit two lines in app/build.gradle to
define ENABLE_GENERIC=ON and actually enable armeabi-v7a if you want an
armeabi-v7a build. This commit just fixes some compilations errors that
crop up if you do so.
2023-02-17 16:58:24 +01:00
JosJuice 0049a76775 JitArm64: Fix special cases of cmp
This fixes a regression from 592ba31. When `a` was a constant 0 and `b`
was a non-constant 0x80000000, the 32-bit negation operation would
overflow, causing an incorrect result. The sign extension needs to happen
before the negation to avoid overflow.

Note that I can't merge the SXTW and NEG into one instruction.
NEG is an alias for SUB with the first operand being set to ZR,
but "SUB (extended register)" treats register 31 as SP instead of ZR.

I've also changed the order for the case where `a` is a constant
0xFFFFFFFF. I don't think the order actually affects correctness here,
but let's use the same order for all the cases since it makes the code
easier to reason about.
2023-02-14 19:16:00 +01:00
JosJuice 5b6784432c Follow-up fixes for "Properly lock CPU before accessing emulated memory" 2023-02-14 18:44:16 +01:00
JosJuice 9d139ea84e Merge pull request #11561 from AdmiralCurtiss/hle-execute-fix
JIT: Fix calls to HLE::Execute.
2023-02-13 12:09:36 +01:00
JosJuice 611e721a4d Jit64: Properly handle backpatching overflowed address calculations
Previously we would only backpatch overflowed address calculations
if the overflow was 0x1000 or less. Now we can handle the full 2 GiB
of overflow in both directions.

I'm also making equivalent changes to JitArm64's code. This isn't because
it needs it – JitArm64 address calculations should never overflow – but
because I wanted to get rid of the 0x100001000 inherited from Jit64 that
makes even less sense for JitArm64 than for Jit64.
2023-02-12 20:48:27 +01:00
JosJuice f3ee167a3c Merge pull request #11536 from JosJuice/transifex-migrate
Update Transifex config for new client
2023-02-12 19:07:10 +01:00
JosJuice 6f0266e8de DolphinQt: Only update call stack if paused
This avoids a pseudo infinite loop where CodeWidget::UpdateCallstack
would lock the CPU in order to read the call stack, causing the CPU to
call Host_UpdateDisasmDialog because it's transitioning from running to
pausing, causing Host::UpdateDisasmDialog to be emitted, causing
CodeWidget::Update to be called, once again causing
CodeWidget::UpdateCallstack to be called, repeating the cycle.

Dolphin didn't go completely unresponsive during this, because
Host_UpdateDisasmDialog schedules the emitting of Host::UpdateDisasmDialog
to happen on another thread without blocking, but it was stopping certain
operations like exiting emulation from working.
2023-02-12 12:50:28 +01:00
JosJuice 7cecb28bdf DolphinQt: Properly lock CPU before accessing emulated memory
This fixes a problem I was having where using frame advance with the
debugger open would frequently cause panic alerts about invalid addresses
due to the CPU thread changing MSR.DR while the host thread was trying
to access memory.

To aid in tracking down all the places where we weren't properly locking
the CPU, I've created a new type (in Core.h) that you have to pass as a
reference or pointer to functions that require running as the CPU thread.
2023-02-12 11:27:50 +01:00
JosJuice 6dfd582de6 OGL: Fix GLES crashing on initialization
Fixes a regression from PR 11522 ("Kill Renderer").
2023-02-09 18:09:03 +01:00
JosJuice 17bdee4366 Update Transifex config for new client
Transifex's old CLI client was deprecated in November 2022. This updates
our config so it can be used with the new client.
2023-02-03 10:13:37 +01:00
JosJuice 46b99671d9 Translation resources sync with Transifex 2023-02-03 10:03:22 +01:00
JosJuice 9eb56551af Merge pull request #11525 from t895/runtime-switch-fix
Android: Fix settings being editable when marked otherwise
2023-02-01 18:03:41 +01:00
JosJuice c63eb75435 Merge pull request #11520 from lioncash/undefined
Common/Network: Resolve -Wexpansion-to-defined warning
2023-01-30 21:17:11 +01:00
JosJuice 43194b2742 Merge pull request #11519 from lioncash/android
AndroidCommon: Make use of std::string_view where applicable
2023-01-30 20:21:44 +01:00
JosJuice 2e8ad9f105 Android: Create ScaledIntSetting class
A little refactoring to cut down on the size of the very big
SettingsFragmentPresenter class.

I ended up adding a bunch of @NonNull annotations in various settings
classes so I could make the parameters `Settings` instead of `Settings?`
in the new Kotlin code.
2023-01-30 20:07:09 +01:00
JosJuice f0b833a639 Merge pull request #11518 from t895/deprecated-setting
Android: Remove unused force filtering setting
2023-01-30 19:56:44 +01:00
JosJuice 65c782b3b9 Merge pull request #11517 from t895/slider-setting-adjustment
Android: Set each slider step size manually
2023-01-30 19:32:18 +01:00
JosJuice 00fdf1ddce Android: Fix crash when attempting to change MEM2 size
The step size for the slider ended up being 10, but Android wanted it
to be a divisor of the slider's range (which is 128 - 64 = 64).
2023-01-29 23:35:54 +01:00
JosJuice afe9d5b098 GameSettings: Replace ForceFiltering with ForceTextureFiltering
This setting was renamed when it was updated to also support forcing
nearest neighbor filtering.
2023-01-29 17:34:26 +01:00
JosJuice e27339039c PPCAnalyst: Actually check if instructions want CR 2023-01-28 20:16:17 +01:00
JosJuice 9d2c4aa325 PPCAnalyst: Use bitsets for CR analysis
Currently we're only performing CR analysis for CR0 and CR1, but I
would like to do it for all CRs. Bitsets are appropriate for this.
2023-01-28 20:16:16 +01:00
JosJuice 3b57fb1d21 PPCTables: Add new instruction flags for CR 2023-01-28 20:16:16 +01:00
JosJuice 3e21ba55f1 Merge pull request #11496 from t895/analytics-dialog-kotlin
Android: Convert analytics dialog to Kotlin
2023-01-28 20:03:49 +01:00
JosJuice 09a8d9591d Translation resources sync with Transifex 2023-01-26 20:56:24 +01:00
JosJuice d0da689eeb DolphinQt: Add i18n comments for strings containing the word "watches"
These new strings could use the same clarification as we have for
the existing string "&Delete Watch".
2023-01-23 20:49:22 +01:00
JosJuice 716dabde96 Merge pull request #11447 from t895/save-state-fix
Android: Fix large strings in save/load savestate fragment
2023-01-16 19:09:37 +01:00
JosJuice 59b276ea87 Merge pull request #11448 from t895/nav-fix-api-26
Android: Fix navigation bar buttons appearing invisible on API 26
2023-01-16 18:45:06 +01:00
JosJuice 8f88297122 Revert "MenuBar: Tweak string for open user folder option"
This reverts commit 6788bda6c9.

The user folder can be either global or local. If it is local,
we shouldn't call it global.

See also da0be24b2f.
2023-01-16 18:31:16 +01:00
JosJuice 4fa9fa997e Core: Allocate 2 GiB of guard pages below fastmem area
See the comment added by this commit. We were previously guarding against
overshooting in address calculations, but not against undershooting.
Perhaps someone assumed that the displacement of an x86 loadstore was
treated as unsigned?

Note: While the comment says we can undershoot by up to 2 GiB, in
practice Jit64 as it currently behaves won't actually undershoot by more
than 0x8000 if my analysis is correct. But address space is cheap, so
let's guard the full 2 GiB.
2023-01-14 20:35:50 +01:00
JosJuice 9c90b31e6a Memmap: Remove some remnants from the 32-bit JITs 2023-01-14 11:46:37 +01:00
JosJuice 9d350fd56b Merge pull request #11437 from t895/grid-options-fix
Android: Fix grid options text borders
2023-01-14 09:42:56 +01:00
JosJuice 9d81c84db0 Merge pull request #11427 from UltraHDR/patch-1
Set LSApplicationCategoryType to games
2023-01-10 19:00:26 +01:00
JosJuice 4b6d6883f8 Merge pull request #11428 from t895/cheats-fix-2
Android: Ignore workaround view height if 0
2023-01-10 18:57:14 +01:00
JosJuice 558e3b5b15 Merge pull request #11425 from t895/expose-frame-time-toggle
Android: Expose "Log Render Time to File" toggle
2023-01-10 09:56:30 +01:00
JosJuice acafb07707 Merge pull request #11421 from t895/disable-header-focus
Android: Disable focus on non-actionable UI
2023-01-09 21:40:18 +01:00
JosJuice 1af8602530 Merge pull request #11411 from t895/managed-device-update
Android: Update managed device for baseline profile generation
2023-01-08 13:37:41 +01:00
JosJuice dcded04719 Merge pull request #11410 from t895/fullscreen-fix
Android: Fix use of fullscreen modes on Cheats Activity
2023-01-07 19:27:30 +01:00
JosJuice 710d7e3637 Merge pull request #11414 from Pokechu22/msvc-dsp-jit-x64-only
Move x64 DSP JIT into DolphinLib.x64.props
2023-01-07 09:37:25 +01:00
JosJuice 24d7cf12a5 Android: Move FPS-related settings to a submenu
Back when this was just the FPS setting, having it in the top level
of the graphics settings was reasonable. But now it's seven settings.
Let's add a new submenu for them.
2022-12-29 17:34:23 +01:00
JosJuice cc768b1ea3 Merge pull request #11357 from t895/elevate-ingame-fragment
Android: Elevate ingame menu fragment with color
2022-12-28 10:25:36 +01:00
JosJuice b3a368ae06 Android: Add VectorToJObjectArray utility function 2022-12-27 22:59:42 +01:00
JosJuice 0b9351c194 Android: Make more meticulous use of DeleteLocalRef
If we're in a function that isn't just going to immediately return to
Java, leaking local references can lead to problems eventually.
2022-12-27 22:03:44 +01:00
JosJuice cf16f49068 PowerPC: Fix theoretically possible infinite loop in WriteToHardware
`em_address + size` can overflow and become 0. It shouldn't happen with
the kinds of memory mappings games use in practice, though.
2022-12-25 12:29:13 +01:00
JosJuice e0fba20f1f Merge pull request #11360 from shuffle2/vs
msvc: remove workaround for arm64 sha1 compiler bug
2022-12-24 22:55:47 +01:00
JosJuice c744ff4934 JitArm64: Implement breakpoints
Plus two miscellaneous debugger features that I found along the way when
reading Jit64's code for comparison: bJITNoBlockLinking and tracing.

Fixes https://bugs.dolphin-emu.org/issues/13127.
2022-12-24 13:24:01 +01:00
JosJuice 0659827485 Jit64: Check for breakpoint without disabling block link
Small optimization. By not calling WriteExit, the block linking system
never finds out about the exit we're doing, saving us from having to
disable block linking.
2022-12-24 13:01:29 +01:00
JosJuice 494b041b34 DolphinQt: Add settings to GBA TAS input window
We should expose Enable Controller Input and the turbo settings for
GBA just like we do for GameCube controllers and Wii Remotes.
I just forgot about it when implementing the GBA TAS input window.
2022-12-24 11:30:25 +01:00
JosJuice 582d6b738b Merge pull request #11358 from t895/close-soft-keyboard
Android: Close soft keyboard on panel close
2022-12-24 11:21:56 +01:00
JosJuice 4d6ab73416 Merge pull request #11359 from t895/android-docs
Bring Android documentation up-to-date
2022-12-24 11:21:04 +01:00
JosJuice 71f1b1db34 Boot: Fix handling of M3U file paths containing backslashes
Previously, if a user on Windows launched Dolphin from the command line
and specified a path to an M3U file and included backslashes in this path,
Dolphin would fail to resolve relative paths in the M3U file.
2022-12-24 11:13:27 +01:00
JosJuice b3bc9c41ea Merge pull request #11369 from t895/switch-fix
Android: Allow users to interact with switches in settings
2022-12-24 09:09:17 +01:00
JosJuice 54a6c4a90d Translation resources sync with Transifex 2022-12-24 08:59:53 +01:00
JosJuice 3611045a6c DolphinQt: Add more i18n comments 2022-12-24 08:32:49 +01:00
JosJuice 547d956278 Common: Use C++20 <bit> header in BitSet.h 2022-12-18 16:51:32 +01:00
JosJuice 9f4d9994bc Merge pull request #11347 from t895/cheats-background-fix
Android: Use colorSurface attribute for cheats activity background
2022-12-18 12:41:15 +01:00
JosJuice 19db7a87a3 Merge pull request #11343 from t895/kotlin-clean
Android: Introduce Kotlin support
2022-12-11 20:12:47 +01:00
JosJuice fdd5190b4c Merge pull request #11340 from merryhime/USE_SIGACTION_ON_APPLE
MachineContext: Fix USE_SIGACTION_ON_APPLE on arm64
2022-12-11 20:12:18 +01:00
JosJuice 701ba7cd43 JitArm64: Improve pipelining of lmw/stmw
The calculation of each address in lmw/stmw currently has a dependency
on the calculation of the previous address. By removing this dependency,
the host CPU should be able to pipeline the loads/stores better. The cost
we pay for this is up to one extra register and one extra MOV instruction
per guest instruction, but often nothing.

Making EmitBackpatchRoutine support using any register as the address
register would let us get rid of the MOV, but I consider that to be too
big of a task to do in one go at the same time as this.
2022-12-11 17:08:12 +01:00
JosJuice 82e87cf7b9 Merge pull request #9944 from JosJuice/android-nonsquare-buttons
Android: Allow non-square overlay control images
2022-12-11 12:10:55 +01:00
JosJuice 454537d53e Replace BitUtils with C++20: RotateLeft/RotateRight
Now that we've flipped the C++20 switch, let's start making use of
the nice new <bit> header.

I'm planning on handling this move away from BitUtils.h incrementally
in a series of PRs. There may be a few functions remaining in
BitUtils.h by the end that C++20 doesn't have any equivalents for.
2022-12-11 08:59:18 +01:00
JosJuice 1fd8d476e8 Merge pull request #11325 from t895/extra-dark
Android: Add black backgrounds toggle
2022-12-10 21:09:26 +01:00
JosJuice 2b7b3c3942 Merge pull request #11335 from t895/baseline-profile
Android: Baseline profile generation
2022-12-10 21:09:18 +01:00
JosJuice 932926a4aa Merge pull request #11329 from t895/elevation-bar
Android: Use ElevationOverlay for app bar elevation color
2022-12-10 20:33:56 +01:00
JosJuice 64bc150b8c Revert "JitArm64: Optimize a few tail calls"
This reverts commit 351d095fff.

In hindsight, my attempted optimization messes with the return
predictor, unlike real tail calls. So I think it does more bad than
good.
2022-12-10 11:35:52 +01:00
JosJuice b5b8871bce Arm64Emitter: Fix SHRN/SHRN2
The "vector shift by immediate" category encodes the shift amount for
right shifts as `size - amount`, whereas left shifts use `amount`.

We're not actually using SHRN/SHRN2 anywhere, which is why this has gone
undetected.
2022-12-10 11:20:23 +01:00
JosJuice 61c10a5644 Merge pull request #11332 from t895/upgrade-dependencies
Android: Upgrade dependencies
2022-12-09 22:11:05 +01:00
JosJuice abf08b5869 Merge pull request #11309 from t895/agp-upgrade
Android: Upgrade AGP to 7.3.1
2022-12-08 19:57:59 +01:00
JosJuice 2a23aab254 Merge pull request #11327 from t895/settings-animation
Android: New settings fragment animations
2022-12-06 22:11:38 +01:00
JosJuice d34c4c67c8 Merge pull request #11328 from t895/string-aggregation
Android: Migrate all strings to strings.xml
2022-12-06 21:41:05 +01:00
JosJuice 6abcaadd5a Merge pull request #11314 from t895/menu-cutout-padding
Android: Pad menu fragment when expanding to cutout area
2022-12-04 18:59:32 +01:00
JosJuice 3a7ecc851b Merge pull request #11324 from t895/back-fix
Android: Fix cheats layout
2022-12-04 18:51:43 +01:00
JosJuice 8bad821019 Translation resources sync with Transifex 2022-12-04 15:21:13 +01:00
JosJuice eeef5363e4 Jit64: Correctly handle NaNs for ps_maddsX 2022-12-03 21:05:05 +01:00
JosJuice 06e60ac327 JitArm64: Implement accurate NaNs
For quite some time now, we've had a setting on x86-64 that makes Dolphin
handle NaNs in a more accurate but slower way. There's only one game that
cares about this, Dragon Ball: Revenge of King Piccolo, and what that game
cares about more specifically is that the default NaN (or "generated NaN"
as I believe it's called in PowerPC documentation) is the same as on
PowerPC. On ARM, the default NaN is the same as on PowerPC, so for the
longest time we didn't need to do anything special to get Dragon Ball:
Revenge of King Piccolo working. However, in 93e636a I changed how we
handle FMA instructions in a way that resulted in the sign of NaNs
becoming inverted for nmadd/nmsub instructions, breaking the game.
To fix this, let's implement the AccurateNaNs setting, like on x86-64.
2022-12-03 19:41:32 +01:00
JosJuice 5c41d3b602 JitArm64: Refactor temp reg handling in fp_arith/ps_arith 2022-12-03 19:08:27 +01:00
JosJuice 2f1a8ee1b9 Jit64: Skip HandleNaNs for operations that can't generate NaN
Operations that have two operands and can't generate a default NaN,
i.e. addition and subtraction, already have the desired NaN handling
on x86. We just need to make sure to not reverse the operands.

This fixes ps_sum0/ps_sum1 outputting NaNs in cases where they shouldn't.
(HandleNaNs assumes that a NaN in a ps0 input always results in a NaN in
the ps0 output, and correspondingly for ps1.)
2022-11-27 11:30:10 +01:00
JosJuice cbceae9176 Jit64: Correctly handle NaNs for ps_mulsX 2022-11-27 11:30:10 +01:00
JosJuice d3180e3516 Jit64: Refactor HandleNaNs operand passing 2022-11-27 11:30:05 +01:00
JosJuice 332d187252 Translation resources sync with Transifex 2022-11-26 22:08:53 +01:00
JosJuice f45d3a6a2c JitArm64: Optimize ps_mergeXX
1. In some cases, ps_merge01 can be implemented using one instruction.
2. When we need two instructions for ps_merge01, it's best to start with
   a MOV to avoid false dependencies on the destination register.
3. ps_merge10 can be implemented using a single EXT instruction.
2022-11-26 18:14:58 +01:00
JosJuice ddf63bacb9 Merge pull request #11296 from t895/tv-game-details-fix
Android: Fix GameDetailsDialog on leanback
2022-11-23 22:06:49 +01:00
JosJuice 8ac8d5afb6 Merge pull request #11295 from t895/onlayout-fix
Android: Fix condition where we set grid span too early
2022-11-22 23:20:31 +01:00
JosJuice d64c3dc267 Arm64Emitter: Add MOVPage2R utility function
This new function is like MOVP2R, except it masks out the lower 12 bits,
returning them instead of writing them to the register. These lower
12 bits can then be used as an offset for LDR/STR. This lets us turn
ADRP+ADD+LDR sequences with a zero offset into ADRP+LDR sequences with
a non-zero offset, saving one instruction.
2022-11-21 23:24:06 +01:00
JosJuice 40571cf13c DolphinQt: Add GBA TAS input window
When emulated GBAs were added to Dolphin, it was possible to control them
using the GC TAS input window. (Z was mapped to Select.) Unaware of this,
I broke the functionality in b296248.

To make it possible to control emulated GBAs using TAS input again,
I'm adding a proper TAS input window for GBAs, with a real Select button
and no analog controls.
2022-11-21 19:16:30 +01:00
JosJuice 4b6bad2f9e Jit64: Use MOV instead of ADD for updating imm Ra
The old code would first MOV the old imm into Ra and then do an ADD.
We can skip the ADD and just MOV the new imm.
2022-11-20 10:50:25 +01:00
JosJuice c8705f014d Merge pull request #11290 from AdmiralCurtiss/phys-mem-region-init
Memmap: Fix initialization of PhysicalMemoryRegion.
2022-11-18 17:53:00 +01:00
JosJuice 0fec70733b Merge pull request #11287 from t895/spacing-fix
Android: Adjust card_width
2022-11-16 22:12:43 +01:00
JosJuice 9766238649 Merge pull request #11267 from t895/smooth-keyboard
Android: Use smooth keyboard animation in cheats activity
2022-11-16 20:48:20 +01:00
JosJuice cecd4d15fe Merge pull request #11254 from t895/adaptive-grid
Android: Dynamically adapt grid span to card_game size
2022-11-16 20:47:59 +01:00
JosJuice 7ce2be9386 Merge pull request #11256 from t895/animate-focus-change
Android: Animate covers on focus change
2022-11-16 20:47:16 +01:00
JosJuice f614f94568 Merge pull request #11272 from t895/tv-update-fix
Android: Use progress bar that does not inherit from AppCompat on leanback
2022-11-13 21:01:56 +01:00
JosJuice 2340a7eea6 Merge pull request #11248 from t895/offload-unmangle
Android: Offload cover path unmangling to another thread
2022-11-13 14:59:00 +01:00