Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FifoPlayer: Copy data with memcpy instead of one byte at a time #9645

Merged
merged 1 commit into from Apr 18, 2021

Conversation

leoetlino
Copy link
Member

@leoetlino leoetlino commented Apr 17, 2021

Copying with memcpy/std::copy is a lot faster than writing one byte at a time. And the behavior should be fully equivalent.

All FastWrite8 does is write a byte and increment the pointer:

void FastWrite8(const u8 value)
{
*PowerPC::ppcState.gather_pipe_ptr = value;
PowerPC::ppcState.gather_pipe_ptr += sizeof(u8);
}

Before: https://f.leolam.fr/out-rs3.svg

After: https://f.leolam.fr/out-rs3_v2.svg

Copying with memcpy/std::copy is a lot faster than writing one byte
at a time. And the behavior should be fully equivalent.
@JMC47
Copy link
Contributor

JMC47 commented Apr 17, 2021

This makes fifologs recorded from Rogue Squadron 3 run "full speed" and also makes a lot of other fifologs run at a much higher potential framerate.

@JosJuice JosJuice merged commit 92308f5 into dolphin-emu:master Apr 18, 2021
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants