- [NEW] Ara es poden afegir i llevar simbols des de la consola

This commit is contained in:
2024-12-11 15:21:55 +01:00
parent 18949140fd
commit 1c6bf95953
2 changed files with 35 additions and 7 deletions

View File

@@ -217,15 +217,15 @@ namespace z80dis
return symbols[pos];
}
bool comp(uint16_t a, uint16_t b) {
return a <= b;
}
void setSymbol(const uint16_t pos, const char *sym)
{
strcpy(symbols[pos], sym);
used_symbols.push_back(pos);
sort(used_symbols.begin(), used_symbols.end(), comp);
if (sym) {
strcpy(symbols[pos], sym);
} else {
symbols[pos][0] = 0;
}
used_symbols.clear();
for (int i=0; i<65536; ++i) if (symbols[i][0]!=0) used_symbols.push_back(i);
saveSymbols();
}