Tie the 6502 disassembler to the "core" processor.

This commit is contained in:
Adrian Conlon
2024-07-22 09:31:03 +01:00
parent bba60b68bc
commit 9c6586cdd0
2 changed files with 9 additions and 3 deletions

View File

@@ -7,10 +7,10 @@ namespace EightBit
using System.Globalization;
using System.Text;
public class Disassembler(Bus bus, M6502 processor, Files.Symbols.Parser symbols)
public class Disassembler(Bus bus, M6502Core processor, Files.Symbols.Parser symbols)
{
private readonly Bus bus = bus;
private readonly M6502 processor = processor;
private readonly M6502Core processor = processor;
private readonly Files.Symbols.Parser symbols = symbols;
private ushort address;

View File

@@ -29,7 +29,7 @@
public Checker(TestRunner runner)
{
this.Runner = runner;
this.Disassembler = new(this.Runner, this.Runner.CPU, this.Symbols);
this.Disassembler = new(this.Runner, (EightBit.M6502Core)this.Runner.CPU, this.Symbols);
}
public void Check(Test test)
@@ -201,6 +201,12 @@
var y_good = this.Check("Y", final.Y, cpu.Y);
var p_good = this.Check("P", final.P, cpu.P);
if (!p_good)
{
this.Messages.Add($"Expected flags: {EightBit.Disassembler.DumpFlags(final.P)}");
this.Messages.Add($"Actual flags : {EightBit.Disassembler.DumpFlags(cpu.P)}");
}
if (final.RAM == null)
{
throw new InvalidOperationException("Expected RAM cannot be null");