summaryrefslogtreecommitdiff
path: root/Source/Android/jni/MainAndroid.cpp
AgeCommit message (Collapse)Author
2023-11-25Android: Remove HostThreadLocks that are no longer neededJosJuice
71ce8bb6f00f4d1cbc1012270d6daefdbda4254d got rid of the need to be the host or CPU thread when writing to the config.
2023-06-21Android: Declare host thread when generating analytics IDJosJuice
Another instance of the host thread check failing.
2023-06-19Merge pull request #11935 from nitanmarcel/patch-1JosJuice
Use getCacheDir if getExternalCacheDir returns null.
2023-06-13Use getCacheDir if getExternalCacheDir returns null.Marcel Alexandru Nitan
2023-06-12Android: Add HostThreadLock where necessaryJosJuice
2023-06-12Android: And Lock and Unlock wrappers to HostThreadLockJosJuice
This way we can ensure DeclareAsHostThread and UndeclareAsHostThread are called when locking and unlocking.
2023-06-12Android: Move host thread lock to a separate fileJosJuice
2023-06-11VideoBackends:Vulkan: Allow loading custom drivers on AndroidRobin Kertels
... using libadrenotools
2023-06-02Core: Assert that only the Host thread may call PauseAndLock().Admiral H. Curtiss
2023-03-26JitInterface: Refactor to class, move to System.Admiral H. Curtiss
2023-03-11Merge pull request #11385 from JosJuice/android-input-overhaulJosJuice
Android input overhaul
2023-03-10HW/DVDInterface: Refactor to class.Admiral H. Curtiss
2023-03-07Android: Change how the overlay controller setting worksJosJuice
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-03Android: Stop extracting pre-defined controller INIsJosJuice
2023-03-03Android: Remove old motion input implementationJosJuice
2023-03-03ControllerInterface/Android: Rip out ButtonManagerJosJuice
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-02-28Jit: Don't use a second stackJosJuice
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-01-31Cleanup headersScott Mansell
2023-01-31Move Presenting, Dumping and ImGui out of RendererScott Mansell
2022-12-27Android: Make more meticulous use of DeleteLocalRefJosJuice
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-10-03Android: Use input override system for touch controlsJosJuice
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-08-06Add Discord presence ioctlv to /dev/dolphinInvoxiPlayGames
2022-07-19Android: Call WiimoteReal::InitAdapterClass before controller initJosJuice
Should fix https://bugs.dolphin-emu.org/issues/12980.
2022-07-17Require frontend to initialize controllersJosJuice
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-03-10GCAdapter: Defer initialization until MainWindow::InitControllersPokechu22
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-02-23Merge pull request #10405 from JosJuice/android-no-boot-timeoutJMC47
Android: Get rid of the boot timeout
2022-02-18Port Wiimote source settings to the new config systemJosJuice
This lets us finally get rid of BootManager's ConfigCache!
2022-01-29Android: Get rid of the boot timeoutJosJuice
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-22Merge pull request #10369 from Simonx22/android-online-system-update-2JMC47
Android: Add online system update functionality
2022-01-21NativeLibrary: Add function to start system menuOatmealDome
2022-01-14Fix static initialisation order fiasco issue for Version variablesLéo Lam
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-09Treewide: Remove unused inclusions of <cinttypes>Pokechu22
Most of these became unneeded when fmt was introduced.
2021-12-25Calls to File::SetUserPath() no longer need to manually append directory ↵Admiral H. Curtiss
separators.
2021-11-22Core/Boot: Refactor storage of boot-to-savestate data into a separate class.Admiral H. Curtiss
2021-10-30Android: Allow starting game with Riivolution patches from the GUIJosJuice
2021-10-15Turn MAX_LOGLEVEL into a true constant (and fix self-comparison warning)Léo Lam
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-09-21Android: Don't rely on onPause for pausing before destroying surfaceJosJuice
Fixes a crash which was uncovered (or just made more likely?) by the previous commit.
2021-09-21Android: Remove state from EmulationStateJosJuice
2021-09-21Android: Remove mSurface from EmulationStateJosJuice
2021-07-13Core: Add GBA host interfaceBonta
2021-07-08Android: Avoid crash on early panic alertJosJuice
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-05-27Implement Cursor Locking and new input focus checks for itFiloppi
2021-03-27Set console's default language/country/region based on computer settingsJosJuice
2021-03-04Android: Remove #ifdef __cplusplus checksJosJuice
A C compiler would very much be unable to build this code anyway.
2021-01-27msbuild: bundle all dolphin "core" code into single libraryShawn Hoffman
2021-01-27Android: Move InstallWAD to a new WiiUtils classJosJuice
I'm trying to move away from dumping every native method in NativeLibrary.
2020-11-30Android: Add "Generate a New Statistics Identity"Ryan Meredith
2020-11-09Android: Remove unnecessary ANativeWindow_release callJosJuice
This is already handled by SurfaceDestroyed. In the worst case, the extra code could even race with SurfaceDestroyed if they are triggered at the same time, but this is highly improbable.
2020-11-09Android: Fix rotating EmulationActivity after boot failsJosJuice
Time for yet another new iteration of working around the "surface destruction during boot" problem... This time, the strategy is to use a mutex in MainAndroid.cpp.