CDVD: Time reads by sectors per second instead of bytes

This commit is contained in:
refractionpcsx2 2021-10-03 20:50:30 +01:00
parent 8cad96499d
commit 6bed14cb26
2 changed files with 7 additions and 2 deletions

View File

@ -689,11 +689,13 @@ static uint cdvdBlockReadTime(CDVD_MODE_TYPE mode)
const float sectorSpeed = (((float)(cdvd.SeekToSector - offset) / numSectors) * 0.60f) + 0.40f;
return ((PSXCLK * cdvd.BlockSize) / ((float)(((mode == MODE_CDROM) ? PSX_CD_READSPEED : PSX_DVD_READSPEED) * cdvd.Speed) * sectorSpeed));
return (PSXCLK / ((((mode == MODE_CDROM) ? CD_SECTORS_PERSECOND : DVD_SECTORS_PERSECOND) * cdvd.Speed) * sectorSpeed));
//return ((PSXCLK * cdvd.BlockSize) / ((float)(((mode == MODE_CDROM) ? PSX_CD_READSPEED : PSX_DVD_READSPEED) * cdvd.Speed) * sectorSpeed));
}
// CLV Read Speed is constant
return ((PSXCLK * cdvd.BlockSize) / (float)(((mode == MODE_CDROM) ? PSX_CD_READSPEED : PSX_DVD_READSPEED) * cdvd.Speed));
//return ((PSXCLK * cdvd.BlockSize) / (float)(((mode == MODE_CDROM) ? PSX_CD_READSPEED : PSX_DVD_READSPEED) * cdvd.Speed));
return (PSXCLK / (((mode == MODE_CDROM) ? CD_SECTORS_PERSECOND : DVD_SECTORS_PERSECOND) * cdvd.Speed));
}
void cdvdReset()

View File

@ -132,6 +132,9 @@ static const uint tbl_ContigiousSeekDelta[3] =
static const uint PSX_CD_READSPEED = 153600; // Bytes per second, rough values from outer CD (CAV).
static const uint PSX_DVD_READSPEED = 1382400; // Bytes per second, rough values from outer DVD (CAV).
static const uint CD_SECTORS_PERSECOND = 75;
static const uint DVD_SECTORS_PERSECOND = 675;
// Legacy Note: FullSeek timing causes many games to load very slow, but it likely not the real problem.
// Games breaking with it set to PSXCLK*40 : "wrath unleashed" and "Shijou Saikyou no Deshi Kenichi".