diff --git a/M6502/Disassembly.cs b/M6502/Disassembler.cs similarity index 99% rename from M6502/Disassembly.cs rename to M6502/Disassembler.cs index 7dce734..d5ce4cb 100644 --- a/M6502/Disassembly.cs +++ b/M6502/Disassembler.cs @@ -6,14 +6,14 @@ namespace EightBit { using System.Text; - public class Disassembly + public class Disassembler { private readonly Bus bus; private readonly M6502 processor; private readonly Symbols symbols; private ushort address; - public Disassembly(Bus bus, M6502 processor, Symbols symbols) + public Disassembler(Bus bus, M6502 processor, Symbols symbols) { this.bus = bus; this.processor = processor; @@ -555,7 +555,7 @@ namespace EightBit private string Dump_Byte(ushort absolute) { - return Disassembly.Dump_ByteValue(this.GetByte(absolute)); + return Disassembler.Dump_ByteValue(this.GetByte(absolute)); } private string Dump_DByte(ushort absolute) @@ -565,7 +565,7 @@ namespace EightBit private string Dump_Word(ushort absolute) { - return Disassembly.Dump_WordValue(this.GetWord(absolute)); + return Disassembler.Dump_WordValue(this.GetWord(absolute)); } private string Disassemble_Implied(string instruction) @@ -585,7 +585,7 @@ namespace EightBit private string Disassemble_Relative(string instruction, ushort absolute) { - return this.AM_Immediate_dump() + "\t" + instruction + " $" + Disassembly.Dump_WordValue(absolute); + return this.AM_Immediate_dump() + "\t" + instruction + " $" + Disassembler.Dump_WordValue(absolute); } private string Disassemble_Immediate(string instruction) diff --git a/M6502/M6502.Test/Board.cs b/M6502/M6502.Test/Board.cs index 8a29c92..03ad6fb 100644 --- a/M6502/M6502.Test/Board.cs +++ b/M6502/M6502.Test/Board.cs @@ -11,9 +11,8 @@ namespace M6502.Test { private readonly Configuration configuration; private readonly Ram ram; - private readonly M6502 cpu; private readonly Symbols symbols; - private readonly Disassembly disassembler; + private readonly Disassembler disassembler; private readonly MemoryMapping mapping; private ushort oldPC; @@ -22,15 +21,15 @@ namespace M6502.Test { this.configuration = configuration; this.ram = new Ram(0x10000); - this.cpu = new M6502(this); + this.CPU = new M6502(this); this.symbols = new Symbols(); - this.disassembler = new Disassembly(this, this.cpu, this.symbols); + this.disassembler = new Disassembler(this, this.CPU, this.symbols); this.mapping = new MemoryMapping(this.ram, 0x0000, (ushort)Mask.Mask16, AccessLevel.ReadWrite); this.oldPC = (ushort)Mask.Mask16; } - public M6502 CPU { get => this.cpu; } + public M6502 CPU { get; } public override void RaisePOWER() { @@ -64,7 +63,7 @@ namespace M6502.Test this.CPU.ExecutedInstruction += this.CPU_ExecutedInstruction; this.Poke(0x00, 0x4c); - this.cpu.PokeWord(0x01, this.configuration.StartAddress); + this.CPU.PokeWord(0x01, this.configuration.StartAddress); } public override MemoryMapping Mapping(ushort absolute) => this.mapping; @@ -82,7 +81,7 @@ namespace M6502.Test var test = this.Peek(0x0200); System.Console.Out.WriteLine(); System.Console.Out.Write("** Test="); - System.Console.Out.WriteLine(Disassembly.Dump_ByteValue(test)); + System.Console.Out.WriteLine(Disassembler.Dump_ByteValue(test)); } } @@ -94,27 +93,27 @@ namespace M6502.Test var output = new StringBuilder(); output.Append("PC="); - output.Append(Disassembly.Dump_WordValue(address)); + output.Append(Disassembler.Dump_WordValue(address)); output.Append(":"); output.Append("P="); - output.Append(Disassembly.Dump_Flags(this.CPU.P)); + output.Append(Disassembler.Dump_Flags(this.CPU.P)); output.Append(", "); output.Append("A="); - output.Append(Disassembly.Dump_ByteValue(this.CPU.A)); + output.Append(Disassembler.Dump_ByteValue(this.CPU.A)); output.Append(", "); output.Append("X="); - output.Append(Disassembly.Dump_ByteValue(this.CPU.X)); + output.Append(Disassembler.Dump_ByteValue(this.CPU.X)); output.Append(", "); output.Append("Y="); - output.Append(Disassembly.Dump_ByteValue(this.CPU.Y)); + output.Append(Disassembler.Dump_ByteValue(this.CPU.Y)); output.Append(", "); output.Append("S="); - output.Append(Disassembly.Dump_ByteValue(this.CPU.S)); + output.Append(Disassembler.Dump_ByteValue(this.CPU.S)); output.Append("\t"); output.Append(this.disassembler.Disassemble(address)); diff --git a/M6502/M6502.Test/Program.cs b/M6502/M6502.Test/Program.cs index 5da7478..0b580ab 100644 --- a/M6502/M6502.Test/Program.cs +++ b/M6502/M6502.Test/Program.cs @@ -4,14 +4,15 @@ namespace M6502.Test { - public class Program + public static class Program { public static void Main(string[] args) { var configuration = new Configuration(); - ////configuration.DebugMode = true; - +#if DEBUG + configuration.DebugMode = true; +#endif using (var harness = new TestHarness(configuration)) { harness.Run(); diff --git a/M6502/M6502.csproj b/M6502/M6502.csproj index af2c924..aa38dde 100644 --- a/M6502/M6502.csproj +++ b/M6502/M6502.csproj @@ -47,7 +47,7 @@ - +