From afacc47f33341bfdbe9972078c339262745c6cfa Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Mon, 22 Nov 2021 16:25:03 +0000 Subject: [PATCH] CDVD: Adjust DMA timing based on PS1 timings. Bus width is 16bit on the PS2 and 8bit on PS1, so serves to reason the DMA would be twice the speed. (PS1 is 24 cycle per word) --- pcsx2/CDVD/CDVD.cpp | 16 ++++++++-------- pcsx2/CDVD/CdRom.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index 95bcf677c3..d1e3c38237 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -1243,7 +1243,7 @@ __fi void cdvdReadInterrupt() cdvd.Status = CDVD_STATUS_PAUSE; cdvd.nCommand = 0; - //DevCon.Warning("Scheduling interrupt in %d cycles", cdvd.ReadTime - (cdvd.BlockSize / 4)); + //DevCon.Warning("Scheduling interrupt in %d cycles", cdvd.ReadTime - ((cdvd.BlockSize / 4) * 12)); // Timing issues on command end // Star Ocean (1.1 Japan) expects the DMA to end and interrupt at least 128 or more cycles before the CDVD command ends. // However the time required seems to increase slowly, so delaying the end of the command is not the solution. @@ -1254,7 +1254,7 @@ __fi void cdvdReadInterrupt() } else { - CDVDREAD_INT((cdvd.BlockSize / 4)); + CDVDREAD_INT((cdvd.BlockSize / 4) * 12); return; } @@ -1262,9 +1262,9 @@ __fi void cdvdReadInterrupt() cdvd.Reading = 1; cdvd.RErr = DoCDVDreadTrack(cdvd.Sector, cdvd.ReadMode); if (cdvd.nextSectorsBuffered) - CDVDREAD_INT((cdvd.BlockSize / 4)); + CDVDREAD_INT((cdvd.BlockSize / 4) * 12); else - CDVDREAD_INT(cdvd.ReadTime + (cdvd.BlockSize / 4)); + CDVDREAD_INT(cdvd.ReadTime + ((cdvd.BlockSize / 4) * 12)); } // Returns the number of IOP cycles until the event completes. @@ -1338,16 +1338,16 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode) if (psxRegs.interrupt & (1 << IopEvt_CdvdSectorReady)) { //DevCon.Warning("coming back from ready sector early reducing %d cycles by %d cycles", seektime, psxRegs.cycle - psxRegs.sCycle[IopEvt_CdvdSectorReady]); - seektime = (psxRegs.cycle - psxRegs.sCycle[IopEvt_CdvdSectorReady]) + (cdvd.BlockSize / 4); + seektime = (psxRegs.cycle - psxRegs.sCycle[IopEvt_CdvdSectorReady]) + ((cdvd.BlockSize / 4) * 12); } else { CDVDSECTORREADY_INT(cdvd.ReadTime); - seektime = cdvd.ReadTime + (cdvd.BlockSize / 4); + seektime = cdvd.ReadTime + ((cdvd.BlockSize / 4) * 12); } } else - seektime = (cdvd.BlockSize / 4); + seektime = (cdvd.BlockSize / 4) * 12; } else { @@ -1363,7 +1363,7 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode) //DevCon.Warning("%s rotational latency at sector %d is %d cycles", (cdvd.SpindlCtrl & CDVD_SPINDLE_CAV) ? "CAV" : "CLV", cdvd.SeekToSector, rotationalLatency); seektime += rotationalLatency + cdvd.ReadTime; CDVDSECTORREADY_INT(seektime); - seektime += (cdvd.BlockSize / 4); + seektime += (cdvd.BlockSize / 4) * 12; } return seektime; } diff --git a/pcsx2/CDVD/CdRom.cpp b/pcsx2/CDVD/CdRom.cpp index 816cbf63c3..4f9b8f5942 100644 --- a/pcsx2/CDVD/CdRom.cpp +++ b/pcsx2/CDVD/CdRom.cpp @@ -1076,7 +1076,7 @@ void psxDma3(u32 madr, u32 bcr, u32 chcr) case 0x41000200: if (cdvd.WaitingDMA) { - PSX_INT(IopEvt_CdvdRead, cdvd.BlockSize / 4); //Data should be already buffered so simulate DMA time + PSX_INT(IopEvt_CdvdRead, (cdvd.BlockSize / 4) * 12); //Data should be already buffered so simulate DMA time } //SysPrintf("unhandled cdrom dma3: madr: %x, bcr: %x, chcr %x\n", madr, bcr, chcr); return;