public unsafe VirtualMachine(DirectKeyboard keyboard, DirectMouse mouse, DirectSound sound)
 {
     this.m_keyboard = keyboard;
     this.m_mouse = mouse;
     this.m_sound = sound;
     m_spectrum = new SpectrumConcrete();
     m_spectrum.UpdateState += OnUpdateState;
     m_spectrum.Breakpoint += OnBreakpoint;
     m_spectrum.UpdateFrame += OnUpdateFrame;
 }
Exemple #2
0
 protected override void OnFormClosed(FormClosedEventArgs e)
 {
     //LogAgent.Debug("MainForm.OnFormClosed");
     try
     {
         renderVideo.FreeWnd();
         if (m_keyboard != null)
             m_keyboard.Dispose();
         m_keyboard = null;
         if (m_mouse != null)
             m_mouse.Dispose();
         m_mouse = null;
         if (m_sound != null)
             m_sound.Dispose();
         m_sound = null;
     }
     catch (Exception ex)
     {
         LogAgent.Error(ex);
     }
     base.OnFormClosed(e);
 }
Exemple #3
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);
     }
 }