Merge pull request #19447 from hrydgard/harvest-moon-save-metadata

Fix Harvest Moon not updating save metadata
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2024-09-11 11:04:00 +02:00
commit 7f145c7b18
4 files changed
+14 -6

No files matched your search

+2 -1
View File
@@ -1112,7 +1112,8 @@ void PSPSaveDialog::ExecuteNotVisibleIOAction() {
param.ClearSFOCache();
auto &result = param.GetPspParam()->common.result;
switch ((SceUtilitySavedataType)(u32)param.GetPspParam()->mode) {
SceUtilitySavedataType utilityMode = (SceUtilitySavedataType)(u32)param.GetPspParam()->mode;
switch (utilityMode) {
case SCE_UTILITY_SAVEDATA_TYPE_LOAD: // Only load and exit
case SCE_UTILITY_SAVEDATA_TYPE_AUTOLOAD:
result = param.Load(param.GetPspParam(), GetSelectedSaveDirName(), currentSelectedSave);
+5 -4
View File
@@ -503,11 +503,13 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
std::string sfopath = dirPath + "/" + SFO_FILENAME;
std::shared_ptr<ParamSFOData> sfoFile = LoadCachedSFO(sfopath, true);
// This was added in #18430, see below.
bool subWrite = param->mode == SCE_UTILITY_SAVEDATA_TYPE_WRITEDATASECURE || param->mode == SCE_UTILITY_SAVEDATA_TYPE_WRITEDATA;
bool wasCrypted = GetSaveCryptMode(param, saveDirName) != 0;
// Update values
if(!subWrite){
// Update values. NOTE! #18430 made this conditional on !subWrite, but this is not correct, as it causes #18687.
// So now we do a hacky trick and just check for a valid title before we proceed with updating the sfoFile.
if (strnlen(param->sfoParam.title, sizeof(param->sfoParam.title)) > 0) {
sfoFile->SetValue("TITLE", param->sfoParam.title, 128);
sfoFile->SetValue("SAVEDATA_TITLE", param->sfoParam.savedataTitle, 128);
sfoFile->SetValue("SAVEDATA_DETAIL", param->sfoParam.detail, 1024);
@@ -554,7 +556,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
// Calc SFO hash for PSP.
if (cryptedData != 0 || (subWrite && wasCrypted)) {
int offset = sfoFile->GetDataOffset(sfoData, "SAVEDATA_PARAMS");
if(offset >= 0)
if (offset >= 0)
UpdateHash(sfoData, (int)sfoSize, offset, DetermineCryptMode(param));
}
@@ -598,7 +600,6 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
delete[] cryptedData;
}
// SAVE ICON0
if (param->icon0FileData.buf.IsValid())
{
+4
View File
@@ -238,6 +238,10 @@ bool CanExtractWithoutOverwrite(struct zip *z, const Path &destination, int maxO
}
for (int i = 0; i < numFiles; i++) {
const char *fn = zip_get_name(z, i, 0);
if (endsWith(fn, "/")) {
// we don't care about directory overwrites, that's fine.
continue;
}
Path p = destination / fn;
if (File::Exists(p)) {
INFO_LOG(Log::HLE, "Extract zip check: %s exists, can't extract without overwrite", p.ToVisualString().c_str());
+3 -1
View File
@@ -125,7 +125,9 @@ void InstallZipScreen::CreateViews() {
destFolders_.push_back(savedataDir);
leftColumn->Add(new NoticeView(NoticeLevel::WARN, di->T("Confirm Overwrite"), ""));
if (overwrite) {
leftColumn->Add(new NoticeView(NoticeLevel::WARN, di->T("Confirm Overwrite"), ""));
}
int columnWidth = 300;