Better "Slow DVD" hack. Now fixes ToA and Digital Devil Saga (one video only though :p)

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@129 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
ramapcsx2 2008-09-17 10:45:38 +00:00 committed by Gregory Hainaut
parent 27c5c735ad
commit 6c8ed786d6
1 changed files with 7 additions and 33 deletions

View File

@ -673,42 +673,16 @@ void cdvdReset()
} }
#define PSX_CD_READSPEED (PSXCLK / 153600) // 1 Byte Time @ x1 (150KB = cd x 1) #define PSX_CD_READSPEED (PSXCLK / 153600) // 1 Byte Time @ x1 (150KB = cd x 1)
#define PSX_DVD_READSPEED (PSXCLK / 1382400) // 1 Byte Time @ x1 (1350KB = dvd x 1) #define PSX_DVD_READSPEED (CHECK_SLOWDVD ? (PSXCLK / 270000) : (PSXCLK /1382400)) // normal is 1 Byte Time @ x1 (1350KB = dvd x 1)
void cdvdReadTimeRcnt(int mode) // Mode 0 is DVD, Mode 1 is CD void cdvdReadTimeRcnt(int mode) // Mode 0 is DVD, Mode 1 is CD
{ {
if (CHECK_SLOWDVD) if (cdvd.Sector == 16) //DVD TOC
{ cdvdReadTime = 30000; //simulates spin-up time, fixes hdloader
int readspeed; // 1 Sector size else
static int last_sector = 0; cdvdReadTime = ( (mode ? PSX_CD_READSPEED : PSX_DVD_READSPEED) * cdvd.BlockSize ) / cdvd.Speed;
int sector_difference = abs(cdvd.Sector - last_sector);
//SysPrintf("cdvdReadTime = %d \n", cdvdReadTime);
readspeed = ( (mode ? PSX_CD_READSPEED : PSX_DVD_READSPEED) * cdvd.BlockSize ) / cdvd.Speed;
//add cycles due to access times, based on try and error
//fixes most of Tales of the Abyss crashes and some Digital Devil Saga videos
//slightly longer loading times now
if (sector_difference > 128 && sector_difference < 1000000) {
readspeed += (sector_difference * 2) / 32;
}
else if (sector_difference >= 1000000) {
readspeed += (sector_difference * 2) / 4;
}
//simulates spin-up time, fixes hdloader
if (cdvd.Sector == 16 /* DVD TOC */) readspeed = 30000;
cdvdReadTime = readspeed;
//SysPrintf("secdiff = %d cdvdReadTime = %d\n", sector_difference, cdvdReadTime);
last_sector = cdvd.Sector;
}
else
{
if (cdvd.Sector == 16) //DVD TOC
cdvdReadTime = 30000; //simulates spin-up time, fixes hdloader
else
cdvdReadTime = ( (mode ? PSX_CD_READSPEED : PSX_DVD_READSPEED) * cdvd.BlockSize ) / cdvd.Speed;
}
//SysPrintf("cdvd type = %x \n", cdvd.Type);
} }
//void cdvdReadTimeRcnt(int mode){ // Mode 0 is DVD, Mode 1 is CD //void cdvdReadTimeRcnt(int mode){ // Mode 0 is DVD, Mode 1 is CD