Having big issues using memcpy/memmove and custom routines to do the same.

Hi,

Back again with hopefully one of tha last "simple" questions I have.
I'm currently trying to copy some memory (500kb) from one place to another, doing this immediately freezes my program.

How (without Kos, newlib) can I copy this data? Is it because I'm naively doing? Should I try to keep things memory aligned (32 bit aligned?)?

Thanks for the help to what I assume will be an easy question.

Btw im moving from 0xACC00000 to 0xAC010000, which should just be the uncached version of 0x8C010000 (EIP of 1st_read.bin)

For the people pointing out that I'm overwriting my current program, I'm not running from 0x8C01000, it's from a completely different place in memory.

Code:
Void memmove(void *dest, void *src, int Len)
{
Char *_dest=(char*)dest;
Char *_src=(char*)src;

Int I;
For(I=0;I<Len;I++)
    *(_dest+I) = _src[I];
}
I don’t think you need to be dereferencing ‘dest’

When in doubt, examine the source code for memcpy =)
Oops. Thanks!
Is it your own program or the program segment added to the original game?
You can upload the 2 - band SH4 assembler bin file to see


是你自己写的程序还是在原游戏中添加的程序段?
你可以上传2进制的sh4汇编bin文件上来看看
Found out the issue. It was an issue with overwriting something that I didn't know existed.
Thanks for all the help! Its finished! (still not quite ready for a source level release but the binary will be out soon)

A new configurable IP.BIN with basic patching, boots scrambled/unscrambled binaries, can do other stuff. should be comparable with ECHELON's but much more powerful!

Original thread: https://assemblergames.com/threads/having-big-issues-using-memcpy-memmove-and-custom-routines-to-do-the-same.68544/