Send direction parameter to DMAC receive function.

This commit is contained in:
Jean-Philip Desjardins 2015-11-16 19:44:17 -05:00
parent 310d45ffc7
commit 002ca4659c
2 changed files with 12 additions and 6 deletions

View File

@ -164,7 +164,7 @@ void CChannel::ExecuteNormal()
qwc = std::min<int32>(m_nQWC, (ringBufferSize - ringBufferAddr) / 0x10);
}
uint32 nRecv = m_receive(m_nMADR, qwc, 0, false);
uint32 nRecv = m_receive(m_nMADR, qwc, m_CHCR.nDIR, false);
m_nMADR += nRecv * 0x10;
m_nQWC -= nRecv;
@ -193,7 +193,7 @@ void CChannel::ExecuteInterleave()
//Transfer
{
uint32 qwc = m_dmac.m_D_SQWC.tqwc;
uint32 recv = m_receive(m_nMADR, qwc, 0, false);
uint32 recv = m_receive(m_nMADR, qwc, CHCR_DIR_FROM, false);
assert(recv == qwc);
m_nMADR += recv * 0x10;
@ -216,7 +216,7 @@ void CChannel::ExecuteSourceChain()
//Execute current
if(m_nQWC != 0)
{
uint32 nRecv = m_receive(m_nMADR, m_nQWC, 0, false);
uint32 nRecv = m_receive(m_nMADR, m_nQWC, CHCR_DIR_FROM, false);
m_nMADR += nRecv * 0x10;
m_nQWC -= nRecv;
@ -245,7 +245,7 @@ void CChannel::ExecuteSourceChain()
{
assert(m_CHCR.nTTE);
m_CHCR.nReserved0 = 0;
if(m_receive(m_nTADR, 1, 0, true) != 1)
if(m_receive(m_nTADR, 1, CHCR_DIR_FROM, true) != 1)
{
//Device didn't receive DmaTag, break for now
m_CHCR.nReserved0 = 1;
@ -288,7 +288,7 @@ void CChannel::ExecuteSourceChain()
if(m_CHCR.nTTE == 1)
{
m_CHCR.nReserved0 = 0;
if(m_receive(m_nTADR, 1, 0, true) != 1)
if(m_receive(m_nTADR, 1, CHCR_DIR_FROM, true) != 1)
{
//Device didn't receive DmaTag, break for now
m_CHCR.nReserved0 = 1;
@ -387,7 +387,7 @@ void CChannel::ExecuteSourceChain()
if(qwc != 0)
{
uint32 nRecv = m_receive(m_nMADR, qwc, 0, false);
uint32 nRecv = m_receive(m_nMADR, qwc, CHCR_DIR_FROM, false);
m_nMADR += nRecv * 0x10;
m_nQWC -= nRecv;

View File

@ -27,6 +27,12 @@ namespace Dmac
DMATAG_END
};
enum CHCR_DIR
{
CHCR_DIR_TO = 0,
CHCR_DIR_FROM = 1,
};
struct CHCR : public convertible<uint32>
{
unsigned int nDIR : 1;