DMA: Determine slice size based on whether pad is transmitting

Plenty of games seem to suffer from this issue where they have
a linked list DMA going while polling the controller. Using a
too-large slice size will result in the serial timing being off,
and the game thinking the controller is disconnected. So we
don't hurt performance too much for the general case, we reduce
this to equal CPU and DMA time when the controller is
transferring, but otherwise leave it at the higher size.
This commit is contained in:
Connor McLaughlin
2021-01-06 00:00:56 +10:00
parent 98a4e59f52
commit 845cd37835
3 changed files with 39 additions and 8 deletions

View File

@ -50,7 +50,6 @@ public:
private:
static constexpr PhysicalMemoryAddress BASE_ADDRESS_MASK = UINT32_C(0x00FFFFFF);
static constexpr PhysicalMemoryAddress ADDRESS_MASK = UINT32_C(0x001FFFFC);
static constexpr u32 TRANSFER_TICKS = 10;
enum class SyncMode : u32
{
@ -68,6 +67,8 @@ private:
void UpdateIRQ();
// returns false if the DMA should now be halted
TickCount GetTransferSliceTicks() const;
TickCount GetTransferHaltTicks() const;
bool TransferChannel(Channel channel);
void HaltTransfer(TickCount duration);
void UnhaltTransfer(TickCount ticks);