private void closeROMToolStripMenuItem_Click(object sender, EventArgs e) { this._YI = (SNES.ROMFile)null; this.EnableMenus(false); this._LevelEditor.OnROMClosed(); this._LevelEditor = (LevelEditor)null; }
private void OpenTheROMFile(string path) { try { SNES.ROMFile romFile = new SNES.ROMFile(); if (!romFile.Open(path)) { throw new Exception(romFile.GetLastError()); } if (romFile.Title != "YOSHI'S ISLAND") { throw new Exception("The loaded ROM is not Yoshi's Island."); } if ((int)(byte)romFile.ROM[32729] != 1) { throw new Exception("The loaded ROM's country code is other than the North America version."); } if ((int)(byte)romFile.ROM[32731] != 0) { throw new Exception("The loaded ROM version is not 1.00"); } this._YI = romFile; this.ROMpath = path; this.EnableMenus(true); this.EnableEditor(0); } catch (Exception ex) { int num = (int)MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }