MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / equatesAddEquate

Method equatesAddEquate

gui/qt/debugger.cpp:1900–1914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1898}
1899
1900void MainWindow::equatesAddEquate(const QString &name, uint32_t address) {
1901 if (address < 0x80) {
1902 return;
1903 }
1904 if (!equatesAddEquateInternal(name, address)) {
1905 return;
1906 }
1907 uint8_t *ptr = static_cast<uint8_t *>(phys_mem_ptr(address - 4, 9));
1908 if (ptr && ptr[4] == 0xC3 && (ptr[0] == 0xC3 || ptr[8] == 0xC3)) { // jump table?
1909 uint32_t address2 = ptr[5] | ptr[6] << 8 | ptr[7] << 16;
1910 if (phys_mem_ptr(address2, 1)) {
1911 equatesAddEquateInternal(QStringLiteral("_") + name, address2);
1912 }
1913 }
1914}
1915
1916bool MainWindow::equatesAddEquateInternal(const QString &name, uint32_t address) {
1917 std::pair<map_value_t::iterator, bool> inserted = disasm.reverse.emplace(name.toUpper().toStdString(), address);

Callers

nothing calls this directly

Calls 1

phys_mem_ptrFunction · 0.85

Tested by

no test coverage detected