diff --git a/SourceGen/AppForms/EditAppSettings.Designer.cs b/SourceGen/AppForms/EditAppSettings.Designer.cs
index fc6a70b..c1f665d 100644
--- a/SourceGen/AppForms/EditAppSettings.Designer.cs
+++ b/SourceGen/AppForms/EditAppSettings.Designer.cs
@@ -71,20 +71,23 @@ namespace SourceGen.AppForms {
this.showCol5 = new System.Windows.Forms.Button();
this.showCol4 = new System.Windows.Forms.Button();
this.asmConfigTabPage = new System.Windows.Forms.TabPage();
+ this.configureAsmGroupBox = new System.Windows.Forms.GroupBox();
+ this.asmColWidthIdLabel = new System.Windows.Forms.Label();
+ this.asmConfigAssemblerLabel = new System.Windows.Forms.Label();
+ this.asmCommentColWidthTextBox = new System.Windows.Forms.TextBox();
+ this.asmOperandColWidthTextBox = new System.Windows.Forms.TextBox();
+ this.asmOpcodeColWidthTextBox = new System.Windows.Forms.TextBox();
+ this.asmLabelColWidthTextBox = new System.Windows.Forms.TextBox();
+ this.asmColWidthLabel = new System.Windows.Forms.Label();
+ this.asmExeLabel = new System.Windows.Forms.Label();
+ this.asmConfigComboBox = new System.Windows.Forms.ComboBox();
+ this.asmExePathTextBox = new System.Windows.Forms.TextBox();
+ this.asmExeBrowseButton = new System.Windows.Forms.Button();
this.showCycleCountsCheckBox = new System.Windows.Forms.CheckBox();
this.configAsmGenLabel = new System.Windows.Forms.Label();
this.longLabelNewLineCheckBox = new System.Windows.Forms.CheckBox();
this.showAsmIdentCheckBox = new System.Windows.Forms.CheckBox();
this.disableLabelLocalizationCheckBox = new System.Windows.Forms.CheckBox();
- this.clearMerlin32Button = new System.Windows.Forms.Button();
- this.clearCc65Button = new System.Windows.Forms.Button();
- this.browseMerlin32Button = new System.Windows.Forms.Button();
- this.browseCc65Button = new System.Windows.Forms.Button();
- this.cc65PathTextBox = new System.Windows.Forms.TextBox();
- this.merlin32PathTextBox = new System.Windows.Forms.TextBox();
- this.asmMerln32Label = new System.Windows.Forms.Label();
- this.asmCc65Label = new System.Windows.Forms.Label();
- this.asmExplanationLabel = new System.Windows.Forms.Label();
this.displayFormatTabPage = new System.Windows.Forms.TabPage();
this.fmtExplanationLabel = new System.Windows.Forms.Label();
this.quickDisplayFormatGroup = new System.Windows.Forms.GroupBox();
@@ -160,6 +163,7 @@ namespace SourceGen.AppForms {
this.codeViewFontGroupBox.SuspendLayout();
this.columnVisGroup.SuspendLayout();
this.asmConfigTabPage.SuspendLayout();
+ this.configureAsmGroupBox.SuspendLayout();
this.displayFormatTabPage.SuspendLayout();
this.quickDisplayFormatGroup.SuspendLayout();
this.operandWidthGroupBox.SuspendLayout();
@@ -519,20 +523,12 @@ namespace SourceGen.AppForms {
//
// asmConfigTabPage
//
+ this.asmConfigTabPage.Controls.Add(this.configureAsmGroupBox);
this.asmConfigTabPage.Controls.Add(this.showCycleCountsCheckBox);
this.asmConfigTabPage.Controls.Add(this.configAsmGenLabel);
this.asmConfigTabPage.Controls.Add(this.longLabelNewLineCheckBox);
this.asmConfigTabPage.Controls.Add(this.showAsmIdentCheckBox);
this.asmConfigTabPage.Controls.Add(this.disableLabelLocalizationCheckBox);
- this.asmConfigTabPage.Controls.Add(this.clearMerlin32Button);
- this.asmConfigTabPage.Controls.Add(this.clearCc65Button);
- this.asmConfigTabPage.Controls.Add(this.browseMerlin32Button);
- this.asmConfigTabPage.Controls.Add(this.browseCc65Button);
- this.asmConfigTabPage.Controls.Add(this.cc65PathTextBox);
- this.asmConfigTabPage.Controls.Add(this.merlin32PathTextBox);
- this.asmConfigTabPage.Controls.Add(this.asmMerln32Label);
- this.asmConfigTabPage.Controls.Add(this.asmCc65Label);
- this.asmConfigTabPage.Controls.Add(this.asmExplanationLabel);
this.asmConfigTabPage.Location = new System.Drawing.Point(4, 22);
this.asmConfigTabPage.Name = "asmConfigTabPage";
this.asmConfigTabPage.Padding = new System.Windows.Forms.Padding(3);
@@ -541,13 +537,138 @@ namespace SourceGen.AppForms {
this.asmConfigTabPage.Text = "Asm Config";
this.asmConfigTabPage.UseVisualStyleBackColor = true;
//
+ // configureAsmGroupBox
+ //
+ this.configureAsmGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.configureAsmGroupBox.Controls.Add(this.asmColWidthIdLabel);
+ this.configureAsmGroupBox.Controls.Add(this.asmConfigAssemblerLabel);
+ this.configureAsmGroupBox.Controls.Add(this.asmCommentColWidthTextBox);
+ this.configureAsmGroupBox.Controls.Add(this.asmOperandColWidthTextBox);
+ this.configureAsmGroupBox.Controls.Add(this.asmOpcodeColWidthTextBox);
+ this.configureAsmGroupBox.Controls.Add(this.asmLabelColWidthTextBox);
+ this.configureAsmGroupBox.Controls.Add(this.asmColWidthLabel);
+ this.configureAsmGroupBox.Controls.Add(this.asmExeLabel);
+ this.configureAsmGroupBox.Controls.Add(this.asmConfigComboBox);
+ this.configureAsmGroupBox.Controls.Add(this.asmExePathTextBox);
+ this.configureAsmGroupBox.Controls.Add(this.asmExeBrowseButton);
+ this.configureAsmGroupBox.Location = new System.Drawing.Point(6, 6);
+ this.configureAsmGroupBox.Name = "configureAsmGroupBox";
+ this.configureAsmGroupBox.Size = new System.Drawing.Size(602, 121);
+ this.configureAsmGroupBox.TabIndex = 0;
+ this.configureAsmGroupBox.TabStop = false;
+ this.configureAsmGroupBox.Text = "Assembler Configuration";
+ //
+ // asmColWidthIdLabel
+ //
+ this.asmColWidthIdLabel.AutoSize = true;
+ this.asmColWidthIdLabel.Location = new System.Drawing.Point(371, 88);
+ this.asmColWidthIdLabel.Name = "asmColWidthIdLabel";
+ this.asmColWidthIdLabel.Size = new System.Drawing.Size(171, 13);
+ this.asmColWidthIdLabel.TabIndex = 10;
+ this.asmColWidthIdLabel.Text = "(label, opcode, operand, comment)";
+ //
+ // asmConfigAssemblerLabel
+ //
+ this.asmConfigAssemblerLabel.AutoSize = true;
+ this.asmConfigAssemblerLabel.Location = new System.Drawing.Point(27, 22);
+ this.asmConfigAssemblerLabel.Name = "asmConfigAssemblerLabel";
+ this.asmConfigAssemblerLabel.Size = new System.Drawing.Size(58, 13);
+ this.asmConfigAssemblerLabel.TabIndex = 0;
+ this.asmConfigAssemblerLabel.Text = "Assembler:";
+ //
+ // asmCommentColWidthTextBox
+ //
+ this.asmCommentColWidthTextBox.Location = new System.Drawing.Point(301, 85);
+ this.asmCommentColWidthTextBox.Name = "asmCommentColWidthTextBox";
+ this.asmCommentColWidthTextBox.Size = new System.Drawing.Size(64, 20);
+ this.asmCommentColWidthTextBox.TabIndex = 9;
+ this.asmCommentColWidthTextBox.TextChanged += new System.EventHandler(this.AsmConfig_TextChanged);
+ //
+ // asmOperandColWidthTextBox
+ //
+ this.asmOperandColWidthTextBox.Location = new System.Drawing.Point(231, 85);
+ this.asmOperandColWidthTextBox.Name = "asmOperandColWidthTextBox";
+ this.asmOperandColWidthTextBox.Size = new System.Drawing.Size(64, 20);
+ this.asmOperandColWidthTextBox.TabIndex = 8;
+ this.asmOperandColWidthTextBox.TextChanged += new System.EventHandler(this.AsmConfig_TextChanged);
+ //
+ // asmOpcodeColWidthTextBox
+ //
+ this.asmOpcodeColWidthTextBox.Location = new System.Drawing.Point(161, 85);
+ this.asmOpcodeColWidthTextBox.Name = "asmOpcodeColWidthTextBox";
+ this.asmOpcodeColWidthTextBox.Size = new System.Drawing.Size(64, 20);
+ this.asmOpcodeColWidthTextBox.TabIndex = 7;
+ this.asmOpcodeColWidthTextBox.TextChanged += new System.EventHandler(this.AsmConfig_TextChanged);
+ //
+ // asmLabelColWidthTextBox
+ //
+ this.asmLabelColWidthTextBox.Location = new System.Drawing.Point(91, 85);
+ this.asmLabelColWidthTextBox.Name = "asmLabelColWidthTextBox";
+ this.asmLabelColWidthTextBox.Size = new System.Drawing.Size(64, 20);
+ this.asmLabelColWidthTextBox.TabIndex = 6;
+ this.asmLabelColWidthTextBox.TextChanged += new System.EventHandler(this.AsmConfig_TextChanged);
+ //
+ // asmColWidthLabel
+ //
+ this.asmColWidthLabel.AutoSize = true;
+ this.asmColWidthLabel.Location = new System.Drawing.Point(7, 88);
+ this.asmColWidthLabel.Name = "asmColWidthLabel";
+ this.asmColWidthLabel.Size = new System.Drawing.Size(78, 13);
+ this.asmColWidthLabel.TabIndex = 5;
+ this.asmColWidthLabel.Text = "Column widths:";
+ //
+ // asmExeLabel
+ //
+ this.asmExeLabel.AutoSize = true;
+ this.asmExeLabel.Location = new System.Drawing.Point(22, 61);
+ this.asmExeLabel.Name = "asmExeLabel";
+ this.asmExeLabel.Size = new System.Drawing.Size(63, 13);
+ this.asmExeLabel.TabIndex = 2;
+ this.asmExeLabel.Text = "Executable:";
+ //
+ // asmConfigComboBox
+ //
+ this.asmConfigComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.asmConfigComboBox.FormattingEnabled = true;
+ this.asmConfigComboBox.Items.AddRange(new object[] {
+ "cc65",
+ "Merlin32"});
+ this.asmConfigComboBox.Location = new System.Drawing.Point(91, 19);
+ this.asmConfigComboBox.Name = "asmConfigComboBox";
+ this.asmConfigComboBox.Size = new System.Drawing.Size(154, 21);
+ this.asmConfigComboBox.TabIndex = 1;
+ this.asmConfigComboBox.SelectedIndexChanged += new System.EventHandler(this.asmConfigComboBox_SelectedIndexChanged);
+ //
+ // asmExePathTextBox
+ //
+ this.asmExePathTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.asmExePathTextBox.Location = new System.Drawing.Point(91, 58);
+ this.asmExePathTextBox.Name = "asmExePathTextBox";
+ this.asmExePathTextBox.Size = new System.Drawing.Size(424, 20);
+ this.asmExePathTextBox.TabIndex = 3;
+ this.asmExePathTextBox.Text = "C:\\something";
+ this.asmExePathTextBox.TextChanged += new System.EventHandler(this.AsmConfig_TextChanged);
+ //
+ // asmExeBrowseButton
+ //
+ this.asmExeBrowseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.asmExeBrowseButton.Location = new System.Drawing.Point(521, 56);
+ this.asmExeBrowseButton.Name = "asmExeBrowseButton";
+ this.asmExeBrowseButton.Size = new System.Drawing.Size(75, 23);
+ this.asmExeBrowseButton.TabIndex = 4;
+ this.asmExeBrowseButton.Text = "Browse...";
+ this.asmExeBrowseButton.UseVisualStyleBackColor = true;
+ this.asmExeBrowseButton.Click += new System.EventHandler(this.asmExeBrowseButton_Click);
+ //
// showCycleCountsCheckBox
//
this.showCycleCountsCheckBox.AutoSize = true;
- this.showCycleCountsCheckBox.Location = new System.Drawing.Point(10, 217);
+ this.showCycleCountsCheckBox.Location = new System.Drawing.Point(6, 162);
this.showCycleCountsCheckBox.Name = "showCycleCountsCheckBox";
this.showCycleCountsCheckBox.Size = new System.Drawing.Size(116, 17);
- this.showCycleCountsCheckBox.TabIndex = 53;
+ this.showCycleCountsCheckBox.TabIndex = 2;
this.showCycleCountsCheckBox.Text = "Show cycle counts";
this.showCycleCountsCheckBox.UseVisualStyleBackColor = true;
this.showCycleCountsCheckBox.CheckedChanged += new System.EventHandler(this.showCycleCountsCheckBox_CheckedChanged);
@@ -555,29 +676,29 @@ namespace SourceGen.AppForms {
// configAsmGenLabel
//
this.configAsmGenLabel.AutoSize = true;
- this.configAsmGenLabel.Location = new System.Drawing.Point(7, 128);
+ this.configAsmGenLabel.Location = new System.Drawing.Point(3, 143);
this.configAsmGenLabel.Name = "configAsmGenLabel";
- this.configAsmGenLabel.Size = new System.Drawing.Size(154, 13);
- this.configAsmGenLabel.TabIndex = 52;
- this.configAsmGenLabel.Text = "Configure assembly generation:";
+ this.configAsmGenLabel.Size = new System.Drawing.Size(127, 13);
+ this.configAsmGenLabel.TabIndex = 1;
+ this.configAsmGenLabel.Text = "General code generation:";
//
// longLabelNewLineCheckBox
//
this.longLabelNewLineCheckBox.AutoSize = true;
- this.longLabelNewLineCheckBox.Location = new System.Drawing.Point(10, 193);
+ this.longLabelNewLineCheckBox.Location = new System.Drawing.Point(6, 185);
this.longLabelNewLineCheckBox.Name = "longLabelNewLineCheckBox";
this.longLabelNewLineCheckBox.Size = new System.Drawing.Size(173, 17);
- this.longLabelNewLineCheckBox.TabIndex = 51;
+ this.longLabelNewLineCheckBox.TabIndex = 3;
this.longLabelNewLineCheckBox.Text = "Put long labels on separate line";
this.longLabelNewLineCheckBox.UseVisualStyleBackColor = true;
//
// showAsmIdentCheckBox
//
this.showAsmIdentCheckBox.AutoSize = true;
- this.showAsmIdentCheckBox.Location = new System.Drawing.Point(10, 147);
+ this.showAsmIdentCheckBox.Location = new System.Drawing.Point(6, 208);
this.showAsmIdentCheckBox.Name = "showAsmIdentCheckBox";
this.showAsmIdentCheckBox.Size = new System.Drawing.Size(154, 17);
- this.showAsmIdentCheckBox.TabIndex = 10;
+ this.showAsmIdentCheckBox.TabIndex = 4;
this.showAsmIdentCheckBox.Text = "Identify assembler in output";
this.showAsmIdentCheckBox.UseVisualStyleBackColor = true;
this.showAsmIdentCheckBox.CheckedChanged += new System.EventHandler(this.showAsmIdentCheckBox_CheckedChanged);
@@ -585,99 +706,14 @@ namespace SourceGen.AppForms {
// disableLabelLocalizationCheckBox
//
this.disableLabelLocalizationCheckBox.AutoSize = true;
- this.disableLabelLocalizationCheckBox.Location = new System.Drawing.Point(10, 170);
+ this.disableLabelLocalizationCheckBox.Location = new System.Drawing.Point(6, 231);
this.disableLabelLocalizationCheckBox.Name = "disableLabelLocalizationCheckBox";
this.disableLabelLocalizationCheckBox.Size = new System.Drawing.Size(141, 17);
- this.disableLabelLocalizationCheckBox.TabIndex = 9;
+ this.disableLabelLocalizationCheckBox.TabIndex = 5;
this.disableLabelLocalizationCheckBox.Text = "Disable label localization";
this.disableLabelLocalizationCheckBox.UseVisualStyleBackColor = true;
this.disableLabelLocalizationCheckBox.CheckedChanged += new System.EventHandler(this.disableLabelLocalizationCheckBox_CheckedChanged);
//
- // clearMerlin32Button
- //
- this.clearMerlin32Button.Location = new System.Drawing.Point(531, 76);
- this.clearMerlin32Button.Name = "clearMerlin32Button";
- this.clearMerlin32Button.Size = new System.Drawing.Size(75, 23);
- this.clearMerlin32Button.TabIndex = 8;
- this.clearMerlin32Button.Text = "Clear";
- this.clearMerlin32Button.UseVisualStyleBackColor = true;
- this.clearMerlin32Button.Click += new System.EventHandler(this.clearMerlin32Button_Click);
- //
- // clearCc65Button
- //
- this.clearCc65Button.Location = new System.Drawing.Point(531, 35);
- this.clearCc65Button.Name = "clearCc65Button";
- this.clearCc65Button.Size = new System.Drawing.Size(75, 23);
- this.clearCc65Button.TabIndex = 4;
- this.clearCc65Button.Text = "Clear";
- this.clearCc65Button.UseVisualStyleBackColor = true;
- this.clearCc65Button.Click += new System.EventHandler(this.clearCc65Button_Click);
- //
- // browseMerlin32Button
- //
- this.browseMerlin32Button.Location = new System.Drawing.Point(450, 76);
- this.browseMerlin32Button.Name = "browseMerlin32Button";
- this.browseMerlin32Button.Size = new System.Drawing.Size(75, 23);
- this.browseMerlin32Button.TabIndex = 7;
- this.browseMerlin32Button.Text = "Browse...";
- this.browseMerlin32Button.UseVisualStyleBackColor = true;
- this.browseMerlin32Button.Click += new System.EventHandler(this.browseMerlin32Button_Click);
- //
- // browseCc65Button
- //
- this.browseCc65Button.Location = new System.Drawing.Point(450, 35);
- this.browseCc65Button.Name = "browseCc65Button";
- this.browseCc65Button.Size = new System.Drawing.Size(75, 23);
- this.browseCc65Button.TabIndex = 3;
- this.browseCc65Button.Text = "Browse...";
- this.browseCc65Button.UseVisualStyleBackColor = true;
- this.browseCc65Button.Click += new System.EventHandler(this.browseCc65Button_Click);
- //
- // cc65PathTextBox
- //
- this.cc65PathTextBox.Location = new System.Drawing.Point(65, 37);
- this.cc65PathTextBox.Name = "cc65PathTextBox";
- this.cc65PathTextBox.Size = new System.Drawing.Size(379, 20);
- this.cc65PathTextBox.TabIndex = 2;
- this.cc65PathTextBox.Text = "C:\\something";
- this.cc65PathTextBox.TextChanged += new System.EventHandler(this.cc65PathTextBox_TextChanged);
- //
- // merlin32PathTextBox
- //
- this.merlin32PathTextBox.Location = new System.Drawing.Point(65, 78);
- this.merlin32PathTextBox.Name = "merlin32PathTextBox";
- this.merlin32PathTextBox.Size = new System.Drawing.Size(379, 20);
- this.merlin32PathTextBox.TabIndex = 6;
- this.merlin32PathTextBox.Text = "C:\\something";
- this.merlin32PathTextBox.TextChanged += new System.EventHandler(this.merlin32PathTextBox_TextChanged);
- //
- // asmMerln32Label
- //
- this.asmMerln32Label.AutoSize = true;
- this.asmMerln32Label.Location = new System.Drawing.Point(6, 81);
- this.asmMerln32Label.Name = "asmMerln32Label";
- this.asmMerln32Label.Size = new System.Drawing.Size(53, 13);
- this.asmMerln32Label.TabIndex = 5;
- this.asmMerln32Label.Text = "Merlin 32:";
- //
- // asmCc65Label
- //
- this.asmCc65Label.AutoSize = true;
- this.asmCc65Label.Location = new System.Drawing.Point(25, 40);
- this.asmCc65Label.Name = "asmCc65Label";
- this.asmCc65Label.Size = new System.Drawing.Size(34, 13);
- this.asmCc65Label.TabIndex = 1;
- this.asmCc65Label.Text = "cc65:";
- //
- // asmExplanationLabel
- //
- this.asmExplanationLabel.AutoSize = true;
- this.asmExplanationLabel.Location = new System.Drawing.Point(7, 7);
- this.asmExplanationLabel.Name = "asmExplanationLabel";
- this.asmExplanationLabel.Size = new System.Drawing.Size(179, 13);
- this.asmExplanationLabel.TabIndex = 0;
- this.asmExplanationLabel.Text = "Configure installed cross-assemblers:";
- //
// displayFormatTabPage
//
this.displayFormatTabPage.Controls.Add(this.fmtExplanationLabel);
@@ -1450,6 +1486,8 @@ namespace SourceGen.AppForms {
this.columnVisGroup.ResumeLayout(false);
this.asmConfigTabPage.ResumeLayout(false);
this.asmConfigTabPage.PerformLayout();
+ this.configureAsmGroupBox.ResumeLayout(false);
+ this.configureAsmGroupBox.PerformLayout();
this.displayFormatTabPage.ResumeLayout(false);
this.displayFormatTabPage.PerformLayout();
this.quickDisplayFormatGroup.ResumeLayout(false);
@@ -1526,13 +1564,8 @@ namespace SourceGen.AppForms {
private System.Windows.Forms.Label strReverseHiLabel;
private System.Windows.Forms.TextBox strReverseTextBox;
private System.Windows.Forms.Label strReverseLabel;
- private System.Windows.Forms.Label asmExplanationLabel;
- private System.Windows.Forms.TextBox cc65PathTextBox;
- private System.Windows.Forms.TextBox merlin32PathTextBox;
- private System.Windows.Forms.Label asmMerln32Label;
- private System.Windows.Forms.Label asmCc65Label;
- private System.Windows.Forms.Button browseMerlin32Button;
- private System.Windows.Forms.Button browseCc65Button;
+ private System.Windows.Forms.TextBox asmExePathTextBox;
+ private System.Windows.Forms.Button asmExeBrowseButton;
private System.Windows.Forms.GroupBox codeViewFontGroupBox;
private System.Windows.Forms.Label currentFontLabel;
private System.Windows.Forms.Button selectFontButton;
@@ -1550,8 +1583,6 @@ namespace SourceGen.AppForms {
private System.Windows.Forms.CheckBox upperSCheckBox;
private System.Windows.Forms.CheckBox upperACheckBox;
private System.Windows.Forms.CheckBox upperPseudoOpCheckBox;
- private System.Windows.Forms.Button clearMerlin32Button;
- private System.Windows.Forms.Button clearCc65Button;
private System.Windows.Forms.CheckBox disableLabelLocalizationCheckBox;
private System.Windows.Forms.CheckBox enableDebugCheckBox;
private System.Windows.Forms.CheckBox showAsmIdentCheckBox;
@@ -1579,5 +1610,15 @@ namespace SourceGen.AppForms {
private System.Windows.Forms.GroupBox clipboardGroupBox;
private System.Windows.Forms.ComboBox clipboardFormatComboBox;
private System.Windows.Forms.Label clipboardFormatLabel;
+ private System.Windows.Forms.ComboBox asmConfigComboBox;
+ private System.Windows.Forms.GroupBox configureAsmGroupBox;
+ private System.Windows.Forms.Label asmExeLabel;
+ private System.Windows.Forms.Label asmColWidthLabel;
+ private System.Windows.Forms.TextBox asmCommentColWidthTextBox;
+ private System.Windows.Forms.TextBox asmOperandColWidthTextBox;
+ private System.Windows.Forms.TextBox asmOpcodeColWidthTextBox;
+ private System.Windows.Forms.TextBox asmLabelColWidthTextBox;
+ private System.Windows.Forms.Label asmConfigAssemblerLabel;
+ private System.Windows.Forms.Label asmColWidthIdLabel;
}
}
\ No newline at end of file
diff --git a/SourceGen/AppForms/EditAppSettings.cs b/SourceGen/AppForms/EditAppSettings.cs
index e2ec8b7..f54b164 100644
--- a/SourceGen/AppForms/EditAppSettings.cs
+++ b/SourceGen/AppForms/EditAppSettings.cs
@@ -21,6 +21,9 @@ using System.Reflection;
using System.Text;
using System.Windows.Forms;
+using AssemblerInfo = SourceGen.AsmGen.AssemblerInfo;
+using AssemblerConfig = SourceGen.AsmGen.AssemblerConfig;
+
namespace SourceGen.AppForms {
public partial class EditAppSettings : Form {
///
@@ -28,9 +31,9 @@ namespace SourceGen.AppForms {
///
public enum Tab {
Unknown = -1,
- CodeList = 0,
- Assembler = 1,
- AsmFormat = 2,
+ CodeView = 0,
+ AsmConfig = 1,
+ DisplayFOrmat = 2,
PseudoOp = 3
}
@@ -57,12 +60,19 @@ namespace SourceGen.AppForms {
///
private Tab mInitialTab;
+ ///
+ /// Assembler to initially select in combo boxes.
+ ///
+ private AssemblerInfo.Id mInitialAsmId;
+
// Map buttons to column show/hide buttons.
private const int NUM_COLUMNS = ProjectView.CodeListColumnWidths.NUM_COLUMNS;
private string[] mColumnFormats = new string[NUM_COLUMNS];
private Button[] mColButtons;
- // Map pseudo-op text entry fields to PseudoOpName properties.
+ ///
+ /// Map pseudo-op text entry fields to PseudoOpName properties.
+ ///
private struct TextBoxPropertyMap {
public TextBox TextBox { get; private set; }
public PropertyInfo PropInfo { get; private set; }
@@ -74,24 +84,42 @@ namespace SourceGen.AppForms {
}
private TextBoxPropertyMap[] mPseudoNameMap;
+ ///
+ /// Holds an item for the assembler-selection combox box.
+ ///
+ private class AsmComboItem {
+ // Enumerated ID.
+ public AssemblerInfo.Id AssemblerId { get; private set; }
- public EditAppSettings(ProjectView projectView, Tab initialTab) {
+ // Human-readable name.
+ public string Name { get; private set; }
+
+ public AsmComboItem(AssemblerInfo info) {
+ AssemblerId = info.AssemblerId;
+ Name = info.Name;
+ }
+ }
+
+
+ public EditAppSettings(ProjectView projectView, Tab initialTab,
+ AssemblerInfo.Id initialAsmId) {
InitializeComponent();
mProjectView = projectView;
mInitialTab = initialTab;
+ mInitialAsmId = initialAsmId;
// Make a work copy, so we can discard changes if the user cancels out of the dialog.
projectView.SerializeCodeListColumnWidths();
mSettings = AppSettings.Global.GetCopy();
- // Put buttons in an array.
+ // Put column-width buttons in an array.
mColButtons = new Button[] {
showCol0, showCol1, showCol2, showCol3, showCol4,
showCol5, showCol6, showCol7, showCol8 };
Debug.Assert(NUM_COLUMNS == 9);
- // Extract formats from button labels.
+ // Extract formats from column-width button labels.
for (int i = 0; i < NUM_COLUMNS; i++) {
mColButtons[i].Click += ColumnVisibilityButtonClick;
mColumnFormats[i] = mColButtons[i].Text;
@@ -122,6 +150,31 @@ namespace SourceGen.AppForms {
new TextBoxPropertyMap(strDciTextBox, "StrDci"),
new TextBoxPropertyMap(strDciHiTextBox, "StrDciHi"),
};
+
+ ConfigureComboBox(asmConfigComboBox);
+ }
+
+ private void ConfigureComboBox(ComboBox cb) {
+ // Show the Name field.
+ cb.DisplayMember = "Name";
+
+
+ cb.Items.Clear();
+ IEnumerator iter = AssemblerInfo.GetInfoEnumerator();
+ bool foundMatch = false;
+ while (iter.MoveNext()) {
+ AssemblerInfo info = iter.Current;
+ AsmComboItem item = new AsmComboItem(info);
+ cb.Items.Add(item);
+ if (item.AssemblerId == mInitialAsmId) {
+ cb.SelectedItem = item;
+ foundMatch = true;
+ }
+ }
+ if (!foundMatch) {
+ // Need to do this or box will show empty.
+ cb.SelectedIndex = 0;
+ }
}
private void EditAppSettings_Load(object sender, EventArgs e) {
@@ -158,10 +211,7 @@ namespace SourceGen.AppForms {
enableDebugCheckBox.Checked = mSettings.GetBool(AppSettings.DEBUG_MENU_ENABLED, false);
// Assemblers.
- cc65PathTextBox.Text =
- mSettings.GetString(AppSettings.ASM_CC65_EXECUTABLE, string.Empty);
- merlin32PathTextBox.Text =
- mSettings.GetString(AppSettings.ASM_MERLIN32_EXECUTABLE, string.Empty);
+ PopulateAsmConfigItems();
showAsmIdentCheckBox.Checked =
mSettings.GetBool(AppSettings.SRCGEN_ADD_IDENT_COMMENT, false);
disableLabelLocalizationCheckBox.Checked =
@@ -202,9 +252,6 @@ namespace SourceGen.AppForms {
///
private void UpdateControls() {
applyButton.Enabled = mDirty;
-
- clearMerlin32Button.Enabled = !string.IsNullOrEmpty(merlin32PathTextBox.Text);
- clearCc65Button.Enabled = !string.IsNullOrEmpty(cc65PathTextBox.Text);
}
///
@@ -358,41 +405,77 @@ namespace SourceGen.AppForms {
#region Asm Config
- private void browseCc65Button_Click(object sender, EventArgs e) {
- string pathName = BrowseForExecutable("cc65 CL", "cl65.exe");
+ ///
+ /// Populates the UI elements from the asm config item in the settings. If that doesn't
+ /// exist, use the default config.
+ ///
+ private void PopulateAsmConfigItems() {
+ AsmComboItem item = (AsmComboItem) asmConfigComboBox.SelectedItem;
+ AssemblerInfo.Id asmId = item.AssemblerId;
+
+ AssemblerConfig config = AssemblerConfig.GetConfig(mSettings, asmId);
+ if (config == null) {
+ AsmGen.IAssembler asm = AssemblerInfo.GetAssembler(asmId);
+ config = asm.GetDefaultConfig();
+ }
+
+ asmExePathTextBox.Text = config.ExecutablePath;
+ asmLabelColWidthTextBox.Text = config.ColumnWidths[0].ToString();
+ asmOpcodeColWidthTextBox.Text = config.ColumnWidths[1].ToString();
+ asmOperandColWidthTextBox.Text = config.ColumnWidths[2].ToString();
+ asmCommentColWidthTextBox.Text = config.ColumnWidths[3].ToString();
+ }
+
+ private AssemblerConfig GetAsmConfigFromUi() {
+ int[] widths = new int[4];
+ for (int i = 0; i < widths.Length; i++) {
+ widths[i] = 1; // minimum width for all fields is 1
+ }
+
+ int result;
+ if (int.TryParse(asmLabelColWidthTextBox.Text, out result) && result > 0) {
+ widths[0] = result;
+ }
+ if (int.TryParse(asmOpcodeColWidthTextBox.Text, out result) && result > 0) {
+ widths[1] = result;
+ }
+ if (int.TryParse(asmOperandColWidthTextBox.Text, out result) && result > 0) {
+ widths[2] = result;
+ }
+ if (int.TryParse(asmCommentColWidthTextBox.Text, out result) && result > 0) {
+ widths[3] = result;
+ }
+
+ return new AssemblerConfig(asmExePathTextBox.Text, widths);
+ }
+
+ private void asmConfigComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+ PopulateAsmConfigItems();
+ }
+
+ private void asmExeBrowseButton_Click(object sender, EventArgs e) {
+ AsmComboItem item = (AsmComboItem)asmConfigComboBox.SelectedItem;
+ AssemblerInfo.Id asmId = item.AssemblerId;
+
+ // Figure out what we're looking for. For example, cc65 needs "cl65".
+ AsmGen.IAssembler asm = AssemblerInfo.GetAssembler(asmId);
+ asm.GetExeIdentifiers(out string humanName, out string exeName);
+
+ // Ask the user to find it.
+ string pathName = BrowseForExecutable(humanName, exeName);
if (pathName != null) {
- cc65PathTextBox.Text = pathName;
- mSettings.SetString(AppSettings.ASM_CC65_EXECUTABLE, pathName);
+ asmExePathTextBox.Text = pathName;
+ AssemblerConfig.SetConfig(mSettings, asmId, GetAsmConfigFromUi());
+ SetDirty(true);
}
}
- private void cc65PathTextBox_TextChanged(object sender, EventArgs e) {
- mSettings.SetString(AppSettings.ASM_CC65_EXECUTABLE, cc65PathTextBox.Text);
- SetDirty(true);
- }
-
- private void clearCc65Button_Click(object sender, EventArgs e) {
- cc65PathTextBox.Text = string.Empty;
- mSettings.SetString(AppSettings.ASM_CC65_EXECUTABLE, null);
- SetDirty(true);
- }
-
- private void browseMerlin32Button_Click(object sender, EventArgs e) {
- string pathName = BrowseForExecutable("Merlin Assembler", "Merlin32.exe");
- if (pathName != null) {
- merlin32PathTextBox.Text = pathName;
- mSettings.SetString(AppSettings.ASM_MERLIN32_EXECUTABLE, pathName);
- }
- }
-
- private void clearMerlin32Button_Click(object sender, EventArgs e) {
- merlin32PathTextBox.Text = string.Empty;
- mSettings.SetString(AppSettings.ASM_MERLIN32_EXECUTABLE, null);
- SetDirty(true);
- }
-
- private void merlin32PathTextBox_TextChanged(object sender, EventArgs e) {
- mSettings.SetString(AppSettings.ASM_MERLIN32_EXECUTABLE, merlin32PathTextBox.Text);
+ ///
+ /// Handles a text-changed event in the executable and column width text boxes.
+ ///
+ private void AsmConfig_TextChanged(object sender, EventArgs e) {
+ AsmComboItem item = (AsmComboItem)asmConfigComboBox.SelectedItem;
+ AssemblerConfig.SetConfig(mSettings, item.AssemblerId, GetAsmConfigFromUi());
SetDirty(true);
}
@@ -405,19 +488,34 @@ namespace SourceGen.AppForms {
private string BrowseForExecutable(string prefix, string name) {
string pathName = null;
+ if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
+ name += ".exe";
+ }
+
OpenFileDialog dlg = new OpenFileDialog();
dlg.FileName = name;
dlg.Filter = prefix + "|" + name;
dlg.RestoreDirectory = true;
if (dlg.ShowDialog() != DialogResult.Cancel) {
pathName = dlg.FileName;
- SetDirty(true);
}
dlg.Dispose();
return pathName;
}
+ private void showCycleCountsCheckBox_CheckedChanged(object sender, EventArgs e) {
+ mSettings.SetBool(AppSettings.SRCGEN_SHOW_CYCLE_COUNTS,
+ showCycleCountsCheckBox.Checked);
+ SetDirty(true);
+ }
+
+ private void longLabelNewLineCheckBox_CheckedChanged(object sender, EventArgs e) {
+ mSettings.SetBool(AppSettings.SRCGEN_LONG_LABEL_NEW_LINE,
+ longLabelNewLineCheckBox.Checked);
+ SetDirty(true);
+ }
+
private void showAsmIdentCheckBox_CheckedChanged(object sender, EventArgs e) {
mSettings.SetBool(AppSettings.SRCGEN_ADD_IDENT_COMMENT, showAsmIdentCheckBox.Checked);
SetDirty(true);
@@ -429,18 +527,6 @@ namespace SourceGen.AppForms {
SetDirty(true);
}
- private void longLabelNewLineCheckBox_CheckedChanged(object sender, EventArgs e) {
- mSettings.SetBool(AppSettings.SRCGEN_LONG_LABEL_NEW_LINE,
- longLabelNewLineCheckBox.Checked);
- SetDirty(true);
- }
-
- private void showCycleCountsCheckBox_CheckedChanged(object sender, EventArgs e) {
- mSettings.SetBool(AppSettings.SRCGEN_SHOW_CYCLE_COUNTS,
- showCycleCountsCheckBox.Checked);
- SetDirty(true);
- }
-
#endregion Asm Config
diff --git a/SourceGen/AppForms/ProjectView.cs b/SourceGen/AppForms/ProjectView.cs
index 93d07f6..93df22a 100644
--- a/SourceGen/AppForms/ProjectView.cs
+++ b/SourceGen/AppForms/ProjectView.cs
@@ -1936,15 +1936,16 @@ namespace SourceGen.AppForms {
// Edit > Settings...
private void settingsToolStripMenuItem_Click(object sender, EventArgs e) {
- ShowAppSettings(EditAppSettings.Tab.Unknown);
+ ShowAppSettings(EditAppSettings.Tab.Unknown, AsmGen.AssemblerInfo.Id.Unknown);
}
///
/// Opens the app settings dialog.
///
/// Tab to present to the user.
- public void ShowAppSettings(EditAppSettings.Tab initialTab) {
- EditAppSettings dlg = new EditAppSettings(this, initialTab);
+ public void ShowAppSettings(EditAppSettings.Tab initialTab,
+ AsmGen.AssemblerInfo.Id initialAsmId) {
+ EditAppSettings dlg = new EditAppSettings(this, initialTab, initialAsmId);
dlg.ShowDialog();
dlg.Dispose();
}
diff --git a/SourceGen/AppSettings.cs b/SourceGen/AppSettings.cs
index 2bcd140..656006d 100644
--- a/SourceGen/AppSettings.cs
+++ b/SourceGen/AppSettings.cs
@@ -108,11 +108,8 @@ namespace SourceGen {
// Main project view settings.
public const string PRVW_RECENT_PROJECT_LIST = "prvw-recent-project-list";
- // cc65 assembler settings
- public const string ASM_CC65_EXECUTABLE = "asm-cc65-executable";
-
- // Merlin 32 assembler settings.
- public const string ASM_MERLIN32_EXECUTABLE = "asm-merlin32-executable";
+ // Assembler settings prefix
+ public const string ASM_CONFIG_PREFIX = "asm-config-";
// Internal debugging features.
public const string DEBUG_MENU_ENABLED = "debug-menu-enabled";
diff --git a/SourceGen/AsmGen/AsmCc65.cs b/SourceGen/AsmGen/AsmCc65.cs
index 90aafaf..ce72463 100644
--- a/SourceGen/AsmGen/AsmCc65.cs
+++ b/SourceGen/AsmGen/AsmCc65.cs
@@ -661,16 +661,27 @@ namespace SourceGen.AsmGen {
private string WorkDirectory { get; set; }
+ // IAssembler
+ public void GetExeIdentifiers(out string humanName, out string exeName) {
+ humanName = "cc65 CL";
+ exeName = "cl65";
+ }
+
+ // IAssembler
+ public AssemblerConfig GetDefaultConfig() {
+ return new AssemblerConfig(string.Empty, new int[] { 9, 8, 11, 72 });
+ }
// IAssembler
public AssemblerVersion QueryVersion() {
- string exe = AppSettings.Global.GetString(AppSettings.ASM_CC65_EXECUTABLE, null);
- if (string.IsNullOrEmpty(exe)) {
+ AssemblerConfig config =
+ AssemblerConfig.GetConfig(AppSettings.Global, AssemblerInfo.Id.Cc65);
+ if (config == null || string.IsNullOrEmpty(config.ExecutablePath)) {
return null;
}
- ShellCommand cmd = new ShellCommand(exe, "--version",
- System.IO.Directory.GetCurrentDirectory(), null);
+ ShellCommand cmd = new ShellCommand(config.ExecutablePath, "--version",
+ Directory.GetCurrentDirectory(), null);
cmd.Execute();
if (string.IsNullOrEmpty(cmd.Stdout)) {
return null;
@@ -721,25 +732,16 @@ namespace SourceGen.AsmGen {
Debug.WriteLine("NOTE: source file is not in work directory");
}
- //string home = AppSettings.Global.GetString(AppSettings.ASM_CC65_HOME, null);
- //string cl65 = AppSettings.Global.GetString(AppSettings.ASM_CC65_EXECUTABLE, null);
- //Debug.Assert(!string.IsNullOrEmpty(cl65));
- //Debug.Assert(!string.IsNullOrEmpty(home));
-
- //Dictionary envVars = new Dictionary(1);
- //envVars.Add("CC65_HOME", home);
-
- //string exePath = Path.Combine(home, cl65);
-
- string cl65 = AppSettings.Global.GetString(AppSettings.ASM_CC65_EXECUTABLE, null);
- if (string.IsNullOrEmpty(cl65)) {
+ AssemblerConfig config =
+ AssemblerConfig.GetConfig(AppSettings.Global, AssemblerInfo.Id.Cc65);
+ if (string.IsNullOrEmpty(config.ExecutablePath)) {
Debug.WriteLine("Assembler not configured");
return null;
}
// Wrap pathname in quotes in case it has spaces.
// (Do we need to shell-escape quotes in the pathName?)
- ShellCommand cmd = new ShellCommand(cl65,
+ ShellCommand cmd = new ShellCommand(config.ExecutablePath,
"--target none \"" + pathName + "\"", WorkDirectory, null);
cmd.Execute();
diff --git a/SourceGen/AsmGen/AsmMerlin32.cs b/SourceGen/AsmGen/AsmMerlin32.cs
index 011a4e0..8da9e7e 100644
--- a/SourceGen/AsmGen/AsmMerlin32.cs
+++ b/SourceGen/AsmGen/AsmMerlin32.cs
@@ -609,15 +609,27 @@ namespace SourceGen.AsmGen {
private string WorkDirectory { get; set; }
+ // IAssembler
+ public void GetExeIdentifiers(out string humanName, out string exeName) {
+ humanName = "Merlin Assembler";
+ exeName = "Merlin32";
+ }
+
+ // IAssembler
+ public AssemblerConfig GetDefaultConfig() {
+ return new AssemblerConfig(string.Empty, new int[] { 9, 6, 11, 74 });
+ }
+
// IAssembler
public AssemblerVersion QueryVersion() {
- string exe = AppSettings.Global.GetString(AppSettings.ASM_MERLIN32_EXECUTABLE, null);
- if (string.IsNullOrEmpty(exe)) {
+ AssemblerConfig config =
+ AssemblerConfig.GetConfig(AppSettings.Global, AssemblerInfo.Id.Merlin32);
+ if (config == null || string.IsNullOrEmpty(config.ExecutablePath)) {
return null;
}
- ShellCommand cmd = new ShellCommand(exe, string.Empty,
- System.IO.Directory.GetCurrentDirectory(), null);
+ ShellCommand cmd = new ShellCommand(config.ExecutablePath, string.Empty,
+ Directory.GetCurrentDirectory(), null);
cmd.Execute();
if (string.IsNullOrEmpty(cmd.Stdout)) {
return null;
@@ -667,15 +679,16 @@ namespace SourceGen.AsmGen {
Debug.WriteLine("NOTE: source file is not in work directory");
}
- string exe = AppSettings.Global.GetString(AppSettings.ASM_MERLIN32_EXECUTABLE, null);
- if (string.IsNullOrEmpty(exe)) {
+ AssemblerConfig config =
+ AssemblerConfig.GetConfig(AppSettings.Global, AssemblerInfo.Id.Merlin32);
+ if (string.IsNullOrEmpty(config.ExecutablePath)) {
Debug.WriteLine("Assembler not configured");
return null;
}
// Wrap pathname in quotes in case it has spaces.
// (Do we need to shell-escape quotes in the pathName?)
- ShellCommand cmd = new ShellCommand(exe, ". \"" + pathName + "\"",
+ ShellCommand cmd = new ShellCommand(config.ExecutablePath, ". \"" + pathName + "\"",
WorkDirectory, null);
cmd.Execute();
diff --git a/SourceGen/AsmGen/AssemblerConfig.cs b/SourceGen/AsmGen/AssemblerConfig.cs
new file mode 100644
index 0000000..8c38725
--- /dev/null
+++ b/SourceGen/AsmGen/AssemblerConfig.cs
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2018 faddenSoft
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Text;
+using System.Web.Script.Serialization;
+
+namespace SourceGen.AsmGen {
+ ///
+ /// Assembler configuration holder. Serializes and deserializes information held in
+ /// application settings.
+ ///
+ public class AssemblerConfig {
+ // Fields are deserialized from JSON. Changing the names will break compatibility.
+
+ ///
+ /// Path to cross-assembler executable. Will be null or empty if this assembler
+ /// is not configured.
+ ///
+ public string ExecutablePath { get; set; }
+
+ ///
+ /// Column display widths.
+ ///
+ public int[] ColumnWidths { get; set; }
+
+ public const int NUM_COLUMNS = 4; // label, opcode, operand, comment
+
+
+ ///
+ /// Nullary constructor, for serialization.
+ ///
+ public AssemblerConfig() { }
+
+ ///
+ /// Constructor.
+ ///
+ /// Path to executable. May be empty.
+ /// Column widths.
+ public AssemblerConfig(string exePath, int[] widths) {
+ if (exePath == null) {
+ throw new Exception("Bad exe path");
+ }
+ if (widths.Length != NUM_COLUMNS) {
+ throw new Exception("Bad widths.Length " + widths.Length);
+ }
+ ExecutablePath = exePath;
+ ColumnWidths = widths;
+ }
+
+ private static string GetSettingName(AssemblerInfo.Id id) {
+ return AppSettings.ASM_CONFIG_PREFIX + id.ToString();
+ }
+
+ ///
+ /// Creates a populated AssemblerConfig from the app settings for the specified ID.
+ ///
+ /// Settings object to pull the values from.
+ /// Assembler ID.
+ /// The AssemblerConfig, or null if not configured.
+ public static AssemblerConfig GetConfig(AppSettings settings, AssemblerInfo.Id id) {
+ string cereal = settings.GetString(GetSettingName(id), null);
+ if (string.IsNullOrEmpty(cereal)) {
+ return null;
+ }
+
+ JavaScriptSerializer ser = new JavaScriptSerializer();
+ try {
+ AssemblerConfig config = ser.Deserialize(cereal);
+ if (config.ColumnWidths == null || config.ColumnWidths.Length != NUM_COLUMNS) {
+ throw new Exception("Bad column widths");
+ }
+ if (config.ExecutablePath == null) {
+ throw new Exception("Missing exe path");
+ }
+ return config;
+ } catch (Exception ex) {
+ Debug.WriteLine("AssemblerConfig deserialization failed: " + ex.Message);
+ return null;
+ }
+ }
+
+ ///
+ /// Updates the assembler settings for the specified ID.
+ ///
+ /// Settings object to update.
+ /// Assembler ID.
+ /// Asm configuration.
+ public static void SetConfig(AppSettings settings, AssemblerInfo.Id id,
+ AssemblerConfig config) {
+ JavaScriptSerializer ser = new JavaScriptSerializer();
+ string cereal = ser.Serialize(config);
+
+ settings.SetString(GetSettingName(id), cereal);
+ }
+ }
+}
diff --git a/SourceGen/AsmGen/GenAndAsm.cs b/SourceGen/AsmGen/GenAndAsm.cs
index e244334..020f4f2 100644
--- a/SourceGen/AsmGen/GenAndAsm.cs
+++ b/SourceGen/AsmGen/GenAndAsm.cs
@@ -221,22 +221,12 @@ namespace SourceGen.AsmGen {
}
///
- /// Returns true if the selected assembler has been configured.
+ /// Returns true if the selected cross-assembler executable has been configured.
///
private bool IsAssemblerConfigured() {
- string settingStr;
- switch (mSelectedAssemblerId) {
- case AssemblerInfo.Id.Cc65:
- settingStr = AppSettings.ASM_CC65_EXECUTABLE;
- break;
- case AssemblerInfo.Id.Merlin32:
- settingStr = AppSettings.ASM_MERLIN32_EXECUTABLE;
- break;
- default:
- Debug.Assert(false);
- return false;
- }
- return !string.IsNullOrEmpty(AppSettings.Global.GetString(settingStr, null));
+ AssemblerConfig config =
+ AssemblerConfig.GetConfig(AppSettings.Global, mSelectedAssemblerId);
+ return !string.IsNullOrEmpty(config.ExecutablePath);
}
private void assemblerSettingsButton_Click(object sender, EventArgs e) {
@@ -254,7 +244,8 @@ namespace SourceGen.AsmGen {
///
private void DoSettings() {
// Pop open the app settings dialog, with the appropriate tab selected.
- mProjView.ShowAppSettings(AppForms.EditAppSettings.Tab.Assembler);
+ mProjView.ShowAppSettings(AppForms.EditAppSettings.Tab.AsmConfig,
+ mSelectedAssemblerId);
// Update the controls based on whether or not the assembler is now available.
UpdateAssemblerControls();
diff --git a/SourceGen/AsmGen/IAssembler.cs b/SourceGen/AsmGen/IAssembler.cs
index d884b8b..2de7a84 100644
--- a/SourceGen/AsmGen/IAssembler.cs
+++ b/SourceGen/AsmGen/IAssembler.cs
@@ -22,6 +22,20 @@ namespace SourceGen.AsmGen {
/// Common interface for executing assemblers.
///
public interface IAssembler {
+ ///
+ /// Gets identification strings for the executable. These are used when browsing for
+ /// the assembler binary.
+ ///
+ /// Human-readable name to show in the "open" dialog.
+ /// Name of executable to find, without ".exe".
+ void GetExeIdentifiers(out string humanName, out string exeName);
+
+ ///
+ /// Queries the assembler for its default configuration.
+ ///
+ /// Config object with default values.
+ AssemblerConfig GetDefaultConfig();
+
///
/// Queries the assembler for its version.
///
diff --git a/SourceGen/SourceGen.csproj b/SourceGen/SourceGen.csproj
index ca6b5a1..612296c 100644
--- a/SourceGen/SourceGen.csproj
+++ b/SourceGen/SourceGen.csproj
@@ -98,6 +98,7 @@
+
Form