diff options
| author | 2023-10-31 02:23:57 -0400 | |
|---|---|---|
| committer | 2023-10-31 14:41:40 -0400 | |
| commit | 133788d0d4c12df7d7e39c4962cadadc781c596c (patch) | |
| tree | 79f6d686aec99bb398a08da2cb46c1306cbae1fb /src | |
| parent | android: Implement applet launcher (diff) | |
| download | yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar.gz yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.tar.xz yuzu-133788d0d4c12df7d7e39c4962cadadc781c596c.zip | |
android: Initialize filesystem components during application start
Diffstat (limited to 'src')
| -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) | |||
| 247 | } | 247 | } |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | void EmulationSession::InitializeSystem() { | ||
| 251 | // Initialize filesystem. | ||
| 252 | m_system.SetFilesystem(m_vfs); | ||
| 253 | m_system.GetUserChannel().clear(); | ||
| 254 | m_manual_provider = std::make_unique<FileSys::ManualContentProvider>(); | ||
| 255 | m_system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>()); | ||
| 256 | m_system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::FrontendManual, | ||
| 257 | m_manual_provider.get()); | ||
| 258 | m_system.GetFileSystemController().CreateFactories(*m_vfs); | ||
| 259 | } | ||
| 260 | |||
| 250 | Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string& filepath) { | 261 | Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string& filepath) { |
| 251 | std::scoped_lock lock(m_mutex); | 262 | std::scoped_lock lock(m_mutex); |
| 252 | 263 | ||
| @@ -254,9 +265,6 @@ Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string | |||
| 254 | m_window = | 265 | m_window = |
| 255 | std::make_unique<EmuWindow_Android>(&m_input_subsystem, m_native_window, m_vulkan_library); | 266 | std::make_unique<EmuWindow_Android>(&m_input_subsystem, m_native_window, m_vulkan_library); |
| 256 | 267 | ||
| 257 | m_system.SetFilesystem(m_vfs); | ||
| 258 | m_system.GetUserChannel().clear(); | ||
| 259 | |||
| 260 | // Initialize system. | 268 | // Initialize system. |
| 261 | jauto android_keyboard = std::make_unique<SoftwareKeyboard::AndroidKeyboard>(); | 269 | jauto android_keyboard = std::make_unique<SoftwareKeyboard::AndroidKeyboard>(); |
| 262 | m_software_keyboard = android_keyboard.get(); | 270 | m_software_keyboard = android_keyboard.get(); |
| @@ -277,11 +285,6 @@ Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string | |||
| 277 | }); | 285 | }); |
| 278 | 286 | ||
| 279 | // Initialize filesystem. | 287 | // Initialize filesystem. |
| 280 | m_manual_provider = std::make_unique<FileSys::ManualContentProvider>(); | ||
| 281 | m_system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>()); | ||
| 282 | m_system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::FrontendManual, | ||
| 283 | m_manual_provider.get()); | ||
| 284 | m_system.GetFileSystemController().CreateFactories(*m_vfs); | ||
| 285 | ConfigureFilesystemProvider(filepath); | 288 | ConfigureFilesystemProvider(filepath); |
| 286 | 289 | ||
| 287 | // Initialize account manager | 290 | // Initialize account manager |
| @@ -663,11 +666,12 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchReleased(JNIEnv* env, jclass c | |||
| 663 | } | 666 | } |
| 664 | } | 667 | } |
| 665 | 668 | ||
| 666 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation(JNIEnv* env, jclass clazz) { | 669 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jclass clazz) { |
| 667 | // Create the default config.ini. | 670 | // Create the default config.ini. |
| 668 | Config{}; | 671 | Config{}; |
| 669 | // Initialize the emulated system. | 672 | // Initialize the emulated system. |
| 670 | EmulationSession::GetInstance().System().Initialize(); | 673 | EmulationSession::GetInstance().System().Initialize(); |
| 674 | EmulationSession::GetInstance().InitializeSystem(); | ||
| 671 | } | 675 | } |
| 672 | 676 | ||
| 673 | jint Java_org_yuzu_yuzu_1emu_NativeLibrary_defaultCPUCore(JNIEnv* env, jclass clazz) { | 677 | 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: | |||
| 43 | 43 | ||
| 44 | const Core::PerfStatsResults& PerfStats() const; | 44 | const Core::PerfStatsResults& PerfStats() const; |
| 45 | void ConfigureFilesystemProvider(const std::string& filepath); | 45 | void ConfigureFilesystemProvider(const std::string& filepath); |
| 46 | void InitializeSystem(); | ||
| 46 | Core::SystemResultStatus InitializeEmulation(const std::string& filepath); | 47 | Core::SystemResultStatus InitializeEmulation(const std::string& filepath); |
| 47 | 48 | ||
| 48 | bool IsHandheldOnly(); | 49 | bool IsHandheldOnly(); |