Remove the AutoDMA buffer hack, using its own allocated space as it's supposed to.

If there's any regression we should look at what CAUSES it, instead of hacking it back.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3214 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2010-06-16 20:15:33 +00:00
parent a74c3bbcd2
commit c6ad0e52b5
3 changed files with 33 additions and 26 deletions

View File

@ -96,7 +96,8 @@ void V_Core::AutoDMAReadBuffer(int mode) //mode: 0= split stereo; 1 = do not spl
if(mode)
{
if( DMAPtr != NULL )
memcpy((ADMATempBuffer+(spos<<1)),DMAPtr+InputDataProgress,0x400);
//memcpy((ADMATempBuffer+(spos<<1)),DMAPtr+InputDataProgress,0x400);
memcpy(GetMemPtr(0x2000+(Index<<10)+spos),DMAPtr+InputDataProgress,0x400);
MADR+=0x400;
InputDataLeft-=0x200;
InputDataProgress+=0x200;
@ -104,15 +105,15 @@ void V_Core::AutoDMAReadBuffer(int mode) //mode: 0= split stereo; 1 = do not spl
else
{
if( DMAPtr != NULL )
memcpy((ADMATempBuffer+spos),DMAPtr+InputDataProgress,0x200);
//memcpy((spu2mem+0x2000+(core<<10)+spos),DMAPtr+InputDataProgress,0x200);
//memcpy((ADMATempBuffer+spos),DMAPtr+InputDataProgress,0x200);
memcpy(GetMemPtr(0x2000+(Index<<10)+spos),DMAPtr+InputDataProgress,0x200);
MADR+=0x200;
InputDataLeft-=0x100;
InputDataProgress+=0x100;
if( DMAPtr != NULL )
memcpy((ADMATempBuffer+spos+0x200),DMAPtr+InputDataProgress,0x200);
//memcpy((spu2mem+0x2200+(core<<10)+spos),DMAPtr+InputDataProgress,0x200);
//memcpy((ADMATempBuffer+spos+0x200),DMAPtr+InputDataProgress,0x200);
memcpy(GetMemPtr(0x2200+(Index<<10)+spos),DMAPtr+InputDataProgress,0x200);
MADR+=0x200;
InputDataLeft-=0x100;
InputDataProgress+=0x100;
@ -554,7 +555,8 @@ s32 V_Core::NewDmaWrite(u32* data, u32 bytesLeft, u32* bytesProcessed)
if(false)//(mode)
{
memcpy((ADMATempBuffer+(InputPosWrite<<1)),mptr,0x400);
//memcpy((ADMATempBuffer+(InputPosWrite<<1)),mptr,0x400);
memcpy(GetMemPtr(0x2000+(Index<<10)+InputPosWrite),mptr,0x400);
mptr+=0x200;
// Flag interrupt? If IRQA occurs between start and dest, flag it.
@ -574,8 +576,8 @@ s32 V_Core::NewDmaWrite(u32* data, u32 bytesLeft, u32* bytesProcessed)
}
else
{
memcpy((ADMATempBuffer+InputPosWrite),mptr,0x200);
//memcpy((spu2mem+0x2000+(Index<<10)+InputPosWrite),mptr,0x200);
//memcpy((ADMATempBuffer+InputPosWrite),mptr,0x200);
memcpy(GetMemPtr(0x2000+(Index<<10)+InputPosWrite),mptr,0x200);
mptr+=0x100;
// Flag interrupt? If IRQA occurs between start and dest, flag it.
@ -593,8 +595,8 @@ s32 V_Core::NewDmaWrite(u32* data, u32 bytesLeft, u32* bytesProcessed)
}
}
memcpy((ADMATempBuffer+InputPosWrite+0x200),mptr,0x200);
//memcpy((spu2mem+0x2200+(Index<<10)+InputPosWrite),mptr,0x200);
//memcpy((ADMATempBuffer+InputPosWrite+0x200),mptr,0x200);
memcpy(GetMemPtr(0x2000+(Index<<10)+InputPosWrite),mptr,0x200);
mptr+=0x100;
// Flag interrupt? If IRQA occurs between start and dest, flag it.

View File

@ -32,18 +32,23 @@
StereoOut32 V_Core::ReadInput_HiFi()
{
InputPosRead &= ~1;
//
//#ifdef PCM24_S1_INTERLEAVE
// StereoOut32 retval(
// *((s32*)(ADMATempBuffer+(InputPosRead<<1))),
// *((s32*)(ADMATempBuffer+(InputPosRead<<1)+2))
// );
//#else
// StereoOut32 retval(
// (s32&)(ADMATempBuffer[InputPosRead]),
// (s32&)(ADMATempBuffer[InputPosRead+0x200])
// );
//#endif
#ifdef PCM24_S1_INTERLEAVE
StereoOut32 retval(
*((s32*)(ADMATempBuffer+(InputPosRead<<1))),
*((s32*)(ADMATempBuffer+(InputPosRead<<1)+2))
(s32&)(*GetMemPtr(0x2000 + (Index<<10) + InputPosRead)),
(s32&)(*GetMemPtr(0x2200 + (Index<<10) + InputPosRead))
);
#else
StereoOut32 retval(
(s32&)(ADMATempBuffer[InputPosRead]),
(s32&)(ADMATempBuffer[InputPosRead+0x200])
);
#endif
if( Index == 1 )
{
@ -111,13 +116,13 @@ StereoOut32 V_Core::ReadInput()
if( (Index!=1) || ((PlayMode&2)==0) )
{
// Using the temporary buffer because this area gets overwritten by some other code.
//*PData.Left = (s32)*(s16*)(spu2mem+0x2000+(core<<10)+InputPos);
//*PData.Right = (s32)*(s16*)(spu2mem+0x2200+(core<<10)+InputPos);
//retval = StereoOut32(
// (s32)ADMATempBuffer[InputPosRead],
// (s32)ADMATempBuffer[InputPosRead+0x200]
//);
retval = StereoOut32(
(s32)ADMATempBuffer[InputPosRead],
(s32)ADMATempBuffer[InputPosRead+0x200]
(s32)(*GetMemPtr(0x2000 + (Index<<10) + InputPosRead)),
(s32)(*GetMemPtr(0x2200 + (Index<<10) + InputPosRead))
);
}

View File

@ -435,7 +435,7 @@ struct V_Core
// HACK -- This is a temp buffer which is (or isn't?) used to circumvent some memory
// corruption that originates elsewhere in the plugin. >_< The actual ADMA buffer
// is an area mapped to SPU2 main memory.
s16 ADMATempBuffer[0x1000];
//s16 ADMATempBuffer[0x1000];
// ----------------------------------------------------------------------------------
// V_Core Methods