1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-07-14 19:24:21 +00:00

Check both directions for project/platform "nearby" matches

If a symbol is defined at <addr>, and we counter STA <addr>-1,Y,
we want to use the symbol in the operand.  This worked for labels
but not project/platform symbols.

Also, fixed a crash that happened if you tried to delete an auto
label.
This commit is contained in:
Andy McFadden
2019-09-12 14:24:09 -07:00
parent 81157b6b47
commit 1631cd77f6
6 changed files with 34 additions and 12 deletions

View File

@ -1624,10 +1624,17 @@ namespace SourceGen {
if (mProject.UserLabels.ContainsKey(offset)) {
oldUserValue = mProject.UserLabels[offset];
}
UndoableChange uc = UndoableChange.CreateLabelChange(offset,
oldUserValue, dlg.LabelSym);
ChangeSet cs = new ChangeSet(uc);
ApplyUndoableChanges(cs);
if (oldUserValue == dlg.LabelSym) {
// Only expected when attr.Symbol is Auto
Debug.Assert(attr.Symbol.SymbolSource == Symbol.Source.Auto);
Debug.Assert(oldUserValue == null);
Debug.WriteLine("Ignoring attempt to delete an auto label");
} else {
UndoableChange uc = UndoableChange.CreateLabelChange(offset,
oldUserValue, dlg.LabelSym);
ChangeSet cs = new ChangeSet(uc);
ApplyUndoableChanges(cs);
}
}
}