service/fsp_srv: Update SaveDataInfo and SaveDataDescriptor structs

I realized that I updated the documentation on SwitchBrew a while ago,
but never actually updated the structs within yuzu.
This commit is contained in:
Lioncash 2019-04-04 21:10:47 -04:00
parent 7c31661869
commit d9ee58a3b5
3 changed files with 15 additions and 4 deletions

View File

@ -16,8 +16,10 @@ namespace FileSys {
constexpr char SAVE_DATA_SIZE_FILENAME[] = ".yuzu_save_size"; constexpr char SAVE_DATA_SIZE_FILENAME[] = ".yuzu_save_size";
std::string SaveDataDescriptor::DebugInfo() const { std::string SaveDataDescriptor::DebugInfo() const {
return fmt::format("[type={:02X}, title_id={:016X}, user_id={:016X}{:016X}, save_id={:016X}]", return fmt::format("[type={:02X}, title_id={:016X}, user_id={:016X}{:016X}, save_id={:016X}, "
static_cast<u8>(type), title_id, user_id[1], user_id[0], save_id); "rank={}, index={}]",
static_cast<u8>(type), title_id, user_id[1], user_id[0], save_id,
static_cast<u8>(rank), index);
} }
SaveDataFactory::SaveDataFactory(VirtualDir save_directory) : dir(std::move(save_directory)) { SaveDataFactory::SaveDataFactory(VirtualDir save_directory) : dir(std::move(save_directory)) {

View File

@ -32,12 +32,19 @@ enum class SaveDataType : u8 {
CacheStorage = 5, CacheStorage = 5,
}; };
enum class SaveDataRank : u8 {
Primary,
Secondary,
};
struct SaveDataDescriptor { struct SaveDataDescriptor {
u64_le title_id; u64_le title_id;
u128 user_id; u128 user_id;
u64_le save_id; u64_le save_id;
SaveDataType type; SaveDataType type;
INSERT_PADDING_BYTES(7); SaveDataRank rank;
u16_le index;
INSERT_PADDING_BYTES(4);
u64_le zero_1; u64_le zero_1;
u64_le zero_2; u64_le zero_2;
u64_le zero_3; u64_le zero_3;

View File

@ -616,7 +616,9 @@ private:
u64_le save_id; u64_le save_id;
u64_le title_id; u64_le title_id;
u64_le save_image_size; u64_le save_image_size;
INSERT_PADDING_BYTES(0x28); u16_le index;
FileSys::SaveDataRank rank;
INSERT_PADDING_BYTES(0x25);
}; };
static_assert(sizeof(SaveDataInfo) == 0x60, "SaveDataInfo has incorrect size."); static_assert(sizeof(SaveDataInfo) == 0x60, "SaveDataInfo has incorrect size.");