diff options
| author | 2020-04-14 15:00:57 -0400 | |
|---|---|---|
| committer | 2020-05-11 12:54:30 -0400 | |
| commit | ab9ddab0a21fa447f8cd93df0d529069e5a1cae0 (patch) | |
| tree | 8c502bfae23568be23765079aaaa00417f711f73 | |
| parent | file_sys: control_metadata: Expose device_save_data_size. (diff) | |
| download | yuzu-ab9ddab0a21fa447f8cd93df0d529069e5a1cae0.tar.gz yuzu-ab9ddab0a21fa447f8cd93df0d529069e5a1cae0.tar.xz yuzu-ab9ddab0a21fa447f8cd93df0d529069e5a1cae0.zip | |
file_sys: savefata_factory: Update to support DeviceSaveData.
| -rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index f3def93ab..adfd2c1a4 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp | |||
| @@ -57,7 +57,8 @@ void PrintSaveDataDescriptorWarnings(SaveDataDescriptor meta) { | |||
| 57 | bool ShouldSaveDataBeAutomaticallyCreated(SaveDataSpaceId space, const SaveDataDescriptor& desc) { | 57 | bool ShouldSaveDataBeAutomaticallyCreated(SaveDataSpaceId space, const SaveDataDescriptor& desc) { |
| 58 | return desc.type == SaveDataType::CacheStorage || desc.type == SaveDataType::TemporaryStorage || | 58 | return desc.type == SaveDataType::CacheStorage || desc.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.title_id == 0 && desc.save_id == 0); | 60 | (desc.type == SaveDataType::SaveData || desc.type == SaveDataType::DeviceSaveData) && |
| 61 | desc.title_id == 0 && desc.save_id == 0); | ||
| 61 | } | 62 | } |
| 62 | 63 | ||
| 63 | } // Anonymous namespace | 64 | } // Anonymous namespace |
| @@ -139,8 +140,10 @@ std::string SaveDataFactory::GetFullPath(SaveDataSpaceId space, SaveDataType typ | |||
| 139 | u128 user_id, u64 save_id) { | 140 | u128 user_id, u64 save_id) { |
| 140 | // According to switchbrew, if a save is of type SaveData and the title id field is 0, it should | 141 | // According to switchbrew, if a save is of type SaveData and the title id field is 0, it should |
| 141 | // be interpreted as the title id of the current process. | 142 | // be interpreted as the title id of the current process. |
| 142 | if (type == SaveDataType::SaveData && title_id == 0) { | 143 | if (type == SaveDataType::SaveData || type == SaveDataType::DeviceSaveData) { |
| 143 | title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); | 144 | if (title_id == 0) { |
| 145 | title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); | ||
| 146 | } | ||
| 144 | } | 147 | } |
| 145 | 148 | ||
| 146 | std::string out = GetSaveDataSpaceIdPath(space); | 149 | std::string out = GetSaveDataSpaceIdPath(space); |