1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-02-07 14:31:00 +00:00

Update for cc65 v2.18

WDM <arg> now works.  MVN/MVP are still broken.  Correct code is
generated for whichever version of the assembler is configured.
Regression tests updated for new version.

Also, fixed a UI bug where manual edits to the assembler path were
being ignored.
This commit is contained in:
Andy McFadden 2019-08-04 13:38:25 -07:00
parent 1ad9caa783
commit 71badf2359
6 changed files with 30 additions and 16 deletions

View File

@ -94,8 +94,9 @@ namespace SourceGen.AsmGen {
/// </summary>
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 <arg> to opcode $05.
// https://github.com/cc65/cc65/issues/715
// https://github.com/cc65/cc65/issues/716

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -156,7 +156,7 @@ limitations under the License.
<Button DockPanel.Dock="Right" Content="Browse..." Width="75"
Margin="8,0,0,8" Click="AsmExeBrowseButton_Click"/>
<TextBox Name="asmExePathTextBox" DockPanel.Dock="Left" Margin="0,0,0,8"
Text="C:\something"/>
Text="C:\something" TextChanged="AsmExePathTextBox_TextChanged"/>
</DockPanel>
<TextBlock Grid.Column="0" Grid.Row="2" Text="Column widths:"

View File

@ -631,6 +631,16 @@ namespace SourceGen.WpfGui {
}
private void AsmExePathTextBox_TextChanged(object sender, TextChangedEventArgs e) {
if (IsLoaded) {
// We don't really need to be updating AssemblerConfig every time they type
// a character, but it's fine.
AssemblerInfo asmInfo = (AssemblerInfo)asmConfigComboBox.SelectedItem;
AssemblerConfig.SetConfig(mSettings, asmInfo.AssemblerId, GetAsmConfigFromUi());
IsDirty = true;
}
}
/// <summary>
/// Creates a file dialog to search for a specific executable.
/// </summary>