Example #1
0
        private void flagCheckTest(InstructionData testData)
        {
            cpu.reset();
            cpu.set("flags", 0xFF);
            cpu.step();

            for (var x = 0; x < testData.flags.Length; x++)
            {
                var flag = testData.flags[x];
                var mask = EXPECTED_FLAG_MAP[x];
                switch (flag)
                {
                case FLAG_CLEAR:
                    Assert.That(cpu.regCC & mask, Is.EqualTo(0));
                    break;

                case FLAG_SET:
                    Assert.IsTrue((cpu.regCC & mask) > 0);
                    break;

                case FLAG_UNAFFECTED:
                    var unaffectedFlag = (byte)(cpu.regCC & mask);
                    TestContext.WriteLine("offset: {0}, {1}, mask: {2}", x, unaffectedFlag, mask);
                    Assert.IsTrue(unaffectedFlag > 0);
                    break;

                default:
                    break;
                }
            }
        }
Example #2
0
        public void ShouldReadResetVectorOnBoot()
        {
            TestContext.WriteLine("should read RESET vector on boot");

            cpu.reset();
            Assert.That(readMemoryAddressAccess[0], Is.EqualTo(RESET_VECTOR_OFFSET_LO));
            Assert.That(readMemoryAddressAccess[1], Is.EqualTo(RESET_VECTOR_OFFSET_HI));
        }
Example #3
0
        public void Init()
        {
            readMemoryAddress  = new List <ushort>();
            writeMemoryAddress = new List <AddressValueData>();

            cpu = Cpu6809.getInstance(WriteMemoryMock, ReadMemoryMock);
            cpu.reset();
        }
Example #4
0
        public void reset()
        {
            Debug.Print("RESET_CPU_BOARD");
            ticksIrq = 0;
            protectedMemoryWriteAttempts = 0;
            memoryWrites = 0;

            memoryPatch.removeVolatileEntries();
            displayBoard.reset();
            soundBoard.reset();
            asic.reset();
            cpu.reset();
        }