diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 18077b7fd..9811bbb13 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -972,29 +972,24 @@ bool SavedataParam::GetSize(SceUtilitySavedataParam *param) PSPFileInfo info = pspFileSystem.GetFileInfo(saveDir); bool exists = info.exists; - if (Memory::IsValidAddress(param->sizeAddr)) + if (param->sizeInfo.Valid()) { - PspUtilitySavedataSizeInfo sizeInfo; - Memory::ReadStruct(param->sizeAddr, &sizeInfo); - // TODO: Read the entries and count up the size vs. existing size? - sizeInfo.sectorSize = (int)MemoryStick_SectorSize(); - sizeInfo.freeSectors = (int)(MemoryStick_FreeSpace() / MemoryStick_SectorSize()); + param->sizeInfo->sectorSize = (int)MemoryStick_SectorSize(); + param->sizeInfo->freeSectors = (int)(MemoryStick_FreeSpace() / MemoryStick_SectorSize()); // TODO: Is this after the specified files? Before? - sizeInfo.freeKB = (int)(MemoryStick_FreeSpace() / 1024); + param->sizeInfo->freeKB = (int)(MemoryStick_FreeSpace() / 1024); std::string spaceTxt = SavedataParam::GetSpaceText((int)MemoryStick_FreeSpace()); - strncpy(sizeInfo.freeString, spaceTxt.c_str(), 8); - sizeInfo.freeString[7] = '\0'; + strncpy(param->sizeInfo->freeString, spaceTxt.c_str(), 8); + param->sizeInfo->freeString[7] = '\0'; // TODO. - sizeInfo.neededKB = 0; - strcpy(sizeInfo.neededString, "0 KB"); - sizeInfo.overwriteKB = 0; - strcpy(sizeInfo.overwriteString, "0 KB"); - - Memory::WriteStruct(param->sizeAddr, &sizeInfo); + param->sizeInfo->neededKB = 0; + strcpy(param->sizeInfo->neededString, "0 KB"); + param->sizeInfo->overwriteKB = 0; + strcpy(param->sizeInfo->overwriteString, "0 KB"); } return exists; diff --git a/Core/Dialog/SavedataParam.h b/Core/Dialog/SavedataParam.h index b3493769d..9611edf81 100644 --- a/Core/Dialog/SavedataParam.h +++ b/Core/Dialog/SavedataParam.h @@ -85,18 +85,16 @@ struct PspUtilitySavedataFileData { int unknown; }; -// TODO: According to JPCSP, should verify. struct PspUtilitySavedataSizeEntry { u64 size; char name[16]; }; -// TODO: According to JPCSP, should verify. struct PspUtilitySavedataSizeInfo { - int secureNumEntries; - int numEntries; - u32 secureEntriesPtr; - u32 entriesPtr; + int numSecureEntries; + int numNormalEntries; + PSPPointer secureEntries; + PSPPointer normalEntries; int sectorSize; int freeSectors; int freeKB; @@ -225,7 +223,7 @@ struct SceUtilitySavedataParam PSPPointer fileList; // Function 22 GETSIZES - u32 sizeAddr; + PSPPointer sizeInfo; };