From 5b1dde290a01423833cfafbf38088037c511eb9b Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sat, 3 Nov 2018 14:02:52 -0700 Subject: [PATCH] Show assembler options in header comment --- SourceGen/AsmGen/AsmCc65.cs | 6 ++++-- SourceGen/AsmGen/AsmMerlin32.cs | 4 +++- SourceGen/AsmGen/AsmTass64.cs | 7 ++++--- SourceGen/Properties/Resources.Designer.cs | 2 +- SourceGen/Properties/Resources.resx | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/SourceGen/AsmGen/AsmCc65.cs b/SourceGen/AsmGen/AsmCc65.cs index bd4f3b1..751e7bc 100644 --- a/SourceGen/AsmGen/AsmCc65.cs +++ b/SourceGen/AsmGen/AsmCc65.cs @@ -232,7 +232,7 @@ namespace SourceGen.AsmGen { // Currently generating code for v2.17. OutputLine(SourceFormatter.FullLineCommentDelimiter + string.Format(Properties.Resources.GENERATED_FOR_VERSION, - "cc65", V2_17)); + "cc65", V2_17, AsmCc65.OPTIONS)); } GenCommon.Generate(this, sw, worker); @@ -700,6 +700,8 @@ namespace SourceGen.AsmGen { /// Cross-assembler execution interface. /// public class AsmCc65 : IAssembler { + public const string OPTIONS = "--target none"; + // Paths from generator. private List mPathNames; @@ -790,7 +792,7 @@ namespace SourceGen.AsmGen { // Wrap pathname in quotes in case it has spaces. // (Do we need to shell-escape quotes in the pathName?) ShellCommand cmd = new ShellCommand(config.ExecutablePath, - "--target none \"" + pathName + "\"", mWorkDirectory, null); + OPTIONS + " \"" + pathName + "\"", mWorkDirectory, null); cmd.Execute(); // Can't really do anything with a "cancel" request. diff --git a/SourceGen/AsmGen/AsmMerlin32.cs b/SourceGen/AsmGen/AsmMerlin32.cs index 9464d3f..d9475fc 100644 --- a/SourceGen/AsmGen/AsmMerlin32.cs +++ b/SourceGen/AsmGen/AsmMerlin32.cs @@ -225,7 +225,7 @@ namespace SourceGen.AsmGen { // No version-specific stuff yet. We're generating code for v1.0. OutputLine(SourceFormatter.FullLineCommentDelimiter + string.Format(Properties.Resources.GENERATED_FOR_VERSION, - "Merlin 32", new CommonUtil.Version(1, 0))); + "Merlin 32", new CommonUtil.Version(1, 0), string.Empty)); } GenCommon.Generate(this, sw, worker); @@ -768,6 +768,8 @@ namespace SourceGen.AsmGen { // Wrap pathname in quotes in case it has spaces. // (Do we need to shell-escape quotes in the pathName?) + // + // Merlin 32 has no options. The second argument is the macro include file path. ShellCommand cmd = new ShellCommand(config.ExecutablePath, ". \"" + pathName + "\"", mWorkDirectory, null); cmd.Execute(); diff --git a/SourceGen/AsmGen/AsmTass64.cs b/SourceGen/AsmGen/AsmTass64.cs index df1a2d3..f5365e4 100644 --- a/SourceGen/AsmGen/AsmTass64.cs +++ b/SourceGen/AsmGen/AsmTass64.cs @@ -219,7 +219,7 @@ namespace SourceGen.AsmGen { if (Settings.GetBool(AppSettings.SRCGEN_ADD_IDENT_COMMENT, false)) { OutputLine(SourceFormatter.FullLineCommentDelimiter + string.Format(Properties.Resources.GENERATED_FOR_VERSION, - "64tass", V1_53)); + "64tass", V1_53, AsmTass64.OPTIONS)); } GenCommon.Generate(this, sw, worker); @@ -670,6 +670,8 @@ namespace SourceGen.AsmGen { /// Cross-assembler execution interface. /// public class AsmTass64 : IAssembler { + public const string OPTIONS = "--case-sensitive --nostart --long-address -Wall"; + // Paths from generator. private List mPathNames; @@ -756,13 +758,12 @@ namespace SourceGen.AsmGen { worker.ReportProgress(0, Properties.Resources.PROGRESS_ASSEMBLING); - string options = "--case-sensitive --nostart --long-address -Wall"; string outFileName = pathName.Substring(0, pathName.Length - 2); // Wrap pathname in quotes in case it has spaces. // (Do we need to shell-escape quotes in the pathName?) ShellCommand cmd = new ShellCommand(config.ExecutablePath, - options + " \"" + pathName + "\"" + " -o \"" + outFileName + "\"", + OPTIONS + " \"" + pathName + "\"" + " -o \"" + outFileName + "\"", mWorkDirectory, null); cmd.Execute(); diff --git a/SourceGen/Properties/Resources.Designer.cs b/SourceGen/Properties/Resources.Designer.cs index fb46157..bbfc6ff 100644 --- a/SourceGen/Properties/Resources.Designer.cs +++ b/SourceGen/Properties/Resources.Designer.cs @@ -529,7 +529,7 @@ namespace SourceGen.Properties { } /// - /// Looks up a localized string similar to Target assembler: {0} v{1}. + /// Looks up a localized string similar to Target assembler: {0} v{1} [{2}]. /// internal static string GENERATED_FOR_VERSION { get { diff --git a/SourceGen/Properties/Resources.resx b/SourceGen/Properties/Resources.resx index 87ee568..c499c0c 100644 --- a/SourceGen/Properties/Resources.resx +++ b/SourceGen/Properties/Resources.resx @@ -274,7 +274,7 @@ Target assembler: {0} (latest) - Target assembler: {0} v{1} + Target assembler: {0} v{1} [{2}] Hide