diff --git a/SourceGen/AsmGen/AsmCc65.cs b/SourceGen/AsmGen/AsmCc65.cs index 96ebdab..09dcbfc 100644 --- a/SourceGen/AsmGen/AsmCc65.cs +++ b/SourceGen/AsmGen/AsmCc65.cs @@ -94,8 +94,9 @@ namespace SourceGen.AsmGen { /// private CommonUtil.Version mAsmVersion = CommonUtil.Version.NO_VERSION; - // We test against this in a few places. + // Interesting versions. private static CommonUtil.Version V2_17 = new CommonUtil.Version(2, 17); + private static CommonUtil.Version V2_18 = new CommonUtil.Version(2, 18); // Pseudo-op string constants. @@ -145,15 +146,19 @@ namespace SourceGen.AsmGen { // bug fixes. mAsmVersion = asmVersion.Version; } else { - // No assembler installed. Use 2.17. - mAsmVersion = V2_17; - } - if (mAsmVersion <= V2_17) { - // cc65 v2.17: https://github.com/cc65/cc65/issues/717 - Quirks.BlockMoveArgsReversed = true; - // cc65 v2.17: https://github.com/cc65/cc65/issues/754 - Quirks.NoPcRelBankWrap = true; + // No assembler installed. Use 2.18. + mAsmVersion = V2_18; } + + // cc65 v2.17: https://github.com/cc65/cc65/issues/717 + // cc65 v2.18: https://github.com/cc65/cc65/issues/925 + Quirks.BlockMoveArgsReversed = true; + + // cc65 v2.17: https://github.com/cc65/cc65/issues/754 + // still broken in v2.18 + Quirks.NoPcRelBankWrap = true; + + // Special handling for forward references to zero-page labels is required. Quirks.SinglePassAssembler = true; mWorkDirectory = workDirectory; @@ -224,10 +229,9 @@ namespace SourceGen.AsmGen { // string.Format(Properties.Resources.GENERATED_FOR_LATEST, "cc65")); //} - // Currently generating code for v2.17. OutputLine(SourceFormatter.FullLineCommentDelimiter + string.Format(Res.Strings.GENERATED_FOR_VERSION_FMT, - "cc65", V2_17, + "cc65", V2_18, AsmCc65.OPTIONS + " -C " + Path.GetFileName(cfgName))); } @@ -311,7 +315,7 @@ namespace SourceGen.AsmGen { // IGenerator public string ModifyOpcode(int offset, OpDef op) { - if ((op == OpDef.OpWDM_WDM) && mAsmVersion <= V2_17) { + if ((op == OpDef.OpWDM_WDM) && mAsmVersion < V2_18) { // cc65 v2.17 doesn't support WDM, and assembles BRK to opcode $05. // https://github.com/cc65/cc65/issues/715 // https://github.com/cc65/cc65/issues/716 diff --git a/SourceGen/SGTestData/Expected/1000-allops-value-65816_cc65.S b/SourceGen/SGTestData/Expected/1000-allops-value-65816_cc65.S index bc57f59..cf4f432 100644 --- a/SourceGen/SGTestData/Expected/1000-allops-value-65816_cc65.S +++ b/SourceGen/SGTestData/Expected/1000-allops-value-65816_cc65.S @@ -86,7 +86,7 @@ L1089: and ($ff),y rti L10AB: eor ($ff,x) - .byte $42,$ff + wdm $ff eor $ff,S .byte $44,$ff,$fe eor $ff diff --git a/SourceGen/SGTestData/Expected/1001-allops-zero-65816_cc65.S b/SourceGen/SGTestData/Expected/1001-allops-zero-65816_cc65.S index 4e2b707..67a4877 100644 --- a/SourceGen/SGTestData/Expected/1001-allops-zero-65816_cc65.S +++ b/SourceGen/SGTestData/Expected/1001-allops-zero-65816_cc65.S @@ -86,7 +86,7 @@ L1089: and ($00),y rti L10AB: eor ($00,x) - .byte $42,$00 + wdm $00 eor $00,S .byte $44,$00,$00 eor $00 diff --git a/SourceGen/SGTestData/Expected/2014-label-dp_cc65.S b/SourceGen/SGTestData/Expected/2014-label-dp_cc65.S index 2882c84..0e81fb3 100644 --- a/SourceGen/SGTestData/Expected/2014-label-dp_cc65.S +++ b/SourceGen/SGTestData/Expected/2014-label-dp_cc65.S @@ -87,7 +87,7 @@ L1089: and (L0080),y rti L10AB: eor (L0080,x) - .byte $42,$80 + wdm $80 eor $80,S .byte $44,$83,$84 eor z:L0080 diff --git a/SourceGen/WpfGui/EditAppSettings.xaml b/SourceGen/WpfGui/EditAppSettings.xaml index 2f77b10..08777f4 100644 --- a/SourceGen/WpfGui/EditAppSettings.xaml +++ b/SourceGen/WpfGui/EditAppSettings.xaml @@ -156,7 +156,7 @@ limitations under the License.