From b127aace5714b7ee22e1778f0593ca8bf202ea82 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Tue, 9 Feb 2021 22:46:09 +0800 Subject: [PATCH] Only allow sceMpegGetAvcAu warmup for God Eater Series Fix #14086 --- Core/Compatibility.cpp | 1 + Core/Compatibility.h | 1 + Core/HLE/sceMpeg.cpp | 12 +++++++----- assets/compat.ini | 25 +++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index dbd8a804f5ab..ef5bdf94b3c9 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -79,6 +79,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "ShaderColorBitmask", &flags_.ShaderColorBitmask); CheckSetting(iniFile, gameID, "DisableFirstFrameReadback", &flags_.DisableFirstFrameReadback); CheckSetting(iniFile, gameID, "DisableRangeCulling", &flags_.DisableRangeCulling); + CheckSetting(iniFile, gameID, "MpegWarmUpForGodEaterSeries", &flags_.MpegWarmUpForGodEaterSeries); } 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 d5cee15879ba..28caefd16e9d 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -77,6 +77,7 @@ struct CompatFlags { bool ShaderColorBitmask; bool DisableFirstFrameReadback; bool DisableRangeCulling; + bool MpegWarmUpForGodEaterSeries; }; class IniFile; diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index 77888188a4d8..2def75bac042 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -35,6 +35,7 @@ #include "GPU/GPUInterface.h" #include "GPU/GPUState.h" #include "Core/HLE/sceKernelMemory.h" +#include "Core/Core.h" // MPEG AVC elementary stream. static const int MPEG_AVC_ES_SIZE = 2048; // MPEG packet size. @@ -1586,11 +1587,12 @@ static int sceMpegGetAvcAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) return -1; } - int sdkver = sceKernelGetCompiledSdkVersion(); - if ((sdkver >= 0x06000000) && (ctx->mpegwarmUp < MPEG_WARMUP_FRAMES)) { - DEBUG_LOG(ME, "sceMpegGetAvcAu(%08x, %08x, %08x, %08x): warming up", mpeg, streamId, auAddr, attrAddr); - ctx->mpegwarmUp++; - return ERROR_MPEG_NO_DATA; + if (PSP_CoreParameter().compat.flags().MpegWarmUpForGodEaterSeries) { + if (ctx->mpegwarmUp == 0) { + DEBUG_LOG(ME, "sceMpegGetAvcAu(%08x, %08x, %08x, %08x): warming up", mpeg, streamId, auAddr, attrAddr); + ctx->mpegwarmUp++; + return ERROR_MPEG_NO_DATA; + } } SceMpegAu avcAu; diff --git a/assets/compat.ini b/assets/compat.ini index 6d58826743a3..fdf86ff912fb 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -988,3 +988,28 @@ UCJS10007 = true UCES00001 = true UCKS45008 = true NPJG00059 = true + +[MpegWarmUpForGodEaterSeries] +# God Eater issue #13527 ,It is custom mpeg library that required sceMpegGetAvcAu return ERROR_MPEG_NO_DATA but break FIFA 14 issue #14086 +# God Eater 1 +ULJS00237 = true +ULKS46238 = true + +# God Eater 2 +ULJS00597 = true +NPJH50832 = true +ULJS19093 = true +NPJH50832 = true + +# God Eater Burst +ULJS00351 = true +NPJH50352 = true +ULJS00350 = true +ULKS46263 = true +ULUS10563 = true +ULES01519 = true +ULJS19056 = true +NPJH50352 = true +ULUS10563FV = true +ULJS19081 = true +NPJH50352 = true \ No newline at end of file