mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Revert compatibility flag for GTA Music Hack.
This reverts commit eb4ca0cf81.
This commit is contained in:
1 parent
6c31612b1d
commit
2037977292
4 files changed
+12
-115
No files matched your search
@@ -42,5 +42,4 @@ void Compatibility::Clear() {
|
||||
void Compatibility::LoadIniSection(IniFile &iniFile, std::string section) {
|
||||
iniFile.Get(section.c_str(), "NoDepthRounding", &flags_.NoDepthRounding, flags_.NoDepthRounding);
|
||||
iniFile.Get(section.c_str(), "PixelDepthRounding", &flags_.PixelDepthRounding, flags_.PixelDepthRounding);
|
||||
iniFile.Get(section.c_str(), "GTAMusicFix", &flags_.GTAMusicFix, flags_.GTAMusicFix);
|
||||
}
|
||||
@@ -47,7 +47,6 @@
|
||||
struct CompatFlags {
|
||||
bool NoDepthRounding;
|
||||
bool PixelDepthRounding;
|
||||
bool GTAMusicFix;
|
||||
};
|
||||
|
||||
class IniFile;
|
||||
|
||||
+12
-64
@@ -17,16 +17,13 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "Core/CoreParameter.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HLE/FunctionWrappers.h"
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/Compatibility.h"
|
||||
#include "Core/MemMapHelpers.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/Debugger/Breakpoints.h"
|
||||
#include "Core/HW/MediaEngine.h"
|
||||
#include "Core/HW/BufferQueue.h"
|
||||
@@ -335,12 +332,6 @@ struct Atrac {
|
||||
}
|
||||
|
||||
void SeekToSample(int sample) {
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
s64 seek_pos = (s64)sample;
|
||||
av_seek_frame(pFormatCtx, audio_stream_index, seek_pos, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
const u32 atracSamplesPerFrame = (codecType == PSP_MODE_AT_3_PLUS ? ATRAC3PLUS_MAX_SAMPLES : ATRAC3_MAX_SAMPLES);
|
||||
|
||||
// Discard any pending packet data.
|
||||
@@ -403,19 +394,11 @@ struct Atrac {
|
||||
packet->size = 0;
|
||||
|
||||
if (FillPacket()) {
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
if (packet->size >= needed) {
|
||||
memcpy(tempPacket.data + initialSize, packet->data, needed);
|
||||
packet->size -= needed;
|
||||
packet->data += needed;
|
||||
}
|
||||
} else {
|
||||
int to_copy = packet->size >= needed ? needed : packet->size;
|
||||
memcpy(tempPacket.data + initialSize, packet->data, to_copy);
|
||||
packet->size -= to_copy;
|
||||
packet->data += to_copy;
|
||||
tempPacket.size = initialSize + to_copy;
|
||||
}
|
||||
int to_copy = packet->size >= needed ? needed : packet->size;
|
||||
memcpy(tempPacket.data + initialSize, packet->data, to_copy);
|
||||
packet->size -= to_copy;
|
||||
packet->data += to_copy;
|
||||
tempPacket.size = initialSize + to_copy;
|
||||
} else {
|
||||
tempPacket.size = initialSize;
|
||||
}
|
||||
@@ -893,28 +876,17 @@ u32 _AtracDecodeData(int atracID, u8 *outbuf, u32 outbufPtr, u32 *SamplesNum, u3
|
||||
// It seems like the PSP aligns the sample position to 0x800...?
|
||||
int offsetSamples = atrac->firstSampleoffset + firstOffsetExtra;
|
||||
int skipSamples = 0;
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
skipSamples = atrac->currentSample == 0 ? offsetSamples : 0;
|
||||
}
|
||||
u32 maxSamples = atrac->endSample - atrac->currentSample;
|
||||
u32 unalignedSamples = (offsetSamples + atrac->currentSample) % atracSamplesPerFrame;
|
||||
if (unalignedSamples != 0) {
|
||||
// We're off alignment, possibly due to a loop. Force it back on.
|
||||
maxSamples = atracSamplesPerFrame - unalignedSamples;
|
||||
if (!PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
skipSamples = unalignedSamples;
|
||||
}
|
||||
skipSamples = unalignedSamples;
|
||||
}
|
||||
|
||||
#ifdef USE_FFMPEG
|
||||
if (!atrac->failedDecode && (atrac->codecType == PSP_MODE_AT_3 || atrac->codecType == PSP_MODE_AT_3_PLUS) && atrac->pCodecCtx) {
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
int forceseekSample = atrac->currentSample * 2 > atrac->endSample ? 0 : atrac->endSample;
|
||||
atrac->SeekToSample(forceseekSample);
|
||||
atrac->SeekToSample(atrac->currentSample == 0 ? 0 : atrac->currentSample + offsetSamples);
|
||||
} else {
|
||||
atrac->SeekToSample(atrac->currentSample);
|
||||
}
|
||||
atrac->SeekToSample(atrac->currentSample);
|
||||
|
||||
AtracDecodeResult res = ATDECODE_FEEDME;
|
||||
while (atrac->FillPacket()) {
|
||||
@@ -990,11 +962,7 @@ u32 _AtracDecodeData(int atracID, u8 *outbuf, u32 outbufPtr, u32 *SamplesNum, u3
|
||||
int finishFlag = 0;
|
||||
if (atrac->loopNum != 0 && (atrac->currentSample > atrac->loopEndSample ||
|
||||
(numSamples == 0 && atrac->first.size >= atrac->first.filesize))) {
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
atrac->currentSample = 0;
|
||||
} else {
|
||||
atrac->SeekToSample(atrac->loopStartSample);
|
||||
}
|
||||
atrac->SeekToSample(atrac->loopStartSample);
|
||||
if (atrac->loopNum > 0)
|
||||
atrac->loopNum --;
|
||||
} else if (atrac->currentSample >= atrac->endSample ||
|
||||
@@ -1344,9 +1312,7 @@ static u32 sceAtracGetStreamDataInfo(int atracID, u32 writeAddr, u32 writableByt
|
||||
// Reset temp buf for adding more stream data and set full filled buffer.
|
||||
atrac->first.writableBytes = std::min(atrac->first.filesize - atrac->first.size, atrac->atracBufSize);
|
||||
} else {
|
||||
if (!PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
atrac->first.writableBytes = std::min(atrac->first.filesize - atrac->first.size, atrac->first.writableBytes);
|
||||
}
|
||||
atrac->first.writableBytes = std::min(atrac->first.filesize - atrac->first.size, atrac->first.writableBytes);
|
||||
}
|
||||
|
||||
atrac->first.offset = 0;
|
||||
@@ -1388,18 +1354,13 @@ static u32 sceAtracResetPlayPosition(int atracID, int sample, int bytesWrittenFi
|
||||
INFO_LOG(ME, "sceAtracResetPlayPosition(%i, %i, %i, %i)", atracID, sample, bytesWrittenFirstBuf, bytesWrittenSecondBuf);
|
||||
if (bytesWrittenFirstBuf > 0)
|
||||
sceAtracAddStreamData(atracID, bytesWrittenFirstBuf);
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
atrac->currentSample = sample;
|
||||
}
|
||||
#ifdef USE_FFMPEG
|
||||
if ((atrac->codecType == PSP_MODE_AT_3 || atrac->codecType == PSP_MODE_AT_3_PLUS) && atrac->pCodecCtx) {
|
||||
atrac->SeekToSample(sample);
|
||||
} else
|
||||
#endif // USE_FFMPEG
|
||||
{
|
||||
if (!PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
atrac->currentSample = sample;
|
||||
}
|
||||
atrac->currentSample = sample;
|
||||
atrac->decodePos = atrac->getDecodePosBySample(sample);
|
||||
}
|
||||
}
|
||||
@@ -2187,13 +2148,7 @@ static int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesCo
|
||||
}
|
||||
|
||||
int numSamples = 0;
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
int forceseekSample = 0x200000;
|
||||
atrac->SeekToSample(forceseekSample);
|
||||
atrac->SeekToSample(atrac->currentSample);
|
||||
} else {
|
||||
atrac->ForceSeekToSample(atrac->currentSample);
|
||||
}
|
||||
atrac->ForceSeekToSample(atrac->currentSample);
|
||||
|
||||
if (!atrac->failedDecode) {
|
||||
AtracDecodeResult res;
|
||||
@@ -2222,18 +2177,11 @@ static int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesCo
|
||||
atrac->currentSample += numSamples;
|
||||
numSamples = (atrac->codecType == PSP_MODE_AT_3_PLUS ? ATRAC3PLUS_MAX_SAMPLES : ATRAC3_MAX_SAMPLES);
|
||||
Memory::Write_U32(numSamples * sizeof(s16) * atrac->atracOutputChannels, sampleBytesAddr);
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
atrac->SeekToSample(atrac->currentSample);
|
||||
}
|
||||
|
||||
if (atrac->bufferPos >= atrac->first.size) {
|
||||
atrac->first.writableBytes = atrac->atracBytesPerFrame;
|
||||
atrac->first.size = atrac->firstSampleoffset;
|
||||
if (PSP_CoreParameter().compat.flags().GTAMusicFix) {
|
||||
atrac->currentSample = 0;
|
||||
} else {
|
||||
atrac->ForceSeekToSample(0);
|
||||
}
|
||||
atrac->ForceSeekToSample(0);
|
||||
}
|
||||
else
|
||||
atrac->first.writableBytes = 0;
|
||||
|
||||
@@ -73,52 +73,3 @@ PixelDepthRounding = true
|
||||
PixelDepthRounding = true
|
||||
[ULJS00454]
|
||||
PixelDepthRounding = true
|
||||
|
||||
|
||||
# GTA audio issues
|
||||
# These games stream their radio stations from disc as giant audio files. They seek into
|
||||
# the correct position. Our ATRAC3 module (sceAtrac) implementation is still not very accurate
|
||||
# and needs some special handling for this to work correctly, for unknown reasons.
|
||||
|
||||
# GTAMusicFix removes the effect of pull #6976, which fixed many games but broke GTA.
|
||||
# Issue #7863 has some more information.
|
||||
|
||||
# GTA Liberty City Stories
|
||||
[ULUS10041]
|
||||
GTAMusicFix = true
|
||||
[ULES00151]
|
||||
GTAMusicFix = true
|
||||
[ULJM05255]
|
||||
GTAMusicFix = true
|
||||
[ULJM05359]
|
||||
GTAMusicFix = true
|
||||
[ULJM05885]
|
||||
GTAMusicFix = true
|
||||
[NPJH50825]
|
||||
GTAMusicFix = true
|
||||
|
||||
# GTA Vice City Stories
|
||||
[ULES00502]
|
||||
GTAMusicFix = true
|
||||
[ULUS10160]
|
||||
GTAMusicFix = true
|
||||
[ULJM05297]
|
||||
GTAMusicFix = true
|
||||
[ULJM05395]
|
||||
GTAMusicFix = true
|
||||
[ULJM05884]
|
||||
GTAMusicFix = true
|
||||
[NPJH50827]
|
||||
GTAMusicFix = true
|
||||
|
||||
# GTA Chinatown Wars
|
||||
[ULUS10490]
|
||||
GTAMusicFix = true
|
||||
[ULES01347]
|
||||
GTAMusicFix = true
|
||||
[ULJM05604]
|
||||
GTAMusicFix = true
|
||||
[ULJM05804]
|
||||
GTAMusicFix = true
|
||||
[NPJH00138]
|
||||
GTAMusicFix = true
|
||||
Reference in new issue
Block a user