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.
This commit is contained in:
Léo Lam 2021-04-17 15:51:08 +02:00
parent 14959a1087
commit cc32fa91af
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 3 additions and 2 deletions

View File

@ -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++]);