mirror of
https://github.com/fadden/6502bench.git
synced 2025-07-26 05:24:41 +00:00
Improve split-address table formatter
Don't enable OK unless at least one address is valid. Don't apply code hints unless asked. Rename a couple of things for clarity. Add documentation to manual. (issue #10)
This commit is contained in:
@@ -2644,23 +2644,24 @@ namespace SourceGen.AppForms {
|
||||
cs.Add(uc);
|
||||
}
|
||||
|
||||
|
||||
// Apply code hints.
|
||||
TypedRangeSet newSet = new TypedRangeSet();
|
||||
TypedRangeSet undoSet = new TypedRangeSet();
|
||||
if (dlg.WantCodeHints) {
|
||||
TypedRangeSet newSet = new TypedRangeSet();
|
||||
TypedRangeSet undoSet = new TypedRangeSet();
|
||||
|
||||
foreach (int offset in dlg.AllTargetOffsets) {
|
||||
if (!mProject.GetAnattrib(offset).IsInstruction) {
|
||||
CodeAnalysis.TypeHint oldType = mProject.TypeHints[offset];
|
||||
if (oldType == CodeAnalysis.TypeHint.Code) {
|
||||
continue; // already set
|
||||
foreach (int offset in dlg.AllTargetOffsets) {
|
||||
if (!mProject.GetAnattrib(offset).IsInstruction) {
|
||||
CodeAnalysis.TypeHint oldType = mProject.TypeHints[offset];
|
||||
if (oldType == CodeAnalysis.TypeHint.Code) {
|
||||
continue; // already set
|
||||
}
|
||||
undoSet.Add(offset, (int)oldType);
|
||||
newSet.Add(offset, (int)CodeAnalysis.TypeHint.Code);
|
||||
}
|
||||
undoSet.Add(offset, (int)oldType);
|
||||
newSet.Add(offset, (int)CodeAnalysis.TypeHint.Code);
|
||||
}
|
||||
}
|
||||
if (newSet.Count != 0) {
|
||||
cs.Add(UndoableChange.CreateTypeHintChange(undoSet, newSet));
|
||||
if (newSet.Count != 0) {
|
||||
cs.Add(UndoableChange.CreateTypeHintChange(undoSet, newSet));
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, apply the change.
|
||||
|
Reference in New Issue
Block a user