public void GetAndSetState() { TestContext.WriteLine("get and set state"); cpu.regA = 0x44; Cpu6809.State state = cpu.getState(); cpu.regA = 0; cpu.setState(state); Assert.That(cpu.regA, Is.EqualTo(0x44)); }
public State getState() { var asic = new Asic { ram = memoryPatch.applyPatchesToExposedMemory(ram), wpc = this.asic.getState(), display = displayBoard.getState(), sound = soundBoard.getState() }; var cpuState = cpu.getState(); return(new State { asic = asic, romFileName = romFileName, cpuState = cpuState, protectedMemoryWriteAttempts = protectedMemoryWriteAttempts, memoryWrites = memoryWrites, ticksIrq = ticksIrq, version = SERIALIZED_STATE_VERSION }); }