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

Function nextaddr

src/debug.cpp:1456–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454}
1455
1456static uaecptr nextaddr(uaecptr addr, uaecptr last, uaecptr *endp, bool verbose, bool *lfp)
1457{
1458 addrbank *ab;
1459 int lastbank = currprefs.address_space_24 ? 255 : 65535;
1460
1461 if (addr != 0xffffffff) {
1462 addrbank *ab2 = get_mem_bank_real(addr);
1463 addr++;
1464 ab = get_mem_bank_real(addr);
1465 if (ab->baseaddr && (ab->flags & nextaddr_ab_flags_mask) == nextaddr_ab_flags && ab == ab2) {
1466 return addr;
1467 }
1468 } else {
1469 addr = 0;
1470 }
1471
1472 while (addr < (lastbank << 16)) {
1473 ab = get_mem_bank_real(addr);
1474 if (ab->baseaddr && ((ab->flags & nextaddr_ab_flags_mask) == nextaddr_ab_flags))
1475 break;
1476 addr += 65536;
1477 }
1478 if (addr >= (lastbank << 16)) {
1479 if (endp)
1480 *endp = 0xffffffff;
1481 return 0xffffffff;
1482 }
1483
1484 uaecptr start = addr;
1485
1486 while (addr <= (lastbank << 16)) {
1487 addrbank *ab2 = get_mem_bank_real(addr);
1488 if ((last && last != 0xffffffff && addr >= last) || !ab2->baseaddr || ((ab2->flags & nextaddr_ab_flags_mask) != nextaddr_ab_flags) || ab != ab2) {
1489 if (endp)
1490 *endp = addr;
1491 break;
1492 }
1493 addr += 65536;
1494 }
1495
1496 if (verbose) {
1497 if (lfp && *lfp) {
1498 console_out_f(_T("\n"));
1499 *lfp = false;
1500 }
1501 console_out_f(_T("Scanning %08x - %08x (%s)\n"), start, addr - 1, get_mem_bank(start).name);
1502 }
1503
1504 return start;
1505}
1506
1507uaecptr dumpmem2 (uaecptr addr, TCHAR *out, int osize)
1508{

Callers 5

deepcheatsearchFunction · 0.85
cheatsearchFunction · 0.85
illg_initFunction · 0.85
searchmemFunction · 0.85
find_eaFunction · 0.85

Calls 2

get_mem_bank_realFunction · 0.85
console_out_fFunction · 0.50

Tested by

no test coverage detected