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

Function strA

gui/qt/debugger/disasm.cpp:51–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51static std::string strA(uint32_t data) {
52 std::pair<map_t::iterator, map_t::iterator> range;
53 map_t::iterator sit;
54 std::string ret;
55 bool high = data > 511;
56 range = disasm.map.equal_range(data);
57 for (sit = range.first; sit != range.second; ++sit) {
58 if (high || sit->second[0] == '_') {
59 if (!ret.empty()) {
60 ret += '|';
61 }
62 ret += sit->second;
63 }
64 }
65 if (!ret.empty()) {
66 return ret;
67 }
68 if (disasm.il) {
69 snprintf(tmpbuf, sizeof(tmpbuf), "$%06X", data);
70 } else {
71 range = disasm.map.equal_range(cpu.registers.MBASE<<16|data);
72 for (sit = range.first; sit != range.second; ++sit) {
73 if (high || sit->second[0] == '_') {
74 if (!ret.empty()) {
75 ret += '|';
76 }
77 ret += sit->second;
78 }
79 }
80 if (!ret.empty()) {
81 if (data > 0xFFFF) {
82 ret += " & $FFFF";
83 }
84 return ret;
85 }
86 snprintf(tmpbuf, sizeof(tmpbuf), "$%04X", data);
87 }
88 return std::string(tmpbuf);
89}
90
91static int disasmFetch(struct zdis_ctx *ctx, uint32_t addr) {
92 char tmp[3];

Callers 1

disasmPutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected