aboutsummaryrefslogtreecommitdiff
path: root/source/cheats.cpp
diff options
context:
space:
mode:
authorNebuleon Fumika2013-02-01 00:33:30 -0500
committerNebuleon Fumika2013-02-01 00:33:30 -0500
commitf385752705de73b04cbbda735a71f14c19e241a6 (patch)
tree59aca906a8c3fcbaae402d503e7c6b34643e0199 /source/cheats.cpp
parentf0fab191e48f165c551980d724bba2f26a764795 (diff)
downloadsnes9x2005-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/cheats.cpp')
-rw-r--r--source/cheats.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/cheats.cpp b/source/cheats.cpp
index dc388d2..9c4a8f2 100644
--- a/source/cheats.cpp
+++ b/source/cheats.cpp
@@ -190,8 +190,11 @@ const char *S9xGameGenieToRaw (const char *code, uint32 *address, uint8 *byte)
void S9xStartCheatSearch (SCheatData *d)
{
+ // memmove may be required: Source is usually a different malloc, but could be pointed to d->CWRAM [Neb]
memmove (d->CWRAM, d->RAM, 0x20000);
+ // memmove may be required: Source is usually a different malloc, but could be pointed to d->CSRAM [Neb]
memmove (d->CSRAM, d->SRAM, 0x10000);
+ // memmove may be required: Source is usually a different malloc, but could be pointed to d->CIRAM [Neb]
memmove (d->CIRAM, &d->FillRAM [0x3000], 0x2000);
memset ((char *) d->WRAM_BITS, 0xff, 0x20000 >> 3);
memset ((char *) d->SRAM_BITS, 0xff, 0x10000 >> 3);