diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/android/app/src/main/jni/emu_window/emu_window.cpp | 8 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/emu_window/emu_window.h | 4 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/native.cpp | 2 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/native.h | 3 |
4 files changed, 13 insertions, 4 deletions
diff --git a/src/android/app/src/main/jni/emu_window/emu_window.cpp b/src/android/app/src/main/jni/emu_window/emu_window.cpp index a7e414b81..c4f631924 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.cpp +++ b/src/android/app/src/main/jni/emu_window/emu_window.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "input_common/drivers/virtual_gamepad.h" | 9 | #include "input_common/drivers/virtual_gamepad.h" |
| 10 | #include "input_common/main.h" | 10 | #include "input_common/main.h" |
| 11 | #include "jni/emu_window/emu_window.h" | 11 | #include "jni/emu_window/emu_window.h" |
| 12 | #include "jni/native.h" | ||
| 12 | 13 | ||
| 13 | void EmuWindow_Android::OnSurfaceChanged(ANativeWindow* surface) { | 14 | void EmuWindow_Android::OnSurfaceChanged(ANativeWindow* surface) { |
| 14 | m_window_width = ANativeWindow_getWidth(surface); | 15 | m_window_width = ANativeWindow_getWidth(surface); |
| @@ -57,6 +58,13 @@ void EmuWindow_Android::OnRemoveNfcTag() { | |||
| 57 | m_input_subsystem->GetVirtualAmiibo()->CloseAmiibo(); | 58 | m_input_subsystem->GetVirtualAmiibo()->CloseAmiibo(); |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 61 | void EmuWindow_Android::OnFrameDisplayed() { | ||
| 62 | if (!m_first_frame) { | ||
| 63 | EmulationSession::GetInstance().OnEmulationStarted(); | ||
| 64 | m_first_frame = true; | ||
| 65 | } | ||
| 66 | } | ||
| 67 | |||
| 60 | EmuWindow_Android::EmuWindow_Android(InputCommon::InputSubsystem* input_subsystem, | 68 | EmuWindow_Android::EmuWindow_Android(InputCommon::InputSubsystem* input_subsystem, |
| 61 | ANativeWindow* surface, | 69 | ANativeWindow* surface, |
| 62 | std::shared_ptr<Common::DynamicLibrary> driver_library) | 70 | std::shared_ptr<Common::DynamicLibrary> driver_library) |
diff --git a/src/android/app/src/main/jni/emu_window/emu_window.h b/src/android/app/src/main/jni/emu_window/emu_window.h index b38087f73..a34a0e479 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.h +++ b/src/android/app/src/main/jni/emu_window/emu_window.h | |||
| @@ -45,7 +45,7 @@ public: | |||
| 45 | float gyro_z, float accel_x, float accel_y, float accel_z); | 45 | float gyro_z, float accel_x, float accel_y, float accel_z); |
| 46 | void OnReadNfcTag(std::span<u8> data); | 46 | void OnReadNfcTag(std::span<u8> data); |
| 47 | void OnRemoveNfcTag(); | 47 | void OnRemoveNfcTag(); |
| 48 | void OnFrameDisplayed() override {} | 48 | void OnFrameDisplayed() override; |
| 49 | 49 | ||
| 50 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override { | 50 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override { |
| 51 | return {std::make_unique<GraphicsContext_Android>(m_driver_library)}; | 51 | return {std::make_unique<GraphicsContext_Android>(m_driver_library)}; |
| @@ -61,4 +61,6 @@ private: | |||
| 61 | float m_window_height{}; | 61 | float m_window_height{}; |
| 62 | 62 | ||
| 63 | std::shared_ptr<Common::DynamicLibrary> m_driver_library; | 63 | std::shared_ptr<Common::DynamicLibrary> m_driver_library; |
| 64 | |||
| 65 | bool m_first_frame = false; | ||
| 64 | }; | 66 | }; |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 1484cc224..64663b084 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -372,8 +372,6 @@ void EmulationSession::RunEmulation() { | |||
| 372 | m_system.InitializeDebugger(); | 372 | m_system.InitializeDebugger(); |
| 373 | } | 373 | } |
| 374 | 374 | ||
| 375 | OnEmulationStarted(); | ||
| 376 | |||
| 377 | while (true) { | 375 | while (true) { |
| 378 | { | 376 | { |
| 379 | [[maybe_unused]] std::unique_lock lock(m_mutex); | 377 | [[maybe_unused]] std::unique_lock lock(m_mutex); |
diff --git a/src/android/app/src/main/jni/native.h b/src/android/app/src/main/jni/native.h index 6b02c44b5..78ef96802 100644 --- a/src/android/app/src/main/jni/native.h +++ b/src/android/app/src/main/jni/native.h | |||
| @@ -52,9 +52,10 @@ public: | |||
| 52 | void OnGamepadDisconnectEvent([[maybe_unused]] int index); | 52 | void OnGamepadDisconnectEvent([[maybe_unused]] int index); |
| 53 | SoftwareKeyboard::AndroidKeyboard* SoftwareKeyboard(); | 53 | SoftwareKeyboard::AndroidKeyboard* SoftwareKeyboard(); |
| 54 | 54 | ||
| 55 | static void OnEmulationStarted(); | ||
| 56 | |||
| 55 | private: | 57 | private: |
| 56 | static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max); | 58 | static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max); |
| 57 | static void OnEmulationStarted(); | ||
| 58 | static void OnEmulationStopped(Core::SystemResultStatus result); | 59 | static void OnEmulationStopped(Core::SystemResultStatus result); |
| 59 | 60 | ||
| 60 | private: | 61 | private: |