summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-05-23 09:56:57 +0000
committerSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-05-23 09:56:57 +0000
commita9356b36c83aa562e366a8e7d8957df3228e5268 (patch)
treec89cf463bcd3c5038b1830e4562c0ada92bfd099 /libpcsxcore
parent73a1ca6333f4ddfff7dd959a7a42e43d0ff24bdb (diff)
downloadpcsxr-a9356b36c83aa562e366a8e7d8957df3228e5268.tar.gz
ecm lut fix: resident evil cut scenes now work.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@90499 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rwxr-xr-xlibpcsxcore/cdriso.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c
index 95a787b4..0acd2824 100755
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -1287,7 +1287,9 @@ static int cdread_ecm_decode(FILE *f, unsigned int base, void *dest, int sector)
if (sector <= len_ecm_savetable) {
// get sector from LUT which points to wanted sector or close to
- for (sectorcount = sector; ((sectorcount > 0) && ((sector-sectorcount) <= 2*75)); sectorcount--) {
+ // TODO: What would be optimal maximum to search near sector?
+ // Might cause slowdown if too small but too big also..
+ for (sectorcount = sector; ((sectorcount > 0) && ((sector-sectorcount) <= 50000)); sectorcount--) {
if (ecm_savetable[sectorcount].filepos >= ECM_HEADER_SIZE) {
pos = &(ecm_savetable[sectorcount]);
//printf("LUTSector %i %i %i %i\n", sector, pos->sector, prevsector, base);
@@ -1333,6 +1335,9 @@ static int cdread_ecm_decode(FILE *f, unsigned int base, void *dest, int sector)
if (!processsectors && sectorcount >= (sector-1)) { // ensure that we read the sector we are supposed to
processsectors = TRUE;
//printf("Saving at %i\n", sectorcount);
+ } else if (processsectors && sectorcount > sector) {
+ //printf("Terminating at %i\n", sectorcount);
+ break;
}
/*printf("Type %i Num %i SeekSector %i ProcessedSectors %i(%i) Bytecount %i Pos %li Write %u\n",
type, num, sector, sectorcount, pos->sector, writebytecount, ftell(f), processsectors);*/