Esempio n. 1
0
        public static ROMType GetType(byte i)
        {
            ROMType retval = new ROMType(i, "ERROR");

            try
            {
                foreach (ROMType rt in Type)
                {
                    if (rt.Code == i)
                    {
                        retval = rt;
                    }
                }

                return(retval);
            }
            catch (Exception)
            {
                return(Type[26]);
            }
        }
Esempio n. 2
0
        public Hardware(int ramSize, int romSize = 3145728, int ramSlotsNumber = 1, int romNumber = 1, ROMType type = ROMType.HDD, int bitsDepth = 32)
        {
            RamSlotsNumber = ramSlotsNumber;
            RAMs           = new RAM[RamSlotsNumber];
            for (int i = 0; i < RamSlotsNumber; i++)
            {
                uint adress = (uint)(i * ramSize);
                RAMs[i] = new RAM(ramSize, adress, bitsDepth);
            }

            RomNumber = romNumber;
            ROMs      = new ROM[RomNumber];
            for (int i = 0; i < RomNumber; i++)
            {
                ROMs[i] = new ROM(romSize, type);
            }

            CPU = new CPU(bitsDepth);
        }
Esempio n. 3
0
 public ROM(int size, ROMType type = ROMType.HDD)
 {
     ByteCells = new byte[size];
 }