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

Function dumpmem2

src/debug.cpp:1507–1540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1505}
1506
1507uaecptr dumpmem2 (uaecptr addr, TCHAR *out, int osize)
1508{
1509 int i, cols = 8;
1510 int nonsafe = 0;
1511
1512 if (osize <= (9 + cols * 5 + 1 + 2 * cols))
1513 return addr;
1514 _sntprintf (out, osize*sizeof(TCHAR), _T("%08X "), addr);
1515 for (i = 0; i < cols; i++) {
1516 uae_u8 b1, b2;
1517 b1 = b2 = 0;
1518 if (debug_safe_addr (addr, 1)) {
1519 b1 = get_byte_debug (addr + 0);
1520 b2 = get_byte_debug (addr + 1);
1521 _sntprintf (out + 9 + i * 5, (osize - (9 + i * 5))*sizeof(TCHAR), _T("%02X%02X "), b1, b2);
1522 out[9 + cols * 5 + 1 + i * 2 + 0] = b1 >= 32 && b1 < 127 ? b1 : '.';
1523 out[9 + cols * 5 + 1 + i * 2 + 1] = b2 >= 32 && b2 < 127 ? b2 : '.';
1524 } else {
1525 nonsafe++;
1526 _tcscpy (out + 9 + i * 5, _T("**** "));
1527 out[9 + cols * 5 + 1 + i * 2 + 0] = '*';
1528 out[9 + cols * 5 + 1 + i * 2 + 1] = '*';
1529 }
1530 addr += 2;
1531 }
1532 out[9 + cols * 5] = ' ';
1533 out[9 + cols * 5 + 1 + 2 * cols] = 0;
1534 if (nonsafe == cols) {
1535 addrbank *ab = &get_mem_bank (addr);
1536 if (ab->name)
1537 memcpy (out + (9 + 4 + 1) * sizeof (TCHAR), ab->name, _tcslen (ab->name) * sizeof (TCHAR));
1538 }
1539 return addr;
1540}
1541
1542static TCHAR dumpmemline[MAX_LINEWIDTH + 1];
1543

Callers 1

dumpmemFunction · 0.85

Calls 2

debug_safe_addrFunction · 0.70
get_byte_debugFunction · 0.70

Tested by

no test coverage detected