diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-10-31 07:23:57 +0100 |
---|---|---|
committer | Charles Lombardo <clombardo169@gmail.com> | 2023-10-31 19:41:40 +0100 |
commit | 133788d0d4c12df7d7e39c4962cadadc781c596c (patch) | |
tree | 79f6d686aec99bb398a08da2cb46c1306cbae1fb | |
parent | android: Implement applet launcher (diff) | |
download | yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar.gz yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar.bz2 yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar.lz yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar.xz yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar.zst yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.zip |
-rw-r--r-- | src/android/app/src/main/jni/native.cpp | 22 | ||||
-rw-r--r-- | src/android/app/src/main/jni/native.h | 1 |
2 files changed, 14 insertions, 9 deletions
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index f7931a89d..0e458df38 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -247,6 +247,17 @@ void EmulationSession::ConfigureFilesystemProvider(const std::string& filepath) } } +void EmulationSession::InitializeSystem() { + // Initialize filesystem. + m_system.SetFilesystem(m_vfs); + m_system.GetUserChannel().clear(); + m_manual_provider = std::make_unique<FileSys::ManualContentProvider>(); + m_system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>()); + m_system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::FrontendManual, + m_manual_provider.get()); + m_system.GetFileSystemController().CreateFactories(*m_vfs); +} + Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string& filepath) { std::scoped_lock lock(m_mutex); @@ -254,9 +265,6 @@ Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string m_window = std::make_unique<EmuWindow_Android>(&m_input_subsystem, m_native_window, m_vulkan_library); - m_system.SetFilesystem(m_vfs); - m_system.GetUserChannel().clear(); - // Initialize system. jauto android_keyboard = std::make_unique<SoftwareKeyboard::AndroidKeyboard>(); m_software_keyboard = android_keyboard.get(); @@ -277,11 +285,6 @@ Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string }); // Initialize filesystem. - m_manual_provider = std::make_unique<FileSys::ManualContentProvider>(); - m_system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>()); - m_system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::FrontendManual, - m_manual_provider.get()); - m_system.GetFileSystemController().CreateFactories(*m_vfs); ConfigureFilesystemProvider(filepath); // Initialize account manager @@ -663,11 +666,12 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchReleased(JNIEnv* env, jclass c } } -void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation(JNIEnv* env, jclass clazz) { +void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jclass clazz) { // Create the default config.ini. Config{}; // Initialize the emulated system. EmulationSession::GetInstance().System().Initialize(); + EmulationSession::GetInstance().InitializeSystem(); } jint Java_org_yuzu_yuzu_1emu_NativeLibrary_defaultCPUCore(JNIEnv* env, jclass clazz) { diff --git a/src/android/app/src/main/jni/native.h b/src/android/app/src/main/jni/native.h index b1db87e41..0aa2b085b 100644 --- a/src/android/app/src/main/jni/native.h +++ b/src/android/app/src/main/jni/native.h @@ -43,6 +43,7 @@ public: const Core::PerfStatsResults& PerfStats() const; void ConfigureFilesystemProvider(const std::string& filepath); + void InitializeSystem(); Core::SystemResultStatus InitializeEmulation(const std::string& filepath); bool IsHandheldOnly(); |