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

Function strW

gui/qt/debugger/disasm.cpp:13–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11static char tmpbuf[20];
12
13static std::string strW(uint32_t data) {
14 std::pair<map_t::iterator, map_t::iterator> range;
15 map_t::iterator sit;
16 std::string ret;
17 bool high = data > 511;
18 if (disasm.il) {
19 snprintf(tmpbuf, sizeof(tmpbuf), "$%06X", data);
20 } else {
21 snprintf(tmpbuf, sizeof(tmpbuf), "$%04X", data);
22 }
23 if (high) {
24 range = disasm.map.equal_range(data);
25 for (sit = range.first; sit != range.second; ++sit) {
26 ret += sit->second;
27 ret += '|';
28 }
29 if (!ret.empty()) {
30 ret += std::string(tmpbuf);
31 return ret;
32 }
33 if (!disasm.il) {
34 range = disasm.map.equal_range(cpu.registers.MBASE<<16|data);
35 for (sit = range.first; sit != range.second; ++sit) {
36 ret += sit->second;
37 ret += '|';
38 }
39 if (!ret.empty()) {
40 ret += std::string(tmpbuf);
41 if (data > 0xFFFF) {
42 ret += " & $FFFF";
43 }
44 return ret;
45 }
46 }
47 }
48 return std::string(tmpbuf);
49}
50
51static std::string strA(uint32_t data) {
52 std::pair<map_t::iterator, map_t::iterator> range;

Callers 1

disasmPutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected