private void timer2_Tick(object sender, EventArgs e) { for (int i = 0; i < 50; i++) { cpu.RunCycle(); } cpu.UpdateTimers(); UpdateScreen(); }
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(); }