From 8ef1e71ce0b64a89e9260f529479a5b1fa796404 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 21 Mar 2020 00:15:49 +1000 Subject: [PATCH] DMA: Channels other than OTC should run based on request in SyncMode 0 --- src/core/dma.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/dma.cpp b/src/core/dma.cpp index 1ddd1bf80..756fa4861 100644 --- a/src/core/dma.cpp +++ b/src/core/dma.cpp @@ -147,6 +147,11 @@ void DMA::WriteRegister(u32 offset, u32 value) state.channel_control.bits = (state.channel_control.bits & ~ChannelState::ChannelControl::WRITE_MASK) | (value & ChannelState::ChannelControl::WRITE_MASK); Log_TracePrintf("DMA channel %u channel control <- 0x%08X", channel_index, state.channel_control.bits); + + // start/trigger bit must be enabled for OTC + if (static_cast(channel_index) == Channel::OTC) + SetRequest(static_cast(channel_index), state.channel_control.start_trigger); + UpdateChannelTransferEvent(static_cast(channel_index)); return; } @@ -228,13 +233,7 @@ bool DMA::CanTransferChannel(Channel channel) const if (!cs.channel_control.enable_busy) return false; - if (!cs.request && channel != Channel::OTC) - return false; - - if (cs.channel_control.sync_mode == SyncMode::Manual && !cs.channel_control.start_trigger) - return false; - - return true; + return cs.request; } bool DMA::CanRunAnyChannels() const