SPU2: Move ADMA clear to ADMA disable.

Fix bug with errantly setting data size if there isn't any.
This commit is contained in:
refractionpcsx2 2022-10-21 10:45:20 +01:00
parent 09a49cfaa0
commit bdac7672b7
3 changed files with 11 additions and 7 deletions

View File

@ -108,7 +108,7 @@ void V_Core::AutoDMAReadBuffer(int mode) //mode: 0= split stereo; 1 = do not spl
int size = std::min(InputDataLeft, (u32)0x200);
if (!leftbuffer)
size = 0x100;
size = std::min(size, 0x100);
LogAutoDMA(Index ? ADMA7LogFile : ADMA4LogFile);
//ConLog("Refilling ADMA buffer at %x OutPos %x with %x\n", spos, OutPos, size);
// HACKFIX!! DMAPtr can be invalid after a savestate load, so the savestate just forces it

View File

@ -116,12 +116,6 @@ StereoOut32 V_Core::ReadInput()
retval = StereoOut32(
(s32)(*GetMemPtr(0x2000 + (Index << 10) + ReadIndex)),
(s32)(*GetMemPtr(0x2200 + (Index << 10) + ReadIndex)));
// Not accurate behaviour but shouldn't hurt for now, need to run some tests
// to see why Prince of Persia Warrior Within buzzes when going in to the map
// since it starts an ADMA of music, then kills ADMA, so it loops on a few ms of data.
GetMemPtr(0x2000 + (Index << 10) + ReadIndex)[0] = 0;
GetMemPtr(0x2200 + (Index << 10) + ReadIndex)[0] = 0;
}
#ifdef PCSX2_DEVBUILD

View File

@ -1559,6 +1559,16 @@ static void RegWrite_Core(u16 value)
thiscore.InputDataLeft = 0;
thiscore.DMAICounter = 0;
thiscore.InputDataTransferred = 0;
// Not accurate behaviour but shouldn't hurt for now, need to run some tests
// to see why Prince of Persia Warrior Within buzzes when going in to the map
// since it starts an ADMA of music, then kills ADMA and input DMA
// without disabling ADMA read mode or clearing the buffer.
for (int i = 0; i < 0x200; i++)
{
GetMemPtr(0x2000 + (thiscore.Index << 10))[i] = 0;
GetMemPtr(0x2200 + (thiscore.Index << 10))[i] = 0;
}
}
break;