diff options
| author | bunnei <bunneidev@gmail.com> | 2015-01-25 22:13:13 -0500 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2015-01-25 22:13:13 -0500 |
| commit | e7dd4d34aa05b185cca8224fa47125f21856f05d (patch) | |
| tree | 2da4b86c0f08d09502c80fb4ae41fe6259407cfc /src/core/hle/service/fs/archive.cpp | |
| parent | cc34462b71b31a6c75a746f18289bc53026ab612 (diff) | |
| parent | 2ea60bdc7f6f7b176eb8bfc5b31d0cd76cad3d61 (diff) | |
Merge pull request #485 from Subv/more_servs
Services: Stubbed more services.
Diffstat (limited to 'src/core/hle/service/fs/archive.cpp')
| -rw-r--r-- | src/core/hle/service/fs/archive.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 958dd9344..1bb4e4b23 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -432,6 +432,28 @@ ResultCode FormatSaveData() { return archive_itr->second->backend->Format(FileSys::Path()); } +ResultCode CreateExtSaveData(u32 high, u32 low) { + // Construct the binary path to the archive first + std::vector<u8> binary_path; + binary_path.reserve(12); + // The first word is all zero to specify a NAND archive + for (unsigned i = 0; i < 4; ++i) + binary_path.push_back(0); + // Next is the low word + for (unsigned i = 0; i < 4; ++i) + binary_path.push_back((low >> (8 * i)) & 0xFF); + // Next is the high word + for (unsigned i = 0; i < 4; ++i) + binary_path.push_back((high >> i) & 0xFF); + FileSys::Path path(binary_path); + std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX); + std::string base_path = FileSys::GetExtDataContainerPath(nand_directory, true); + std::string extsavedata_path = FileSys::GetExtSaveDataPath(base_path, path); + if (!FileUtil::CreateFullPath(extsavedata_path)) + return ResultCode(-1); // TODO(Subv): Find the right error code + return RESULT_SUCCESS; +} + /// Initialize archives void ArchiveInit() { next_handle = 1; |
