From 6411df7ff96a98c1ccece046f1e0bd442b6797f9 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Mon, 4 Nov 2019 13:34:49 -0800 Subject: [PATCH] Add toolbar button for "Go to Last Change" Also, updated a couple of comments. --- SourceGen/AsmGen/AsmAcme.cs | 6 ++++++ SourceGen/Res/CommandIcons.xaml | 24 ++++++++++++++++++++++++ SourceGen/Symbol.cs | 5 ++--- SourceGen/WpfGui/MainWindow.xaml | 4 ++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/SourceGen/AsmGen/AsmAcme.cs b/SourceGen/AsmGen/AsmAcme.cs index 6fd31fb..070158b 100644 --- a/SourceGen/AsmGen/AsmAcme.cs +++ b/SourceGen/AsmGen/AsmAcme.cs @@ -221,6 +221,8 @@ namespace SourceGen.AsmGen { mLocalizer = new LabelLocalizer(Project); if (!Settings.GetBool(AppSettings.SRCGEN_DISABLE_LABEL_LOCALIZATION, false)) { + // While '.' labels are limited to the current zone, '@' labels are visible + // between global labels. (This is poorly documented.) mLocalizer.LocalPrefix = "@"; mLocalizer.Analyze(); } @@ -503,6 +505,10 @@ namespace SourceGen.AsmGen { // IGenerator public void OutputLocalVariableTable(int offset, List newDefs, LocalVariableTable allDefs) { + // We can do better here, but it requires knowing whether anything in "newDefs" + // overwrote a previous entry. If everything is new, we don't need to start + // a new zone, and can just output newDefs. (We don't need to start a new zone + // on a "clear previous".) OutputLine(string.Empty, "!zone", "Z" + offset.ToString("x6"), string.Empty); for (int i = 0; i < allDefs.Count; i++) { DefSymbol defSym = allDefs[i]; diff --git a/SourceGen/Res/CommandIcons.xaml b/SourceGen/Res/CommandIcons.xaml index bb417d3..2f66bec 100644 --- a/SourceGen/Res/CommandIcons.xaml +++ b/SourceGen/Res/CommandIcons.xaml @@ -49,6 +49,30 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SourceGen/Symbol.cs b/SourceGen/Symbol.cs index 8f206e4..a23cfe3 100644 --- a/SourceGen/Symbol.cs +++ b/SourceGen/Symbol.cs @@ -38,8 +38,7 @@ namespace SourceGen { /// /// Local internal label, global internal label, or reference to an - /// external address? Constants get a separate type in case we need to - /// distinguish them from addresses. + /// external address? Constants get a separate type. /// public enum Type { Unknown = 0, @@ -59,7 +58,7 @@ namespace SourceGen { } /// - /// True if the symbol is a local variable. + /// True if the symbol is a local variable. /// public bool IsVariable { get { return SymbolSource == Source.Variable; } diff --git a/SourceGen/WpfGui/MainWindow.xaml b/SourceGen/WpfGui/MainWindow.xaml index c5f76e0..37eae72 100644 --- a/SourceGen/WpfGui/MainWindow.xaml +++ b/SourceGen/WpfGui/MainWindow.xaml @@ -421,6 +421,10 @@ limitations under the License. ToolTip="Navigate forward (Alt+Right or Ctrl+Shift+Minus)"> +