diff options
| author | 2024-01-26 09:55:25 -0500 | |
|---|---|---|
| committer | 2024-01-26 09:55:25 -0500 | |
| commit | 55482ab5dce463d5014498b006c18a90d0d004e6 (patch) | |
| tree | b343faa9cadc692265efb4b6b88e157c97ef76d2 /src/android | |
| parent | Merge pull request #12796 from t895/controller-optimizations (diff) | |
| parent | Address review comments and fix compilation problems (diff) | |
| download | yuzu-55482ab5dce463d5014498b006c18a90d0d004e6.tar.gz yuzu-55482ab5dce463d5014498b006c18a90d0d004e6.tar.xz yuzu-55482ab5dce463d5014498b006c18a90d0d004e6.zip | |
Merge pull request #12707 from FearlessTobi/fs-housekeeping
fs: Various cleanups & add path class for later use
Diffstat (limited to 'src/android')
| -rw-r--r-- | src/android/app/src/main/jni/game_metadata.cpp | 12 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/native.cpp | 15 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/android/app/src/main/jni/game_metadata.cpp b/src/android/app/src/main/jni/game_metadata.cpp index 78f604c70..8f0da1413 100644 --- a/src/android/app/src/main/jni/game_metadata.cpp +++ b/src/android/app/src/main/jni/game_metadata.cpp | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <core/core.h> | 4 | #include "core/core.h" |
| 5 | #include <core/file_sys/mode.h> | 5 | #include "core/file_sys/fs_filesystem.h" |
| 6 | #include <core/file_sys/patch_manager.h> | 6 | #include "core/file_sys/patch_manager.h" |
| 7 | #include <core/loader/nro.h> | ||
| 8 | #include <jni.h> | ||
| 9 | #include "core/loader/loader.h" | 7 | #include "core/loader/loader.h" |
| 8 | #include "core/loader/nro.h" | ||
| 9 | #include "jni.h" | ||
| 10 | #include "jni/android_common/android_common.h" | 10 | #include "jni/android_common/android_common.h" |
| 11 | #include "native.h" | 11 | #include "native.h" |
| 12 | 12 | ||
| @@ -79,7 +79,7 @@ extern "C" { | |||
| 79 | jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsValid(JNIEnv* env, jobject obj, | 79 | jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsValid(JNIEnv* env, jobject obj, |
| 80 | jstring jpath) { | 80 | jstring jpath) { |
| 81 | const auto file = EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( | 81 | const auto file = EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( |
| 82 | GetJString(env, jpath), FileSys::Mode::Read); | 82 | GetJString(env, jpath), FileSys::OpenMode::Read); |
| 83 | if (!file) { | 83 | if (!file) { |
| 84 | return false; | 84 | return false; |
| 85 | } | 85 | } |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 247f2c2b3..3fd9a500c 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -35,9 +35,10 @@ | |||
| 35 | #include "core/crypto/key_manager.h" | 35 | #include "core/crypto/key_manager.h" |
| 36 | #include "core/file_sys/card_image.h" | 36 | #include "core/file_sys/card_image.h" |
| 37 | #include "core/file_sys/content_archive.h" | 37 | #include "core/file_sys/content_archive.h" |
| 38 | #include "core/file_sys/fs_filesystem.h" | ||
| 38 | #include "core/file_sys/submission_package.h" | 39 | #include "core/file_sys/submission_package.h" |
| 39 | #include "core/file_sys/vfs.h" | 40 | #include "core/file_sys/vfs/vfs.h" |
| 40 | #include "core/file_sys/vfs_real.h" | 41 | #include "core/file_sys/vfs/vfs_real.h" |
| 41 | #include "core/frontend/applets/cabinet.h" | 42 | #include "core/frontend/applets/cabinet.h" |
| 42 | #include "core/frontend/applets/controller.h" | 43 | #include "core/frontend/applets/controller.h" |
| 43 | #include "core/frontend/applets/error.h" | 44 | #include "core/frontend/applets/error.h" |
| @@ -154,7 +155,7 @@ void EmulationSession::SurfaceChanged() { | |||
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | void EmulationSession::ConfigureFilesystemProvider(const std::string& filepath) { | 157 | void EmulationSession::ConfigureFilesystemProvider(const std::string& filepath) { |
| 157 | const auto file = m_system.GetFilesystem()->OpenFile(filepath, FileSys::Mode::Read); | 158 | const auto file = m_system.GetFilesystem()->OpenFile(filepath, FileSys::OpenMode::Read); |
| 158 | if (!file) { | 159 | if (!file) { |
| 159 | return; | 160 | return; |
| 160 | } | 161 | } |
| @@ -475,8 +476,8 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_doesUpdateMatchProgram(JNIEnv* en | |||
| 475 | u64 program_id = EmulationSession::GetProgramId(env, jprogramId); | 476 | u64 program_id = EmulationSession::GetProgramId(env, jprogramId); |
| 476 | std::string updatePath = GetJString(env, jupdatePath); | 477 | std::string updatePath = GetJString(env, jupdatePath); |
| 477 | std::shared_ptr<FileSys::NSP> nsp = std::make_shared<FileSys::NSP>( | 478 | std::shared_ptr<FileSys::NSP> nsp = std::make_shared<FileSys::NSP>( |
| 478 | EmulationSession::GetInstance().System().GetFilesystem()->OpenFile(updatePath, | 479 | EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( |
| 479 | FileSys::Mode::Read)); | 480 | updatePath, FileSys::OpenMode::Read)); |
| 480 | for (const auto& item : nsp->GetNCAs()) { | 481 | for (const auto& item : nsp->GetNCAs()) { |
| 481 | for (const auto& nca_details : item.second) { | 482 | for (const auto& nca_details : item.second) { |
| 482 | if (nca_details.second->GetName().ends_with(".cnmt.nca")) { | 483 | if (nca_details.second->GetName().ends_with(".cnmt.nca")) { |
| @@ -719,7 +720,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmptyUserDirectory(JNIEnv* | |||
| 719 | jobject instance) { | 720 | jobject instance) { |
| 720 | const auto nand_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir); | 721 | const auto nand_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir); |
| 721 | auto vfs_nand_dir = EmulationSession::GetInstance().System().GetFilesystem()->OpenDirectory( | 722 | auto vfs_nand_dir = EmulationSession::GetInstance().System().GetFilesystem()->OpenDirectory( |
| 722 | Common::FS::PathToUTF8String(nand_dir), FileSys::Mode::Read); | 723 | Common::FS::PathToUTF8String(nand_dir), FileSys::OpenMode::Read); |
| 723 | 724 | ||
| 724 | const auto user_id = EmulationSession::GetInstance().System().GetProfileManager().GetUser( | 725 | const auto user_id = EmulationSession::GetInstance().System().GetProfileManager().GetUser( |
| 725 | static_cast<std::size_t>(0)); | 726 | static_cast<std::size_t>(0)); |
| @@ -889,7 +890,7 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobject j | |||
| 889 | 890 | ||
| 890 | const auto nandDir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir); | 891 | const auto nandDir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir); |
| 891 | auto vfsNandDir = system.GetFilesystem()->OpenDirectory(Common::FS::PathToUTF8String(nandDir), | 892 | auto vfsNandDir = system.GetFilesystem()->OpenDirectory(Common::FS::PathToUTF8String(nandDir), |
| 892 | FileSys::Mode::Read); | 893 | FileSys::OpenMode::Read); |
| 893 | 894 | ||
| 894 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( | 895 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( |
| 895 | {}, vfsNandDir, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, | 896 | {}, vfsNandDir, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, |