public DirectedGraphNode Add <AddressT, DataT>(MemoryRom <AddressT, DataT> rom)
            where AddressT : BusData, new()
            where DataT : BusData, new()
        {
            if (!Visit(rom))
            {
                return(FindNode(rom));
            }

            DirectedGraphNode node = AddNode <MemoryRom <AddressT, DataT> >(rom.Name);

            SetNodeMap(rom, node);

            if (!DisplayComponents)
            {
                node = null;
            }

            LinkContains(node, Add(rom.Address, rom.Name));
            LinkContains(node, Add(rom.Data, rom.Name));
            LinkContains(node, Add(rom.ChipEnable, rom.Name));
            LinkContains(node, Add(rom.OutputEnable, rom.Name));

            return(node);
        }
        public static MemoryRom <BusData16, BusData8> NewRom(byte[] buffer)
        {
            var mem = new MemoryRom <BusData16, BusData8>();

            if (buffer != null)
            {
                mem.Write(buffer);
            }

            return(mem);
        }
Exemple #3
0
        public static MemoryRom <BusData16, BusData8> NewRom(byte[] buffer)
        {
            var mem = new MemoryRom <BusData16, BusData8>();

            if (buffer != null)
            {
                var writer = new MemoryWriter <BusData16, BusData8>(mem);
                writer.CopyFrom(CreateBinaryReader(buffer));
            }

            return(mem);
        }