private void menuItemOpenRom_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "Game Boy ROMs (*.gb, *.gbc, *.bin, *.rom)|*.gb;*.gbc;*.bin;*.rom|All Files (*.*)|*.*"; fd.FilterIndex = 1; fd.Multiselect = false; var okSelected = fd.ShowDialog(); if (okSelected == DialogResult.OK) { Cart cart = new Cart(fd.FileName); gb.LoadCart(cart); Console.WriteLine(cart.GetCartType()); if (File.ReadAllBytes(fd.FileName).Length == 0x10000 && cart.GetCartType() == CartType.ROM) { //Doesn't execute CPU when loading a ramdump return; } gb.Start(); debuggerForm.Initialize(); } }
private void _BadCartPathTestBody() { Cart cart = new Cart(Path.Combine(cartPath, "blahblahblah.gbnevertobefound")); }