private void Open_Click(object sender, RoutedEventArgs e) { //chip.Reset(); byte[] fileArray; Microsoft.Win32.OpenFileDialog dialog = new Microsoft.Win32.OpenFileDialog(); if (dialog.ShowDialog() != null) { string fileName = dialog.FileName; fileArray = File.ReadAllBytes(fileName); chip.Reset(); Draw(new bool[64 * 32]); chip.LoadFile(fileArray); cycle -= Nop; cycle = new EmulateCycle(chip.Tick); } }
public MainWindow() { InitializeComponent(); this.MinWidth = 70; this.MinHeight = 80; chip = new Chip8(); gameHeight = 32; gameWidth = 64; disp = new Chip8EmulatedDisplay(64, 32); _ArrayPosition = disp.getArray(); //_ArrayPosition = new float[]{ 0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.1f }; _ArrayColor = new float[32 * 64 * 18]; cycle = new EmulateCycle(Nop); var myTextBlock = (System.Windows.Controls.Label) this.FindName("opcodeLabel"); myTextBlock.Content = _ArrayPosition.Length; }