From 5f0189ef278ebb7ef9fd4e08fff8728449bf6b6f Mon Sep 17 00:00:00 2001 From: "SND\\shalma_cp" Date: Fri, 4 Feb 2011 03:24:09 +0000 Subject: Experimental patches 1- cdrom.c Remove IRQ clear - read reschedule Fix xa streaming timing (ex. Final Fantasy Tactics) 2- cdrom.c BIOS music player - init attenuators 3- r3000a.c Set spu async to ~10 apu cycle updates Correct Square sound effects Disabled by default git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@62890 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/cdrom.c | 22 +++++++++++++++++++++- libpcsxcore/r3000a.c | 23 +++++++++++++++++++++++ libpcsxcore/r3000a.h | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) (limited to 'libpcsxcore') diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 0ab72a1a..e880a2f9 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -2200,10 +2200,22 @@ void cdrWrite3(unsigned char rt) { cdr.Irq = 0; return; } - + +#if 1 + if (cdr.Reading && !cdr.ResultReady) { + CDREAD_INT((cdr.Mode & MODE_SPEED) ? (cdReadTime / 2) : cdReadTime); + } +#else + // XA streaming - incorrect timing because of this reschedule + // - Final Fantasy Tactics + // - various other games + + /* if (cdr.Reading && !cdr.ResultReady) { CDREAD_INT((cdr.Mode & MODE_SPEED) ? (cdReadTime / 2) : cdReadTime); } + */ +#endif return; } @@ -2382,6 +2394,14 @@ void cdrReset() { cdr.CurTrack = 1; cdr.File = 1; cdr.Channel = 1; + +#if 0 + // BIOS player - default values + cdr.AttenuatorLeft[0] = 0x80; + cdr.AttenuatorLeft[1] = 0x00; + cdr.AttenuatorRight[0] = 0x80; + cdr.AttenuatorRight[1] = 0x00; +#endif } int cdrFreeze(gzFile f, int Mode) { diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 1422d52f..d5616cbe 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -123,6 +123,29 @@ void psxBranchTest() { } } +#if 0 + if( SPU_async ) + { + static int init; + int elapsed; + + if( init == 0 ) { + // 10 apu cycles + // - Final Fantasy Tactics (distorted - dropped sound effects) + psxRegs.intCycle[PSXINT_SPUASYNC].cycle = PSXCLK / 44100 * 10; + + init = 1; + } + + elapsed = psxRegs.cycle - psxRegs.intCycle[PSXINT_SPUASYNC].sCycle; + if (elapsed >= psxRegs.intCycle[PSXINT_SPUASYNC].cycle) { + SPU_async( elapsed ); + + psxRegs.intCycle[PSXINT_SPUASYNC].sCycle = psxRegs.cycle; + } + } +#endif + if ((psxRegs.cycle - psxNextsCounter) >= psxNextCounter) psxRcntUpdate(); diff --git a/libpcsxcore/r3000a.h b/libpcsxcore/r3000a.h index ae48a5c0..f2bdecd7 100644 --- a/libpcsxcore/r3000a.h +++ b/libpcsxcore/r3000a.h @@ -155,7 +155,7 @@ enum { PSXINT_MDECINDMA, PSXINT_GPUOTCDMA, PSXINT_CDRDMA, - DUMMY1, + PSXINT_SPUASYNC, PSXINT_CDRDBUF, PSXINT_CDRLID, PSXINT_CDRPLAY -- cgit v1.2.3