Browse Source
Merge pull request #11959 from t895/firmware-reload-fix
android: Don't reload log/system after loading firmware/backup
pull/15/merge
liamwhite
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
18 additions and
13 deletions
-
src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt
-
src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt
-
src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryInitialization.kt
-
src/android/app/src/main/jni/native.cpp
-
src/android/app/src/main/jni/native.h
|
|
|
@ -252,7 +252,7 @@ object NativeLibrary { |
|
|
|
|
|
|
|
external fun reloadKeys(): Boolean |
|
|
|
|
|
|
|
external fun initializeSystem() |
|
|
|
external fun initializeSystem(reload: Boolean) |
|
|
|
|
|
|
|
external fun defaultCPUCore(): Int |
|
|
|
|
|
|
|
|
|
|
|
@ -403,7 +403,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider { |
|
|
|
} else { |
|
|
|
firmwarePath.deleteRecursively() |
|
|
|
cacheFirmwareDir.copyRecursively(firmwarePath, true) |
|
|
|
NativeLibrary.initializeSystem() |
|
|
|
NativeLibrary.initializeSystem(true) |
|
|
|
getString(R.string.save_file_imported_success) |
|
|
|
} |
|
|
|
} catch (e: Exception) { |
|
|
|
@ -649,7 +649,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider { |
|
|
|
} |
|
|
|
|
|
|
|
// Reinitialize relevant data |
|
|
|
NativeLibrary.initializeSystem() |
|
|
|
NativeLibrary.initializeSystem(true) |
|
|
|
gamesViewModel.reloadGames(false) |
|
|
|
|
|
|
|
return@newInstance getString(R.string.user_data_import_success) |
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ object DirectoryInitialization { |
|
|
|
fun start() { |
|
|
|
if (!areDirectoriesReady) { |
|
|
|
initializeInternalStorage() |
|
|
|
NativeLibrary.initializeSystem() |
|
|
|
NativeLibrary.initializeSystem(false) |
|
|
|
areDirectoriesReady = true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -247,11 +247,13 @@ void EmulationSession::ConfigureFilesystemProvider(const std::string& filepath) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void EmulationSession::InitializeSystem() { |
|
|
|
void EmulationSession::InitializeSystem(bool reload) { |
|
|
|
if (!reload) { |
|
|
|
// Initialize logging system
|
|
|
|
Common::Log::Initialize(); |
|
|
|
Common::Log::SetColorConsoleBackendEnabled(true); |
|
|
|
Common::Log::Start(); |
|
|
|
} |
|
|
|
|
|
|
|
// Initialize filesystem.
|
|
|
|
m_system.SetFilesystem(m_vfs); |
|
|
|
@ -667,12 +669,15 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchReleased(JNIEnv* env, jclass c |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jclass clazz) { |
|
|
|
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jclass clazz, |
|
|
|
jboolean reload) { |
|
|
|
// Create the default config.ini.
|
|
|
|
Config{}; |
|
|
|
// Initialize the emulated system.
|
|
|
|
if (!reload) { |
|
|
|
EmulationSession::GetInstance().System().Initialize(); |
|
|
|
EmulationSession::GetInstance().InitializeSystem(); |
|
|
|
} |
|
|
|
EmulationSession::GetInstance().InitializeSystem(reload); |
|
|
|
} |
|
|
|
|
|
|
|
jint Java_org_yuzu_yuzu_1emu_NativeLibrary_defaultCPUCore(JNIEnv* env, jclass clazz) { |
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ public: |
|
|
|
|
|
|
|
const Core::PerfStatsResults& PerfStats() const; |
|
|
|
void ConfigureFilesystemProvider(const std::string& filepath); |
|
|
|
void InitializeSystem(); |
|
|
|
void InitializeSystem(bool reload); |
|
|
|
Core::SystemResultStatus InitializeEmulation(const std::string& filepath); |
|
|
|
|
|
|
|
bool IsHandheldOnly(); |
|
|
|
|