summaryrefslogtreecommitdiff
path: root/Source/Android/jni/MainAndroid.cpp
AgeCommit message (Collapse)Author
2026-01-19State: Simplify interthread communication and cleanups. Save/Load calls are ↵Jordan Woyak
now always non-blocking for the caller, but appropriately block the CPU thread as needed.
2025-11-08Init achievement manager in Android startupLillyJadeKatrin
2025-11-08Merge pull request #14047 from Simonx22/reset-all-dolphin-settings-androidOatmealDome
Android: Add Reset Dolphin Settings functionality
2025-11-08Merge pull request #14086 from Simonx22/android/use-native-analyticsOatmealDome
Android: Use the shared HTTP analytics backend
2025-11-08Android: Use the shared HTTP analytics backendSimonx22
We can now route Android analytics through Common::HttpAnalyticsBackend, drop the Volley sender, and keep the JNI layer limited to only transfer metadata since https://bugs.dolphin-emu.org/issues/11772 has been fixed.
2025-11-02Android: Add Reset Dolphin Settings functionalitySimonx22
2025-09-19Logging: Don't overwrite LDEBUG verbosity in Release buildsDentomologist
Preserve the configured logging verbosity unless the user actually changes it, rather than capping it to LINFO on release builds. Rename LogManager::m_level to m_effective_level and distinguish between the config and effective level in various function/variable names. Make m_effective_level atomic to prevent data races when setting the effective log level from the config changed callback.
2025-08-03Host: Remove unnecessary functionsDentomologist
Remove Host_RefreshDSPDebuggerWindow (which hasn't done anything since DolphinWX was removed in 44b22c90) and DSP::Host::UpdateDebugger (which only called Host_RefreshDSPDebuggerWindow).
2025-08-03Host: Remove unnecessary functionDentomologist
Remove Host_UpdateMainFrame(). The only non-empty call happened in DolphinNoGUI which called s_update_main_frame_event.Set(), but DolphinNoGUI never waits on that event.
2025-07-26Android: Don't let RetroAchievements override onPauseJosJuice
When Android sends Dolphin to the background, emulation *must* pause, otherwise emulation continues running and continues outputting audio to the user. RetroAchievements mustn't be allowed to override it.
2025-03-15Merge pull request #12866 from JosJuice/android-log-types-sortingJosJuice
Android: Replace log type names map with array
2025-01-10Merge pull request #13030 from JosJuice/android-wait-for-surface-in-runAdmiral H. Curtiss
Android: Wait for surface in Run
2024-11-15GDBStub: Signal Breakpoint Changes To Hostmitaclaw
2024-11-03VideoBackendBase: Clarify function nameDentomologist
Rename GetDefaultBackendName to GetDefaultBackendConfigName to distinguish it from the display name.
2024-10-23Host: Rename `JitCacheInvalidation`mitaclaw
There are two hard problems in computer science...
2024-10-19DolphinQt: JIT Widget Refreshmitaclaw
Fulfilling a certain six-year-old todo.
2024-10-18JitCache: Add WipeBlockProfilingData Functionmitaclaw
Accessible from DolphinQt and Android.
2024-10-04Partially revert "Revert "Audit uses of IsRunning and GetState""JosJuice
This reverts the revert commit bc67fc97c39628c76a4dbca411b0e8a9bfaf726a, except for the changes in BaseConfigLoader.cpp, which caused the bug that made us revert 72cf2bdb87f09deff22e1085de3290126aa4ad05. PR 12917 contains an improved change to BaseConfigLoader.cpp, which can be merged (or rejected) independently. A few changes have also been made based on review comments.
2024-08-21Android: Wait for surface in RunJosJuice
When we boot the core, it needs to have a valid surface to draw graphics to. Our Kotlin code does wait for a valid surface to exist before it calls NativeLibrary.Run, but there's a chance for the surface to be deleted before Run locks s_surface_lock. If that happens, the core boots without a valid surface, which presumably would cause a crash. (I haven't been able to reproduce the problem myself.)
2024-07-28MainAndroid: Thread Correctness In WriteJitBlockLogDumpmitaclaw
In a race condition, the core could shut down between the `JitInterface::GetCore` nullptr check and the `JitInterface::JitBlockLogDump` call which constructs a `CPUThreadGuard`. In this scenario, nothing horrible happens—`JitBlockLogDump` also checks for a nullptr—but it would be a failure to display the correct feedback to the user.
2024-07-27MainAndroid: Use JNI_FALSE instead of static_cast<jboolean>(false)mitaclaw
2024-06-26Revert "Audit uses of IsRunning and GetState"JosJuice
This reverts commit 72cf2bdb87f09deff22e1085de3290126aa4ad05. SYSCONF settings are getting cleared when they shouldn't be. Let's revert the change until I get proper time to figure out why it's broken.
2024-06-22Merge pull request #12828 from JosJuice/unify-state-variables-2Admiral H. Curtiss
Clean up Core::GetState
2024-06-21Audit uses of IsRunning and GetStateJosJuice
Some pieces of code are calling IsRunning because there's some particular action that only makes sense when emulation is running, for instance showing the state of the emulated CPU. IsRunning is appropriate to use for this. Then there are pieces of code that are calling IsRunning because there's some particular thing they must avoid doing e.g. when the CPU thread is running or IOS is running. IsRunning isn't quite appropriate for this. Such code should also be checking for the states Starting and Stopping. Keep in mind that: * When the state is Starting, the state can asynchronously change to Running at any time. * When we try to stop the core, the state gets set to Stopping before we take any action to actually stop things. This commit adds a new method Core::IsUninitialized, and changes all callers of IsRunning and GetState that look to me like they should be changed.
2024-06-21Core: Store current state in less placesJosJuice
Core::GetState reads from four different pieces of state: s_is_stopping, s_hardware_initialized, s_is_booting, and CPUManager::IsStepping. I'm keeping that last one as is for now because there's code in Dolphin that sets it directly, but we can unify the other three to make things easier to reason about. This commit also gets rid of s_is_started. This was previously used in Core::IsRunningAndStarted to ensure true wouldn't be returned until the CPU thread was started, but it wasn't used in Core::GetState, so Core::GetState would happily return State::Running after we had initialized the hardware but before we had initialized the CPU thread. As far as I know, there are no callers that have any real need to know whether the boot process is currently initializing the hardware or the CPU thread. Perhaps once upon a time there was a desire to make the apploader debuggable, but a long time has passed without anyone stepping up to implement it, and the way CBoot::RunApploader is implemented makes it rather difficult. So this commit makes all the functions in Core.cpp consider the core to still be starting until the CPU thread is started.
2024-06-15Android: Replace log type names map with arrayJosJuice
Storing the log type names in a map results in them getting re-sorted by their keys, which doesn't quite give us the sorting we want. In particular, the Achievements category ended up being sorted at R (for RetroAchivements) instead of at A. Every use of the map is just iterating through it, so there's no real reason why it has to be a map anyway.
2024-05-31TAS Input: Enable hotkeys and controller input when Input has focusDentomologist
Enable emulator hotkeys and controller input (when that option is enabled) when a TAS Input window has focus, as if it was the render window instead. This allows TASers to use frame advance and the like without having to switch the focused window or disabling Hotkeys Require Window Focus which also picks up keypresses while other apps are active. Cursor updates are disabled when the TAS Input window has focus, as otherwise the Wii IR widget (and anything else controlled by the mouse) becomes unusable. The cursor continues to work normally when the render window has focus.
2024-05-03Core::SetState: Avoid Global System Accessormitaclaw
2024-05-01Core::IsRunning: Avoid Global System Accessormitaclaw
2024-04-13Merge pull request #12691 from mitaclaw/jit-profiling-restorationAdmiral H. Curtiss
JitCache: Software Profiling Restoration
2024-04-09JitCache: Software Profiling Restorationmitaclaw
Rekindle software JIT profiling with a std::chrono conversion and a config connection.
2024-04-08Core::GetState: Avoid Global System Accessormitaclaw
2024-03-31Merge pull request #12645 from mitaclaw/ppc-symbols-signalAdmiral H. Curtiss
DolphinQt: A Ubiquitous Signal For When Symbols Change
2024-03-28DolphinQt: A Ubiquitous Signal For When Symbols Changemitaclaw
There were three distinct mechanisms for signaling symbol changes in DolphinQt: `Host::NotifyMapLoaded`, `MenuBar::NotifySymbolsUpdated`, and `CodeViewWidget::SymbolsChanged`. The behavior of these signals has been consolidated into the new `Host::PPCSymbolsUpdated` signal, which can be emitted from anywhere in DolphinQt to properly update symbols everywhere in DolphinQt.
2024-03-23Core: Remove RunAsCPUThreadmitaclaw
It's a fine function, but CPUThreadGuard is more vogue. Also, its potential for being confused with RunOnCPUThread will not be missed.
2024-03-22Merge pull request #12606 from mitaclaw/state-global-systemAdmiral H. Curtiss
State: Avoid Global System Accessor
2024-03-22Merge pull request #12620 from mitaclaw/jit-interface-cpu-thread-guardAdmiral H. Curtiss
JitInterface::ClearCache: Modernize With CPUThreadGuard
2024-03-18Core: Avoid (Some) Global System Accessormitaclaw
2024-03-17Merge pull request #12616 from mitaclaw/dvd-interface-cpu-thread-guardAdmiral H. Curtiss
DVDInterface: Modernize With CPUThreadGuard
2024-03-08DVDInterface: Modernize With CPUThreadGuardmitaclaw
2024-03-04JitInterface::ClearCache: Modernize With CPUThreadGuardmitaclaw
It is recommended to view this diff with whitespace changes hidden.
2024-03-01BootManager: Avoid Global System Accessormitaclaw
2024-03-01State: Avoid Global System Accessormitaclaw
2024-01-31Migrate SConfig::bWii to System.Admiral H. Curtiss
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.