Fix for Endgame which tries to do 0 sector CDVD reads.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4802 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2011-07-09 23:47:12 +00:00
parent 93163f988d
commit cad9249b79
1 changed files with 14 additions and 11 deletions

View File

@ -834,21 +834,24 @@ __fi void cdvdReadInterrupt()
pxAssume( cdvd.RErr == 0 ); pxAssume( cdvd.RErr == 0 );
} }
if (cdvdReadSector() == -1) if (cdvd.nSectors > 0)
{ {
// This means that the BCR/DMA hasn't finished yet, and rather than fire off the if (cdvdReadSector() == -1)
// sector-finished notice too early (which might overwrite game data) we delay a {
// bit and try to read the sector again later. // This means that the BCR/DMA hasn't finished yet, and rather than fire off the
// An arbitrary delay of some number of cycles probably makes more sense here, // sector-finished notice too early (which might overwrite game data) we delay a
// but for now it's based on the cdvd.ReadTime value. -- air // bit and try to read the sector again later.
// An arbitrary delay of some number of cycles probably makes more sense here,
// but for now it's based on the cdvd.ReadTime value. -- air
pxAssume((int)cdvd.ReadTime > 0 ); pxAssume((int)cdvd.ReadTime > 0 );
CDVDREAD_INT(cdvd.ReadTime/4); CDVDREAD_INT(cdvd.ReadTime/4);
return; return;
}
cdvd.Sector++;
} }
cdvd.Sector++;
if (--cdvd.nSectors <= 0) if (--cdvd.nSectors <= 0)
{ {
cdvd.PwOff |= 1<<Irq_CommandComplete; cdvd.PwOff |= 1<<Irq_CommandComplete;