示例#1
0
文件: Form1.cs 项目: DualBrain/Chip8
 private void timer2_Tick(object sender, EventArgs e)
 {
     for (int i = 0; i < 50; i++)
     {
         cpu.RunCycle();
     }
     cpu.UpdateTimers();
     UpdateScreen();
 }
示例#2
0
文件: Form1.cs 项目: DualBrain/Chip8
        public Form1()
        {
            InitializeComponent();
            cpu = new CPU();
            bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
            g   = Graphics.FromImage(bmp);

            cpu.InitMemory();
            cpu.LoadProgram(File.ReadAllBytes("minimal.ch8"));

            Thread t = new Thread(() => { while (true)
                                          {
                                              cpu.RunCycle(); Thread.Sleep(new TimeSpan(1000));
                                          }
                                  });
            //t.Start();
        }