mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
some completeness with sceSaveDataMount2
This commit is contained in:
parent
1c4a9aa063
commit
e22c77e633
@ -14,10 +14,10 @@
|
||||
#include "core/libraries/network/netctl.h"
|
||||
#include "core/libraries/network/ssl.h"
|
||||
#include "core/libraries/pad/pad.h"
|
||||
#include "core/libraries/save_data/save_data.h"
|
||||
#include "core/libraries/system/commondialog.h"
|
||||
#include "core/libraries/system/msgdialog.h"
|
||||
#include "core/libraries/system/posix.h"
|
||||
#include "core/libraries/save_data/save_data.h"
|
||||
#include "core/libraries/system/savedatadialog.h"
|
||||
#include "core/libraries/system/sysmodule.h"
|
||||
#include "core/libraries/system/systemservice.h"
|
||||
|
@ -4,3 +4,4 @@
|
||||
#pragma once
|
||||
|
||||
constexpr int ORBIS_SAVE_DATA_ERROR_NOT_FOUND = 0x809f0008; // save data doesn't exist
|
||||
constexpr int ORBIS_SAVE_DATA_ERROR_EXISTS = 0x809f0007; // save data directory,same name exists
|
||||
|
@ -337,8 +337,8 @@ int PS4_SYSV_ABI sceSaveDataMount() {
|
||||
|
||||
s32 PS4_SYSV_ABI sceSaveDataMount2(const OrbisSaveDataMount2* mount,
|
||||
OrbisSaveDataMountResult* mount_result) {
|
||||
LOG_ERROR(Lib_SaveData, "(DUMMY) called user_id = {} dir_name = {} blocks = {} mount_mode = {}",
|
||||
mount->user_id, mount->dir_name->data, mount->blocks, mount->mount_mode);
|
||||
LOG_INFO(Lib_SaveData, "called user_id = {} dir_name = {} blocks = {} mount_mode = {}",
|
||||
mount->user_id, mount->dir_name->data, mount->blocks, mount->mount_mode);
|
||||
|
||||
bool rdonly = (mount->mount_mode & ORBIS_SAVE_DATA_MOUNT_MODE_RDONLY) != 0;
|
||||
bool rdwr = (mount->mount_mode & ORBIS_SAVE_DATA_MOUNT_MODE_RDWR) != 0;
|
||||
@ -360,6 +360,20 @@ s32 PS4_SYSV_ABI sceSaveDataMount2(const OrbisSaveDataMount2* mount,
|
||||
mount_result->mount_status = 0;
|
||||
strcpy_s(mount_result->mount_point.data, 16, g_mount_point.c_str());
|
||||
}
|
||||
if (create) {
|
||||
if (std::filesystem::is_directory(mount_dir)) {
|
||||
return ORBIS_SAVE_DATA_ERROR_EXISTS;
|
||||
}
|
||||
std::filesystem::create_directories(mount_dir);
|
||||
|
||||
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||
mnt->Mount(mount_dir, g_mount_point);
|
||||
|
||||
mount_result->mount_status = 1;
|
||||
strcpy_s(mount_result->mount_point.data, 16, g_mount_point.c_str());
|
||||
}
|
||||
mount_result->required_blocks = 0;
|
||||
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user