diff options
| author | 2024-02-19 15:43:18 +0100 | |
|---|---|---|
| committer | 2024-02-19 19:11:07 +0100 | |
| commit | b5a17b501bf66c02495ae6d69a6d734792e3cc6f (patch) | |
| tree | e86d3fe28f3fb984bf4b1e5196d39cceb1782631 | |
| parent | fs: Add and use fs_save_data_types.h (diff) | |
| download | yuzu-b5a17b501bf66c02495ae6d69a6d734792e3cc6f.tar.gz yuzu-b5a17b501bf66c02495ae6d69a6d734792e3cc6f.tar.xz yuzu-b5a17b501bf66c02495ae6d69a6d734792e3cc6f.zip | |
Address review comments
| -rw-r--r-- | src/android/app/src/main/jni/native.cpp | 6 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/file_sys/fs_save_data_types.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_filesystem.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fsp_srv.h | 13 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fsp_types.h (renamed from src/core/hle/service/filesystem/fsp/fsp_util.h) | 12 |
9 files changed, 24 insertions, 21 deletions
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 4ea82e217..fa2300ae6 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -665,7 +665,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmptyUserDirectory(JNIEnv* | |||
| 665 | ASSERT(user_id); | 665 | ASSERT(user_id); |
| 666 | 666 | ||
| 667 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( | 667 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( |
| 668 | {}, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, 1, | 668 | {}, vfs_nand_dir, FileSys::SaveDataSpaceId::User, FileSys::SaveDataType::Account, 1, |
| 669 | user_id->AsU128(), 0); | 669 | user_id->AsU128(), 0); |
| 670 | 670 | ||
| 671 | const auto full_path = Common::FS::ConcatPathSafe(nand_dir, user_save_data_path); | 671 | const auto full_path = Common::FS::ConcatPathSafe(nand_dir, user_save_data_path); |
| @@ -833,8 +833,8 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobject j | |||
| 833 | FileSys::OpenMode::Read); | 833 | FileSys::OpenMode::Read); |
| 834 | 834 | ||
| 835 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( | 835 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( |
| 836 | {}, vfsNandDir, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, | 836 | {}, vfsNandDir, FileSys::SaveDataSpaceId::User, FileSys::SaveDataType::Account, program_id, |
| 837 | program_id, user_id->AsU128(), 0); | 837 | user_id->AsU128(), 0); |
| 838 | return Common::Android::ToJString(env, user_save_data_path); | 838 | return Common::Android::ToJString(env, user_save_data_path); |
| 839 | } | 839 | } |
| 840 | 840 | ||
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 66e65476e..de945fa70 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -598,7 +598,7 @@ add_library(core STATIC | |||
| 598 | hle/service/filesystem/fsp/fsp_pr.h | 598 | hle/service/filesystem/fsp/fsp_pr.h |
| 599 | hle/service/filesystem/fsp/fsp_srv.cpp | 599 | hle/service/filesystem/fsp/fsp_srv.cpp |
| 600 | hle/service/filesystem/fsp/fsp_srv.h | 600 | hle/service/filesystem/fsp/fsp_srv.h |
| 601 | hle/service/filesystem/fsp/fsp_util.h | 601 | hle/service/filesystem/fsp/fsp_types.h |
| 602 | hle/service/filesystem/romfs_controller.cpp | 602 | hle/service/filesystem/romfs_controller.cpp |
| 603 | hle/service/filesystem/romfs_controller.h | 603 | hle/service/filesystem/romfs_controller.h |
| 604 | hle/service/filesystem/save_data_controller.cpp | 604 | hle/service/filesystem/save_data_controller.cpp |
diff --git a/src/core/file_sys/fs_save_data_types.h b/src/core/file_sys/fs_save_data_types.h index 02bbc3294..86a83d217 100644 --- a/src/core/file_sys/fs_save_data_types.h +++ b/src/core/file_sys/fs_save_data_types.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <array> | 6 | #include <array> |
| 7 | #include <fmt/format.h> | ||
| 7 | #include "common/common_funcs.h" | 8 | #include "common/common_funcs.h" |
| 8 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 9 | 10 | ||
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h index b06b3ef0e..b1f3ab5dd 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include "core/file_sys/vfs/vfs.h" | 6 | #include "core/file_sys/vfs/vfs.h" |
| 7 | #include "core/hle/service/filesystem/filesystem.h" | 7 | #include "core/hle/service/filesystem/filesystem.h" |
| 8 | #include "core/hle/service/filesystem/fsp/fsp_util.h" | 8 | #include "core/hle/service/filesystem/fsp/fsp_types.h" |
| 9 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
| 10 | 10 | ||
| 11 | namespace Service::FileSystem { | 11 | namespace Service::FileSystem { |
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp index 13914b5e1..626328234 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/cmif_serialization.h" | 4 | #include "core/hle/service/cmif_serialization.h" |
| 5 | #include "core/hle/service/filesystem/fsp/fs_i_filesystem.h" | ||
| 5 | #include "core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h" | 6 | #include "core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h" |
| 6 | 7 | ||
| 7 | namespace Service::FileSystem { | 8 | namespace Service::FileSystem { |
| @@ -17,7 +18,7 @@ IMultiCommitManager::IMultiCommitManager(Core::System& system_) | |||
| 17 | 18 | ||
| 18 | IMultiCommitManager::~IMultiCommitManager() = default; | 19 | IMultiCommitManager::~IMultiCommitManager() = default; |
| 19 | 20 | ||
| 20 | Result IMultiCommitManager::Add() { | 21 | Result IMultiCommitManager::Add(std::shared_ptr<IFileSystem> filesystem) { |
| 21 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 22 | LOG_WARNING(Service_FS, "(STUBBED) called"); |
| 22 | 23 | ||
| 23 | R_SUCCEED(); | 24 | R_SUCCEED(); |
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h index 274ef0513..8ebf7c7d9 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h | |||
| @@ -14,7 +14,7 @@ public: | |||
| 14 | ~IMultiCommitManager() override; | 14 | ~IMultiCommitManager() override; |
| 15 | 15 | ||
| 16 | private: | 16 | private: |
| 17 | Result Add(); | 17 | Result Add(std::shared_ptr<IFileSystem> filesystem); |
| 18 | Result Commit(); | 18 | Result Commit(); |
| 19 | 19 | ||
| 20 | FileSys::VirtualFile backend; | 20 | FileSys::VirtualFile backend; |
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h index 7b21b029b..e45ad852b 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h | |||
| @@ -23,14 +23,14 @@ public: | |||
| 23 | u64_le save_id_unknown; | 23 | u64_le save_id_unknown; |
| 24 | FileSys::SaveDataSpaceId space; | 24 | FileSys::SaveDataSpaceId space; |
| 25 | FileSys::SaveDataType type; | 25 | FileSys::SaveDataType type; |
| 26 | INSERT_PADDING_BYTES_NOINIT(0x6); | 26 | INSERT_PADDING_BYTES(0x6); |
| 27 | std::array<u8, 0x10> user_id; | 27 | std::array<u8, 0x10> user_id; |
| 28 | u64_le save_id; | 28 | u64_le save_id; |
| 29 | u64_le title_id; | 29 | u64_le title_id; |
| 30 | u64_le save_image_size; | 30 | u64_le save_image_size; |
| 31 | u16_le index; | 31 | u16_le index; |
| 32 | FileSys::SaveDataRank rank; | 32 | FileSys::SaveDataRank rank; |
| 33 | INSERT_PADDING_BYTES_NOINIT(0x25); | 33 | INSERT_PADDING_BYTES(0x25); |
| 34 | }; | 34 | }; |
| 35 | static_assert(sizeof(SaveDataInfo) == 0x60, "SaveDataInfo has incorrect size."); | 35 | static_assert(sizeof(SaveDataInfo) == 0x60, "SaveDataInfo has incorrect size."); |
| 36 | 36 | ||
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h index 7a29d17c9..ee67f6bc1 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include "core/file_sys/fs_save_data_types.h" | 7 | #include "core/file_sys/fs_save_data_types.h" |
| 8 | #include "core/hle/service/cmif_types.h" | 8 | #include "core/hle/service/cmif_types.h" |
| 9 | #include "core/hle/service/filesystem/fsp/fsp_types.h" | ||
| 9 | #include "core/hle/service/service.h" | 10 | #include "core/hle/service/service.h" |
| 10 | 11 | ||
| 11 | namespace Core { | 12 | namespace Core { |
| @@ -39,18 +40,6 @@ enum class AccessLogMode : u32 { | |||
| 39 | SdCard, | 40 | SdCard, |
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | enum class FileSystemProxyType : u8 { | ||
| 43 | Code = 0, | ||
| 44 | Rom = 1, | ||
| 45 | Logo = 2, | ||
| 46 | Control = 3, | ||
| 47 | Manual = 4, | ||
| 48 | Meta = 5, | ||
| 49 | Data = 6, | ||
| 50 | Package = 7, | ||
| 51 | RegisteredUpdate = 8, | ||
| 52 | }; | ||
| 53 | |||
| 54 | class FSP_SRV final : public ServiceFramework<FSP_SRV> { | 43 | class FSP_SRV final : public ServiceFramework<FSP_SRV> { |
| 55 | public: | 44 | public: |
| 56 | explicit FSP_SRV(Core::System& system_); | 45 | explicit FSP_SRV(Core::System& system_); |
diff --git a/src/core/hle/service/filesystem/fsp/fsp_util.h b/src/core/hle/service/filesystem/fsp/fsp_types.h index 253f866db..294da6a2d 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_util.h +++ b/src/core/hle/service/filesystem/fsp/fsp_types.h | |||
| @@ -7,6 +7,18 @@ | |||
| 7 | 7 | ||
| 8 | namespace Service::FileSystem { | 8 | namespace Service::FileSystem { |
| 9 | 9 | ||
| 10 | enum class FileSystemProxyType : u8 { | ||
| 11 | Code = 0, | ||
| 12 | Rom = 1, | ||
| 13 | Logo = 2, | ||
| 14 | Control = 3, | ||
| 15 | Manual = 4, | ||
| 16 | Meta = 5, | ||
| 17 | Data = 6, | ||
| 18 | Package = 7, | ||
| 19 | RegisteredUpdate = 8, | ||
| 20 | }; | ||
| 21 | |||
| 10 | struct SizeGetter { | 22 | struct SizeGetter { |
| 11 | std::function<u64()> get_free_size; | 23 | std::function<u64()> get_free_size; |
| 12 | std::function<u64()> get_total_size; | 24 | std::function<u64()> get_total_size; |