Skip to content

Commit

Permalink
Merge pull request #14091 from sum2012/mpeg_god_eater
Browse files Browse the repository at this point in the history
Only allow sceMpegGetAvcAu warmup for God Eater Series
  • Loading branch information
hrydgard authored Feb 9, 2021
2 parents 3af26a2 + b127aac commit 8b05561
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct CompatFlags {
bool ShaderColorBitmask;
bool DisableFirstFrameReadback;
bool DisableRangeCulling;
bool MpegWarmUpForGodEaterSeries;
};

class IniFile;
Expand Down
12 changes: 7 additions & 5 deletions Core/HLE/sceMpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
25 changes: 25 additions & 0 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8b05561

Please sign in to comment.