Extra Handling of result value of funcStat CB.

This commit is contained in:
RipleyTom 2018-12-04 17:03:47 +01:00 committed by Ivan
parent 92be67b402
commit 5207b00973

View file

@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/Modules/cellSysutil.h"
@ -479,7 +479,7 @@ static NEVER_INLINE s32 savedata_op(ppu_thread& ppu, u32 operation, u32 version,
fs::stat_t dir_info{};
if (!fs::stat(dir_path, dir_info))
{
// error
// funcStat is called even if the directory doesn't exist.
}
statGet->hddFreeSizeKB = 40 * 1024 * 1024 - 1; // Read explanation in cellHddGameCheck
@ -576,10 +576,23 @@ static NEVER_INLINE s32 savedata_op(ppu_thread& ppu, u32 operation, u32 version,
{
cellSaveData.warning("savedata_op(): funcStat returned result=%d.", result->result);
// Skip and error
if (result->result >= CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM || result->result < CELL_SAVEDATA_CBRESULT_ERR_INVALID)
{
// ****** sysutil savedata parameter error : 22 ******
return CELL_SAVEDATA_ERROR_PARAM;
}
if (result->result < CELL_SAVEDATA_CBRESULT_OK_NEXT)
{
return CELL_SAVEDATA_ERROR_CBRESULT;
}
// Skip and return without error
if (result->result == CELL_SAVEDATA_CBRESULT_OK_LAST)
{
return CELL_OK;
}
}
if (statSet->setParam)
@ -656,11 +669,6 @@ static NEVER_INLINE s32 savedata_op(ppu_thread& ppu, u32 operation, u32 version,
return CELL_SAVEDATA_ERROR_PARAM;
}
}
if (result->result != CELL_SAVEDATA_CBRESULT_OK_NEXT)
{
funcFile = vm::null;
}
}