示例#1
0
        protected void RunCycles()
        {
            int millesecondsPerCycle = 1000 / ClockSpeed;

            Stopwatch s = new Stopwatch();

            s.Start();

            while (true)
            {
                CheckInput();

                if (_threadStopped)
                {
                    break;
                }

                _chip8.EmulateCycle();

                Draw();

                while (s.ElapsedMilliseconds < millesecondsPerCycle)
                {
                    Thread.Sleep(1);
                }

                s.Restart();
            }
        }
示例#2
0
        protected void RunCycles()
        {
            int millesecondsPerCycle = 1000 / ClockSpeed;

            Stopwatch s = new Stopwatch();

            s.Start();

            while (true)
            {
                chip8.EmulateCycle();

                while (s.ElapsedMilliseconds < millesecondsPerCycle)
                {
                    Thread.Sleep(1);
                }

                s.Restart();
            }
        }