Very bugfix

I reverted cellSaveData changes since they were relying on the
uninitialized local variable `save_entry` and thus were almost
completely wrong.
This commit is contained in:
Nekotekina 2015-07-16 19:31:58 +03:00
parent 5bd83516ba
commit 9913c9059c
5 changed files with 43 additions and 53 deletions

View file

@ -57,7 +57,6 @@ never_inline s32 savedata_op(
if (!lock)
{
cellSysutil.Error("savedata_op(): failed to lock the mutex.");
return CELL_SAVEDATA_ERROR_BUSY;
}
@ -192,7 +191,6 @@ never_inline s32 savedata_op(
if (result->result < 0)
{
cellSysutil.Error("savedata_op(): funcList returned result < 0.");
return CELL_SAVEDATA_ERROR_CBRESULT;
}
@ -304,7 +302,6 @@ never_inline s32 savedata_op(
if (result->result < 0)
{
cellSysutil.Error("savedata_op(): funcFixed returned result < 0.");
return CELL_SAVEDATA_ERROR_CBRESULT;
}
@ -346,31 +343,10 @@ never_inline s32 savedata_op(
PSFLoader psf;
// Create save directory if necessary
if (save_entry.isNew)
{
if (!Emu.GetVFS().ExistsDir(dir_path) && !Emu.GetVFS().CreateDir(dir_path))
{
cellSysutil.Error("savedata_op(): Savedata directory creation failed.");
}
else
{
// Is loading the PARAM.SFO really necessary? Setting empty stuff seems to fix a couple games.
psf.SetInteger("ATTRIBUTE", 0);
psf.SetString("TITLE", "");
psf.SetString("SUB_TITLE", "");
psf.SetString("DETAIL", "");
psf.SetString("SAVEDATA_LIST_PARAM", "");
}
}
// Load PARAM.SFO
{
if (!save_entry.isNew)
{
vfsFile f(sfo_path);
psf.Load(f);
}
vfsFile f(sfo_path);
psf.Load(f);
}
// Get save stats
@ -460,7 +436,6 @@ never_inline s32 savedata_op(
if (result->result < 0)
{
cellSysutil.Error("savedata_op(): funcStat returned result < 0.");
return CELL_SAVEDATA_ERROR_CBRESULT;
}
@ -510,6 +485,12 @@ never_inline s32 savedata_op(
}
}
// Create save directory if necessary
if (psf && save_entry.isNew && !Emu.GetVFS().CreateDir(dir_path))
{
// Let's ignore this error for now
}
// Enter the loop where the save files are read/created/deleted
vm::stackvar<CellSaveDataFileGet> fileGet(CPU);
vm::stackvar<CellSaveDataFileSet> fileSet(CPU);
@ -523,7 +504,6 @@ never_inline s32 savedata_op(
if (result->result < 0)
{
cellSysutil.Error("savedata_op(): funcFile returned result < 0.");
return CELL_SAVEDATA_ERROR_CBRESULT;
}
@ -772,7 +752,7 @@ s32 cellSaveDataListAutoLoad(
}
s32 cellSaveDataDelete2(u32 container)
{
{
cellSysutil.Todo("cellSaveDataDelete2(container=0x%x)", container);
return CELL_SAVEDATA_RET_CANCEL;