public TestSystemWithTestSignals(
            int[][] BUSREQstartAfterTStatesAndActivateDuringTStates,
            int[][] INTstartAfterTStatesAndActivateDuringTStates,
            int[][] NMIstartAfterTStatesAndActivateDuringTStates,
            int[][] RESETstartAfterTStatesAndActivateDuringTStates,
            int[][] WAITstartAfterTStatesAndActivateDuringTStates
            )
        {
            // Initialize components
            clock = new __Clock(3500000L);
            cpu = new __Z80CPU();
            memory = new _TestMemory(65536, 0);
            BUSREQSignal = new _TestSignal(BUSREQstartAfterTStatesAndActivateDuringTStates);
            INTSignal = new _TestSignal(INTstartAfterTStatesAndActivateDuringTStates);
            NMISignal = new _TestSignal(NMIstartAfterTStatesAndActivateDuringTStates);
            RESETSignal = new _TestSignal(RESETstartAfterTStatesAndActivateDuringTStates);
            WAITSignal = new _TestSignal(WAITstartAfterTStatesAndActivateDuringTStates);

            // Connect buses
            cpu.Address.ConnectTo(addressBus);
            cpu.Data.ConnectTo(dataBus);
            memory.Address.ConnectTo(addressBus);
            memory.Data.ConnectTo(dataBus);

            // Connect individual PINs
            ((__Clock)clock).ConnectTo(cpu, (TestMemory)memory, BUSREQSignal, INTSignal, NMISignal, RESETSignal, WAITSignal);
            ((__Z80CPU)cpu).ConnectTo(clock, (TestMemory)memory, BUSREQSignal, INTSignal, NMISignal, RESETSignal, WAITSignal);
            ((_TestMemory)memory).ConnectTo(clock, cpu);
        }
        public TestSystem(bool simulateSlowMemoryAndDevices)
        {
            // Initialize components
            clock = new _Clock(3500000L);
            cpu = new _Z80CPU();
            if (!simulateSlowMemoryAndDevices)
            {
                memory = new _TestMemory(65536, 0);
            }
            else
            {
                memory = new _TestMemory(65536, 2);
            }

            // Connect buses
            cpu.Address.ConnectTo(addressBus);
            cpu.Data.ConnectTo(dataBus);
            memory.Address.ConnectTo(addressBus);
            memory.Data.ConnectTo(dataBus);

            // Connect individual PINs
            ((_Clock)clock).ConnectTo(cpu, (TestMemory)memory);
            ((_Z80CPU)cpu).ConnectTo(clock, (TestMemory)memory);
            ((_TestMemory)memory).ConnectTo(clock, cpu);
        }
        public TestSystemWithInterruptingDevice(byte portAddress, byte initialValue, int waitCycles, int[][] startInterruptAfterTStatesAndDuringTStates, byte valueForDataBusAfterInterrupt)
        {
            // Initialize components
            clock = new __Clock(3500000L);
            cpu = new __Z80CPU();
            memory = new _TestMemory(65536, 0);
            device = new _TestInterruptingDevice(portAddress, initialValue, waitCycles, startInterruptAfterTStatesAndDuringTStates, valueForDataBusAfterInterrupt);

            // Connect buses
            cpu.Address.ConnectTo(addressBus);
            cpu.Data.ConnectTo(dataBus);
            memory.Address.ConnectTo(addressBus);
            memory.Data.ConnectTo(dataBus);
            device.Address.ConnectTo(addressBus);
            device.Data.ConnectTo(dataBus);

            // Connect individual PINs
            ((__Clock)clock).ConnectTo(cpu, (TestMemory)memory, device);
            ((__Z80CPU)cpu).ConnectTo(clock, (TestMemory)memory, device);
            ((_TestMemory)memory).ConnectTo(clock, cpu);
            ((_TestInterruptingDevice)device).ConnectTo(clock, cpu);
        }
        public TestSystemWithInterruptingDevice(byte portAddress, byte initialValue, int waitCycles, int[][] startInterruptAfterTStatesAndDuringTStates, byte valueForDataBusAfterInterrupt)
        {
            // Initialize components
            clock  = new __Clock(3500000L);
            cpu    = new __Z80CPU();
            memory = new _TestMemory(65536, 0);
            device = new _TestInterruptingDevice(portAddress, initialValue, waitCycles, startInterruptAfterTStatesAndDuringTStates, valueForDataBusAfterInterrupt);

            // Connect buses
            cpu.Address.ConnectTo(addressBus);
            cpu.Data.ConnectTo(dataBus);
            memory.Address.ConnectTo(addressBus);
            memory.Data.ConnectTo(dataBus);
            device.Address.ConnectTo(addressBus);
            device.Data.ConnectTo(dataBus);

            // Connect individual PINs
            ((__Clock)clock).ConnectTo(cpu, (TestMemory)memory, device);
            ((__Z80CPU)cpu).ConnectTo(clock, (TestMemory)memory, device);
            ((_TestMemory)memory).ConnectTo(clock, cpu);
            ((_TestInterruptingDevice)device).ConnectTo(clock, cpu);
        }
        public TestSystemWithMultiportDevice(IDictionary<byte, IList<byte>> valuesForPortAddresses)
        {
            // Initialize components
            clock = new _Clock(3500000L);
            cpu = new __Z80CPU();
            memory = new _TestMemory(65536, 0);
            multiportDevice = new _TestMultiportDevice();
            multiportDevice.ReadValuesForPortAddresses = valuesForPortAddresses;

            // Connect buses
            cpu.Address.ConnectTo(addressBus);
            cpu.Data.ConnectTo(dataBus);
            memory.Address.ConnectTo(addressBus);
            memory.Data.ConnectTo(dataBus);
            multiportDevice.Address.ConnectTo(addressBus);
            multiportDevice.Data.ConnectTo(dataBus);

            // Connect individual PINs
            ((_Clock)clock).ConnectTo(cpu, (TestMemory)memory);
            ((__Z80CPU)cpu).ConnectTo(clock, (TestMemory)memory, multiportDevice);
            ((_TestMemory)memory).ConnectTo(clock, cpu);
            ((_TestMultiportDevice)multiportDevice).ConnectTo(cpu);
        }
Beispiel #6
0
        public TestSystemWithMultiportDevice(IDictionary <byte, IList <byte> > valuesForPortAddresses)
        {
            // Initialize components
            clock           = new _Clock(3500000L);
            cpu             = new __Z80CPU();
            memory          = new _TestMemory(65536, 0);
            multiportDevice = new _TestMultiportDevice();
            multiportDevice.ReadValuesForPortAddresses = valuesForPortAddresses;

            // Connect buses
            cpu.Address.ConnectTo(addressBus);
            cpu.Data.ConnectTo(dataBus);
            memory.Address.ConnectTo(addressBus);
            memory.Data.ConnectTo(dataBus);
            multiportDevice.Address.ConnectTo(addressBus);
            multiportDevice.Data.ConnectTo(dataBus);

            // Connect individual PINs
            ((_Clock)clock).ConnectTo(cpu, (TestMemory)memory);
            ((__Z80CPU)cpu).ConnectTo(clock, (TestMemory)memory, multiportDevice);
            ((_TestMemory)memory).ConnectTo(clock, cpu);
            ((_TestMultiportDevice)multiportDevice).ConnectTo(cpu);
        }
        public TestSystemWithTwoDevices(bool simulateSlowMemoryAndDevices)
            : base(simulateSlowMemoryAndDevices)
        {
            // Initialize components
            clock = new __Clock(3500000L);
            cpu = new __Z80CPU();
            if (!simulateSlowMemoryAndDevices)
            {
                memory = new _TestMemory(65536, 0);
                device1 = new _TestDevice(1, 10, 0);
                device2 = new _TestDevice(2, 20, 0);
            }
            else
            {
                memory = new _TestMemory(65536, 2);
                device1 = new _TestDevice(1, 10, 2);
                device2 = new _TestDevice(2, 20, 2);
            }

            // Connect buses
            cpu.Address.ConnectTo(addressBus);
            cpu.Data.ConnectTo(dataBus);
            memory.Address.ConnectTo(addressBus);
            memory.Data.ConnectTo(dataBus);
            device1.Address.ConnectTo(addressBus);
            device1.Data.ConnectTo(dataBus);
            device2.Address.ConnectTo(addressBus);
            device2.Data.ConnectTo(dataBus);

            // Connect individual PINs
            ((__Clock)clock).ConnectTo(cpu, (TestMemory)memory, device1, device2);
            ((__Z80CPU)cpu).ConnectTo(clock, (TestMemory)memory, device1, device2);
            ((_TestMemory)memory).ConnectTo(clock, cpu);
            ((_TestDevice)device1).ConnectTo(clock, cpu);
            ((_TestDevice)device2).ConnectTo(clock, cpu);
        }