small fix in sceSaveDataGetEventResult and sceAppContentTemporaryDataMount2.

This commit is contained in:
raziel1000 2024-07-08 22:39:40 -06:00
parent 13b9469af4
commit 427a7aa407
2 changed files with 6 additions and 12 deletions

View File

@ -198,6 +198,8 @@ int PS4_SYSV_ABI sceAppContentTemporaryDataMount() {
int PS4_SYSV_ABI sceAppContentTemporaryDataMount2(OrbisAppContentTemporaryDataOption option,
OrbisAppContentMountPoint* mountPoint) {
if (std::string_view(mountPoint->data).empty()) // causing issues with save_data.
return ORBIS_APP_CONTENT_ERROR_PARAMETER;
auto* param_sfo = Common::Singleton<PSF>::Instance();
std::string id(param_sfo->GetString("CONTENT_ID"), 7, 9);
const auto& mount_dir = Common::FS::GetUserPath(Common::FS::PathType::TempDataDir) / id;

View File

@ -248,20 +248,12 @@ int PS4_SYSV_ABI sceSaveDataGetEventInfo() {
int PS4_SYSV_ABI sceSaveDataGetEventResult(const OrbisSaveDataEventParam* eventParam,
OrbisSaveDataEvent* event) {
LOG_INFO(Lib_SaveData, "called sceSaveDataGetEventResult : null = {}", (eventParam == nullptr));
if (eventParam == nullptr)
return ORBIS_SAVE_DATA_ERROR_PARAMETER;
// eventParam can be 0/null.
if (event == nullptr)
return ORBIS_SAVE_DATA_ERROR_NOT_INITIALIZED;
const auto& mount_dir = Common::FS::GetUserPath(Common::FS::PathType::SaveDataDir) /
std::to_string(1) / game_serial; // fix me
Common::FS::IOFile file(mount_dir / "param.txt", Common::FS::FileAccessMode::Read);
OrbisSaveDataParam* param = new OrbisSaveDataParam{};
file.ReadRaw<u8>(param, sizeof(OrbisSaveDataParam));
LOG_INFO(Lib_SaveData, "called");
LOG_INFO(Lib_SaveData, "called: Todo.");
event->userId = 1;
return ORBIS_OK;
}