Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow sceMpegGetAvcAu warmup for God Eater Series #14091

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just call this MpegWarmUp. We might find other uses.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add warm up in sceMpegGetAtracAu for fix another games , change MpegWarmUpForGodEaterSeries to MpegWarmUp would confuse name.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, for now. I hope eventually we can find a universal solution to these instead of relying on compat.ini hacks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm obviously not a fan of the idea of having an array of warm up flags for every HLE function. If we have to do this though, MpegAvcWarmUp would be a better name.

I think we need to figure out what the actual variables are that cause the delay, which btw is seen in most pspautotests of Mpeg even with firmware 1.50 set.

-[Unknown]

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unknownbrackets My goal for sceMpegGetAtracAu 's warmup don't need add games in compat.ini

}

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