1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-06-12 23:29:32 +00:00

Output code for v2.17 when cc65 isn't found

We were generating code for > 2.17, with various bug fixes, but
since that's not shipping yet it won't be usable by anybody who
doesn't have a tip-of-tree cc65 installation.
This commit is contained in:
Andy McFadden 2018-10-01 17:11:09 -07:00
parent 31450d8314
commit ea2bc67ef4
2 changed files with 27 additions and 16 deletions

View File

@ -124,13 +124,18 @@ namespace SourceGen.AsmGen {
Project = project;
Quirks = new AssemblerQuirks();
if (asmVersion != null) {
// Use the actual version. If it's > 2.17 we'll try to take advantage of
// bug fixes.
mAsmVersion = asmVersion.Version;
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;
}
} 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;
}
mWorkDirectory = workDirectory;
@ -175,14 +180,19 @@ namespace SourceGen.AsmGen {
mOutStream = sw;
if (Settings.GetBool(AppSettings.SRCGEN_ADD_IDENT_COMMENT, false)) {
if (mAsmVersion.IsValid && mAsmVersion <= V2_17) {
OutputLine(SourceFormatter.FullLineCommentDelimiter +
string.Format(Properties.Resources.GENERATED_FOR_VERSION,
"cc65", mAsmVersion.ToString()));
} else {
OutputLine(SourceFormatter.FullLineCommentDelimiter +
string.Format(Properties.Resources.GENERATED_FOR_LATEST, "cc65"));
}
//if (mAsmVersion.IsValid && mAsmVersion <= V2_17) {
// OutputLine(SourceFormatter.FullLineCommentDelimiter +
// string.Format(Properties.Resources.GENERATED_FOR_VERSION,
// "cc65", mAsmVersion.ToString()));
//} else {
// OutputLine(SourceFormatter.FullLineCommentDelimiter +
// string.Format(Properties.Resources.GENERATED_FOR_LATEST, "cc65"));
//}
// Currently generating code for v2.17.
OutputLine(SourceFormatter.FullLineCommentDelimiter +
string.Format(Properties.Resources.GENERATED_FOR_VERSION,
"cc65", V2_17));
}
GenCommon.Generate(this, sw, worker);

View File

@ -169,9 +169,10 @@ namespace SourceGen.AsmGen {
mOutStream = sw;
if (Settings.GetBool(AppSettings.SRCGEN_ADD_IDENT_COMMENT, false)) {
// No version-specific stuff yet.
// No version-specific stuff yet. We're generating code for v1.0.
OutputLine(SourceFormatter.FullLineCommentDelimiter +
string.Format(Properties.Resources.GENERATED_FOR_LATEST, "Merlin 32"));
string.Format(Properties.Resources.GENERATED_FOR_VERSION,
"Merlin 32", new CommonUtil.Version(1, 0)));
}
GenCommon.Generate(this, sw, worker);