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/c4emu.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/c4emu.cpp')
-rw-r--r-- | source/c4emu.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/c4emu.cpp b/source/c4emu.cpp index a8fcce9..be08f07 100644 --- a/source/c4emu.cpp +++ b/source/c4emu.cpp @@ -878,6 +878,7 @@ void S9xSetC4 (uint8 byte, uint16 Address) if(byte != 0) printf("C4 load: non-0 written to $7f47! Wrote %02x\n", byte); if(READ_WORD(Memory.C4RAM+0x1f45) < 0x6000 || (READ_WORD(Memory.C4RAM+0x1f45) + READ_WORD(Memory.C4RAM+0x1f43)) > 0x6c00) printf("C4 load: Dest unusual! It's %04x\n", READ_WORD(Memory.C4RAM+0x1f45)); #endif + // memmove required: Can overlap arbitrarily [Neb] memmove(Memory.C4RAM+(READ_WORD(Memory.C4RAM+0x1f45)&0x1fff), S9xGetMemPointer(READ_3WORD(Memory.C4RAM+0x1f40)), READ_WORD(Memory.C4RAM+0x1f43)); |