mirror of https://github.com/PCSX2/pcsx2.git
CDVD: No rotational delay for seeks less than buffered sectors
Fixes Shadow Hearts Covenant hangs
This commit is contained in:
parent
6beac26727
commit
122968e63a
|
@ -1244,7 +1244,7 @@ __fi void cdvdReadInterrupt()
|
|||
if (cdvd.nextSectorsBuffered)
|
||||
CDVDREAD_INT((cdvd.BlockSize / 4) * 12);
|
||||
else
|
||||
CDVDREAD_INT(cdvd.ReadTime + ((cdvd.BlockSize / 4) * 12));
|
||||
CDVDREAD_INT((psxRegs.cycle - psxRegs.sCycle[IopEvt_CdvdSectorReady]) + ((cdvd.BlockSize / 4) * 12));
|
||||
}
|
||||
|
||||
// Returns the number of IOP cycles until the event completes.
|
||||
|
@ -1254,6 +1254,7 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode)
|
|||
|
||||
uint delta = abs((s32)(cdvd.SeekToSector - cdvd.Sector));
|
||||
uint seektime;
|
||||
bool isSeeking = cdvd.nCommand == N_CD_SEEK;
|
||||
|
||||
cdvd.Ready &= ~(CDVD_DRIVE_READY | CDVD_DRIVE_DATARDY);
|
||||
cdvd.Reading = 1;
|
||||
|
@ -1291,6 +1292,7 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode)
|
|||
CDVD_LOG("CdSeek Begin > to sector %d, from %d - delta=%d [FAST]", cdvd.SeekToSector, cdvd.Sector, delta);
|
||||
seektime = Cdvd_FastSeek_Cycles;
|
||||
}
|
||||
isSeeking = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1331,13 +1333,20 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode)
|
|||
}
|
||||
else
|
||||
{
|
||||
psxRegs.interrupt &= ~(1 << IopEvt_CdvdSectorReady);
|
||||
cdvd.nextSectorsBuffered = 0;
|
||||
if (delta < cdvd.nextSectorsBuffered)
|
||||
{
|
||||
isSeeking = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
psxRegs.interrupt &= ~(1 << IopEvt_CdvdSectorReady);
|
||||
cdvd.nextSectorsBuffered = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only do this on reads, the seek kind of accounts for this and then it reads the sectors after
|
||||
if (delta && cdvd.nCommand != N_CD_SEEK)
|
||||
if (delta && !isSeeking)
|
||||
{
|
||||
int rotationalLatency = cdvdRotationalLatency((CDVD_MODE_TYPE)cdvdIsDVD());
|
||||
//DevCon.Warning("%s rotational latency at sector %d is %d cycles", (cdvd.SpindlCtrl & CDVD_SPINDLE_CAV) ? "CAV" : "CLV", cdvd.SeekToSector, rotationalLatency);
|
||||
|
@ -1345,6 +1354,8 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode)
|
|||
CDVDSECTORREADY_INT(seektime);
|
||||
seektime += (cdvd.BlockSize / 4) * 12;
|
||||
}
|
||||
else if(cdvd.nCommand != N_CD_SEEK)
|
||||
CDVDSECTORREADY_INT(seektime + ((cdvd.BlockSize / 4) * 12));
|
||||
return seektime;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue