diff options
author | Nebuleon Fumika | 2013-02-01 00:33:30 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-02-01 00:33:30 -0500 |
commit | f385752705de73b04cbbda735a71f14c19e241a6 (patch) | |
tree | 59aca906a8c3fcbaae402d503e7c6b34643e0199 /source/cheats2.cpp | |
parent | f0fab191e48f165c551980d724bba2f26a764795 (diff) | |
download | snes9x2005-f385752705de73b04cbbda735a71f14c19e241a6.tar.gz snes9x2005-f385752705de73b04cbbda735a71f14c19e241a6.tar.bz2 snes9x2005-f385752705de73b04cbbda735a71f14c19e241a6.zip |
memcpy vs memmove: memmove correctly handles overlapping source and destination memory buffers, but is slower than memcpy in many implementations. When memory buffers don't overlap, memcpy may be more efficient.
The DS2 SDK is such an implementation, so change many memmoves into memcpys.
Diffstat (limited to 'source/cheats2.cpp')
-rw-r--r-- | source/cheats2.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/cheats2.cpp b/source/cheats2.cpp index e5a7b0f..59855b9 100644 --- a/source/cheats2.cpp +++ b/source/cheats2.cpp @@ -128,6 +128,7 @@ void S9xDeleteCheat (uint32 which1) if (Cheat.c [which1].enabled) S9xRemoveCheat (which1); + // memmove required: Overlapping addresses [Neb] memmove (&Cheat.c [which1], &Cheat.c [which1 + 1], sizeof (Cheat.c [0]) * (Cheat.num_cheats - which1 - 1)); Cheat.num_cheats--; //MK: This used to set it to 0?? |