From ee34a73e80b1577891e0f90937cbe58d07608491 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Mon, 26 Nov 2018 21:34:00 +0800 Subject: [PATCH] yugioh save fix tool --- Core/Config.cpp | 1 + Core/Config.h | 1 + Core/HLE/sceUtility.cpp | 11 +++++++++-- UI/GameSettingsScreen.cpp | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index a62dbb21f6..197ce3ed5a 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -838,6 +838,7 @@ static ConfigSetting systemParamSettings[] = { ConfigSetting("proAdhocServer", &g_Config.proAdhocServer, "black-seraph.com", true, true), ConfigSetting("MacAddress", &g_Config.sMACAddress, "", true, true), ConfigSetting("PortOffset", &g_Config.iPortOffset, 0, true, true), + ConfigSetting("SavedataCorrectionForyugioh", &g_Config.bSavedataCorrectionForyugioh, false, true, true), ReportedConfigSetting("Language", &g_Config.iLanguage, &DefaultSystemParamLanguage, true, true), ConfigSetting("TimeFormat", &g_Config.iTimeFormat, PSP_SYSTEMPARAM_TIME_FORMAT_24HR, true, true), ConfigSetting("DateFormat", &g_Config.iDateFormat, PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD, true, true), diff --git a/Core/Config.h b/Core/Config.h index 311516d769..44f74a2ec2 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -90,6 +90,7 @@ public: bool bCheckForNewVersion; bool bForceLagSync; bool bFuncReplacements; + bool bSavedataCorrectionForyugioh; bool bHideSlowWarnings; bool bHideStateWarnings; bool bPreloadFunctions; diff --git a/Core/HLE/sceUtility.cpp b/Core/HLE/sceUtility.cpp index 6b5b89d75f..0519c139d2 100644 --- a/Core/HLE/sceUtility.cpp +++ b/Core/HLE/sceUtility.cpp @@ -185,8 +185,15 @@ static int sceUtilitySavedataInitStart(u32 paramAddr) { if (currentDialogActive && currentDialogType != UTILITY_DIALOG_SAVEDATA) { - WARN_LOG(SCEUTILITY, "sceUtilitySavedataInitStart(%08x): wrong dialog type", paramAddr); - return SCE_ERROR_UTILITY_WRONG_TYPE; + if (g_Config.bSavedataCorrectionForyugioh) + { + WARN_LOG(SCEUTILITY, "Savedata Correction"); + g_Config.bSavedataCorrectionForyugioh = false; + } + else { + WARN_LOG(SCEUTILITY, "sceUtilitySavedataInitStart(%08x): wrong dialog type", paramAddr); + return SCE_ERROR_UTILITY_WRONG_TYPE; + } } oldStatus = 100; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index c3b98df7a1..016bc107cd 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -671,6 +671,8 @@ void GameSettingsScreen::CreateViews() { tools->Add(new ItemHeader(ms->T("Tools"))); // These were moved here so use the wrong translation objects, to avoid having to change all inis... This isn't a sustainable situation :P tools->Add(new Choice(sa->T("Savedata Manager")))->OnClick.Handle(this, &GameSettingsScreen::OnSavedataManager); + // issue #7914 + tools->Add(new CheckBox(&g_Config.bSavedataCorrectionForyugioh, sa->T("Savedata correction for yugioh"))); tools->Add(new Choice(dev->T("System Information")))->OnClick.Handle(this, &GameSettingsScreen::OnSysInfo); tools->Add(new Choice(sy->T("Developer Tools")))->OnClick.Handle(this, &GameSettingsScreen::OnDeveloperTools); tools->Add(new Choice(ri->T("Remote disc streaming")))->OnClick.Handle(this, &GameSettingsScreen::OnRemoteISO);