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

Function deepcheatsearch

src/debug.cpp:3619–3772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3617}
3618
3619static void deepcheatsearch(TCHAR **c)
3620{
3621 static int first = 1;
3622 static uae_u8 *memtmp;
3623 static int memsize, memsize2;
3624 uae_u8 *p1, *p2;
3625 uaecptr addr, end;
3626 int i, wasmodified, nonmodified;
3627 static int size;
3628 static int inconly, deconly, maxdiff;
3629 int addrcnt, cnt;
3630 TCHAR v;
3631
3632 v = _totupper(**c);
3633
3634 if(!memtmp || v == 'S') {
3635 maxdiff = 0x10000;
3636 inconly = 0;
3637 deconly = 0;
3638 size = 1;
3639 }
3640
3641 if (**c)
3642 (*c)++;
3643 ignore_ws(c);
3644 if ((**c) == '1' || (**c) == '2') {
3645 size = **c - '0';
3646 (*c)++;
3647 }
3648 if (more_params(c))
3649 maxdiff = readint(c, NULL);
3650
3651 if (!memtmp || v == 'S') {
3652 first = 1;
3653 xfree (memtmp);
3654 memsize = 0;
3655 addr = 0xffffffff;
3656 nextaddr_init(addr);
3657 while ((addr = nextaddr(addr, 0, &end, false, NULL)) != 0xffffffff) {
3658 memsize += end - addr;
3659 addr = end - 1;
3660 }
3661 memsize2 = (memsize + 7) / 8;
3662 memtmp = xmalloc(uae_u8, memsize + memsize2);
3663 if (!memtmp)
3664 return;
3665 memset(memtmp + memsize, 0xff, memsize2);
3666 p1 = memtmp;
3667 addr = 0xffffffff;
3668 nextaddr_init(addr);
3669 while ((addr = nextaddr(addr, 0, &end, true, NULL)) != 0xffffffff) {
3670 for (i = addr; i < end; i++)
3671 *p1++ = get_byte_debug(i);
3672 addr = end - 1;
3673 }
3674 console_out(_T("Deep trainer first pass complete.\n"));
3675 return;
3676 }

Callers 1

debug_lineFunction · 0.85

Calls 13

ignore_wsFunction · 0.85
more_paramsFunction · 0.85
readintFunction · 0.85
nextaddr_initFunction · 0.85
nextaddrFunction · 0.85
iscancelFunction · 0.85
clearcheaterFunction · 0.85
addcheaterFunction · 0.85
listcheaterFunction · 0.85
get_byte_debugFunction · 0.70
get_word_debugFunction · 0.70
console_outFunction · 0.50

Tested by

no test coverage detected