More review fixes
This commit is contained in:
@@ -12,10 +12,9 @@
|
|||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
std::string SaveStructDebugInfo(SaveDataDescriptor save_struct) {
|
std::string SaveDataDescriptor::DebugInfo() {
|
||||||
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>(save_struct.type), save_struct.title_id,
|
static_cast<u8>(type), title_id, user_id[1], user_id[0], save_id);
|
||||||
save_struct.user_id[1], save_struct.user_id[0], save_struct.save_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveDataFactory::SaveDataFactory(std::string nand_directory)
|
SaveDataFactory::SaveDataFactory(std::string nand_directory)
|
||||||
@@ -65,7 +64,7 @@ ResultVal<std::unique_ptr<FileSystemBackend>> SaveDataFactory::Open(SaveDataSpac
|
|||||||
FileUtil::CreateFullPath(save_directory);
|
FileUtil::CreateFullPath(save_directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(DarkLordZach): For some reason, CreateFullPath dosen't create the last bit. Should be
|
// TODO(DarkLordZach): For some reason, CreateFullPath doesn't create the last bit. Should be
|
||||||
// fixed with VFS.
|
// fixed with VFS.
|
||||||
if (!FileUtil::IsDirectory(save_directory)) {
|
if (!FileUtil::IsDirectory(save_directory)) {
|
||||||
FileUtil::CreateDir(save_directory);
|
FileUtil::CreateDir(save_directory);
|
||||||
@@ -83,6 +82,8 @@ ResultVal<std::unique_ptr<FileSystemBackend>> SaveDataFactory::Open(SaveDataSpac
|
|||||||
|
|
||||||
std::string SaveDataFactory::GetFullPath(SaveDataSpaceId space, SaveDataType type, u64 title_id,
|
std::string SaveDataFactory::GetFullPath(SaveDataSpaceId space, SaveDataType type, u64 title_id,
|
||||||
u128 user_id, u64 save_id) const {
|
u128 user_id, u64 save_id) const {
|
||||||
|
// According to switchbrew, if a save is of type SaveData and the title id field is 0, it should
|
||||||
|
// be interpreted as the title id of the current process.
|
||||||
if (type == SaveDataType::SaveData && title_id == 0)
|
if (type == SaveDataType::SaveData && title_id == 0)
|
||||||
title_id = Core::CurrentProcess()->program_id;
|
title_id = Core::CurrentProcess()->program_id;
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ struct SaveDataDescriptor {
|
|||||||
u64_le zero_1;
|
u64_le zero_1;
|
||||||
u64_le zero_2;
|
u64_le zero_2;
|
||||||
u64_le zero_3;
|
u64_le zero_3;
|
||||||
|
|
||||||
|
std::string DebugInfo();
|
||||||
};
|
};
|
||||||
static_assert(sizeof(SaveDataDescriptor) == 0x40, "SaveDataDescriptor has incorrect size.");
|
static_assert(sizeof(SaveDataDescriptor) == 0x40, "SaveDataDescriptor has incorrect size.");
|
||||||
|
|
||||||
std::string SaveStructDebugInfo(SaveDataDescriptor save_struct);
|
|
||||||
|
|
||||||
/// File system interface to the SaveData archive
|
/// File system interface to the SaveData archive
|
||||||
class SaveDataFactory {
|
class SaveDataFactory {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -522,7 +522,7 @@ void FSP_SRV::CreateSaveData(Kernel::HLERequestContext& ctx) {
|
|||||||
u128 uid = rp.PopRaw<u128>();
|
u128 uid = rp.PopRaw<u128>();
|
||||||
|
|
||||||
LOG_WARNING(Service_FS, "(STUBBED) called save_struct = {}, uid = {:016X}{:016X}",
|
LOG_WARNING(Service_FS, "(STUBBED) called save_struct = {}, uid = {:016X}{:016X}",
|
||||||
FileSys::SaveStructDebugInfo(save_struct), uid[1], uid[0]);
|
save_struct.DebugInfo(), uid[1], uid[0]);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
|||||||
Reference in New Issue
Block a user