Ejemplo n.º 1
0
 /// <summary>
 /// This event handler is called when clicking the Pause And Open Debugger menu item.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void pauseAndOpenDebuggerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Debugger == null || Debugger.IsDisposed) //Just in case the debugger was dismissed with the close button.
     {
         Debugger = new DebuggerForm(Emu, UpdateDisplayDel);
     }
     Emu.IsPaused = true;
     Debugger.UpdateInfo();
     Debugger.Show();
 }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();

            //Emulator component.
            Emu = new Emulator();

            //Register Tick Handler. This event is raised every frame by SDL.
            SdlDotNet.Core.Events.Tick += new EventHandler <TickEventArgs>(Events_Tick);

            //Set the FPS that SDL will try to match.
            TargetRenderFPS           = 60;
            SdlDotNet.Core.Events.Fps = TargetRenderFPS;

            //Set the FPS at which the Tick event must be raised.
            SdlDotNet.Core.Events.TargetFps = 60;

            //This delegate allows the debugger to redraw the output window after every step. (Normally it is just done once a frame)
            UpdateDisplayDel = new VoidNoParams(UpdateDisplay);

            //Ready the input handler and attach it to the emulator
            InpHand = new InputHandler();
            Emu.AttachInputHandler(InpHand);
            this.KeyDown += new KeyEventHandler(InpHand.KeyDown);
            this.KeyUp   += new KeyEventHandler(InpHand.KeyUp);

            //Attach the input handler to the input mapper form
            InputMapper = new InputMapperForm(InpHand);

            //Attach the redraw delegate to the debugger
            Debugger = new DebuggerForm(Emu, UpdateDisplayDel);

            //Create a "NumericInput" form. This is used to get the Target FPS when the user wants to change it.
            NumInp       = new NumericInputFrom();
            NumInp.Title = "Target FPS";
        }