diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/fs/archive.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.h | 7 | ||||
| -rw-r--r-- | src/core/hle/service/fs/fs_user.cpp | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 481715f17..e197d3599 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp | |||
| @@ -383,15 +383,13 @@ ResultVal<Kernel::SharedPtr<Directory>> OpenDirectoryFromArchive(ArchiveHandle a | |||
| 383 | return MakeResult<Kernel::SharedPtr<Directory>>(std::move(directory)); | 383 | return MakeResult<Kernel::SharedPtr<Directory>>(std::move(directory)); |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | ResultCode FormatSaveData() { | 386 | ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::Path& path) { |
| 387 | // Do not create the archive again if it already exists | 387 | auto archive_itr = id_code_map.find(id_code); |
| 388 | auto archive_itr = id_code_map.find(ArchiveIdCode::SaveData); | ||
| 389 | if (archive_itr == id_code_map.end()) { | 388 | if (archive_itr == id_code_map.end()) { |
| 390 | return UnimplementedFunction(ErrorModule::FS); // TODO(Subv): Find the right error | 389 | return UnimplementedFunction(ErrorModule::FS); // TODO(Subv): Find the right error |
| 391 | } | 390 | } |
| 392 | 391 | ||
| 393 | // Use an empty path, we do not use it when formatting the savedata | 392 | return archive_itr->second->Format(path); |
| 394 | return archive_itr->second->Format(FileSys::Path()); | ||
| 395 | } | 393 | } |
| 396 | 394 | ||
| 397 | ResultCode CreateExtSaveData(u32 high, u32 low) { | 395 | ResultCode CreateExtSaveData(u32 high, u32 low) { |
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index e27ad7d60..c490327d0 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h | |||
| @@ -162,10 +162,13 @@ ResultVal<Kernel::SharedPtr<Directory>> OpenDirectoryFromArchive(ArchiveHandle a | |||
| 162 | const FileSys::Path& path); | 162 | const FileSys::Path& path); |
| 163 | 163 | ||
| 164 | /** | 164 | /** |
| 165 | * Creates a blank SaveData archive. | 165 | * Erases the contents of the physical folder that contains the archive |
| 166 | * identified by the specified id code and path | ||
| 167 | * @param id_code The id of the archive to format | ||
| 168 | * @param path The path to the archive, if relevant. | ||
| 166 | * @return ResultCode 0 on success or the corresponding code on error | 169 | * @return ResultCode 0 on success or the corresponding code on error |
| 167 | */ | 170 | */ |
| 168 | ResultCode FormatSaveData(); | 171 | ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::Path& path = FileSys::Path()); |
| 169 | 172 | ||
| 170 | /** | 173 | /** |
| 171 | * Creates a blank SharedExtSaveData archive for the specified extdata ID | 174 | * Creates a blank SharedExtSaveData archive for the specified extdata ID |
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index d57dd042b..71ee4ff55 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp | |||
| @@ -468,7 +468,7 @@ static void FormatSaveData(Service::Interface* self) { | |||
| 468 | return; | 468 | return; |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | cmd_buff[1] = FormatSaveData().raw; | 471 | cmd_buff[1] = FormatArchive(ArchiveIdCode::SaveData).raw; |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | /** | 474 | /** |
| @@ -484,7 +484,7 @@ static void FormatThisUserSaveData(Service::Interface* self) { | |||
| 484 | 484 | ||
| 485 | // TODO(Subv): Find out what the inputs and outputs of this function are | 485 | // TODO(Subv): Find out what the inputs and outputs of this function are |
| 486 | 486 | ||
| 487 | cmd_buff[1] = FormatSaveData().raw; | 487 | cmd_buff[1] = FormatArchive(ArchiveIdCode::SaveData).raw; |
| 488 | } | 488 | } |
| 489 | 489 | ||
| 490 | static void CreateExtSaveData(Service::Interface* self) { | 490 | static void CreateExtSaveData(Service::Interface* self) { |