Exemple #1
0
        // Starts the interpreter
        private void StartInterpreteter()
        {
            // Ends any previous interpreter session
            interpreting = false;

            // Initialises the interpreter
            interpreter = InitialiseInterpreter();
            if (interpreter == null)
            {
                return;
            }

            // Initialises the interpreter output
            screen = InitialiseScreen();
            if (screen == null)
            {
                return;
            }

            // Initialises the interpreter keyboard
            keyboard = InitialiseKeyboard();
            if (keyboard == null)
            {
                return;
            }

            // Sets up the clock to output at frameRate Hz (processes at clockSpeed Hz) and starts the interpreter
            interpreting        = true;
            clockTimer          = new Timer();
            clockTimer.Interval = 1000 / frameRate;
            clockTimer.Tick    += new System.EventHandler(ClockTick);
            clockTimer.Start();
        }
Exemple #2
0
        public Window()
        {
            InitializeComponent();

            // Sets the resolution
            this.ClientSize = new Size(InterpreterOutput.ClientRectangle.Width,
                                       MenuStrip.ClientRectangle.Height + InterpreterOutput.ClientRectangle.Height);

            // Sets CHIP-8 Objects to null
            interpreter = null;
            screen      = null;
            keyboard    = null;
        }