protected override System.Diagnostics.ProcessStartInfo launchEmulatorInternal(Game game) { List<string> args = new List<string>(); args.Add(game.filePath); ProcessStartInfo info = new ProcessStartInfo(); info.Arguments = string.Join(" ", args); info.CreateNoWindow = true; info.FileName = mExecutableFile.FullName; info.WindowStyle = ProcessWindowStyle.Maximized; info.WorkingDirectory = mRootDir.FullName; info.UseShellExecute = false; return info; }
protected override ProcessStartInfo launchEmulatorInternal(Game game) { List<string> args = new List<string>(); args.Add(game.name); args.Add("-joy"); args.Add("-paddle_device joystick"); args.Add("-adstick_device joystick"); args.Add("-pedal_device joystick"); args.Add("-dial_device joystick"); args.Add("-trackball_device joystick"); args.Add("-lightgun_device joystick"); args.Add("-positional_device joystick"); ProcessStartInfo info = new ProcessStartInfo(); info.Arguments = string.Join(" ", args.ToArray()); info.CreateNoWindow = true; info.FileName = mExecutableFile.FullName; info.WindowStyle = ProcessWindowStyle.Hidden; info.WorkingDirectory = mRootDir.FullName; info.UseShellExecute = false; return info; }
protected override IEnumerable<Game> locateGames(System.IO.DirectoryInfo dir) { List<Game> games = new List<Game>(); foreach (FileInfo file in dir.GetFiles("*.z64", SearchOption.AllDirectories).ToList()) { Game game = new Game(this); game.name = file.Name.Remove(file.Name.Length - 4); game.filePath = file.FullName; games.Add(game); } return games; }
protected override IEnumerable<Game> locateGames(DirectoryInfo dir) { List<Game> games = new List<Game>(); //search the top level directories to identify and single game rom foreach (DirectoryInfo romDir in dir.EnumerateDirectories("*", SearchOption.TopDirectoryOnly)) { if (romDir.GetFiles().Length > 0) { Game game = new Game(this); game.name = romDir.Name; game.filePath = romDir.FullName; games.Add(game); } } //search for zip files foreach (FileInfo romZipFile in dir.EnumerateFiles("*.zip", SearchOption.TopDirectoryOnly)) { Game game = new Game(this); game.name = romZipFile.Name.Remove(romZipFile.Name.IndexOf(".zip")); game.filePath = romZipFile.FullName; games.Add(game); } return games; }
protected abstract ProcessStartInfo launchEmulatorInternal(Game game);
public void launchEmulator(Game game) { if (!isRunning && mRootDir.Exists && mExecutableFile != null && mExecutableFile.Exists) { ProcessStartInfo info = launchEmulatorInternal(game); info.RedirectStandardOutput = true; info.RedirectStandardError = true; mProcess = Process.Start(info); mOutputReader.RunWorkerAsync(); mProcess.Exited += new EventHandler(onProcessExited); Console.WriteLine("Starting " + displayName); if (launched != null) { launched(this); } } }