New, separate GPU plugin based on Unai. (#233)
[pcsx_rearmed.git] / libpcsxcore / cdrom.c
index 24fd9c9..26f68ac 100644 (file)
@@ -534,9 +534,9 @@ void cdrPlayInterrupt()
        if (!cdr.Play) return;
        
        if (CDR_readCDDA && !cdr.Muted && cdr.Mode & MODE_REPORT) {
-               cdrAttenuate((u8 *)read_buf, CD_FRAMESIZE_RAW / 4, 1);
+               cdrAttenuate(read_buf, CD_FRAMESIZE_RAW / 4, 1);
                if (SPU_playCDDAchannel)
-                       SPU_playCDDAchannel((u8 *)read_buf, CD_FRAMESIZE_RAW);
+                       SPU_playCDDAchannel(read_buf, CD_FRAMESIZE_RAW);
        }
 
        cdr.SetSectorPlay[2]++;
@@ -1183,6 +1183,19 @@ void cdrReadInterrupt() {
                        int ret = xa_decode_sector(&cdr.Xa, cdr.Transfer+4, cdr.FirstSector);
                        if (!ret) {
                                cdrAttenuate(cdr.Xa.pcm, cdr.Xa.nsamples, cdr.Xa.stereo);
+                               /*
+                                * Gameblabla -
+                                * This is a hack for Megaman X4, Castlevania etc...
+                                * that regressed from the new m_locationChanged and CDROM timings changes.
+                                * It is mostly noticeable in Castevania however and the stuttering can be very jarring.
+                                * 
+                                * According to PCSX redux authors, we shouldn't cause a location change if
+                                * the sector difference is too small. 
+                                * I attempted to go with that approach but came empty handed.
+                                * So for now, let's just set cdr.m_locationChanged to false when playing back any ADPCM samples.
+                                * This does not regress Crash Team Racing's intro at least.
+                               */
+                               cdr.m_locationChanged = FALSE;
                                SPU_playADPCMchannel(&cdr.Xa);
                                cdr.FirstSector = 0;
                        }