mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-03-11 05:41:49 +00:00
Tidy 6809 tests namespace
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
// <copyright file="AbxTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
public class AbxTests
|
||||
{
|
||||
private readonly Board board = new Board();
|
||||
private readonly Board board = new();
|
||||
private readonly MC6809 cpu;
|
||||
|
||||
public AbxTests()
|
||||
{
|
||||
this.cpu = this.board.CPU;
|
||||
|
||||
this.board.Poke(0, 0x3a);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// <copyright file="AdcTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using EightBit;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
@@ -30,7 +29,7 @@ namespace EightBit
|
||||
{
|
||||
this.board.Poke(0, 0x89);
|
||||
this.board.Poke(1, 0x7c);
|
||||
this.cpu.CC = EightBit.Chip.SetBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = Chip.SetBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.A = 0x3a;
|
||||
this.cpu.Step();
|
||||
Assert.AreEqual(0xb7, this.cpu.A);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="AddTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="AndTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="AslTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="AsrTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="BgtTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="BhiTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="BitTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="BleTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
// <copyright file="Board.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using EightBit;
|
||||
|
||||
public sealed class Board : EightBit.Bus
|
||||
public sealed class Board : Bus
|
||||
{
|
||||
private readonly Ram ram = new Ram(0x10000); // 0000 - FFFF, 64K RAM
|
||||
private readonly Ram ram = new(0x10000); // 0000 - FFFF, 64K RAM
|
||||
private readonly MemoryMapping mapping;
|
||||
|
||||
public Board()
|
||||
{
|
||||
this.CPU = new MC6809(this);
|
||||
this.mapping = new MemoryMapping(this.ram, 0x0000, 0xffff, EightBit.AccessLevel.ReadWrite);
|
||||
this.CPU = new(this);
|
||||
this.mapping = new(this.ram, 0x0000, 0xffff, AccessLevel.ReadWrite);
|
||||
}
|
||||
|
||||
public MC6809 CPU { get; }
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="ClrTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="CmpTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="ComTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="DaaTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="DecTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="EorTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="ExgTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="IncTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="JsrTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
// https://github.com/sorenroug/osnine-java/blob/master/core/src/test/java/org/roug/osnine/BranchAndJumpTest.java
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="LdTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="LeaTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// <copyright file="LsrTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using EightBit;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
@@ -47,9 +46,9 @@ namespace EightBit
|
||||
public void TestLSR_a_two()
|
||||
{
|
||||
this.board.Poke(0xb00, 0x44);
|
||||
this.cpu.CC = MC6809.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = MC6809.SetBit(this.cpu.CC, (byte)StatusBits.VF);
|
||||
this.cpu.CC = MC6809.SetBit(this.cpu.CC, (byte)StatusBits.NF);
|
||||
this.cpu.CC = Chip.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = Chip.SetBit(this.cpu.CC, (byte)StatusBits.VF);
|
||||
this.cpu.CC = Chip.SetBit(this.cpu.CC, (byte)StatusBits.NF);
|
||||
this.cpu.A = 1;
|
||||
this.cpu.PC.Word = 0xb00;
|
||||
|
||||
@@ -66,8 +65,8 @@ namespace EightBit
|
||||
public void TestLSR_a_three()
|
||||
{
|
||||
this.board.Poke(0xb00, 0x44);
|
||||
this.cpu.CC = MC6809.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = MC6809.ClearBit(this.cpu.CC, (byte)StatusBits.VF);
|
||||
this.cpu.CC = Chip.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = Chip.ClearBit(this.cpu.CC, (byte)StatusBits.VF);
|
||||
this.cpu.A = 0xb8;
|
||||
this.cpu.PC.Word = 0xb00;
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// <copyright file="MulTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using EightBit;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
@@ -55,8 +54,8 @@ namespace EightBit
|
||||
{
|
||||
this.board.Poke(0xb00, 0x3d);
|
||||
this.cpu.CC = 0;
|
||||
this.cpu.CC = MC6809.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = MC6809.SetBit(this.cpu.CC, (byte)StatusBits.ZF);
|
||||
this.cpu.CC = Chip.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = Chip.SetBit(this.cpu.CC, (byte)StatusBits.ZF);
|
||||
this.cpu.A = 0xc;
|
||||
this.cpu.B = 0x00;
|
||||
this.cpu.PC.Word = 0xb00;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="NegTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="OrTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="PshTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="PulTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="RolTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// <copyright file="RorTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using EightBit;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
@@ -48,7 +47,7 @@ namespace EightBit
|
||||
this.board.Poke(0xb00, 0x56);
|
||||
this.cpu.B = 0x89;
|
||||
this.cpu.CC = 0;
|
||||
this.cpu.CC = MC6809.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.CC = Chip.ClearBit(this.cpu.CC, (byte)StatusBits.CF);
|
||||
this.cpu.PC.Word = 0xb00;
|
||||
|
||||
this.cpu.Step();
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="RtsTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
// https://github.com/sorenroug/osnine-java/blob/master/core/src/test/java/org/roug/osnine/BranchAndJumpTest.java
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="SbcTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="SexTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="SubTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="TfrTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// <copyright file="TstTests.cs" company="Adrian Conlon">
|
||||
// Copyright (c) Adrian Conlon. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace EightBit
|
||||
namespace MC6809.UnitTest
|
||||
{
|
||||
using MC6809;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
|
||||
Reference in New Issue
Block a user