From f385752705de73b04cbbda735a71f14c19e241a6 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Fri, 1 Feb 2013 00:33:30 -0500 Subject: 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. --- source/cheats2.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/cheats2.cpp') 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?? -- cgit v1.2.3