MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / copymem

Function copymem

src/debug.cpp:5291–5338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5289}
5290
5291static void copymem(TCHAR **c)
5292{
5293 uae_u32 addr = 0, eaddr = 0, dst = 0;
5294 bool err;
5295
5296 ignore_ws(c);
5297 if (!more_params(c))
5298 return;
5299 addr = readhex(c, &err);
5300 if (err) {
5301 return;
5302 }
5303 ignore_ws (c);
5304 if (!more_params(c))
5305 return;
5306 eaddr = readhex(c, &err);
5307 if (err) {
5308 return;
5309 }
5310 ignore_ws (c);
5311 if (!more_params(c))
5312 return;
5313 dst = readhex(c, &err);
5314 if (err) {
5315 return;
5316 }
5317
5318 if (addr >= eaddr)
5319 return;
5320 uae_u32 addrb = addr;
5321 uae_u32 dstb = dst;
5322 uae_u32 len = eaddr - addr;
5323 if (dst <= addr) {
5324 while (addr < eaddr) {
5325 put_byte(dst, get_byte(addr));
5326 addr++;
5327 dst++;
5328 }
5329 } else {
5330 dst += eaddr - addr;
5331 while (addr < eaddr) {
5332 dst--;
5333 eaddr--;
5334 put_byte(dst, get_byte(eaddr));
5335 }
5336 }
5337 console_out_f(_T("Copied from %08x - %08x to %08x - %08x\n"), addrb, addrb + len - 1, dstb, dstb + len - 1);
5338}
5339
5340static void writeintomem (TCHAR **c)
5341{

Callers 1

writeintomemFunction · 0.85

Calls 6

ignore_wsFunction · 0.85
more_paramsFunction · 0.85
readhexFunction · 0.85
put_byteFunction · 0.85
get_byteFunction · 0.85
console_out_fFunction · 0.50

Tested by

no test coverage detected