Ejemplo n.º 1
0
        public void Init(VirtualMachine vm, RenderVideo renderVideo)
        {
            m_renderVideo = renderVideo;
            m_vm = vm;

            m_workBus = new BusManager();
            m_workBus.Init(new Engine.Z80.Z80CPU(), new ZXMAK2.Serializers.LoadManager(null), true);

            var xml = new XmlDocument();
            var root = xml.AppendChild(xml.CreateElement("Bus"));
            try
            {
                m_vm.Spectrum.BusManager.SaveConfig(root);

                m_workBus.LoadConfig(root);
                m_workBus.Disconnect();
                initWorkBus();
            }
            catch (Exception ex)
            {
                LogAgent.Error(ex);
            }
        }
Ejemplo n.º 2
0
 internal void InitWnd()
 {
     //LogAgent.Debug("MainForm.InitWnd");
     try
     {
         renderVideo.InitWnd();
         m_mouse = new DirectMouse(this);
         m_keyboard = new DirectKeyboard(this);
         m_sound = new DirectSound(this, -1, 44100, 16, 2, 882 * 2 * 2, 4);
         m_vm = new VirtualMachine(m_keyboard, m_mouse, m_sound);
         m_vm.Spectrum.BusManager.BusConnected += OnVmBusConnected;
         m_vm.Spectrum.BusManager.BusDisconnect += OnVmBusDisconnect;
         m_vm.UpdateVideo += vm_UpdateVideo;
         m_vm.Init();
     }
     catch (Exception ex)
     {
         LogAgent.Error(ex);
     }
 }