diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/archive_backend.h | 2 | ||||
| -rw-r--r-- | src/core/file_sys/archive_extsavedata.cpp | 2 | ||||
| -rw-r--r-- | src/core/file_sys/archive_extsavedata.h | 4 | ||||
| -rw-r--r-- | src/core/file_sys/archive_savedata.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/cfg/cfg.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/fs/fs_user.cpp | 2 |
8 files changed, 12 insertions, 14 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 800ac1541..94cda172f 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h | |||
| @@ -172,7 +172,7 @@ public: | |||
| 172 | */ | 172 | */ |
| 173 | virtual ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) = 0; | 173 | virtual ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) = 0; |
| 174 | 174 | ||
| 175 | /* | 175 | /** |
| 176 | * Retrieves the format info about the archive with the specified path | 176 | * Retrieves the format info about the archive with the specified path |
| 177 | * @param path Path to the archive | 177 | * @param path Path to the archive |
| 178 | * @return Format information about the archive or error code | 178 | * @return Format information about the archive or error code |
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index e83a6153d..ca7fd5c5e 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp | |||
| @@ -117,7 +117,7 @@ ResultVal<ArchiveFormatInfo> ArchiveFactory_ExtSaveData::GetFormatInfo(const Pat | |||
| 117 | return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS, ErrorSummary::InvalidState, ErrorLevel::Status); | 117 | return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS, ErrorSummary::InvalidState, ErrorLevel::Status); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void ArchiveFactory_ExtSaveData::WriteIcon(const Path& path, u8* icon_data, u32 icon_size) { | 120 | void ArchiveFactory_ExtSaveData::WriteIcon(const Path& path, const u8* icon_data, u32 icon_size) { |
| 121 | std::string game_path = FileSys::GetExtSaveDataPath(GetMountPoint(), path); | 121 | std::string game_path = FileSys::GetExtSaveDataPath(GetMountPoint(), path); |
| 122 | FileUtil::IOFile icon_file(game_path + "icon", "wb+"); | 122 | FileUtil::IOFile icon_file(game_path + "icon", "wb+"); |
| 123 | icon_file.WriteBytes(icon_data, icon_size); | 123 | icon_file.WriteBytes(icon_data, icon_size); |
diff --git a/src/core/file_sys/archive_extsavedata.h b/src/core/file_sys/archive_extsavedata.h index 48e092ee7..1ebe0529f 100644 --- a/src/core/file_sys/archive_extsavedata.h +++ b/src/core/file_sys/archive_extsavedata.h | |||
| @@ -36,13 +36,13 @@ public: | |||
| 36 | 36 | ||
| 37 | const std::string& GetMountPoint() const { return mount_point; } | 37 | const std::string& GetMountPoint() const { return mount_point; } |
| 38 | 38 | ||
| 39 | /* | 39 | /** |
| 40 | * Writes the SMDH icon of the ExtSaveData to file | 40 | * Writes the SMDH icon of the ExtSaveData to file |
| 41 | * @param path Path of this ExtSaveData | 41 | * @param path Path of this ExtSaveData |
| 42 | * @param icon_data Binary data of the icon | 42 | * @param icon_data Binary data of the icon |
| 43 | * @param icon_size Size of the icon data | 43 | * @param icon_size Size of the icon data |
| 44 | */ | 44 | */ |
| 45 | void WriteIcon(const Path& path, u8* icon_data, u32 icon_size); | 45 | void WriteIcon(const Path& path, const u8* icon_data, u32 icon_size); |
| 46 | 46 | ||
| 47 | private: | 47 | private: |
| 48 | /** | 48 | /** |
diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index 82f49af5d..c2d32ed7e 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp | |||
| @@ -26,14 +26,14 @@ static std::string GetSaveDataContainerPath(const std::string& sdmc_directory) { | |||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | static std::string GetSaveDataPath(const std::string& mount_location, u64 program_id) { | 28 | static std::string GetSaveDataPath(const std::string& mount_location, u64 program_id) { |
| 29 | u32 high = program_id >> 32; | 29 | u32 high = (u32)(program_id >> 32); |
| 30 | u32 low = program_id & 0xFFFFFFFF; | 30 | u32 low = (u32)(program_id & 0xFFFFFFFF); |
| 31 | return Common::StringFromFormat("%s%08x/%08x/data/00000001/", mount_location.c_str(), high, low); | 31 | return Common::StringFromFormat("%s%08x/%08x/data/00000001/", mount_location.c_str(), high, low); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | static std::string GetSaveDataMetadataPath(const std::string& mount_location, u64 program_id) { | 34 | static std::string GetSaveDataMetadataPath(const std::string& mount_location, u64 program_id) { |
| 35 | u32 high = program_id >> 32; | 35 | u32 high = (u32)(program_id >> 32); |
| 36 | u32 low = program_id & 0xFFFFFFFF; | 36 | u32 low = (u32)(program_id & 0xFFFFFFFF); |
| 37 | return Common::StringFromFormat("%s%08x/%08x/data/00000001.metadata", mount_location.c_str(), high, low); | 37 | return Common::StringFromFormat("%s%08x/%08x/data/00000001.metadata", mount_location.c_str(), high, low); |
| 38 | } | 38 | } |
| 39 | 39 | ||
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index bb2c55612..525432957 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp | |||
| @@ -310,6 +310,7 @@ ResultCode UpdateConfigNANDSavegame() { | |||
| 310 | 310 | ||
| 311 | ResultCode FormatConfig() { | 311 | ResultCode FormatConfig() { |
| 312 | ResultCode res = DeleteConfigNANDSaveFile(); | 312 | ResultCode res = DeleteConfigNANDSaveFile(); |
| 313 | // The delete command fails if the file doesn't exist, so we have to check that too | ||
| 313 | if (!res.IsSuccess() && res.description != ErrorDescription::FS_NotFound) | 314 | if (!res.IsSuccess() && res.description != ErrorDescription::FS_NotFound) |
| 314 | return res; | 315 | return res; |
| 315 | // Delete the old data | 316 | // Delete the old data |
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 63381250a..676a2ee56 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp | |||
| @@ -308,11 +308,8 @@ ResultVal<Kernel::SharedPtr<File>> OpenFileFromArchive(ArchiveHandle archive_han | |||
| 308 | return ERR_INVALID_HANDLE; | 308 | return ERR_INVALID_HANDLE; |
| 309 | 309 | ||
| 310 | auto backend = archive->OpenFile(path, mode); | 310 | auto backend = archive->OpenFile(path, mode); |
| 311 | if (backend.Failed()) { | 311 | if (backend.Failed()) |
| 312 | return backend.Code(); | 312 | return backend.Code(); |
| 313 | return ResultCode(ErrorDescription::FS_NotFound, ErrorModule::FS, | ||
| 314 | ErrorSummary::NotFound, ErrorLevel::Status); | ||
| 315 | } | ||
| 316 | 313 | ||
| 317 | auto file = Kernel::SharedPtr<File>(new File(backend.MoveFrom(), path)); | 314 | auto file = Kernel::SharedPtr<File>(new File(backend.MoveFrom(), path)); |
| 318 | return MakeResult<Kernel::SharedPtr<File>>(std::move(file)); | 315 | return MakeResult<Kernel::SharedPtr<File>>(std::move(file)); |
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index b17d7c902..006606740 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h | |||
| @@ -183,7 +183,7 @@ ResultVal<u64> GetFreeBytesInArchive(ArchiveHandle archive_handle); | |||
| 183 | */ | 183 | */ |
| 184 | ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo& format_info, const FileSys::Path& path = FileSys::Path()); | 184 | ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo& format_info, const FileSys::Path& path = FileSys::Path()); |
| 185 | 185 | ||
| 186 | /* | 186 | /** |
| 187 | * Retrieves the format info about the archive of the specified type and path. | 187 | * Retrieves the format info about the archive of the specified type and path. |
| 188 | * The format info is supplied by the client code when creating archives. | 188 | * The format info is supplied by the client code when creating archives. |
| 189 | * @param id_code The id of the archive | 189 | * @param id_code The id of the archive |
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index ff7a9975e..3ec7ceb30 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp | |||
| @@ -250,7 +250,7 @@ static void CreateFile(Service::Interface* self) { | |||
| 250 | 250 | ||
| 251 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); | 251 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); |
| 252 | 252 | ||
| 253 | LOG_DEBUG(Service_FS, "type=%d size=%lld data=%s", filename_type, filename_size, file_path.DebugStr().c_str()); | 253 | LOG_DEBUG(Service_FS, "type=%d size=%llu data=%s", filename_type, filename_size, file_path.DebugStr().c_str()); |
| 254 | 254 | ||
| 255 | cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; | 255 | cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; |
| 256 | } | 256 | } |