From cc32fa91af5431951f8f155d184d0d719b1961ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 17 Apr 2021 15:51:08 +0200 Subject: [PATCH] FifoPlayer: Copy data with memcpy instead of one byte at a time Copying with memcpy/std::copy is a lot faster than writing one byte at a time. And the behavior should be fully equivalent. --- Source/Core/Core/FifoPlayer/FifoPlayer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/FifoPlayer/FifoPlayer.cpp b/Source/Core/Core/FifoPlayer/FifoPlayer.cpp index 49a89749dd..880ef791a5 100644 --- a/Source/Core/Core/FifoPlayer/FifoPlayer.cpp +++ b/Source/Core/Core/FifoPlayer/FifoPlayer.cpp @@ -381,8 +381,9 @@ void FifoPlayer::WriteFifo(const u8* data, u32 start, u32 end) u32 burstEnd = std::min(written + 255, lastBurstEnd); - while (written < burstEnd) - GPFifo::FastWrite8(data[written++]); + std::copy(data + written, data + burstEnd, PowerPC::ppcState.gather_pipe_ptr); + PowerPC::ppcState.gather_pipe_ptr += burstEnd - written; + written = burstEnd; GPFifo::Write8(data[written++]);