From 561cbab5c5ba39da6a9d4bb31dd0e16a76103a97 Mon Sep 17 00:00:00 2001 From: shenweip Date: Sun, 6 Oct 2013 22:17:05 +0800 Subject: [PATCH] Use sfo file to set savedata'date when mode is 11. --- Core/Dialog/SavedataParam.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index bf8faee4f..9ffea0a3e 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -821,6 +821,7 @@ bool SavedataParam::GetList(SceUtilitySavedataParam *param) u32 maxFile = param->idList->maxCount; std::vector validDir; + std::vector sfoFiles; std::vector allDir = pspFileSystem.GetDirListing(savePath); if (param->idList.IsValid()) @@ -835,13 +836,21 @@ bool SavedataParam::GetList(SceUtilitySavedataParam *param) } } + PSPFileInfo sfoFile; + for (size_t i = 0; i < validDir.size(); ++i) { + // GetFileName(param) == NUll here + // so use sfo files to set the date. + sfoFile = pspFileSystem.GetFileInfo(savePath + validDir[i].name + "/" + "PARAM.SFO"); + sfoFiles.push_back(sfoFile); + } + SceUtilitySavedataIdListEntry *entries = param->idList->entries; for (u32 i = 0; i < (u32)validDir.size(); i++) { entries[i].st_mode = 0x11FF; - __IoCopyDate(entries[i].st_ctime, validDir[i].ctime); - __IoCopyDate(entries[i].st_atime, validDir[i].atime); - __IoCopyDate(entries[i].st_mtime, validDir[i].mtime); + __IoCopyDate(entries[i].st_ctime, sfoFiles[i].ctime); + __IoCopyDate(entries[i].st_atime, sfoFiles[i].atime); + __IoCopyDate(entries[i].st_mtime, sfoFiles[i].mtime); // folder name without gamename (max 20 u8) std::string outName = validDir[i].name.substr(GetGameName(param).size()); memset(entries[i].name, 0, sizeof(entries[i].name));