Don't start VIF1 DMA transfers immediately.

This commit is contained in:
Jean-Philip Desjardins 2020-04-18 15:31:53 -04:00
parent 7b2a6ccc44
commit d94a3d2c87
2 changed files with 12 additions and 0 deletions

View file

@ -97,6 +97,10 @@ void CChannel::WriteCHCR(uint32 nValue)
{
m_nSCCTRL |= SCCTRL_INITXFER;
}
if(m_number == CDMAC::CHANNEL_ID_VIF1)
{
m_nSCCTRL |= SCCTRL_PAUSE;
}
m_nSCCTRL &= ~SCCTRL_RETTOP;
Execute();
}
@ -106,6 +110,13 @@ void CChannel::Execute()
{
if(m_CHCR.nSTR != 0)
{
//Don't start the DMA transfer now, wait till the next iteration
//Needed for Wild Arms 4
if(m_nSCCTRL & SCCTRL_PAUSE)
{
m_nSCCTRL &= ~SCCTRL_PAUSE;
return;
}
if(m_dmac.m_D_ENABLE & CDMAC::ENABLE_CPND)
{
//TODO: Need to check cases where this is done on channels other than 4

View file

@ -91,6 +91,7 @@ namespace Dmac
{
SCCTRL_RETTOP = 0x001,
SCCTRL_INITXFER = 0x200,
SCCTRL_PAUSE = 0x400,
};
void ExecuteSourceChainTransfer(bool);