mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 00:13:08 +00:00
SaveData: implement sceSaveDataTransferringMount
This commit is contained in:
parent
bb32b30a58
commit
9b617dcc8c
@ -262,6 +262,14 @@ struct OrbisSaveDataRestoreBackupData {
|
|||||||
s32 : 32;
|
s32 : 32;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct OrbisSaveDataTransferringMount {
|
||||||
|
OrbisUserServiceUserId userId;
|
||||||
|
const OrbisSaveDataTitleId* titleId;
|
||||||
|
const OrbisSaveDataDirName* dirName;
|
||||||
|
const OrbisSaveDataFingerprint* fingerprint;
|
||||||
|
std::array<u8, 32> _reserved;
|
||||||
|
};
|
||||||
|
|
||||||
struct OrbisSaveDataDirNameSearchCond {
|
struct OrbisSaveDataDirNameSearchCond {
|
||||||
OrbisUserServiceUserId userId;
|
OrbisUserServiceUserId userId;
|
||||||
int : 32;
|
int : 32;
|
||||||
@ -357,7 +365,8 @@ static Error setNotInitializedError() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Error saveDataMount(const OrbisSaveDataMount2* mount_info,
|
static Error saveDataMount(const OrbisSaveDataMount2* mount_info,
|
||||||
OrbisSaveDataMountResult* mount_result) {
|
OrbisSaveDataMountResult* mount_result,
|
||||||
|
std::string_view title_id = g_game_serial) {
|
||||||
|
|
||||||
if (mount_info->userId < 0) {
|
if (mount_info->userId < 0) {
|
||||||
return Error::INVALID_LOGIN_USER;
|
return Error::INVALID_LOGIN_USER;
|
||||||
@ -369,8 +378,8 @@ static Error saveDataMount(const OrbisSaveDataMount2* mount_info,
|
|||||||
|
|
||||||
// check backup status
|
// check backup status
|
||||||
{
|
{
|
||||||
const auto save_path = SaveInstance::MakeDirSavePath(mount_info->userId, g_game_serial,
|
const auto save_path =
|
||||||
mount_info->dirName->data);
|
SaveInstance::MakeDirSavePath(mount_info->userId, title_id, mount_info->dirName->data);
|
||||||
if (Backup::IsBackupExecutingFor(save_path) && g_fw_ver) {
|
if (Backup::IsBackupExecutingFor(save_path) && g_fw_ver) {
|
||||||
return Error::BACKUP_BUSY;
|
return Error::BACKUP_BUSY;
|
||||||
}
|
}
|
||||||
@ -409,7 +418,7 @@ static Error saveDataMount(const OrbisSaveDataMount2* mount_info,
|
|||||||
return Error::MOUNT_FULL;
|
return Error::MOUNT_FULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveInstance save_instance{slot_num, mount_info->userId, g_game_serial, dir_name,
|
SaveInstance save_instance{slot_num, mount_info->userId, std::string{title_id}, dir_name,
|
||||||
(int)mount_info->blocks};
|
(int)mount_info->blocks};
|
||||||
|
|
||||||
if (save_instance.Mounted()) {
|
if (save_instance.Mounted()) {
|
||||||
@ -1647,9 +1656,24 @@ Error PS4_SYSV_ABI sceSaveDataTerminate() {
|
|||||||
return Error::OK;
|
return Error::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI sceSaveDataTransferringMount() {
|
Error PS4_SYSV_ABI sceSaveDataTransferringMount(const OrbisSaveDataTransferringMount* mount,
|
||||||
LOG_ERROR(Lib_SaveData, "(STUBBED) called");
|
OrbisSaveDataMountResult* mountResult) {
|
||||||
return ORBIS_OK;
|
LOG_DEBUG(Lib_SaveData, "called");
|
||||||
|
if (!g_initialized) {
|
||||||
|
LOG_INFO(Lib_SaveData, "called without initialize");
|
||||||
|
return setNotInitializedError();
|
||||||
|
}
|
||||||
|
if (mount == nullptr || mount->titleId == nullptr || mount->dirName == nullptr) {
|
||||||
|
LOG_INFO(Lib_SaveData, "called with invalid parameter");
|
||||||
|
return Error::PARAMETER;
|
||||||
|
}
|
||||||
|
LOG_DEBUG(Lib_SaveData, "called titleId: {}, dirName: {}", mount->titleId->data.to_view(),
|
||||||
|
mount->dirName->data.to_view());
|
||||||
|
OrbisSaveDataMount2 mount_info{};
|
||||||
|
mount_info.userId = mount->userId;
|
||||||
|
mount_info.dirName = mount->dirName;
|
||||||
|
mount_info.mountMode = OrbisSaveDataMountMode::RDONLY;
|
||||||
|
return saveDataMount(&mount_info, mountResult, mount->titleId->data.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
Error PS4_SYSV_ABI sceSaveDataUmount(const OrbisSaveDataMountPoint* mountPoint) {
|
Error PS4_SYSV_ABI sceSaveDataUmount(const OrbisSaveDataMountPoint* mountPoint) {
|
||||||
|
@ -70,6 +70,7 @@ struct OrbisSaveDataMountInfo;
|
|||||||
struct OrbisSaveDataMountPoint;
|
struct OrbisSaveDataMountPoint;
|
||||||
struct OrbisSaveDataMountResult;
|
struct OrbisSaveDataMountResult;
|
||||||
struct OrbisSaveDataRestoreBackupData;
|
struct OrbisSaveDataRestoreBackupData;
|
||||||
|
struct OrbisSaveDataTransferringMount;
|
||||||
|
|
||||||
int PS4_SYSV_ABI sceSaveDataAbort();
|
int PS4_SYSV_ABI sceSaveDataAbort();
|
||||||
Error PS4_SYSV_ABI sceSaveDataBackup(const OrbisSaveDataBackup* backup);
|
Error PS4_SYSV_ABI sceSaveDataBackup(const OrbisSaveDataBackup* backup);
|
||||||
@ -174,7 +175,8 @@ int PS4_SYSV_ABI sceSaveDataSupportedFakeBrokenStatus();
|
|||||||
int PS4_SYSV_ABI sceSaveDataSyncCloudList();
|
int PS4_SYSV_ABI sceSaveDataSyncCloudList();
|
||||||
Error PS4_SYSV_ABI sceSaveDataSyncSaveDataMemory(OrbisSaveDataMemorySync* syncParam);
|
Error PS4_SYSV_ABI sceSaveDataSyncSaveDataMemory(OrbisSaveDataMemorySync* syncParam);
|
||||||
Error PS4_SYSV_ABI sceSaveDataTerminate();
|
Error PS4_SYSV_ABI sceSaveDataTerminate();
|
||||||
int PS4_SYSV_ABI sceSaveDataTransferringMount();
|
Error PS4_SYSV_ABI sceSaveDataTransferringMount(const OrbisSaveDataTransferringMount* mount,
|
||||||
|
OrbisSaveDataMountResult* mountResult);
|
||||||
Error PS4_SYSV_ABI sceSaveDataUmount(const OrbisSaveDataMountPoint* mountPoint);
|
Error PS4_SYSV_ABI sceSaveDataUmount(const OrbisSaveDataMountPoint* mountPoint);
|
||||||
int PS4_SYSV_ABI sceSaveDataUmountSys();
|
int PS4_SYSV_ABI sceSaveDataUmountSys();
|
||||||
Error PS4_SYSV_ABI sceSaveDataUmountWithBackup(const OrbisSaveDataMountPoint* mountPoint);
|
Error PS4_SYSV_ABI sceSaveDataUmountWithBackup(const OrbisSaveDataMountPoint* mountPoint);
|
||||||
|
Loading…
Reference in New Issue
Block a user