dma: more accurate ICR register handling
[pcsx_rearmed.git] / libpcsxcore / cdrom.c
index 87a7c19..1569839 100644 (file)
@@ -1905,9 +1905,10 @@ void cdrWrite3(unsigned char rt) {
                if (cdr.Reading && !cdr.ResultReady) {
                        int left = psxRegs.intCycle[PSXINT_CDREAD].sCycle + psxRegs.intCycle[PSXINT_CDREAD].cycle - psxRegs.cycle;
                        int time = (cdr.Mode & MODE_SPEED) ? (cdReadTime / 2) : cdReadTime;
-                       if (left < time / 2) { // rearmed guesswork hack
-                               //printf("-- resched %d -> %d\n", left, time / 2);
-                               CDREAD_INT(time / 2);
+                       if (Config.CdrReschedule != 2)
+                       if (left < time / 2 || Config.CdrReschedule) { // rearmed guesswork hack
+                               //printf("-- resched %d -> %d\n", left, time);
+                               CDREAD_INT(time);
                        }
                }
 
@@ -2017,8 +2018,11 @@ void psxDma3(u32 madr, u32 bcr, u32 chcr) {
 
 void cdrDmaInterrupt()
 {
-       HW_DMA3_CHCR &= SWAP32(~0x01000000);
-       DMA_INTERRUPT(3);
+       if (HW_DMA3_CHCR & SWAP32(0x01000000))
+       {
+               HW_DMA3_CHCR &= SWAP32(~0x01000000);
+               DMA_INTERRUPT(3);
+       }
 }
 
 void cdrReset() {