diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 6 | ||||
| -rw-r--r-- | src/core/file_sys/savedata_factory.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.h | 1 |
6 files changed, 25 insertions, 2 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index 6c3685927..b5254dd75 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp | |||
| @@ -105,7 +105,7 @@ ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, | |||
| 105 | 105 | ||
| 106 | auto out = dir->GetDirectoryRelative(save_directory); | 106 | auto out = dir->GetDirectoryRelative(save_directory); |
| 107 | 107 | ||
| 108 | if (out == nullptr && ShouldSaveDataBeAutomaticallyCreated(space, meta)) { | 108 | if (out == nullptr && (ShouldSaveDataBeAutomaticallyCreated(space, meta) && auto_create)) { |
| 109 | return Create(space, meta); | 109 | return Create(space, meta); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| @@ -199,4 +199,8 @@ void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 us | |||
| 199 | size_file->WriteObject(new_value); | 199 | size_file->WriteObject(new_value); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | void SaveDataFactory::SetAutoCreate(bool state) { | ||
| 203 | auto_create = state; | ||
| 204 | } | ||
| 205 | |||
| 202 | } // namespace FileSys | 206 | } // namespace FileSys |
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 86c9f5350..1d8dc981f 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h | |||
| @@ -104,9 +104,12 @@ public: | |||
| 104 | void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, | 104 | void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, |
| 105 | SaveDataSize new_value) const; | 105 | SaveDataSize new_value) const; |
| 106 | 106 | ||
| 107 | void SetAutoCreate(bool state); | ||
| 108 | |||
| 107 | private: | 109 | private: |
| 108 | VirtualDir dir; | 110 | VirtualDir dir; |
| 109 | Core::System& system; | 111 | Core::System& system; |
| 112 | bool auto_create{true}; | ||
| 110 | }; | 113 | }; |
| 111 | 114 | ||
| 112 | } // namespace FileSys | 115 | } // namespace FileSys |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 4a1908bcb..3c16fe6c7 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -721,6 +721,10 @@ FileSys::VirtualDir FileSystemController::GetBCATDirectory(u64 title_id) const { | |||
| 721 | return bis_factory->GetBCATDirectory(title_id); | 721 | return bis_factory->GetBCATDirectory(title_id); |
| 722 | } | 722 | } |
| 723 | 723 | ||
| 724 | void FileSystemController::SetAutoSaveDataCreation(bool enable) { | ||
| 725 | save_data_factory->SetAutoCreate(enable); | ||
| 726 | } | ||
| 727 | |||
| 724 | void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | 728 | void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { |
| 725 | if (overwrite) { | 729 | if (overwrite) { |
| 726 | bis_factory = nullptr; | 730 | bis_factory = nullptr; |
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 7102d3f9a..b6b1b9220 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -120,6 +120,8 @@ public: | |||
| 120 | 120 | ||
| 121 | FileSys::VirtualDir GetBCATDirectory(u64 title_id) const; | 121 | FileSys::VirtualDir GetBCATDirectory(u64 title_id) const; |
| 122 | 122 | ||
| 123 | void SetAutoSaveDataCreation(bool enable); | ||
| 124 | |||
| 123 | // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function | 125 | // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function |
| 124 | // above is called. | 126 | // above is called. |
| 125 | void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite = true); | 127 | void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite = true); |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index d9e8020b4..52dc73cf8 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -764,7 +764,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) | |||
| 764 | {1000, nullptr, "SetBisRootForHost"}, | 764 | {1000, nullptr, "SetBisRootForHost"}, |
| 765 | {1001, nullptr, "SetSaveDataSize"}, | 765 | {1001, nullptr, "SetSaveDataSize"}, |
| 766 | {1002, nullptr, "SetSaveDataRootPath"}, | 766 | {1002, nullptr, "SetSaveDataRootPath"}, |
| 767 | {1003, nullptr, "DisableAutoSaveDataCreation"}, | 767 | {1003, &FSP_SRV::DisableAutoSaveDataCreation, "DisableAutoSaveDataCreation"}, |
| 768 | {1004, &FSP_SRV::SetGlobalAccessLogMode, "SetGlobalAccessLogMode"}, | 768 | {1004, &FSP_SRV::SetGlobalAccessLogMode, "SetGlobalAccessLogMode"}, |
| 769 | {1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"}, | 769 | {1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"}, |
| 770 | {1006, &FSP_SRV::OutputAccessLogToSdCard, "OutputAccessLogToSdCard"}, | 770 | {1006, &FSP_SRV::OutputAccessLogToSdCard, "OutputAccessLogToSdCard"}, |
| @@ -1030,6 +1030,15 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) { | |||
| 1030 | rb.PushIpcInterface<IStorage>(std::move(storage)); | 1030 | rb.PushIpcInterface<IStorage>(std::move(storage)); |
| 1031 | } | 1031 | } |
| 1032 | 1032 | ||
| 1033 | void FSP_SRV::DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx) { | ||
| 1034 | LOG_DEBUG(Service_FS, "called"); | ||
| 1035 | |||
| 1036 | fsc.SetAutoSaveDataCreation(false); | ||
| 1037 | |||
| 1038 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1039 | rb.Push(RESULT_SUCCESS); | ||
| 1040 | } | ||
| 1041 | |||
| 1033 | void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | 1042 | void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { |
| 1034 | IPC::RequestParser rp{ctx}; | 1043 | IPC::RequestParser rp{ctx}; |
| 1035 | log_mode = rp.PopEnum<LogMode>(); | 1044 | log_mode = rp.PopEnum<LogMode>(); |
diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.h index b01b924eb..ff7455a20 100644 --- a/src/core/hle/service/filesystem/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp_srv.h | |||
| @@ -50,6 +50,7 @@ private: | |||
| 50 | void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx); | 50 | void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx); |
| 51 | void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); | 51 | void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); |
| 52 | void OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx); | 52 | void OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx); |
| 53 | void DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx); | ||
| 53 | void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); | 54 | void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); |
| 54 | void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); | 55 | void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); |
| 55 | void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx); | 56 | void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx); |