Exemplo n.º 1
0
        protected Console(SerializationInfo info, StreamingContext ctx)
        {
            Cpu = (ICpu)info.GetValue("Cpu", typeof(ICpu));
            Mmu = (IMmu)info.GetValue("Mmu", typeof(IMmu));
            Gpu = (IGpu)info.GetValue("Gpu", typeof(IGpu));
            Timer = (ITimer)info.GetValue("Timer", typeof(ITimer));

            // Hack to reset references on deserialize
            (Cpu as Cpu).Mmu = Mmu;
            (Gpu as Gpu).Mmu = Mmu;
            (Timer as Timer).Mmu = Mmu;
            Controller = new Controller(Mmu);

            _breakpoints = new HashSet<uint>();
            _turnedOn = true;
            _paused = true;
            _emitFrames = true;
            CartridgeLoaded = true;
        }
Exemplo n.º 2
0
 public static Console Default()
 {
     var mmu = new Mmu();
     var cpu = new Cpu(mmu);
     var gpu = new Gpu(mmu);
     var timer = new Timer(mmu);
     var controller = new Controller(mmu);
     return new Console(cpu, mmu, gpu, timer, controller);
 }