diff --git a/M6502/M6502.HarteTest/SingleStepTests.cs b/M6502/M6502.HarteTest/SingleStepTests.cs index fb3a13f..a91e3fc 100644 --- a/M6502/M6502.HarteTest/SingleStepTests.cs +++ b/M6502/M6502.HarteTest/SingleStepTests.cs @@ -91,4 +91,20 @@ namespace M6502.HarteTest public async Task OpcodeSingleStep(string filePath) => await HarteTestHelper.RunOpcodeAsync(filePath, new TestRunner(r => new WDC65C02(r))).ConfigureAwait(false); } + + [TestClass] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Maintainability", "CA1515:Consider making public types internal", Justification = "Test class needs to be externally visible")] + public class Ricoh2A03SingleStepTests + { + private const string TestDataDirectory = @"C:\github\spectrum\libraries\EightBit\modules\65x02\nes6502\v1"; + + public static IEnumerable OpcodeFiles => HarteTestHelper.GetOpcodeFiles(TestDataDirectory); + + public static string GetDisplayName(MethodInfo m, object[] data) => HarteTestHelper.GetDisplayName(m, data); + + [TestMethod] + [DynamicData(nameof(OpcodeFiles), DynamicDataSourceType.Property, DynamicDataDisplayName = nameof(GetDisplayName))] + public async Task OpcodeSingleStep(string filePath) + => await HarteTestHelper.RunOpcodeAsync(filePath, new TestRunner(r => new Ricoh2A03(r))).ConfigureAwait(false); + } } diff --git a/M6502/Ricoh2A03.cs b/M6502/Ricoh2A03.cs new file mode 100644 index 0000000..5c691df --- /dev/null +++ b/M6502/Ricoh2A03.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Adrian Conlon. All rights reserved. +// + +namespace M6502 +{ + using EightBit; + + public class Ricoh2A03(Bus bus) : MOS6502(bus) + { + protected override byte DecimalSUB(byte operand, int borrow) + { + return base.BinarySUB(operand, borrow); + } + + protected override byte DecimalADC(byte data) + { + return base.BinaryADC(data); + } + } +}