public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { _path = AppConfig.GetFullPath("duckstation"); _resolution = resolution; string exe = Path.Combine(_path, "duckstation-nogui-x64-ReleaseLTCG.exe"); if (!File.Exists(exe)) { return(null); } SetupSettings(); if (SystemConfig["ratio"] == "4:3") { _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); } _resolution = resolution; return(new ProcessStartInfo() { FileName = exe, WorkingDirectory = _path, Arguments = "\"" + rom + "\"", }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { string path = AppConfig.GetFullPath("supermodel"); string exe = Path.Combine(path, "supermodel.exe"); if (!File.Exists(exe)) { return(null); } List <string> args = new List <string>(); if (resolution != null) { args.Add("-res=" + resolution.Width + "," + resolution.Height); } else { args.Add("-res=" + Screen.PrimaryScreen.Bounds.Width + "," + Screen.PrimaryScreen.Bounds.Height); } _resolution = resolution; if (ReshadeManager.Setup(ReshadeBezelType.opengl, system, rom, path, resolution)) { args.Add("-fullscreen"); } else { _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); if (_bezelFileInfo == null) { args.Add("-fullscreen"); if (SystemConfig["ratio"] != "4:3") { args.Add("-wide-screen"); args.Add("-stretch"); } } } if (SystemConfig["VSync"] != "false") { args.Add("-vsync"); } args.Add("\"" + rom + "\""); return(new ProcessStartInfo() { FileName = exe, Arguments = string.Join(" ", args), WorkingDirectory = path, }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { string folderName = (emulator == "dolphin-triforce" || core == "dolphin-triforce" || emulator == "triforce" || core == "triforce") ? "dolphin-triforce" : "dolphin"; string path = AppConfig.GetFullPath(folderName); if (string.IsNullOrEmpty(path)) { path = AppConfig.GetFullPath("dolphin"); } if (string.IsNullOrEmpty(path)) { path = AppConfig.GetFullPath("dolphin-emu"); } string exe = Path.Combine(path, "Dolphin.exe"); if (!File.Exists(exe)) { _triforce = true; exe = Path.Combine(path, "DolphinWX.exe"); } if (!File.Exists(exe)) { return(null); } string portableFile = Path.Combine(path, "portable.txt"); if (!File.Exists(portableFile)) { File.WriteAllText(portableFile, ""); } if ((system == "gamecube" && SystemConfig["ratio"] == "") || SystemConfig["ratio"] == "4/3") { _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); } _resolution = resolution; SetupGeneralConfig(path, system); SetupGfxConfig(path); DolphinControllers.WriteControllersConfig(path, system, rom); return(new ProcessStartInfo() { FileName = exe, Arguments = "-b -e \"" + rom + "\"", WorkingDirectory = path, WindowStyle = (_bezelFileInfo == null ? ProcessWindowStyle.Normal : ProcessWindowStyle.Maximized) }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { string path = AppConfig.GetFullPath("gsplus-win-sdl"); if (string.IsNullOrEmpty(path)) { path = AppConfig.GetFullPath("gsplus"); } string exe = Path.Combine(path, "gsplus.exe"); if (!File.Exists(exe)) { return(null); } IniFile conf = new IniFile(Path.Combine(path, "config.txt"), true); conf.WriteValue(null, "s5d1", ""); conf.WriteValue(null, "s5d2", ""); conf.WriteValue(null, "s6d1", ""); conf.WriteValue(null, "s6d2", ""); conf.WriteValue(null, "s7d1", ""); if (!string.IsNullOrEmpty(AppConfig["bios"]) && Directory.Exists(AppConfig["bios"])) { conf.WriteValue(null, "g_cfg_rom_path", Path.Combine(AppConfig.GetFullPath("bios"), "APPLE2GS.ROM")); } if (Path.GetExtension(rom).ToLowerInvariant() == ".2mg") { conf.WriteValue(null, "s7d1", rom); } conf.Save(); _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); _resolution = resolution; string screenShots = ""; if (!string.IsNullOrEmpty(AppConfig["thumbnails"]) && Directory.Exists(AppConfig["thumbnails"])) { screenShots = " -ssdir \"" + AppConfig.GetFullPath("thumbnails") + "\""; } return(new ProcessStartInfo() { FileName = exe, WorkingDirectory = path, Arguments = "-borderless -sw 1920 -sh 1080" + screenShots, }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { _path = AppConfig.GetFullPath("pcsx2"); _resolution = resolution; string exe = Path.Combine(_path, "pcsx2.exe"); if (!File.Exists(exe)) { return(null); } SetupPaths(); SetupVM(); SetupLilyPad(); SetupGSDx(resolution); if (SystemConfig["ratio"] == "4:3") { _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); } _resolution = resolution; List <string> commandArray = new List <string>(); commandArray.Add("--portable"); commandArray.Add("--fullscreen"); commandArray.Add("--nogui"); if (SystemConfig.isOptSet("fullboot") && SystemConfig.getOptBoolean("fullboot")) { commandArray.Add("--fullboot"); } string args = string.Join(" ", commandArray); return(new ProcessStartInfo() { FileName = exe, WorkingDirectory = _path, Arguments = args + " \"" + rom + "\"", }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { string path = AppConfig.GetFullPath("applewin"); string exe = Path.Combine(path, "applewin.exe"); if (!File.Exists(exe)) { return(null); } _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); _resolution = resolution; return(new ProcessStartInfo() { FileName = exe, WorkingDirectory = path, Arguments = "-f -no-printscreen-dlg -d1 \"" + rom + "\"", }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { _path = AppConfig.GetFullPath("raine"); _resolution = resolution; string exe = Path.Combine(_path, "raine.exe"); if (!File.Exists(exe) || !Environment.Is64BitOperatingSystem) { exe = Path.Combine(_path, "raine32.exe"); } if (!File.Exists(exe)) { return(null); } if (Path.GetExtension(rom).ToLowerInvariant() == ".zip") { rom = Path.GetFileNameWithoutExtension(rom); } SetupSettings(); if (SystemConfig["ratio"] == "ON") { _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); } _resolution = resolution; return(new ProcessStartInfo() { FileName = exe, WorkingDirectory = _path, Arguments = "-n -fs 1 \"" + rom + "\"", }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { _resolution = resolution; _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); string path = AppConfig.GetFullPath("tsugaru"); string exe = Path.Combine(path, "Tsugaru_CUI.exe"); if (!File.Exists(exe)) { return(null); } List <string> commandArray = new List <string>(); string biosPath = null; if (!string.IsNullOrEmpty(AppConfig["bios"])) { if (Directory.Exists(Path.Combine(AppConfig.GetFullPath("bios"), "fmtownsux"))) { biosPath = Path.Combine(AppConfig.GetFullPath("bios"), "fmtownsux"); } else if (Directory.Exists(Path.Combine(AppConfig.GetFullPath("bios"), "fmtowns"))) { biosPath = Path.Combine(AppConfig.GetFullPath("bios"), "fmtowns"); } else if (Directory.Exists(Path.Combine(path, "roms"))) { biosPath = Path.Combine(path, "roms"); } else if (Directory.Exists(Path.Combine(path, "fmtownsux"))) { biosPath = Path.Combine(path, "fmtownsux"); } } if (string.IsNullOrEmpty(biosPath) || !File.Exists(Path.Combine(biosPath, "FMT_SYS.ROM"))) { SimpleLogger.Instance.Info("TsugaruGenerator : Bios path not found"); return(null); } commandArray.Add(biosPath); commandArray.Add("-CMOS"); commandArray.Add(Path.Combine(biosPath, "CMOS.DAT")); commandArray.Add("-WINDOWSHIFT"); if (Directory.Exists(rom)) { var cueFile = Directory.GetFiles(rom, "*.cue").FirstOrDefault(); if (!string.IsNullOrEmpty(cueFile)) { commandArray.Add("-CD"); commandArray.Add(cueFile); } else { SimpleLogger.Instance.Info("TsugaruGenerator : Cue file not found"); return(null); } } else { string ext = Path.GetExtension(rom).ToLowerInvariant(); if (ext == ".cue" || ext == ".iso") { commandArray.Add("-CD"); commandArray.Add(rom); } else { commandArray.Add("-FD0"); commandArray.Add(rom); } } commandArray.Add("-GAMEPORT0"); int joyIndex = -1; int joys = WinMM.joyGetNumDevs(); for (int i = 0; i < joys; i++) { WinMM.JOYCAPS caps = new WinMM.JOYCAPS(); int ret = WinMM.joyGetDevCapsA(i, ref caps, Marshal.SizeOf(caps)); if (ret == 0) { joyIndex = i; break; } } if (joyIndex >= 0) { commandArray.Add("PHYS" + joyIndex.ToString()); } else { commandArray.Add("KEY"); } commandArray.Add("-GAMEPORT1"); commandArray.Add("MOUSE"); commandArray.Add("-AUTOSCALE"); commandArray.Add("-MAXIMIZE"); commandArray.Add("-FREQ"); commandArray.Add("33"); commandArray.Add("-MEMSIZE"); commandArray.Add("8"); // commandArray.Add("-NOCATCHUPREALTIME"); commandArray.Add("-MOUSEINTEGSPD"); commandArray.Add("32"); for (int i = 0; i < commandArray.Count; i++) { commandArray[i] = "\"" + commandArray[i] + "\""; } string args = string.Join(" ", commandArray); return(new ProcessStartInfo() { FileName = exe, WorkingDirectory = path, WindowStyle = ProcessWindowStyle.Minimized, Arguments = args, }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { string path = AppConfig.GetFullPath("m2emulator"); string exe = Path.Combine(path, "emulator_multicpu.exe"); if (core != null && core.ToLower().Contains("singlecpu")) { exe = Path.Combine(path, "emulator.exe"); } if (!File.Exists(exe)) { return(null); } string pakDir = Path.Combine(path, "roms"); if (!Directory.Exists(pakDir)) { Directory.CreateDirectory(pakDir); } foreach (var file in Directory.GetFiles(pakDir)) { if (Path.GetFileName(file) == Path.GetFileName(rom)) { continue; } File.Delete(file); } _destFile = Path.Combine(pakDir, Path.GetFileName(rom)); if (!File.Exists(_destFile)) { File.Copy(rom, _destFile); try { new FileInfo(_destFile).Attributes &= ~FileAttributes.ReadOnly; } catch { } } string parentRom = null; if (parentRoms.TryGetValue(Path.GetFileNameWithoutExtension(rom).ToLowerInvariant(), out parentRom)) { parentRom = Path.Combine(Path.GetDirectoryName(rom), parentRom + ".zip"); _destParent = Path.Combine(pakDir, Path.GetFileName(parentRom)); if (!File.Exists(_destParent)) { File.Copy(parentRom, _destParent); try { new FileInfo(_destParent).Attributes &= ~FileAttributes.ReadOnly; } catch { } } } _resolution = resolution; if (!ReshadeManager.Setup(ReshadeBezelType.d3d9, system, rom, path, resolution)) { _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); } SetupConfig(path, resolution); string arg = Path.GetFileNameWithoutExtension(_destFile); return(new ProcessStartInfo() { FileName = exe, Arguments = arg, WorkingDirectory = path, }); }
public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution) { string path = AppConfig.GetFullPath("supermodel"); string exe = Path.Combine(path, "supermodel.exe"); if (!File.Exists(exe)) { return(null); } List <string> args = new List <string>(); bool isWideScreen = false; if (resolution != null) { isWideScreen = ((float)resolution.Width / (float)resolution.Height) > 1.75f; args.Add("-res=" + resolution.Width + "," + resolution.Height); } else { isWideScreen = ((float)Screen.PrimaryScreen.Bounds.Width / (float)Screen.PrimaryScreen.Bounds.Height) >= 1.75f; args.Add("-res=" + Screen.PrimaryScreen.Bounds.Width + "," + Screen.PrimaryScreen.Bounds.Height); } _resolution = resolution; bool wideScreen = SystemConfig["widescreen"] == "1" || SystemConfig["widescreen"] == "2" || (!SystemConfig.isOptSet("widescreen") && isWideScreen); if (wideScreen) { ReshadeManager.Setup(ReshadeBezelType.opengl, null, null, path, resolution); args.Add("-fullscreen"); if (SystemConfig["widescreen"] == "2") { args.Add("-stretch"); } else { args.Add("-wide-screen"); } } else { if (ReshadeManager.Setup(ReshadeBezelType.opengl, system, rom, path, resolution)) { args.Add("-fullscreen"); } else { _bezelFileInfo = BezelFiles.GetBezelFiles(system, rom, resolution); if (_bezelFileInfo == null) { args.Add("-fullscreen"); } } } // quad rendering if (SystemConfig.isOptSet("quadRendering") && SystemConfig.getOptBoolean("quadRendering")) { args.Add("-quad-rendering"); } // crosshairs if (SystemConfig.isOptSet("crosshairs")) { args.Add("-crosshairs=" + SystemConfig["crosshairs"]); } // force feedback if (SystemConfig.isOptSet("forceFeedback") && SystemConfig.getOptBoolean("forceFeedback")) { args.Add("-force-feedback"); } try { string iniPath = Path.Combine(path, "Config", "Supermodel.ini"); if (File.Exists(iniPath)) { using (IniFile ini = new IniFile(iniPath, false)) { ini.WriteValue(" Global ", "FullScreen", _bezelFileInfo == null ? "1" : "0"); ini.WriteValue(" Global ", "WideScreen", wideScreen ? "1" : "0"); ini.Save(); } } } catch { } if (SystemConfig["VSync"] != "false") { args.Add("-vsync"); } args.Add("\"" + rom + "\""); return(new ProcessStartInfo() { FileName = exe, Arguments = string.Join(" ", args), WorkingDirectory = path, }); }