diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index 29a8874039a4..775d180517b9 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -134,6 +134,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "Fontltn12Hack", &flags_.Fontltn12Hack); CheckSetting(iniFile, gameID, "LoadCLUTFromCurrentFrameOnly", &flags_.LoadCLUTFromCurrentFrameOnly); CheckSetting(iniFile, gameID, "ForceUMDReadSpeed", &flags_.ForceUMDReadSpeed); + CheckSetting(iniFile, gameID, "AtracDecodeDataRemainFrameHack", &flags_.AtracDecodeDataRemainFrameHack); } void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) { diff --git a/Core/Compatibility.h b/Core/Compatibility.h index a917d17e5e22..731fe5380d18 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -104,6 +104,7 @@ struct CompatFlags { bool Fontltn12Hack; bool LoadCLUTFromCurrentFrameOnly; bool ForceUMDReadSpeed; + bool AtracDecodeDataRemainFrameHack; }; struct VRCompat { diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 52fa4ebe618c..f40816f0b5df 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -1380,8 +1380,11 @@ static u32 sceAtracDecodeData(int atracID, u32 outAddr, u32 numSamplesAddr, u32 if (Memory::IsValidAddress(finishFlagAddr)) Memory::Write_U32(finish, finishFlagAddr); // On error, no remaining frame value is written. - if (ret == 0 && Memory::IsValidAddress(remainAddr)) + if (ret == 0 && Memory::IsValidAddress(remainAddr)){ + if (PSP_CoreParameter().compat.flags().AtracDecodeDataRemainFrameHack && remains > 0) + remains--; Memory::Write_U32(remains, remainAddr); + } } DEBUG_LOG(ME, "%08x=sceAtracDecodeData(%i, %08x, %08x[%08x], %08x[%08x], %08x[%d])", ret, atracID, outAddr, numSamplesAddr, numSamples, @@ -1531,7 +1534,6 @@ static u32 sceAtracGetLoopStatus(int atracID, u32 loopNumAddr, u32 statusAddr) { ERROR_LOG(ME, "sceAtracGetLoopStatus(%i, %08x, %08x): no data", atracID, loopNumAddr, statusAddr); return ATRAC_ERROR_NO_DATA; } else { - DEBUG_LOG(ME, "sceAtracGetLoopStatus(%i, %08x, %08x)", atracID, loopNumAddr, statusAddr); if (Memory::IsValidAddress(loopNumAddr)) Memory::Write_U32(atrac->loopNum_, loopNumAddr); // return audio's loopinfo in at3 file @@ -1542,7 +1544,7 @@ static u32 sceAtracGetLoopStatus(int atracID, u32 loopNumAddr, u32 statusAddr) { Memory::Write_U32(0, statusAddr); } } - return 0; + return hleLogDebug(ME, 0); } static u32 sceAtracGetInternalErrorInfo(int atracID, u32 errorAddr) { diff --git a/assets/compat.ini b/assets/compat.ini index 59909df931a1..9105d17a3770 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -1645,4 +1645,11 @@ SYPH04036 = true # Prototype? ULES00590 = true ULJM05075 = true #Sengoku Musou 3Z Special DLC see #9993 -ULJM06024 = true \ No newline at end of file +ULJM06024 = true + +[AtracDecodeDataRemainFrameHack] +#Return less than 1 RemainFrame in sceAtracDecodeData to get valid data,then psp will call sceAtracAddStreamData and sceAtracGetStreamDataInfo. + +# Kaitou Apricot see #15233 +ULJM05276 = true +NPJH50167 = true