mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Alternate solution for ModNation Racers metadata overwrite (see #18430 comments)
This commit is contained in:
parent
8e3daeb1e3
commit
c2a38181ad
2 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue