diff --git a/SourceGen/MainController.cs b/SourceGen/MainController.cs
index fa23efa..a70b2e9 100644
--- a/SourceGen/MainController.cs
+++ b/SourceGen/MainController.cs
@@ -3952,6 +3952,49 @@ namespace SourceGen {
showTextDlg.ShowDialog();
}
+ public void Debug_ApplyPlatformSymbols() {
+ ChangeSet cs = new ChangeSet(1);
+
+ foreach (Symbol sym in mProject.SymbolTable) {
+ if (sym.SymbolSource != Symbol.Source.Platform) {
+ continue;
+ }
+ DefSymbol defSym = (DefSymbol)sym;
+ if (defSym.MultiMask != null) {
+ // These would require additional work... probably.
+ continue;
+ }
+
+ int offset = mProject.AddrMap.AddressToOffset(0, sym.Value);
+ if (offset < 0) {
+ continue;
+ }
+
+ // Make sure this is the start of an instruction or data item. (If you
+ // haven't finished hinting code, it's best to disable the string/fill finder.)
+ Anattrib attr = mProject.GetAnattrib(offset);
+ if (!attr.IsStart) {
+ Debug.WriteLine("Found match at non-start +" + offset.ToString("x6") +
+ ": " + defSym);
+ continue;
+ }
+
+ // Check for user label. Okay to overwrite auto label.
+ if (mProject.UserLabels.ContainsKey(offset)) {
+ Debug.WriteLine("User label already exists at +" + offset.ToString("x6"));
+ continue;
+ }
+
+ // Create a new user label symbol.
+ Symbol newSym = new Symbol(sym.Label, sym.Value, Symbol.Source.User,
+ Symbol.Type.GlobalAddr, Symbol.LabelAnnotation.None);
+ UndoableChange uc = UndoableChange.CreateLabelChange(offset, null, newSym);
+ cs.Add(uc);
+ }
+
+ ApplyUndoableChanges(cs);
+ }
+
#endregion Debug features
}
}
diff --git a/SourceGen/RuntimeData/Help/advanced.html b/SourceGen/RuntimeData/Help/advanced.html
index 6861c3a..736ab3b 100644
--- a/SourceGen/RuntimeData/Help/advanced.html
+++ b/SourceGen/RuntimeData/Help/advanced.html
@@ -306,10 +306,10 @@ not help you debug 6502 projects.
- Re-analyze (F5). Causes a full re-analysis. Useful if you think
the display is out of sync.
- - Show Problem List Viewer. Opens a floating window that shows some
- of the problems encountered during the last analysis pass.
- - Show Undo/Redo History. Opens a floating window that lets you
- watch the contents of the undo buffer while you work.
+ - Source Generation Tests. Opens the regression test harness. See
+
README.md
in the SGTestData directory for more information.
+ If the regression tests weren't included in the SourceGen distribution,
+ this will have nothing to do.
- Show Analyzer Output. Opens a floating window with a text log from
the most recent analysis pass. The exact contents will vary depending
on how the verbosity level is configured internally. Debug messages
@@ -318,9 +318,11 @@ not help you debug 6502 projects.
timer results from the most recent analysis pass. Times for individual
stages are noted, as are times for groups of functions. This
provides a crude sense of where time is being spent.
+ - Show Undo/Redo History. Opens a floating window that lets you
+ watch the contents of the undo buffer while you work.
- Extension Script Info. Shows a bit about the currently-loaded
extension scripts.
- - Toggle Comment Rulers. Adds a string of digits above every
+
- Show Comment Rulers. Adds a string of digits above every
multi-line comment (long comment, note). Useful for confirming that
the width limitation is being obeyed. These are added exactly
as shown, without comment delimiters, into generated assembly output,
@@ -329,10 +331,18 @@ not help you debug 6502 projects.
script sandbox every 60 seconds. This seems to be required to avoid
an infrequently-encountered Windows bug. (See code for notes and
stackoverflow.com links.)
- - Source Generation Tests. Opens the regression test harness. See
- the README.md in the SGTestData directory for more information. If
- the regression tests weren't included in the SourceGen distribution,
- this will have nothing to do.
+ - Applesoft to HTML. An experimental feature that formats an
+ Applesoft program as HTML.
+ - Apply Platform Symbols. An experimental feature for turning platform
+ symbols into address labels. This will run through the list of all
+ symbols loaded from .sym65 files and find addresses that fall within
+ the bounds of the file. If it finds an address that is the start
+ of a code/data line and doesn't already have a user-supplied label,
+ the platform symbol's label will be applied. Useful for
+ disassembling ROM images or other code with an established set of
+ public entry points.
+ (Tip: disable "analyze uncategorized data" from the project
+ properties editor first.)
diff --git a/SourceGen/WpfGui/MainWindow.xaml b/SourceGen/WpfGui/MainWindow.xaml
index 591b7aa..8ad6e77 100644
--- a/SourceGen/WpfGui/MainWindow.xaml
+++ b/SourceGen/WpfGui/MainWindow.xaml
@@ -176,6 +176,7 @@ limitations under the License.
+
@@ -296,6 +297,8 @@ limitations under the License.
CanExecute="IsProjectOpen" Executed="Debug_RefreshCmd_Executed"/>
+
+
diff --git a/SourceGen/WpfGui/MainWindow.xaml.cs b/SourceGen/WpfGui/MainWindow.xaml.cs
index cbdb702..dd64af1 100644
--- a/SourceGen/WpfGui/MainWindow.xaml.cs
+++ b/SourceGen/WpfGui/MainWindow.xaml.cs
@@ -1333,6 +1333,11 @@ namespace SourceGen.WpfGui {
mMainCtrl.Debug_ApplesoftToHtml();
}
+ private void Debug_ApplyPlatformSymbolsCmd_Executed(object sender,
+ ExecutedRoutedEventArgs e) {
+ mMainCtrl.Debug_ApplyPlatformSymbols();
+ }
+
private void Debug_ExtensionScriptInfoCmd_Executed(object sender,
ExecutedRoutedEventArgs e) {
mMainCtrl.Debug_ExtensionScriptInfo();