From b1340ec2acb459fb107e6d7e6b49c9dcaee0fd00 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Wed, 22 Jul 2020 10:53:54 -0700 Subject: [PATCH] Tweaks --- SourceGen/CodeAnalysis.cs | 11 +++++++++++ SourceGen/Exporter.cs | 2 ++ SourceGen/MainController.cs | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/SourceGen/CodeAnalysis.cs b/SourceGen/CodeAnalysis.cs index 932738b..a7bc721 100644 --- a/SourceGen/CodeAnalysis.cs +++ b/SourceGen/CodeAnalysis.cs @@ -43,6 +43,17 @@ namespace SourceGen { /// The hints are not used directly by the data analyzer, but the effects they /// have on the Anattrib array are. /// + /// + /// This invokes methods in extension scripts to handle things like inline data + /// following a JSR. The added cost is generally low, because the AppDomain security + /// sandbox doesn't add a lot of overhead. Unfortunately this approach is deprecated + /// by Microsoft and may break or become unavailable. If that happens, and we have to + /// switch to a sandbox approach with significant overhead, we will most likely want + /// to move the code analyzer itself into the sandbox. + /// + /// For this reason it's best to minimize direct interaction between the code here and + /// that elsewhere in the program. + /// public enum TypeHint : sbyte { // No hint. Default value populated in new arrays. NoHint = 0, diff --git a/SourceGen/Exporter.cs b/SourceGen/Exporter.cs index 7bf7f59..884dcde 100644 --- a/SourceGen/Exporter.cs +++ b/SourceGen/Exporter.cs @@ -247,6 +247,8 @@ namespace SourceGen { sb.Append(IncludeNotes.ToString()); sb.Append(";gfx="); sb.Append(GenerateImageFiles.ToString()); + sb.Append(";opWrap="); + sb.Append(mFormatter.Config.mOperandWrapLen); // Not included: pseudo-op definitions; delimiter definitions diff --git a/SourceGen/MainController.cs b/SourceGen/MainController.cs index e22ae04..a384a35 100644 --- a/SourceGen/MainController.cs +++ b/SourceGen/MainController.cs @@ -21,6 +21,7 @@ using System.Text; using System.Web.Script.Serialization; using System.Windows; using System.Windows.Input; +using System.Windows.Media; using Microsoft.Win32; using Asm65; @@ -28,7 +29,6 @@ using CommonUtil; using CommonWPF; using SourceGen.Sandbox; using SourceGen.WpfGui; -using System.Windows.Media; namespace SourceGen { /// @@ -2718,6 +2718,11 @@ namespace SourceGen { UndoableChange uc = UndoableChange.CreateDummyChange(UndoableChange.ReanalysisScope.CodeAndData); ApplyChanges(new ChangeSet(uc), false); + + // TODO(someday): this would really be better as a special-case dummy change + // that caused the "external files have changed" behavior in ApplyChanges() to fire. + // Before we can do that, though, we need a way to propagate the load errors and + // compiler warnings out for display. } public void Goto() {