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
This commit is contained in:
SND\ckain_cp 2014-05-23 09:56:57 +00:00
parent 73a1ca6333
commit a9356b36c8
1 changed files with 6 additions and 1 deletions

View File

@ -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);*/