From ee34a73e80b1577891e0f90937cbe58d07608491 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Mon, 26 Nov 2018 21:34:00 +0800 Subject: [PATCH 1/2] 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); From b82b42fab091a247d78941b36e02eed1963e08a3 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Tue, 27 Nov 2018 22:45:51 +0800 Subject: [PATCH 2/2] Use compat setting instead --- Core/Compatibility.cpp | 1 + Core/Compatibility.h | 1 + Core/Config.cpp | 1 - Core/Config.h | 1 - Core/HLE/sceUtility.cpp | 6 +++--- UI/GameSettingsScreen.cpp | 2 -- assets/compat.ini | 38 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index 692993973c..855218db6b 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -60,6 +60,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "MGS2AcidHack", &flags_.MGS2AcidHack); CheckSetting(iniFile, gameID, "SonicRivalsHack", &flags_.SonicRivalsHack); CheckSetting(iniFile, gameID, "BlockTransferAllowCreateFB", &flags_.BlockTransferAllowCreateFB); + CheckSetting(iniFile, gameID, "YugiohSaveFix", &flags_.YugiohSaveFix); } void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) { diff --git a/Core/Compatibility.h b/Core/Compatibility.h index 97373b9418..0d74f828f6 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -60,6 +60,7 @@ struct CompatFlags { bool MGS2AcidHack; bool SonicRivalsHack; bool BlockTransferAllowCreateFB; + bool YugiohSaveFix; }; class IniFile; diff --git a/Core/Config.cpp b/Core/Config.cpp index 197ce3ed5a..a62dbb21f6 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -838,7 +838,6 @@ 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 44f74a2ec2..311516d769 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -90,7 +90,6 @@ 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 0519c139d2..1a9c994701 100644 --- a/Core/HLE/sceUtility.cpp +++ b/Core/HLE/sceUtility.cpp @@ -26,6 +26,7 @@ #include "Core/MIPS/MIPS.h" #include "Core/Reporting.h" #include "Core/Config.h" +#include "Core/System.h" #include "Core/HLE/sceKernel.h" #include "Core/HLE/sceKernelMemory.h" @@ -185,10 +186,9 @@ static int sceUtilitySavedataInitStart(u32 paramAddr) { if (currentDialogActive && currentDialogType != UTILITY_DIALOG_SAVEDATA) { - if (g_Config.bSavedataCorrectionForyugioh) + if (PSP_CoreParameter().compat.flags().YugiohSaveFix) { - WARN_LOG(SCEUTILITY, "Savedata Correction"); - g_Config.bSavedataCorrectionForyugioh = false; + WARN_LOG(SCEUTILITY, "Yugioh Savedata Correction"); } else { WARN_LOG(SCEUTILITY, "sceUtilitySavedataInitStart(%08x): wrong dialog type", paramAddr); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 016bc107cd..c3b98df7a1 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -671,8 +671,6 @@ 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); diff --git a/assets/compat.ini b/assets/compat.ini index 895db36663..d64361c8eb 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -346,3 +346,41 @@ NPJH50686 = true # Digimon Adventures (JP, and English patches...) ULJS00078 = true # MotoGP ULUS10153 = true # MotoGP UCES00373 = true # MotoGP + +[YugiohSaveFix] +# The cause of Yu-gi-oh series 's bad save (cannot save) are load "save status" and use cwcheat, +# but the real cause still unknown. #7914 + +# Yu-Gi-Oh! Duel Monsters GX: Tag Force +ULJM05151 = true +ULES00600 = true +ULUS10136 = true + +# Yu-Gi-Oh! Duel Monsters GX: Tag Force 2 +ULUS10302 = true +ULJM05260 = true +ULES00925 = true +ULES00926 = true + +# Yu-Gi-Oh! Duel Monsters GX: Tag Force 3 +ULES01183 = true +ULJM05373 = true + +# Yu-Gi-Oh! 5D's Tag Force 4 +ULUS10481 = true +ULJM05479 = true +ULES01362 = true + +# Yu-Gi-Oh! 5D's Tag Force 5 +ULUS10555 = true +ULJM05734 = true + +# Yu-Gi-Oh! 5D's Tag Force 6 +ULJM-05940 = true +NPJH-50794 = true + +# Yu-Gi-Oh! 5D's Tag Force +ULJM05940 = true + +# Yu-Gi-Oh! ARC-V Tag Force Special +NPJH00142 = true