public DWindow(NES6502 cpu, Cart cr, NESCore nes) { this.cpu = cpu; this.cr = cr; this.nes = nes; InitializeComponent(); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "NES Roms (*.nes)|*.nes"; if (ofd.ShowDialog() == DialogResult.OK) { fileName = ofd.FileName; //START INIT CODE cr = cs.ReadCart(fileName); nes = new NESCore(cr); cpu = new NES6502(cr, nes); ren = new BMP16Renderer(cr); ppu = new PPUCore(cr, ren); cpu.pc_reg = nes.GetResetAddr(); //END INIT CODE MessageBox.Show("PRG ROM loaded!!!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); buttons(true); } }