diff options
| author | 2020-08-03 18:06:48 -0700 | |
|---|---|---|
| committer | 2020-08-03 18:06:48 -0700 | |
| commit | 0dbb95c42dd0c2d531926975b52d57776b63df0f (patch) | |
| tree | 3d4d6c99a93ecb2cd5112821f848be0de7bcdfb3 /src | |
| parent | Merge pull request #4480 from lioncash/optimize (diff) | |
| parent | minor nits (diff) | |
| download | yuzu-0dbb95c42dd0c2d531926975b52d57776b63df0f.tar.gz yuzu-0dbb95c42dd0c2d531926975b52d57776b63df0f.tar.xz yuzu-0dbb95c42dd0c2d531926975b52d57776b63df0f.zip | |
Merge pull request #4456 from Morph1984/stub-really-long-fs-func
fsp-srv: Stub Read/WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 33 | ||||
| -rw-r--r-- | src/core/file_sys/savedata_factory.h | 47 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 6 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 73 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.h | 6 |
7 files changed, 120 insertions, 63 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index adfd2c1a4..ba4efee3a 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp | |||
| @@ -17,23 +17,23 @@ constexpr char SAVE_DATA_SIZE_FILENAME[] = ".yuzu_save_size"; | |||
| 17 | 17 | ||
| 18 | namespace { | 18 | namespace { |
| 19 | 19 | ||
| 20 | void PrintSaveDataDescriptorWarnings(SaveDataDescriptor meta) { | 20 | void PrintSaveDataAttributeWarnings(SaveDataAttribute meta) { |
| 21 | if (meta.type == SaveDataType::SystemSaveData || meta.type == SaveDataType::SaveData) { | 21 | if (meta.type == SaveDataType::SystemSaveData || meta.type == SaveDataType::SaveData) { |
| 22 | if (meta.zero_1 != 0) { | 22 | if (meta.zero_1 != 0) { |
| 23 | LOG_WARNING(Service_FS, | 23 | LOG_WARNING(Service_FS, |
| 24 | "Possibly incorrect SaveDataDescriptor, type is " | 24 | "Possibly incorrect SaveDataAttribute, type is " |
| 25 | "SystemSaveData||SaveData but offset 0x28 is non-zero ({:016X}).", | 25 | "SystemSaveData||SaveData but offset 0x28 is non-zero ({:016X}).", |
| 26 | meta.zero_1); | 26 | meta.zero_1); |
| 27 | } | 27 | } |
| 28 | if (meta.zero_2 != 0) { | 28 | if (meta.zero_2 != 0) { |
| 29 | LOG_WARNING(Service_FS, | 29 | LOG_WARNING(Service_FS, |
| 30 | "Possibly incorrect SaveDataDescriptor, type is " | 30 | "Possibly incorrect SaveDataAttribute, type is " |
| 31 | "SystemSaveData||SaveData but offset 0x30 is non-zero ({:016X}).", | 31 | "SystemSaveData||SaveData but offset 0x30 is non-zero ({:016X}).", |
| 32 | meta.zero_2); | 32 | meta.zero_2); |
| 33 | } | 33 | } |
| 34 | if (meta.zero_3 != 0) { | 34 | if (meta.zero_3 != 0) { |
| 35 | LOG_WARNING(Service_FS, | 35 | LOG_WARNING(Service_FS, |
| 36 | "Possibly incorrect SaveDataDescriptor, type is " | 36 | "Possibly incorrect SaveDataAttribute, type is " |
| 37 | "SystemSaveData||SaveData but offset 0x38 is non-zero ({:016X}).", | 37 | "SystemSaveData||SaveData but offset 0x38 is non-zero ({:016X}).", |
| 38 | meta.zero_3); | 38 | meta.zero_3); |
| 39 | } | 39 | } |
| @@ -41,33 +41,32 @@ void PrintSaveDataDescriptorWarnings(SaveDataDescriptor meta) { | |||
| 41 | 41 | ||
| 42 | if (meta.type == SaveDataType::SystemSaveData && meta.title_id != 0) { | 42 | if (meta.type == SaveDataType::SystemSaveData && meta.title_id != 0) { |
| 43 | LOG_WARNING(Service_FS, | 43 | LOG_WARNING(Service_FS, |
| 44 | "Possibly incorrect SaveDataDescriptor, type is SystemSaveData but title_id is " | 44 | "Possibly incorrect SaveDataAttribute, type is SystemSaveData but title_id is " |
| 45 | "non-zero ({:016X}).", | 45 | "non-zero ({:016X}).", |
| 46 | meta.title_id); | 46 | meta.title_id); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | if (meta.type == SaveDataType::DeviceSaveData && meta.user_id != u128{0, 0}) { | 49 | if (meta.type == SaveDataType::DeviceSaveData && meta.user_id != u128{0, 0}) { |
| 50 | LOG_WARNING(Service_FS, | 50 | LOG_WARNING(Service_FS, |
| 51 | "Possibly incorrect SaveDataDescriptor, type is DeviceSaveData but user_id is " | 51 | "Possibly incorrect SaveDataAttribute, type is DeviceSaveData but user_id is " |
| 52 | "non-zero ({:016X}{:016X})", | 52 | "non-zero ({:016X}{:016X})", |
| 53 | meta.user_id[1], meta.user_id[0]); | 53 | meta.user_id[1], meta.user_id[0]); |
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | bool ShouldSaveDataBeAutomaticallyCreated(SaveDataSpaceId space, const SaveDataDescriptor& desc) { | 57 | bool ShouldSaveDataBeAutomaticallyCreated(SaveDataSpaceId space, const SaveDataAttribute& attr) { |
| 58 | return desc.type == SaveDataType::CacheStorage || desc.type == SaveDataType::TemporaryStorage || | 58 | return attr.type == SaveDataType::CacheStorage || attr.type == SaveDataType::TemporaryStorage || |
| 59 | (space == SaveDataSpaceId::NandUser && ///< Normal Save Data -- Current Title & User | 59 | (space == SaveDataSpaceId::NandUser && ///< Normal Save Data -- Current Title & User |
| 60 | (desc.type == SaveDataType::SaveData || desc.type == SaveDataType::DeviceSaveData) && | 60 | (attr.type == SaveDataType::SaveData || attr.type == SaveDataType::DeviceSaveData) && |
| 61 | desc.title_id == 0 && desc.save_id == 0); | 61 | attr.title_id == 0 && attr.save_id == 0); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | } // Anonymous namespace | 64 | } // Anonymous namespace |
| 65 | 65 | ||
| 66 | std::string SaveDataDescriptor::DebugInfo() const { | 66 | std::string SaveDataAttribute::DebugInfo() const { |
| 67 | return fmt::format("[type={:02X}, title_id={:016X}, user_id={:016X}{:016X}, " | 67 | return fmt::format("[title_id={:016X}, user_id={:016X}{:016X}, save_id={:016X}, type={:02X}, " |
| 68 | "save_id={:016X}, " | ||
| 69 | "rank={}, index={}]", | 68 | "rank={}, index={}]", |
| 70 | static_cast<u8>(type), title_id, user_id[1], user_id[0], save_id, | 69 | title_id, user_id[1], user_id[0], save_id, static_cast<u8>(type), |
| 71 | static_cast<u8>(rank), index); | 70 | static_cast<u8>(rank), index); |
| 72 | } | 71 | } |
| 73 | 72 | ||
| @@ -80,8 +79,8 @@ SaveDataFactory::SaveDataFactory(VirtualDir save_directory) : dir(std::move(save | |||
| 80 | SaveDataFactory::~SaveDataFactory() = default; | 79 | SaveDataFactory::~SaveDataFactory() = default; |
| 81 | 80 | ||
| 82 | ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space, | 81 | ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space, |
| 83 | const SaveDataDescriptor& meta) const { | 82 | const SaveDataAttribute& meta) const { |
| 84 | PrintSaveDataDescriptorWarnings(meta); | 83 | PrintSaveDataAttributeWarnings(meta); |
| 85 | 84 | ||
| 86 | const auto save_directory = | 85 | const auto save_directory = |
| 87 | GetFullPath(space, meta.type, meta.title_id, meta.user_id, meta.save_id); | 86 | GetFullPath(space, meta.type, meta.title_id, meta.user_id, meta.save_id); |
| @@ -98,7 +97,7 @@ ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space, | |||
| 98 | } | 97 | } |
| 99 | 98 | ||
| 100 | ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, | 99 | ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, |
| 101 | const SaveDataDescriptor& meta) const { | 100 | const SaveDataAttribute& meta) const { |
| 102 | 101 | ||
| 103 | const auto save_directory = | 102 | const auto save_directory = |
| 104 | GetFullPath(space, meta.type, meta.title_id, meta.user_id, meta.save_id); | 103 | GetFullPath(space, meta.type, meta.title_id, meta.user_id, meta.save_id); |
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 991e57aa1..6625bbbd8 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h | |||
| @@ -21,6 +21,7 @@ enum class SaveDataSpaceId : u8 { | |||
| 21 | TemporaryStorage = 3, | 21 | TemporaryStorage = 3, |
| 22 | SdCardUser = 4, | 22 | SdCardUser = 4, |
| 23 | ProperSystem = 100, | 23 | ProperSystem = 100, |
| 24 | SafeMode = 101, | ||
| 24 | }; | 25 | }; |
| 25 | 26 | ||
| 26 | enum class SaveDataType : u8 { | 27 | enum class SaveDataType : u8 { |
| @@ -30,28 +31,50 @@ enum class SaveDataType : u8 { | |||
| 30 | DeviceSaveData = 3, | 31 | DeviceSaveData = 3, |
| 31 | TemporaryStorage = 4, | 32 | TemporaryStorage = 4, |
| 32 | CacheStorage = 5, | 33 | CacheStorage = 5, |
| 34 | SystemBcat = 6, | ||
| 33 | }; | 35 | }; |
| 34 | 36 | ||
| 35 | enum class SaveDataRank : u8 { | 37 | enum class SaveDataRank : u8 { |
| 36 | Primary, | 38 | Primary = 0, |
| 37 | Secondary, | 39 | Secondary = 1, |
| 38 | }; | 40 | }; |
| 39 | 41 | ||
| 40 | struct SaveDataDescriptor { | 42 | enum class SaveDataFlags : u32 { |
| 41 | u64_le title_id; | 43 | None = (0 << 0), |
| 44 | KeepAfterResettingSystemSaveData = (1 << 0), | ||
| 45 | KeepAfterRefurbishment = (1 << 1), | ||
| 46 | KeepAfterResettingSystemSaveDataWithoutUserSaveData = (1 << 2), | ||
| 47 | NeedsSecureDelete = (1 << 3), | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct SaveDataAttribute { | ||
| 51 | u64 title_id; | ||
| 42 | u128 user_id; | 52 | u128 user_id; |
| 43 | u64_le save_id; | 53 | u64 save_id; |
| 44 | SaveDataType type; | 54 | SaveDataType type; |
| 45 | SaveDataRank rank; | 55 | SaveDataRank rank; |
| 46 | u16_le index; | 56 | u16 index; |
| 47 | INSERT_PADDING_BYTES(4); | 57 | INSERT_PADDING_BYTES(4); |
| 48 | u64_le zero_1; | 58 | u64 zero_1; |
| 49 | u64_le zero_2; | 59 | u64 zero_2; |
| 50 | u64_le zero_3; | 60 | u64 zero_3; |
| 51 | 61 | ||
| 52 | std::string DebugInfo() const; | 62 | std::string DebugInfo() const; |
| 53 | }; | 63 | }; |
| 54 | static_assert(sizeof(SaveDataDescriptor) == 0x40, "SaveDataDescriptor has incorrect size."); | 64 | static_assert(sizeof(SaveDataAttribute) == 0x40, "SaveDataAttribute has incorrect size."); |
| 65 | |||
| 66 | struct SaveDataExtraData { | ||
| 67 | SaveDataAttribute attr; | ||
| 68 | u64 owner_id; | ||
| 69 | s64 timestamp; | ||
| 70 | SaveDataFlags flags; | ||
| 71 | INSERT_PADDING_BYTES(4); | ||
| 72 | s64 available_size; | ||
| 73 | s64 journal_size; | ||
| 74 | s64 commit_id; | ||
| 75 | std::array<u8, 0x190> unused; | ||
| 76 | }; | ||
| 77 | static_assert(sizeof(SaveDataExtraData) == 0x200, "SaveDataExtraData has incorrect size."); | ||
| 55 | 78 | ||
| 56 | struct SaveDataSize { | 79 | struct SaveDataSize { |
| 57 | u64 normal; | 80 | u64 normal; |
| @@ -64,8 +87,8 @@ public: | |||
| 64 | explicit SaveDataFactory(VirtualDir dir); | 87 | explicit SaveDataFactory(VirtualDir dir); |
| 65 | ~SaveDataFactory(); | 88 | ~SaveDataFactory(); |
| 66 | 89 | ||
| 67 | ResultVal<VirtualDir> Create(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; | 90 | ResultVal<VirtualDir> Create(SaveDataSpaceId space, const SaveDataAttribute& meta) const; |
| 68 | ResultVal<VirtualDir> Open(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; | 91 | ResultVal<VirtualDir> Open(SaveDataSpaceId space, const SaveDataAttribute& meta) const; |
| 69 | 92 | ||
| 70 | VirtualDir GetSaveDataSpaceDirectory(SaveDataSpaceId space) const; | 93 | VirtualDir GetSaveDataSpaceDirectory(SaveDataSpaceId space) const; |
| 71 | 94 | ||
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index ceed20609..55a1edf1a 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -1342,12 +1342,12 @@ void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) { | |||
| 1342 | 1342 | ||
| 1343 | LOG_DEBUG(Service_AM, "called, uid={:016X}{:016X}", user_id[1], user_id[0]); | 1343 | LOG_DEBUG(Service_AM, "called, uid={:016X}{:016X}", user_id[1], user_id[0]); |
| 1344 | 1344 | ||
| 1345 | FileSys::SaveDataDescriptor descriptor{}; | 1345 | FileSys::SaveDataAttribute attribute{}; |
| 1346 | descriptor.title_id = system.CurrentProcess()->GetTitleID(); | 1346 | attribute.title_id = system.CurrentProcess()->GetTitleID(); |
| 1347 | descriptor.user_id = user_id; | 1347 | attribute.user_id = user_id; |
| 1348 | descriptor.type = FileSys::SaveDataType::SaveData; | 1348 | attribute.type = FileSys::SaveDataType::SaveData; |
| 1349 | const auto res = system.GetFileSystemController().CreateSaveData( | 1349 | const auto res = system.GetFileSystemController().CreateSaveData( |
| 1350 | FileSys::SaveDataSpaceId::NandUser, descriptor); | 1350 | FileSys::SaveDataSpaceId::NandUser, attribute); |
| 1351 | 1351 | ||
| 1352 | IPC::ResponseBuilder rb{ctx, 4}; | 1352 | IPC::ResponseBuilder rb{ctx, 4}; |
| 1353 | rb.Push(res.Code()); | 1353 | rb.Push(res.Code()); |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index c66124998..4490f8e4c 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -311,7 +311,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS( | |||
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData( | 313 | ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData( |
| 314 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const { | 314 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& save_struct) const { |
| 315 | LOG_TRACE(Service_FS, "Creating Save Data for space_id={:01X}, save_struct={}", | 315 | LOG_TRACE(Service_FS, "Creating Save Data for space_id={:01X}, save_struct={}", |
| 316 | static_cast<u8>(space), save_struct.DebugInfo()); | 316 | static_cast<u8>(space), save_struct.DebugInfo()); |
| 317 | 317 | ||
| @@ -323,15 +323,15 @@ ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData( | |||
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveData( | 325 | ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveData( |
| 326 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& descriptor) const { | 326 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& attribute) const { |
| 327 | LOG_TRACE(Service_FS, "Opening Save Data for space_id={:01X}, save_struct={}", | 327 | LOG_TRACE(Service_FS, "Opening Save Data for space_id={:01X}, save_struct={}", |
| 328 | static_cast<u8>(space), descriptor.DebugInfo()); | 328 | static_cast<u8>(space), attribute.DebugInfo()); |
| 329 | 329 | ||
| 330 | if (save_data_factory == nullptr) { | 330 | if (save_data_factory == nullptr) { |
| 331 | return FileSys::ERROR_ENTITY_NOT_FOUND; | 331 | return FileSys::ERROR_ENTITY_NOT_FOUND; |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | return save_data_factory->Open(space, descriptor); | 334 | return save_data_factory->Open(space, attribute); |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace( | 337 | ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace( |
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 1b0a6a949..6dbbf0b2b 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -31,7 +31,7 @@ enum class SaveDataSpaceId : u8; | |||
| 31 | enum class SaveDataType : u8; | 31 | enum class SaveDataType : u8; |
| 32 | enum class StorageId : u8; | 32 | enum class StorageId : u8; |
| 33 | 33 | ||
| 34 | struct SaveDataDescriptor; | 34 | struct SaveDataAttribute; |
| 35 | struct SaveDataSize; | 35 | struct SaveDataSize; |
| 36 | } // namespace FileSys | 36 | } // namespace FileSys |
| 37 | 37 | ||
| @@ -69,9 +69,9 @@ public: | |||
| 69 | ResultVal<FileSys::VirtualFile> OpenRomFS(u64 title_id, FileSys::StorageId storage_id, | 69 | ResultVal<FileSys::VirtualFile> OpenRomFS(u64 title_id, FileSys::StorageId storage_id, |
| 70 | FileSys::ContentRecordType type) const; | 70 | FileSys::ContentRecordType type) const; |
| 71 | ResultVal<FileSys::VirtualDir> CreateSaveData( | 71 | ResultVal<FileSys::VirtualDir> CreateSaveData( |
| 72 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const; | 72 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& save_struct) const; |
| 73 | ResultVal<FileSys::VirtualDir> OpenSaveData( | 73 | ResultVal<FileSys::VirtualDir> OpenSaveData( |
| 74 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const; | 74 | FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& save_struct) const; |
| 75 | ResultVal<FileSys::VirtualDir> OpenSaveDataSpace(FileSys::SaveDataSpaceId space) const; | 75 | ResultVal<FileSys::VirtualDir> OpenSaveDataSpace(FileSys::SaveDataSpaceId space) const; |
| 76 | ResultVal<FileSys::VirtualDir> OpenSDMC() const; | 76 | ResultVal<FileSys::VirtualDir> OpenSDMC() const; |
| 77 | ResultVal<FileSys::VirtualDir> OpenBISPartition(FileSys::BisPartitionId id) const; | 77 | ResultVal<FileSys::VirtualDir> OpenBISPartition(FileSys::BisPartitionId id) const; |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 20c331b77..26fd87f58 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -696,8 +696,8 @@ FSP_SRV::FSP_SRV(FileSystemController& fsc, const Core::Reporter& reporter) | |||
| 696 | {67, nullptr, "FindSaveDataWithFilter"}, | 696 | {67, nullptr, "FindSaveDataWithFilter"}, |
| 697 | {68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, | 697 | {68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, |
| 698 | {69, nullptr, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, | 698 | {69, nullptr, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, |
| 699 | {70, nullptr, "WriteSaveDataFileSystemExtraDataBySaveDataAttribute"}, | 699 | {70, &FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute, "WriteSaveDataFileSystemExtraDataBySaveDataAttribute"}, |
| 700 | {71, nullptr, "ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, | 700 | {71, &FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute, "ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, |
| 701 | {80, nullptr, "OpenSaveDataMetaFile"}, | 701 | {80, nullptr, "OpenSaveDataMetaFile"}, |
| 702 | {81, nullptr, "OpenSaveDataTransferManager"}, | 702 | {81, nullptr, "OpenSaveDataTransferManager"}, |
| 703 | {82, nullptr, "OpenSaveDataTransferManagerVersion2"}, | 703 | {82, nullptr, "OpenSaveDataTransferManagerVersion2"}, |
| @@ -812,7 +812,7 @@ void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) { | |||
| 812 | void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | 812 | void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) { |
| 813 | IPC::RequestParser rp{ctx}; | 813 | IPC::RequestParser rp{ctx}; |
| 814 | 814 | ||
| 815 | auto save_struct = rp.PopRaw<FileSys::SaveDataDescriptor>(); | 815 | auto save_struct = rp.PopRaw<FileSys::SaveDataAttribute>(); |
| 816 | [[maybe_unused]] auto save_create_struct = rp.PopRaw<std::array<u8, 0x40>>(); | 816 | [[maybe_unused]] auto save_create_struct = rp.PopRaw<std::array<u8, 0x40>>(); |
| 817 | u128 uid = rp.PopRaw<u128>(); | 817 | u128 uid = rp.PopRaw<u128>(); |
| 818 | 818 | ||
| @@ -826,17 +826,18 @@ void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | |||
| 826 | } | 826 | } |
| 827 | 827 | ||
| 828 | void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | 828 | void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { |
| 829 | LOG_INFO(Service_FS, "called."); | 829 | IPC::RequestParser rp{ctx}; |
| 830 | 830 | ||
| 831 | struct Parameters { | 831 | struct Parameters { |
| 832 | FileSys::SaveDataSpaceId save_data_space_id; | 832 | FileSys::SaveDataSpaceId space_id; |
| 833 | FileSys::SaveDataDescriptor descriptor; | 833 | FileSys::SaveDataAttribute attribute; |
| 834 | }; | 834 | }; |
| 835 | 835 | ||
| 836 | IPC::RequestParser rp{ctx}; | ||
| 837 | const auto parameters = rp.PopRaw<Parameters>(); | 836 | const auto parameters = rp.PopRaw<Parameters>(); |
| 838 | 837 | ||
| 839 | auto dir = fsc.OpenSaveData(parameters.save_data_space_id, parameters.descriptor); | 838 | LOG_INFO(Service_FS, "called."); |
| 839 | |||
| 840 | auto dir = fsc.OpenSaveData(parameters.space_id, parameters.attribute); | ||
| 840 | if (dir.Failed()) { | 841 | if (dir.Failed()) { |
| 841 | IPC::ResponseBuilder rb{ctx, 2, 0, 0}; | 842 | IPC::ResponseBuilder rb{ctx, 2, 0, 0}; |
| 842 | rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); | 843 | rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); |
| @@ -844,13 +845,18 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | |||
| 844 | } | 845 | } |
| 845 | 846 | ||
| 846 | FileSys::StorageId id; | 847 | FileSys::StorageId id; |
| 847 | if (parameters.save_data_space_id == FileSys::SaveDataSpaceId::NandUser) { | 848 | |
| 849 | switch (parameters.space_id) { | ||
| 850 | case FileSys::SaveDataSpaceId::NandUser: | ||
| 848 | id = FileSys::StorageId::NandUser; | 851 | id = FileSys::StorageId::NandUser; |
| 849 | } else if (parameters.save_data_space_id == FileSys::SaveDataSpaceId::SdCardSystem || | 852 | break; |
| 850 | parameters.save_data_space_id == FileSys::SaveDataSpaceId::SdCardUser) { | 853 | case FileSys::SaveDataSpaceId::SdCardSystem: |
| 854 | case FileSys::SaveDataSpaceId::SdCardUser: | ||
| 851 | id = FileSys::StorageId::SdCard; | 855 | id = FileSys::StorageId::SdCard; |
| 852 | } else { | 856 | break; |
| 857 | case FileSys::SaveDataSpaceId::NandSystem: | ||
| 853 | id = FileSys::StorageId::NandSystem; | 858 | id = FileSys::StorageId::NandSystem; |
| 859 | break; | ||
| 854 | } | 860 | } |
| 855 | 861 | ||
| 856 | auto filesystem = | 862 | auto filesystem = |
| @@ -876,22 +882,31 @@ void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& | |||
| 876 | rb.PushIpcInterface<ISaveDataInfoReader>(std::make_shared<ISaveDataInfoReader>(space, fsc)); | 882 | rb.PushIpcInterface<ISaveDataInfoReader>(std::make_shared<ISaveDataInfoReader>(space, fsc)); |
| 877 | } | 883 | } |
| 878 | 884 | ||
| 879 | void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | 885 | void FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute(Kernel::HLERequestContext& ctx) { |
| 880 | IPC::RequestParser rp{ctx}; | 886 | LOG_WARNING(Service_FS, "(STUBBED) called."); |
| 881 | log_mode = rp.PopEnum<LogMode>(); | ||
| 882 | |||
| 883 | LOG_DEBUG(Service_FS, "called, log_mode={:08X}", static_cast<u32>(log_mode)); | ||
| 884 | 887 | ||
| 885 | IPC::ResponseBuilder rb{ctx, 2}; | 888 | IPC::ResponseBuilder rb{ctx, 2}; |
| 886 | rb.Push(RESULT_SUCCESS); | 889 | rb.Push(RESULT_SUCCESS); |
| 887 | } | 890 | } |
| 888 | 891 | ||
| 889 | void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | 892 | void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( |
| 890 | LOG_DEBUG(Service_FS, "called"); | 893 | Kernel::HLERequestContext& ctx) { |
| 894 | IPC::RequestParser rp{ctx}; | ||
| 895 | |||
| 896 | struct Parameters { | ||
| 897 | FileSys::SaveDataSpaceId space_id; | ||
| 898 | FileSys::SaveDataAttribute attribute; | ||
| 899 | }; | ||
| 900 | |||
| 901 | const auto parameters = rp.PopRaw<Parameters>(); | ||
| 902 | // Stub this to None for now, backend needs an impl to read/write the SaveDataExtraData | ||
| 903 | constexpr auto flags = static_cast<u32>(FileSys::SaveDataFlags::None); | ||
| 904 | |||
| 905 | LOG_WARNING(Service_FS, "(STUBBED) called, flags={}", flags); | ||
| 891 | 906 | ||
| 892 | IPC::ResponseBuilder rb{ctx, 3}; | 907 | IPC::ResponseBuilder rb{ctx, 3}; |
| 893 | rb.Push(RESULT_SUCCESS); | 908 | rb.Push(RESULT_SUCCESS); |
| 894 | rb.PushEnum(log_mode); | 909 | rb.Push(flags); |
| 895 | } | 910 | } |
| 896 | 911 | ||
| 897 | void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { | 912 | void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { |
| @@ -966,6 +981,24 @@ void FSP_SRV::OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ct | |||
| 966 | rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); | 981 | rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); |
| 967 | } | 982 | } |
| 968 | 983 | ||
| 984 | void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | ||
| 985 | IPC::RequestParser rp{ctx}; | ||
| 986 | log_mode = rp.PopEnum<LogMode>(); | ||
| 987 | |||
| 988 | LOG_DEBUG(Service_FS, "called, log_mode={:08X}", static_cast<u32>(log_mode)); | ||
| 989 | |||
| 990 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 991 | rb.Push(RESULT_SUCCESS); | ||
| 992 | } | ||
| 993 | |||
| 994 | void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | ||
| 995 | LOG_DEBUG(Service_FS, "called"); | ||
| 996 | |||
| 997 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 998 | rb.Push(RESULT_SUCCESS); | ||
| 999 | rb.PushEnum(log_mode); | ||
| 1000 | } | ||
| 1001 | |||
| 969 | void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) { | 1002 | void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) { |
| 970 | const auto raw = ctx.ReadBuffer(); | 1003 | const auto raw = ctx.ReadBuffer(); |
| 971 | auto log = Common::StringFromFixedZeroTerminatedBuffer( | 1004 | auto log = Common::StringFromFixedZeroTerminatedBuffer( |
diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.h index dfb3e395b..4964e874e 100644 --- a/src/core/hle/service/filesystem/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp_srv.h | |||
| @@ -43,11 +43,13 @@ private: | |||
| 43 | void OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx); | 43 | void OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx); |
| 44 | void OpenReadOnlySaveDataFileSystem(Kernel::HLERequestContext& ctx); | 44 | void OpenReadOnlySaveDataFileSystem(Kernel::HLERequestContext& ctx); |
| 45 | void OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx); | 45 | void OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx); |
| 46 | void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); | 46 | void WriteSaveDataFileSystemExtraDataBySaveDataAttribute(Kernel::HLERequestContext& ctx); |
| 47 | void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); | 47 | void ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(Kernel::HLERequestContext& ctx); |
| 48 | void OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); | 48 | void OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); |
| 49 | void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx); | 49 | void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx); |
| 50 | void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); | 50 | void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); |
| 51 | void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); | ||
| 52 | void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); | ||
| 51 | void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx); | 53 | void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx); |
| 52 | void GetAccessLogVersionInfo(Kernel::HLERequestContext& ctx); | 54 | void GetAccessLogVersionInfo(Kernel::HLERequestContext& ctx); |
| 53 | void OpenMultiCommitManager(Kernel::HLERequestContext& ctx); | 55 | void OpenMultiCommitManager(Kernel::HLERequestContext& ctx); |