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:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user