private void run(Filesystem fs) { ROM.load(fs); SpriteData.Load(); if (Properties.Settings.Default.mdi) { new MdiParentForm().Show(); } else { new LevelChooser().Show(); } close = false; Close(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string langDir = System.IO.Path.Combine(Application.StartupPath, "Languages"); string langFileName = System.IO.Path.Combine(langDir, Properties.Settings.Default.LanguageFile + ".ini"); if (System.IO.File.Exists(langFileName)) { System.IO.StreamReader rdr = new StreamReader(langFileName); LanguageManager.Load(rdr.ReadToEnd().Split('\n')); rdr.Close(); } else { MessageBox.Show("File " + langFileName + " could not be found, so the language has defaulted to English."); LanguageManager.Load(Properties.Resources.English.Split('\n')); } string[] args = Environment.GetCommandLineArgs(); if (args.Length == 2) { Console.Out.WriteLine("Loading ROM: " + args[1]); NitroROMFilesystem fs = new NitroROMFilesystem(args[1]); ROM.load(fs); SpriteData.Load(); if (Properties.Settings.Default.mdi) { new MdiParentForm().Show(); } else { new LevelChooser().Show(); } } else { new StartForm().Show(); } Application.Run(); //string[] args = Environment.GetCommandLineArgs(); /* * * if(args.Length > 2 && args[2] == "asmpatch") * { * PatchMaker pm = new PatchMaker(ROM.romfile.Directory); * pm.restore(); * pm.generatePatch(); * } * else if(args.Length > 2 && args[2] == "getcodeaddr") * { * PatchMaker pm = new PatchMaker(ROM.romfile.Directory); * pm.restore(); * Console.Out.WriteLine(String.Format("{0:X8}", pm.getCodeAddr())); * }*/ }