From 8448fd17327af4142e23c9d02963e9df1e7b8eb4 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 23 Feb 2024 23:57:29 +0100 Subject: [PATCH] early-access version 4164 --- README.md | 2 +- src/core/CMakeLists.txt | 2 ++ src/core/file_sys/fs_save_data_types.h | 13 +++++++++++ .../hle/service/filesystem/fsp/fsp_srv.cpp | 22 ++++++++++++++++--- src/core/hle/service/filesystem/fsp/fsp_srv.h | 8 ++++++- .../fsp/save_data_transfer_prohibiter.cpp | 13 +++++++++++ .../fsp/save_data_transfer_prohibiter.h | 16 ++++++++++++++ 7 files changed, 71 insertions(+), 5 deletions(-) create mode 100755 src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp create mode 100755 src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h diff --git a/README.md b/README.md index c14f3ad71..bda1e0184 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 4163. +This is the source code for early-access 4164. ## Legal Notice diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6a55ec03b..3ecc30637 100755 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -625,6 +625,8 @@ add_library(core STATIC hle/service/filesystem/fsp/fsp_srv.cpp hle/service/filesystem/fsp/fsp_srv.h hle/service/filesystem/fsp/fsp_types.h + hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp + hle/service/filesystem/fsp/save_data_transfer_prohibiter.h hle/service/filesystem/romfs_controller.cpp hle/service/filesystem/romfs_controller.h 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 86a83d217..493dba34f 100755 --- a/src/core/file_sys/fs_save_data_types.h +++ b/src/core/file_sys/fs_save_data_types.h @@ -164,6 +164,19 @@ static_assert(sizeof(SaveDataExtraData) == 0x200, "SaveDataExtraData has invalid static_assert(std::is_trivially_copyable_v, "Data type must be trivially copyable."); +struct SaveDataFilter { + bool use_program_id; + bool use_save_data_type; + bool use_user_id; + bool use_save_data_id; + bool use_index; + SaveDataRank rank; + SaveDataAttribute attribute; +}; +static_assert(sizeof(SaveDataFilter) == 0x48, "SaveDataFilter has invalid size."); +static_assert(std::is_trivially_copyable_v, + "Data type must be trivially copyable."); + struct HashSalt { static constexpr size_t Size = 32; diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index fc67a4713..223284255 100755 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp @@ -34,6 +34,7 @@ #include "core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h" #include "core/hle/service/filesystem/fsp/fs_i_storage.h" #include "core/hle/service/filesystem/fsp/fsp_srv.h" +#include "core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h" #include "core/hle/service/filesystem/romfs_controller.h" #include "core/hle/service/filesystem/save_data_controller.h" #include "core/hle/service/hle_ipc.h" @@ -87,7 +88,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) {64, nullptr, "OpenSaveDataInternalStorageFileSystem"}, {65, nullptr, "UpdateSaveDataMacForDebug"}, {66, nullptr, "WriteSaveDataFileSystemExtraData2"}, - {67, nullptr, "FindSaveDataWithFilter"}, + {67, D<&FSP_SRV::FindSaveDataWithFilter>, "FindSaveDataWithFilter"}, {68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, {69, nullptr, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, {70, D<&FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute>, "WriteSaveDataFileSystemExtraDataBySaveDataAttribute"}, @@ -95,7 +96,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) {80, nullptr, "OpenSaveDataMetaFile"}, {81, nullptr, "OpenSaveDataTransferManager"}, {82, nullptr, "OpenSaveDataTransferManagerVersion2"}, - {83, nullptr, "OpenSaveDataTransferProhibiterForCloudBackUp"}, + {83, D<&FSP_SRV::OpenSaveDataTransferProhibiter>, "OpenSaveDataTransferProhibiter"}, {84, nullptr, "ListApplicationAccessibleSaveDataOwnerId"}, {85, nullptr, "OpenSaveDataTransferManagerForSaveDataRepair"}, {86, nullptr, "OpenSaveDataMover"}, @@ -235,7 +236,7 @@ Result FSP_SRV::CreateSaveDataFileSystem(FileSys::SaveDataCreationInfo save_crea } Result FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId( - FileSys::SaveDataCreationInfo save_create_struct, FileSys::SaveDataAttribute save_struct) { + FileSys::SaveDataAttribute save_struct, FileSys::SaveDataCreationInfo save_create_struct) { LOG_DEBUG(Service_FS, "called save_struct = {}", save_struct.DebugInfo()); FileSys::VirtualDir save_data_dir{}; @@ -308,6 +309,14 @@ Result FSP_SRV::OpenSaveDataInfoReaderOnlyCacheStorage( R_SUCCEED(); } +Result FSP_SRV::FindSaveDataWithFilter(Out out_count, + OutBuffer out_buffer, + FileSys::SaveDataSpaceId space_id, + FileSys::SaveDataFilter filter) { + LOG_WARNING(Service_FS, "(STUBBED) called"); + R_THROW(FileSys::ResultTargetNotFound); +} + Result FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute() { LOG_WARNING(Service_FS, "(STUBBED) called."); @@ -332,6 +341,13 @@ Result FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( R_SUCCEED(); } +Result FSP_SRV::OpenSaveDataTransferProhibiter( + OutInterface out_prohibiter, u64 id) { + LOG_WARNING(Service_FS, "(STUBBED) called, id={:016X}", id); + *out_prohibiter = std::make_shared(system); + R_SUCCEED(); +} + Result FSP_SRV::OpenDataStorageByCurrentProcess(OutInterface out_interface) { LOG_DEBUG(Service_FS, "called"); diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h index ee67f6bc1..83d9cb51c 100755 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h @@ -25,6 +25,7 @@ class SaveDataController; class IFileSystem; class ISaveDataInfoReader; +class ISaveDataTransferProhibiter; class IStorage; class IMultiCommitManager; @@ -53,7 +54,7 @@ private: Result CreateSaveDataFileSystem(FileSys::SaveDataCreationInfo save_create_struct, FileSys::SaveDataAttribute save_struct, u128 uid); Result CreateSaveDataFileSystemBySystemSaveDataId( - FileSys::SaveDataCreationInfo save_create_struct, FileSys::SaveDataAttribute save_struct); + FileSys::SaveDataAttribute save_struct, FileSys::SaveDataCreationInfo save_create_struct); Result OpenSaveDataFileSystem(OutInterface out_interface, FileSys::SaveDataSpaceId space_id, FileSys::SaveDataAttribute attribute); @@ -66,11 +67,16 @@ private: Result OpenSaveDataInfoReaderBySaveDataSpaceId(OutInterface out_interface, FileSys::SaveDataSpaceId space); Result OpenSaveDataInfoReaderOnlyCacheStorage(OutInterface out_interface); + Result FindSaveDataWithFilter(Out out_count, OutBuffer out_buffer, + FileSys::SaveDataSpaceId space_id, + FileSys::SaveDataFilter filter); Result WriteSaveDataFileSystemExtraDataBySaveDataAttribute(); Result ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( FileSys::SaveDataSpaceId space_id, FileSys::SaveDataAttribute attribute, InBuffer mask_buffer, OutBuffer out_buffer); + Result OpenSaveDataTransferProhibiter(OutInterface out_prohibiter, + u64 id); Result OpenDataStorageByCurrentProcess(OutInterface out_interface); Result OpenDataStorageByDataId(OutInterface out_interface, FileSys::StorageId storage_id, u32 unknown, u64 title_id); diff --git a/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp new file mode 100755 index 000000000..d8d6289fe --- /dev/null +++ b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.cpp @@ -0,0 +1,13 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h" + +namespace Service::FileSystem { + +ISaveDataTransferProhibiter::ISaveDataTransferProhibiter(Core::System& system_) + : ServiceFramework{system_, "ISaveDataTransferProhibiter"} {} + +ISaveDataTransferProhibiter::~ISaveDataTransferProhibiter() = default; + +} // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h new file mode 100755 index 000000000..d206e1dea --- /dev/null +++ b/src/core/hle/service/filesystem/fsp/save_data_transfer_prohibiter.h @@ -0,0 +1,16 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service::FileSystem { + +class ISaveDataTransferProhibiter : public ServiceFramework { +public: + explicit ISaveDataTransferProhibiter(Core::System& system_); + ~ISaveDataTransferProhibiter() override; +}; + +} // namespace Service::FileSystem