Commit Graph

33529 Commits

Author SHA1 Message Date
Mai 16023ece6d
Merge pull request #11621 from deReeperJosh/skylandersfilefix
Skylander Portal: Clearing and Reloading fix
2023-03-07 15:24:46 -05:00
Admiral H. Curtiss 6d38dd9821
Qt/WatchWidget: Don't update if not paused. 2023-03-07 20:31:15 +01:00
JosJuice 75fb1a7edf Android: Disable input device sensor input due to crash 2023-03-07 17:39:34 +01:00
JosJuice 1788a797e7 Android: Add "more settings" button to overlay control setting dialog
Some people might wonder where the ability to select an extension
and the Sideways Wii Remote went. This button will take them to the
general settings, which is where those settings now live.

At some point in the future, we should probably move everything to the
general settings. But this pull request is already big enough as it is!
2023-03-07 17:39:34 +01:00
JosJuice 6b5f82c12f Android: Change how the overlay controller setting works, part 2
The previous commit wasn't enough for getting inputs to work for
controllers 2-4.
2023-03-07 17:39:34 +01:00
JosJuice 1b55d7c594 Android: Change how the overlay controller setting works
Up until now, there have been two settings on Android that stored the
selected Wii Remote extension: the normal one that's also used on PC,
and a SharedPreferences one that's used by the overlay controls to
determine what controls to show. It is possible for these two to end up
out of sync, and my input changes have made that more likely to happen.

To fix this, let's rework how the overlay controller setting works.
We don't want it to encode the currently selected Wii Remote extension.
However, we can't simply get rid of the setting, because for some Wii
games we need the ability to switch between a GameCube controller and a
Wii Remote. What this commit does is give the user the option to select
any of the 4 GameCube controllers and any of the 4 Wii Remotes. (Before,
controllers 2-4 weren't available in the overlay.) Could be useful for
things like the Psycho Mantis fight in Metal Gear Solid. I'm also
switching from SharedPreferences to Dolphin.ini while I'm at it.
2023-03-07 17:39:34 +01:00
JosJuice 4c326f2030 Android: Remove the in-emulation IR sensitivity options
This too can be set in the normal controller settings now.
2023-03-07 17:39:34 +01:00
JosJuice ee2c7dc24b Android: Remove the in-emulation motion control options
You can set this in the normal controller settings now.
2023-03-07 17:39:34 +01:00
JosJuice 9b9b6d97bc Config: Simplify IsSettingSaveable's handling of Android section
The Android-specific controller mapping system is now gone,
so IsSettingSaveable can be greatly simplified.
2023-03-07 17:39:34 +01:00
JosJuice 32cb41007b Android: Allow changing controller settings during emulation 2023-03-07 17:39:34 +01:00
JosJuice c2779aef06 Android: Add the advanced input mapping dialog
It's missing a lot of features from the PC version for now, like
buttons for inserting functions and the ability to see what the
expression evaluates to. I mostly just wanted to get something in
place so you can set up rumble.

Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
2023-03-07 17:39:30 +01:00
Admiral H. Curtiss f389da2a33
HW/HSP: Refactor to class, move to System. 2023-03-07 02:11:39 +01:00
Admiral H. Curtiss 655cc7f75c
DiscIO: Add support for CleanRip-style split ISOs. 2023-03-05 19:23:55 +01:00
Scott Mansell 4acdbc0e84
Merge pull request #11625 from phire/eventhook_nodiscard
Fix KillRenderer config changed regression
2023-03-06 03:09:12 +13:00
Scott Mansell 901f12c935 HookableEvents: Add [[nodiscard]] to Register 2023-03-06 00:12:26 +13:00
Scott Mansell b7db2510ef Don't discard ConfigChanged callback handle 2023-03-06 00:12:26 +13:00
Scott Mansell 70cfb46f8e Fix duplicated FPS
This is a small regression from KillRenderer, which caused duplicated
frames to be counted on the FPS counter when the "Skip Presenting
Duplicated Frames" option was disabled.
2023-03-05 23:31:12 +13:00
Joshua de Reeper 2585ae9b2c Skylander Portal: Clearing and Reloading fix 2023-03-04 20:13:54 +13:00
JosJuice 42943672bb Android: Add selecting input profile per game 2023-03-03 22:28:25 +01:00
JosJuice 1eeded23df Android: Add input profile management
Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
2023-03-03 22:28:25 +01:00
JosJuice 7ef229d908 Android: Show warning when using old pre-defined controller INIs
Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
2023-03-03 22:28:25 +01:00
JosJuice 8b78f73e80 Android: Add Default and Clear actions for controllers 2023-03-03 22:28:25 +01:00
JosJuice ea3200d4ba Android: Prevent showing mapping dialog with no device selected 2023-03-03 22:28:25 +01:00
JosJuice a1cc19f443 Android: Add "Create mappings for other devices" 2023-03-03 22:28:24 +01:00
JosJuice 2b1dd52750 Android: Add input device selection 2023-03-03 22:28:24 +01:00
JosJuice 2113bf5e3a Android: Implement enabling/disabling control groups
All this code for just a single checkbox... Ah well, it has to be done
2023-03-03 22:28:24 +01:00
JosJuice a78dca5fb0 Android: Move Sideways Wii Remote setting one submenu up
A slight departure from DolphinQt, but I think it makes sense, because
it will make the important Sideways Wii Remote setting easier to find.
2023-03-03 22:28:24 +01:00
JosJuice e7530a1cb9 Android: Split Wii Remote settings into submenus
Too much stuff on one screen otherwise. This split matches DolphinQt.
2023-03-03 22:28:24 +01:00
JosJuice 0dd8bbbbbb Android: Add extension selection 2023-03-03 22:28:24 +01:00
JosJuice 1c26a85e35 Android: Add NumericSetting support 2023-03-03 22:28:24 +01:00
JosJuice 2c529b9db1 Android: Add new input mapping implementation 2023-03-03 22:28:24 +01:00
JosJuice dd8976f18d Android: Remove old input mapping implementation
This old code is of no use now that ButtonManager is gone.
2023-03-03 22:28:24 +01:00
JosJuice 304d898966 Android: Remove copyAsset's overwrite parameter
Because of the previous commit, this is no longer needed.
2023-03-03 22:28:24 +01:00
JosJuice 93657cce54 Android: Stop extracting pre-defined controller INIs 2023-03-03 22:28:24 +01:00
JosJuice 9a8a395560 GCPadEmu/WiimoteEmu: Reorder control groups
This way, Android (which will show groups in the order they're defined)
will show groups in a more logical order similar to DolphinQt.

The main thing that was annoying me was how early Rumble was for
Wii Remotes. Some of the other changes I'm making in this commit,
like the order of Shake/Tilt/Swing, are more arbitrary and were
made for consistency with DolphinQt. But there are also places
where I didn't go all the way with matching DolphinQt. Most notably,
DolphinQt puts sticks before buttons, but I don't see any reason
to do that for Android.
2023-03-03 22:28:24 +01:00
JosJuice e0562abb7d ControllerEmu: Add default mappings for Android
Unlike PCs, Android doesn't really have any input method (not counting
touch) that can reasonably be expected to exist on most devices.
Because of this, I don't think shipping with a default mapping for the
buttons and sticks of GameCube controllers and Wii Remotes makes sense.
I would however like to ship default mappings for a few things:

1. Mapping the Wii Remote's accelerometer and gyroscope to the device's
   accelerometer and gyroscope. This functionality is useful mainly
   for people who use the touchscreen, but can also be useful when
   using a clip-on controller. The disadvantage of having this mapped
   by default is that games disable pointer input if the accelerometer
   reports that the Wii Remote is pointed at the ceiling.

2. Mapping GC keyboards for use with a physical keyboard, like on PC.
   After all, there's no other way of mapping them that makes sense.

3. Mapping rumble to the device's vibrator.

Aside from the GC keyboards, this approach is effectively the same as
what we were doing before the input overhaul.
2023-03-03 22:28:23 +01:00
JosJuice 8e33458f48 ControllerInterface/Android: Implement rumble 2023-03-03 22:28:23 +01:00
JosJuice 065481d989 ControllerInterface/Android: Automatically suspend sensors
This is a battery-saving measure. Whether a sensor should be suspended
is determined in the same way as whether key events and motion events
should be handled by the OS rather than consumed by Dolphin.
2023-03-03 22:28:23 +01:00
JosJuice 36acb17700 ControllerInterface/Android: Implement sensor input for InputDevices
This functionality was added in Android 12 to let apps get motion data
for gamepads.
2023-03-03 22:28:23 +01:00
JosJuice 5e51b56d72 ControllerInterface/Android: Implement sensor input 2023-03-03 22:28:23 +01:00
JosJuice 104ea09892 ControllerInterface/Android: Implement hotplug 2023-03-03 22:28:23 +01:00
JosJuice d6af294a23 ControllerInterface/Android: Return whether input was handled
When Android presents an input event to an app, it wants the app to
return true or false depending on whether the app handled the event or
not. If the event wasn't handled by the app, it will be passed on to
the system, which may decide to take an action depending on what kind
of input event it is. For instance, if a B button press is passed on to
the system, it will be turned into a Back press. But if an R1 press is
passed on to the system, nothing in particular happens.

It's important that we get this return value right in Dolphin. For
instance, the user generally wouldn't want a B button press to open
the EmulationActivity menu, so B button presses usually shouldn't be
passed on to the system - but volume button presses usually should be
passed on to the system, since it would be hard to adjust the volume
otherwise. What ButtonManager did was to pass on input events that are
for a button which the user has not mapped, which I think makes sense.
But exactly how to implement that is more complicated in the new input
backend than in ButtonManager, because now we have a separation between
the input backend and the code that keeps track of the user's mappings.

What I'm going with in this commit is to treat an input as mapped if
it has been polled recently. In part I chose this because it seemed
like a simple way of implementing it that wouldn't cause too many
layering violations, but it also has two useful side effects:

1. If a controller is not being polled (e.g. GameCube controllers in
   Wii games that don't use them), its mappings will not be considered.
2. Once sensor input is implemented in the Android input backend,
   we will be able to use this "polled recently" tracking to power down
   the sensors at times when the game is using a Wii Remote reporting
   mode that doesn't include motion data. (Assuming that the sensor
   inputs only are mapped to Wii Remote motion controls, that is.)
2023-03-03 22:28:23 +01:00
JosJuice ca508e4503 ControllerInterface/Android: Handle input events
Android doesn't let us poll inputs whenever we want. Instead, we
listen to input events (activities will have to forward them to the
input backend), and store the received values in atomic variables
in the Input classes. This is similar in concept to how ButtonManager
worked, but without its homegrown second input mapping system.
2023-03-03 22:28:23 +01:00
JosJuice 792cb62195 ControllerInterface/Android: Implement device population 2023-03-03 22:28:23 +01:00
JosJuice 68ebb5c33e Android: Remove old rumble implementation 2023-03-03 22:28:23 +01:00
JosJuice 9e7a2ee0fb Android: Remove old motion input implementation 2023-03-03 22:28:23 +01:00
JosJuice 0150f521f7 ControllerInterface/Android: Rip out ButtonManager
ButtonManager is very different from how a normal input backend works,
and is making it hard for us to improve controller support on Android.
The following commits will add a new input backend in its place.
2023-03-03 22:28:23 +01:00
JosJuice 95ce41ac56
Merge pull request #11399 from JosJuice/jit-one-stack
Jit: Don't use a second stack
2023-03-03 22:27:16 +01:00
Minty-Meeo bf079d6d3a [[unlikely]] ASSERT
and other ASSERT usage changes
2023-03-02 19:54:15 -06:00
Mai 6361586a04
Merge pull request #11582 from Pokechu22/software-crash-on-startup
Software: Fix regressions from "Kill Renderer"
2023-03-02 15:13:00 -05:00
Mai ab2f8d3475
Merge pull request #11607 from AdmiralCurtiss/sd-progress
Qt/WiiPane: Add progress window for SD card conversion.
2023-03-02 15:08:18 -05:00
Mai 6fcec80eb0
Merge pull request #11605 from JosJuice/android-mappings-button
Android: Add a button for accessing controller mappings
2023-03-02 15:06:47 -05:00
Mai cbbc518bc4
Merge pull request #11612 from iwubcode/custom_texture_data
VideoCommon: move hirestexture data to reusable class called CustomTextureData
2023-03-02 15:05:46 -05:00
Mai 78e8669bac
Merge pull request #11614 from t895/kotlin-cheats
Android: Convert Cheats Activity to Kotlin
2023-03-02 15:04:19 -05:00
Mai 1b7969bc62
Merge pull request #11615 from t895/kotlin-riivolution
Android: Convert Riivolution Boot Activity to Kotlin
2023-03-02 15:03:43 -05:00
Mai b9fd7e7bd4
Merge pull request #11616 from t895/kotlin-skylanders
Android: Convert Skylanders code to Kotlin
2023-03-02 15:03:18 -05:00
Pokechu22 9cdc0aca9b Software: Fix "Auto-Adjust Window Size"
This also needs to be handled on the software renderer path.
2023-03-02 11:08:49 -08:00
Pokechu22 78428dd8db Software: Fix crash on startup when using "Compile Shaders Before Starting"
When that setting is enabled, m_xfb_entry is initially not present (during the phase where a shader compilation progress bar would be shown). The main path checks for m_xfb_entry, but the software renderer fallback path didn't.

Fixes another aspect of https://bugs.dolphin-emu.org/issues/13172.
2023-03-02 11:08:49 -08:00
Pokechu22 4a2d3c83c7 Software: Implement GetSurfaceInfo()
Before, it used a fallback where it returned a default object, where the width and height were set to 0. Presenter::Initialize() used GetSurfaceInfo to set the backbuffer size, then used that size when initializing the on-screen UI (even for the software renderer, where the on-screen UI isn't currently present), which meant that ImGui got a window size of 0 and thus resulted in a failed assertion.

Although BindBackbuffer checks for size changes, it doesn't help because ImGui has already been initialized, and the size hasn't actually changed since initialization occured.

Fixes one aspect of https://bugs.dolphin-emu.org/issues/13172.
2023-03-02 11:08:49 -08:00
JosJuice 96deb2d897 Android: Hide controller mappings button when controller type is None
Also removed the make_sure_continuous_scan_enabled message.
It doesn't make sense with the new UX.
2023-03-02 18:25:10 +01:00
Charles Lombardo 2067c8eed1 Android: Convert ConvertActivity to Kotlin 2023-03-02 01:54:46 -05:00
Charles Lombardo fb432dd58a Android: Convert ConvertFragment to Kotlin 2023-03-02 01:54:46 -05:00
SMarioMan 078730c873
Avoid altering TCP sockets
Co-authored-by: sepalani <sepalani@hotmail.fr>
2023-03-01 20:52:43 -05:00
Charles Lombardo 7efb672be6 Android: Convert SkylanderSlotAdapter to Kotlin 2023-03-01 17:32:19 -05:00
Charles Lombardo 36f1315513 Android: Convert SkylanderSlot to Kotlin 2023-03-01 17:32:07 -05:00
Charles Lombardo bbc1951afb Android: Convert SkylanderConfig to Kotlin 2023-03-01 17:32:07 -05:00
Charles Lombardo 71e82d76b5 Android: Convert SkylanderPair to Kotlin 2023-03-01 17:13:42 -05:00
Charles Lombardo 85b30f198b Android: Convert Skylander to Kotlin 2023-03-01 17:13:01 -05:00
Charles Lombardo 4045e213ba Android: Convert RiivolutionAdapter to Kotlin 2023-03-01 14:39:18 -05:00
Charles Lombardo df21663d4c Android: Convert RiivolutionBootActivity to Kotlin 2023-03-01 14:38:59 -05:00
Charles Lombardo 79d0ff55d2 Android: Convert RiivolutionItem to Kotlin 2023-03-01 14:38:37 -05:00
Charles Lombardo e37503675a Android: Convert RiivolutionViewHolder to Kotlin 2023-03-01 14:38:19 -05:00
Charles Lombardo ec7b811de3 Android: Convert RiivolutionPatches to Kotlin 2023-03-01 14:38:02 -05:00
Charles Lombardo 3935449ca0 Android: Convert TwoPaneOnBackPressedCallback to Kotlin 2023-03-01 13:47:28 -05:00
Charles Lombardo 6bc4ae7438 Android: Convert SettingDisabledWarningFragment to Kotlin 2023-03-01 13:41:55 -05:00
Charles Lombardo 53d404c5a0 Android: Convert HeaderViewHolder to Kotlin 2023-03-01 13:41:02 -05:00
Charles Lombardo 58b7b80902 Android: Convert GraphicsModsDisabledWarningFragment to Kotlin 2023-03-01 13:40:48 -05:00
Charles Lombardo a8da5902bb Android: Convert CheatViewHolder to Kotlin 2023-03-01 13:40:28 -05:00
Charles Lombardo 25fb3218d9 Android: Convert CheatsDisabledWarningFragment to Kotlin 2023-03-01 13:40:08 -05:00
Charles Lombardo fcfde12c52 Android: Convert CheatsAdapter to Kotlin 2023-03-01 13:39:49 -05:00
Charles Lombardo 23d9def613 Android: Convert CheatsActivity to Kotlin 2023-03-01 13:39:23 -05:00
Charles Lombardo 3bcc4a0a59 Android: Convert CheatListFragment to Kotlin 2023-03-01 13:39:07 -05:00
Charles Lombardo d8c1381155 Android: Convert CheatItemViewHolder to Kotlin 2023-03-01 13:38:27 -05:00
Charles Lombardo cacbac9152 Android: Convert CheatItem to Kotlin 2023-03-01 13:37:57 -05:00
Charles Lombardo 5f5c95e7da Android: Convert CheatDetailsFragment to Kotlin 2023-03-01 13:37:21 -05:00
Charles Lombardo b2dd510d0a Android: Convert ActionViewHolder to Kotlin 2023-03-01 13:37:07 -05:00
Charles Lombardo fb177631ef Android: Convert ReadOnlyCheat to Kotlin 2023-03-01 13:36:53 -05:00
Charles Lombardo 59ecda7939 Android: Convert CheatsViewModel to Kotlin 2023-03-01 13:36:40 -05:00
Charles Lombardo 1b61f2c223 Android: Convert Cheat to Kotlin 2023-03-01 13:35:43 -05:00
Charles Lombardo fbc617c917 Android: Convert AbstractCheat to Kotlin 2023-03-01 13:35:33 -05:00
Charles Lombardo 37e8cd1789 Android: Convert GeckoCheat to Kotlin 2023-03-01 13:35:14 -05:00
Charles Lombardo 9e090c6bab Android: Convert GraphicsMod to Kotlin 2023-03-01 13:34:34 -05:00
Charles Lombardo 5f6995fe6c Android: Convert GraphicsModGroup to Kotlin 2023-03-01 13:34:09 -05:00
Charles Lombardo 9cbe66bce4 Android: Convert PatchCheat to Kotlin 2023-03-01 13:33:16 -05:00
Charles Lombardo 408b6cb50c Android: Convert ARCheat to Kotlin 2023-03-01 13:32:42 -05:00
iwubcode 42cb3f3904 VideoCommon: remove HiResTexture DDS loading, update hirestexture logic to use custom texture data 2023-03-01 12:11:04 -06:00
iwubcode 3e35255983 VideoCommon: add class to load custom texture data 2023-03-01 11:58:37 -06:00
Charles Lombardo a4730a9388 Android: Initialize TaskViewModel earlier in User Data Activity 2023-03-01 08:28:44 -05:00
Charles Lombardo 211be4698f
Merge pull request #11515 from t895/user-data-kotlin
Android: Rewrite User Data Activity in Kotlin
2023-02-28 23:47:00 -05:00
Charles Lombardo c904e068f0 Android: Use DialogFragments to direct UserData actions 2023-02-28 22:33:42 -05:00