Exemplo n.º 1
0
        private static MemoryLines GetMemoryLines()
        {
            var lines = new MemoryLines
            {
                AddressBus = new AddressBus(),
                DataBus    = new DataBus(),
                Clock      = new PassthroughClock(),
                MREQ       = new TristateWire(),
                RD         = new TristateWire(),
                WAIT       = new TristateWire(),
                WR         = new TristateWire()
            };

            return(lines);
        }
Exemplo n.º 2
0
        private static Z80CPU GetZ80Cpu()
        {
            var dataBus    = new DataBus();
            var addressBus = new AddressBus();
            var z80Clock   = new PassthroughClock();
            var cpuLines   = new Z80CPULines
            {
                AddressBus  = addressBus,
                DataBus     = dataBus,
                SystemClock = z80Clock,
                BUSACK      = new TristateWire(),
                BUSREQ      = new TristateWire(TristateWireState.PullUp),
                HALT        = new TristateWire(),
                INT         = new TristateWire(TristateWireState.PullUp),
                IORQ        = new TristateWire(),
                M1          = new TristateWire(),
                MREQ        = new TristateWire(),
                NMI         = new TristateWire(TristateWireState.PullUp),
                RD          = new TristateWire(),
                RESET       = new TristateWire(TristateWireState.PullUp),
                RFSH        = new TristateWire(),
                WAIT        = new TristateWire(TristateWireState.PullUp),
                WR          = new TristateWire()
            };

            var memoryConnects = new MemoryLines
            {
                AddressBus = addressBus,
                Clock      = z80Clock,
                DataBus    = dataBus,
                MREQ       = cpuLines.MREQ,
                RD         = cpuLines.RD,
                WAIT       = cpuLines.WAIT,
                WR         = cpuLines.WR
            };
            var unused = new RandomAccessMemory(0, 0x4000, memoryConnects);

            return(new Z80CPU(cpuLines));
        }