Exemple #1
0
        static void Main(string[] args)
        {
            try
            {
                IChip8Device device = BuildDevice();

                LoadProgram(device, "program");

                int displayContentVersion = _display.ContentVersion;

                while (true)
                {
                    device.Tick();
                    if (displayContentVersion != _display.ContentVersion)
                    {
                        DrawScreen(_display);
                        displayContentVersion = _display.ContentVersion;
                    }
                    // System.Threading.Thread.Sleep(100);
                }
            }
            catch (Exception e)
            {
                Console.Error.WriteLine($"Caught an exception: {e.Message}");
            }
        }
Exemple #2
0
 private static void Run(IChip8Device device, NCursesDisplay display)
 {
     while (true)
     {
         device.Tick();
         display.Draw();
         System.Threading.Thread.Sleep(100);
     }
 }