public void STA_Abs() { Ram.Load(0x4000, new byte[] { 0x90, 0x88, 0x99, 0x50, 0x00 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Ram[0x5000], 0x88); }
public void BLDX_Imm() { Ram.Load(0x4000, new byte[] { 0xA0, 0x77, 0x88 }); Driver.Clock(); Assert.AreEqual(Cpu.X.Value, 0x7788); }
public void LDA_Abs() { Ram.Load(0x4000, new byte[] { 0x91, 0x50, 0x00 }); Ram.Load(0x5000, new byte[] { 0x88 }); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x88); }
public void SUB_Carry2() { Ram.Load(0x4000, new byte[] { 0x90, 0x04, 0x20, 0x05 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0xFF); Assert.AreEqual(Cpu.Status.Carry, false); Assert.AreEqual(Cpu.Status.Overflow, false); }
public void INCA_Imp() { Ram.Load(0x4000, new byte[] { 0x90, 0x05, 0x80, 0x80 }); Driver.Clock(); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x07); }
public void LDA_IndX() { Ram.Load(0x4000, new byte[] { 0xa0, 0x00, 0x05, 0x95, 0x50, 0x00 }); Ram.Load(0x5000, new byte[] { 0x60, 0x00 }); Ram.Load(0x6005, new byte[] { 0x88 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x88); }
public void SUB_Overflow1() { //120 - (10) = 130 = (2) //x78 - xF6 = x82 Ram.Load(0x4000, new byte[] { 0x90, 0x78, 0x20, 0xF6 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Status.Carry, false); Assert.AreEqual(Cpu.Status.Overflow, true); }
public void ADD_Carry2() { Ram.Load(0x4000, new byte[] { 0x90, 0xFF, 0x10, 0x01 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x00); Assert.AreEqual(Cpu.Status.Carry, true); Assert.AreEqual(Cpu.Status.Overflow, false); Assert.AreEqual(Cpu.Status.Zero, true); Assert.AreEqual(Cpu.Status.Negative, false); }
public void STA_IndX() { Ram.Load(0x4000, new byte[] { 0x90, 0x88, 0xa0, 0x00, 0x05, 0x9D, 0x50, 0x00 }); Ram.Load(0x5000, new byte[] { 0x60, 0x00 }); Driver.Clock(); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Ram[0x6005], 0x88); }
public void SUB_Imm() { Ram.Load(0x4000, new byte[] { 0x90, 0x02, 0x20, 0x02 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x00); Assert.AreEqual(Cpu.Status.Carry, true); Assert.AreEqual(Cpu.Status.Overflow, false); Assert.AreEqual(Cpu.Status.Zero, true); Assert.AreEqual(Cpu.Status.Negative, false); }
public void OR_Imm() { Ram.Load(0x4000, new byte[] { 0x90, 0x0A, 0x38, 0x04 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x0E); Assert.AreEqual(Cpu.Status.Carry, false); Assert.AreEqual(Cpu.Status.Overflow, false); Assert.AreEqual(Cpu.Status.Zero, false); Assert.AreEqual(Cpu.Status.Negative, false); }
public void LDA_Imm() { Ram.Load(0x4000, new byte[] { 0x90, 0x88, 0x90, 0x00 }); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x88); Assert.AreEqual(Cpu.Status.Negative, true); Assert.AreEqual(Cpu.Status.Zero, false); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x00); Assert.AreEqual(Cpu.Status.Negative, false); Assert.AreEqual(Cpu.Status.Zero, true); }
public void ADD_Overflow1() { //120 + 10 = 130 = (2) //x78 + x0A = x82 Ram.Load(0x4000, new byte[] { 0x90, 0x78, 0x10, 0x0A }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x82); Assert.AreEqual(Cpu.Status.Carry, false); Assert.AreEqual(Cpu.Status.Overflow, true); Assert.AreEqual(Cpu.Status.Zero, false); Assert.AreEqual(Cpu.Status.Negative, true); }
public void ADD_Abs() { Ram.Load(0x4000, new byte[] { 0x90, 0x02, 0x11, 0x50, 0x00 }); Ram.Load(0x5000, new byte[] { 0x02 }); Driver.Clock(); Driver.Clock(); Assert.AreEqual(Cpu.Acc.Value, 0x04); Assert.AreEqual(Cpu.Status.Carry, false); Assert.AreEqual(Cpu.Status.Overflow, false); Assert.AreEqual(Cpu.Status.Zero, false); Assert.AreEqual(Cpu.Status.Negative, false); }
public void Run() { cpu.Process(); ram.Load(); hdd.Read(); }