diff --git a/SourceGen/AsmGen/AsmMerlin32.cs b/SourceGen/AsmGen/AsmMerlin32.cs index ad539d2..098368a 100644 --- a/SourceGen/AsmGen/AsmMerlin32.cs +++ b/SourceGen/AsmGen/AsmMerlin32.cs @@ -51,6 +51,11 @@ namespace SourceGen.AsmGen { // IGenerator public int StartOffset { get { return 0; } } + /// + /// List of binary include sections found in the project. + /// + private List mBinaryIncludes = new List(); + /// /// Working directory, i.e. where we write our output file(s). /// @@ -133,7 +138,7 @@ namespace SourceGen.AsmGen { { "Uninit", "ds" }, //Junk //Align - //BinaryInclude + { "BinaryInclude", "putbin" }, { "StrGeneric", "asc" }, { "StrReverse", "rev" }, //StrNullTerm @@ -244,8 +249,7 @@ namespace SourceGen.AsmGen { } mOutStream = null; - return new GenerationResults(pathNames, string.Empty, - new List()); + return new GenerationResults(pathNames, string.Empty, mBinaryIncludes); } // IGenerator @@ -318,7 +322,6 @@ namespace SourceGen.AsmGen { break; case FormatDescriptor.Type.Uninit: case FormatDescriptor.Type.Junk: - case FormatDescriptor.Type.BinaryInclude: // not supported, gen minimal output int fillVal = Helper.CheckRangeHoldsSingleValue(data, offset, length); if (fillVal >= 0) { opcodeStr = sDataOpNames.Fill; @@ -350,6 +353,12 @@ namespace SourceGen.AsmGen { OutputDenseHex(offset, length, labelStr, commentStr); } break; + case FormatDescriptor.Type.BinaryInclude: + opcodeStr = sDataOpNames.BinaryInclude; + string biPath = BinaryInclude.ConvertPathNameFromStorage(dfd.Extra); + operandStr = biPath; // no quotes + mBinaryIncludes.Add(new BinaryInclude.Excision(offset, length, biPath)); + break; case FormatDescriptor.Type.StringGeneric: case FormatDescriptor.Type.StringReverse: case FormatDescriptor.Type.StringNullTerm: diff --git a/SourceGen/SGTestData/Expected/20300-binary-include_merlin32.S b/SourceGen/SGTestData/Expected/20300-binary-include_merlin32.S index 8fc6ec0..7b4da6f 100644 --- a/SourceGen/SGTestData/Expected/20300-binary-include_merlin32.S +++ b/SourceGen/SGTestData/Expected/20300-binary-include_merlin32.S @@ -9,9 +9,8 @@ L1000 ldy #$28 lda done-1 jmp done -:L1017 hex 20212223242526272829303132333435363738394142434445464748494a5051 - hex 5253545556575859 -:L103F ds 32,$ff +:L1017 putbin 20300-1.bin +:L103F putbin 20300sub/20300-2.bin done rts