diff --git a/SourceGen/DataAnalysis.cs b/SourceGen/DataAnalysis.cs index db22390..76a93d4 100644 --- a/SourceGen/DataAnalysis.cs +++ b/SourceGen/DataAnalysis.cs @@ -718,6 +718,7 @@ namespace SourceGen { #else // Select "is printable" test. We use the extended version to include some // control characters. + // TODO(maybe): require some *actually* printable characters in each string CharEncoding.InclusionTest testPrintable; FormatDescriptor.SubType baseSubType; switch (mAnalysisParams.DefaultTextScanMode) { diff --git a/SourceGen/MainController.cs b/SourceGen/MainController.cs index 8c2e969..eab74b5 100644 --- a/SourceGen/MainController.cs +++ b/SourceGen/MainController.cs @@ -1845,6 +1845,7 @@ namespace SourceGen { } private void EditInstructionOperand(int offset) { +#if false EditInstructionOperand dlg = new EditInstructionOperand(mMainWin, offset, mProject, mOutputFormatter); @@ -1912,7 +1913,21 @@ namespace SourceGen { case WpfGui.EditInstructionOperand.SymbolShortcutAction.None: break; } +#else + EditInstructionOperand dlg = new EditInstructionOperand(mMainWin, mProject, + offset, mOutputFormatter); + if (dlg.ShowDialog() != true) { + return; + } + ChangeSet cs = new ChangeSet(1); + mProject.OperandFormats.TryGetValue(offset, out FormatDescriptor dfd); + if (dlg.FormatDescriptorResult != dfd) { + UndoableChange uc = UndoableChange.CreateOperandFormatChange(offset, + dfd, dlg.FormatDescriptorResult); + cs.Add(uc); + } +#endif if (cs.Count != 0) { ApplyUndoableChanges(cs); } diff --git a/SourceGen/PseudoOp.cs b/SourceGen/PseudoOp.cs index 0b9f917..2edd3f7 100644 --- a/SourceGen/PseudoOp.cs +++ b/SourceGen/PseudoOp.cs @@ -836,7 +836,9 @@ namespace SourceGen { } operandValue = (int)(operandValue & mask); - if (sb.Length != symLabel.Length) { + // If we've added stuff, and we're going to add an adjustment later, stick + // an extra space in between for readability. + if (sb.Length != symLabel.Length && operandValue != symbolValue) { sb.Append(' '); } } else { diff --git a/SourceGen/SourceGen.csproj b/SourceGen/SourceGen.csproj index 38e2e67..a060190 100644 --- a/SourceGen/SourceGen.csproj +++ b/SourceGen/SourceGen.csproj @@ -109,9 +109,6 @@ EditInstructionOperand.xaml - - EditInstructionOperand2.xaml - EditLabel.xaml @@ -269,10 +266,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile diff --git a/SourceGen/WpfGui/EditInstructionOperand.xaml b/SourceGen/WpfGui/EditInstructionOperand.xaml index c4c01e6..e16d592 100644 --- a/SourceGen/WpfGui/EditInstructionOperand.xaml +++ b/SourceGen/WpfGui/EditInstructionOperand.xaml @@ -19,6 +19,7 @@ limitations under the License. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:SourceGen.WpfGui" mc:Ignorable="d" Title="Edit Instruction Operand" @@ -26,72 +27,144 @@ limitations under the License. ShowInTaskbar="False" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded" ContentRendered="Window_ContentRendered"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + N/A + [invalid symbol name] + ? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + +