Commit Graph

355 Commits

Author SHA1 Message Date
JosJuice 1f130bf8a3 Android: Declare host thread when generating analytics ID
Another instance of the host thread check failing.
2023-06-21 18:16:46 +02:00
JosJuice 27db8d4123
Merge pull request #11935 from nitanmarcel/patch-1
Use getCacheDir if getExternalCacheDir returns null.
2023-06-19 20:47:27 +02:00
Marcel Alexandru Nitan cff7a4bfd2 Use getCacheDir if getExternalCacheDir returns null. 2023-06-13 18:44:27 +00:00
JosJuice 03f2f57edf Android: Add HostThreadLock where necessary 2023-06-12 23:39:42 +02:00
JosJuice 3519a7070d Android: And Lock and Unlock wrappers to HostThreadLock
This way we can ensure DeclareAsHostThread and UndeclareAsHostThread
are called when locking and unlocking.
2023-06-12 23:39:42 +02:00
JosJuice 5524042922 Android: Move host thread lock to a separate file 2023-06-12 23:39:42 +02:00
Robin Kertels 23bebc5270
VideoBackends:Vulkan: Allow loading custom drivers on Android
... using libadrenotools
2023-06-11 13:52:34 +02:00
Admiral H. Curtiss a7678f3210
Merge pull request #11694 from jnaidu360/skylanders-portal-window
Skylanders Portal Menu Navigational Improvements
2023-06-06 19:20:39 +02:00
jnaidu360 66f4902a1e Improved Skylanders Portal Window Navigation
Adds features to improve navigation of Skylanders portal menu, includes:
-List of Skylanders and filters for searching
-Improved buttons for faster loading options
-Added default user folder for storing .sky files
2023-06-04 18:10:08 -07:00
Admiral H. Curtiss b3c9f49cbe
Core: Assert that only the Host thread may call PauseAndLock(). 2023-06-02 18:51:43 +02:00
Joshua de Reeper cf3e8714eb Android: Add Hashmap to IDCache 2023-05-28 19:01:21 +12:00
Joshua de Reeper f8abc2c0e6 Android: Infinity Base UI
Add a UI option for the Infinity Base within the Android Emulation Activity
2023-05-28 19:01:21 +12:00
Admiral H. Curtiss 6a339cbdb3
IOS/ES: Split ESDevice into ESCore and ESDevice.
ESCore implements the core functionality that can also be used outside of emulation. ESDevice implements the IOS device and is only available during emulation.
2023-05-15 20:41:05 +02:00
Lioncash e4caace6bb Common/IniFile: Move interface into Common namespace
Gets this out of the global namespace and into the Common namespace
2023-04-13 10:19:28 -04:00
Admiral H. Curtiss 9217a9eba4
JitInterface: Refactor to class, move to System. 2023-03-26 14:38:07 +02:00
JosJuice 8e363c0995 Android: Translate C++ "w" to ParcelFileDescriptor "wt"
Previously we were translating "w" to "w", which unlike in C++ doesn't
truncate. See https://issuetracker.google.com/issues/180526528, and for
reference, https://en.cppreference.com/w/cpp/io/c/fopen and
https://en.cppreference.com/w/cpp/io/basic_filebuf/open.

This issue was brought to my attention by the recently published issue
CVE-2023-21036 in the screenshot editing tool on Pixel phones. I'm not
aware of any code in Dolphin that actually uses "w" with an existing
file on Android (when we ask the user for a location to save to using
SAF, a new file is always created), but still, best to fix this.
2023-03-18 13:44:01 +01:00
JosJuice 68fd133057 Android: Remove support for the old config system
All settings that we care about from an Android perspective are now
supported by the new config system, so we can remove all the Android code
for the old config system. This should have no impact on users.
2023-03-11 17:51:59 +01:00
JosJuice 53e7090f55 Migrate game INI profile setting to new config system 2023-03-11 17:51:58 +01:00
JosJuice 62ff2f1030
Merge pull request #11385 from JosJuice/android-input-overhaul
Android input overhaul
2023-03-11 12:37:44 +01:00
Admiral H. Curtiss eb25c46a91
HW/DVDInterface: Refactor to class. 2023-03-10 18:12:59 +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 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
JosJuice 1eeded23df Android: Add input profile management
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 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 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 93657cce54 Android: Stop extracting pre-defined controller INIs 2023-03-03 22:28:24 +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
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 78e8669bac
Merge pull request #11614 from t895/kotlin-cheats
Android: Convert Cheats Activity to Kotlin
2023-03-02 15:04:19 -05:00
Charles Lombardo ec7b811de3 Android: Convert RiivolutionPatches to Kotlin 2023-03-01 14:38:02 -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
Admiral H. Curtiss 435d8c39ee
Common/FatFsUtil: Add callback for cancelling SD card conversion. 2023-02-28 20:31:51 +01:00
JosJuice 86c1f6e1e7 Jit: Don't use a second stack
This second stack leads to JNI problems on Android, because ART fetches
the address and size of the original stack using pthread functions
(see GetThreadStack in art/runtime/thread.cc), and (presumably) treats
stack addresses outside of the original stack as invalid. (What I don't
understand is why some JNI operations on the CPU thread work fine
despite this but others don't.)

Instead of creating a second stack, let's borrow the approach ART uses:
Use pthread functions to find out the stack's address and size, then
install guard pages at an appropriate location. This lets us get rid
of a workaround we had in the MsgAlert function.

Because we're no longer choosing the stack size ourselves, I've made some
tweaks to where the put the guard pages. Previously we had a stack of
2 MiB and a safe zone of 512 KiB. We now accept stacks as small as 512 KiB
(used on macOS) and use a safe zone of 256 KiB. I feel like this should
be fine, but haven't done much testing beyond "it seems to work".

By the way, on Windows it was already the case that we didn't create
a second stack... But there was a bug in the implementation!
The code for protecting the stack has to run on the CPU thread, since
it's the CPU thread's stack we want to protect, but it was actually
running on EmuThread. This commit fixes that, since now this bug
matters on other operating systems too.
2023-02-28 20:29:46 +01:00
Scott Mansell ccf92a3e56
Merge pull request #11522 from phire/KillRendererWithFire
Kill Renderer (with phire)
2023-02-09 19:59:16 +13:00
Joshua de Reeper 680db55239 Android: Add Skylanders Portal
Co-Authored-By: Charles Lombardo <clombardo169@gmail.com>
2023-02-02 21:16:14 +13:00
Scott Mansell abfc75f362 Cleanup headers 2023-01-31 19:41:24 +13:00
Scott Mansell 0d4537d60f Move Presenting, Dumping and ImGui out of Renderer 2023-01-31 18:45:21 +13:00
Lioncash 5c1954c843 AndroidCommon: Make use of std::string_view where applicable
Several of these can take a string_view rather than needing to
specifically use std::string.
2023-01-30 13:30:52 -05:00
Lioncash e5b91f00b0 Common: Replace StringBeginsWith/StringEndsWith with std equivalents
Obsoletes these functions in favor of the standard member functions
added in C++20.
2023-01-24 14:58:20 -05: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
GaryOderNichts 88c57a00a3 Show vWii System Menu version in Menu Bar 2022-10-22 13:36:55 +02:00
JosJuice 51ee05cb35 Android: Use input override system for touch controls
This is the first step of getting rid of the controller indirection
on Android. (Needing a way for touch controls to provide input
to the emulator core is the reason why the controller indirection
exists to begin with as far as I understand it.)
2022-10-03 22:04:09 +02:00
JosJuice 04072f0ce6 Integrate "Ignore for this session" better with config system
Because of the previous commit, this is needed to stop DolphinQt from
forgetting that the user pressed ignore whenever any part of the config
is changed.

This commit also changes the behavior a bit on DolphinQt: "Ignore for
this session" now applies to the current emulation session instead of
the current Dolphin launch. This matches how it already worked on
Android, and is in my opinion better because it means the user won't
lose out on important panic alerts in a game becase they played another
game first that had repeated panic alerts that they wanted to ignore.

For Android, this commit isn't necessary, but it makes the code cleaner.
2022-09-24 13:03:45 +02:00
InvoxiPlayGames f9e39cf200 Add Discord presence ioctlv to /dev/dolphin 2022-08-06 07:32:29 +01:00
JosJuice 8f410bff15 Android: Add graphics mods support to CheatsActivity 2022-07-23 21:58:45 +02:00
JMC47 3d7b66bcfc
Merge pull request #10861 from JosJuice/android-new-sd
Android: Bring SD card settings up to date with DolphinQt
2022-07-23 07:59:19 -04:00
JosJuice a20d0e31d6 Android: Bring SD card settings up to date with DolphinQt 2022-07-23 13:28:34 +02:00
JosJuice 01e4ce54c8 Android: Call WiimoteReal::InitAdapterClass before controller init
Should fix https://bugs.dolphin-emu.org/issues/12980.
2022-07-19 23:00:21 +02:00
JosJuice dabad82219 Require frontend to initialize controllers
We currently have two different code paths for initializing controllers:
Either the frontend (DolphinQt) can do it, or if the frontend doesn't do
it, the core will do it automatically when booting. Having these two
paths has caused problems in the past due to only one frontend being
tested (see de7ef47548). I would like to get rid of the latter path to
avoid further problems like this.
2022-07-17 14:03:04 +02:00
JosJuice 57733ddc70 Android: Implement installing system update from disc image 2022-04-03 11:15:28 +02:00
Pokechu22 37806472e1 GCAdapter: Defer initialization until MainWindow::InitControllers
If libusb fails to initialize, an assertion fails, but if that happens before the main window is created, then Dolphin just dies.  Now, the panic alert is properly shown and the user can ignore it.
2022-03-10 10:35:45 -08:00
Mai M c474db9301
Merge pull request #10407 from JosJuice/android-reset-callback
Android: Call OnConfigChanged when resetting a setting
2022-02-26 11:24:18 -05:00
JMC47 75ad057b08
Merge pull request #10405 from JosJuice/android-no-boot-timeout
Android: Get rid of the boot timeout
2022-02-23 15:40:54 -05:00
JosJuice 1b76171a27 Android: Get rid of LegacyIntSetting
The only settings that were using LegacyIntSetting are now in the new
config system, so there's no reason to have LegacyIntSetting anymore.
2022-02-18 22:17:39 +01:00
JosJuice aff45c91fc Port Wiimote source settings to the new config system
This lets us finally get rid of BootManager's ConfigCache!
2022-02-18 21:27:10 +01:00
Léo Lam b32af33f24
Merge pull request #10409 from JosJuice/android-no-cplusplus-checks
Android: Get rid of __cplusplus macro checks
2022-01-30 18:55:36 +01:00
JosJuice b8a6fcb1a7 Android: Get rid of __cplusplus macro checks
These files cannot compile correctly as C, so there's no reason to have
ifdefs for C compatibility.

We switched to not checking the __cplusplus macro in our JNI code some
time ago, but it seems like I forgot to remove it from these two files.
2022-01-29 18:38:55 +01:00
JosJuice e101c5aaf3 Android: Fix incorrect include of PostProcessing.h 2022-01-29 18:30:11 +01:00
JosJuice 7f32057e91 Android: Call OnConfigChanged when resetting a setting
Otherwise the value of the setting won't be updated properly.
2022-01-29 15:49:03 +01:00
JosJuice 07f2587e63 Android: Get rid of the boot timeout
We don't have a timeout like this on other platforms, and it doesn't
accomplish anything useful as far as I can tell. If you trigger it,
all that happens is that you don't get a working game and also can't
press Exit Emulation without Dolphin hanging (stuck in Core::Shutdown).
2022-01-29 11:15:04 +01:00
JMC47 237947e2f1
Merge pull request #10369 from Simonx22/android-online-system-update-2
Android: Add online system update functionality
2022-01-22 14:46:42 -05:00
OatmealDome 8ad1292df7 NativeLibrary: Add function to start system menu 2022-01-21 17:23:05 -05:00
OatmealDome 30d51348f9 WiiUtils: Add function to get current system menu version 2022-01-21 17:19:14 -05:00
OatmealDome 36257f7f42 WiiUtils: Add function to check if system menu is installed 2022-01-21 17:18:38 -05:00
OatmealDome 2fc7671eaf WiiUtils: Add doOnlineUpdate() function 2022-01-21 17:17:42 -05:00
OatmealDome 19e1809cdf WiiUtils: Add function to convert UpdateResult to jint 2022-01-21 17:16:23 -05:00
OatmealDome 7c86baee50 WiiUpdateCallback: Add interface for update callback 2022-01-21 17:14:16 -05:00
Léo Lam 83c5446d85
Fix static initialisation order fiasco issue for Version variables
Fixes a crash that could occur if the static constructor function for
the MainSettings.cpp TU happened to run before the variables in
Common/Version.cpp are initialised. (This is known as the static
initialisation order fiasco.)

By using wrapper functions, those variables are now guaranteed to be
constructed on first use.
2022-01-14 00:04:22 +01:00
Pokechu22 161c627466 Treewide: Remove unused inclusions of <cinttypes>
Most of these became unneeded when fmt was introduced.
2022-01-09 12:43:11 -08:00
Admiral H. Curtiss ab56f3ecbd
Calls to File::SetUserPath() no longer need to manually append directory separators. 2021-12-25 20:21:32 +01:00
Admiral H. Curtiss 83ad84061e
Core/Boot: Refactor storage of boot-to-savestate data into a separate class. 2021-11-22 00:35:35 +01:00
JosJuice 22a1f3422c Android: Add Riivolution patch configuration 2021-10-30 23:24:37 +02:00
JosJuice 34021b5ebc Android: Allow starting game with Riivolution patches from the GUI 2021-10-30 23:24:36 +02:00
Léo Lam 7855e5f73b
Turn MAX_LOGLEVEL into a true constant (and fix self-comparison warning)
This replaces the MAX_LOGLEVEL define with a constexpr variable
in order to fix self-comparison warnings in the logging macros
when compiling with Clang. (Without this change, the log level check
in the logging macros is expanded into something like this:
`if (LINFO <= LINFO)`, which triggers a tautological compare warning.)
2021-10-15 21:51:01 +02:00
JosJuice b28e5149a7 Android: Improve OpenModeToAndroid's handling of 'b'
Now it also works when b isn't at the very end. (+ goes after b.)
2021-10-13 17:39:09 +02:00
JosJuice 9bb85ca706 DolphinQt/Android: Add warning when converting NKit files
Yes, that's right! It's time to add even more NKit warnings,
because users still don't understand what NKit is or how it works!

More specifically, some users seem to be under the impression that
converting an NKit file to for instance RVZ using Dolphin's convert
feature will result in a normal RVZ file, when it in fact results in
an NKit RVZ file (since NKit is not a container format in the sense
that GCZ/WIA/RVZ/WBFS/CISO is, but rather a kind of trimmed ISO).
I can hardly blame users for not knowing this, because it's not
intuitive unless you know the technical details of how NKit works.
2021-10-02 11:09:36 +02:00
JosJuice 3eb07e9772 Android: Don't rely on onPause for pausing before destroying surface
Fixes a crash which was uncovered (or just made more likely?)
by the previous commit.
2021-09-21 16:33:57 +02:00
JosJuice 446e2d9119 Android: Remove state from EmulationState 2021-09-21 16:32:47 +02:00
JosJuice 2c564a0b9d Android: Remove mSurface from EmulationState 2021-09-21 16:31:55 +02:00
JosJuice 53ae1a0725 Android: Add Gecko code downloading 2021-09-16 18:48:39 +02:00
JosJuice 404eb13e2f Android: Add the ability to add cheats 2021-09-16 18:48:39 +02:00
JosJuice e299be1d85 Android: Add creator and notes fields for Gecko codes 2021-09-16 18:48:38 +02:00
JosJuice 883a9f8a99 Android: Allow viewing/editing the actual codes 2021-09-16 18:48:38 +02:00
JosJuice 43dcbf33ad Android: Add edit button for cheats 2021-09-16 16:46:49 +02:00
JosJuice 93a1271386 Android: Add checkboxes for toggling cheats enabled 2021-09-16 16:46:49 +02:00
JosJuice 4d609c769f Android: Implement basic read-only cheats list 2021-09-16 16:46:48 +02:00
JosJuice bba33c7ced Android: Don't hold gameFileCache lock while finding games
FindAllGamePaths may take a little while, and holding the
gameFileCache lock isn't actually necessary until it's time to
put the results returned by FindAllGamePaths into gameFileCache.

The downside of this change is that we have to do an extra
round of JNI in between FindAllGamePaths and Update,
but I don't think that's much of a problem.
2021-08-24 14:56:33 +02:00
Bonta 2d744da68c Core: Add GBA host interface 2021-07-13 16:42:49 +02:00