/// <summary> /// Display - Vsync /// </summary> private void cbxVsync_Checked(object sender, RoutedEventArgs e) { // Write to mupen64plus.cfg List <Action> actionsToWrite = new List <Action> { new Action(() => { // ------------------------- // [Video-General] // ------------------------- if (VM.DisplayView.Display_Vsync_IsChecked == true) { Configure.ConigFile.cfg.Write("Video-General", "VerticalSync", "True"); } else if (VM.DisplayView.Display_Vsync_IsChecked == false) { Configure.ConigFile.cfg.Write("Video-General", "VerticalSync", "False"); } }), }; MupenCfg.WriteMupen64PlusCfg(VM.PathsView.Config_Text, // Directory: %AppData%\Mupen64Plus\ "mupen64plus.cfg", // Filename actionsToWrite // Actions to write ); }
/// <summary> /// Disable Spec Recomp /// </summary> private void cbxDisableSpecRecomp_Checked(object sender, RoutedEventArgs e) { // Write to mupen64plus.cfg List <Action> actionsToWrite = new List <Action> { new Action(() => { // ------------------------- // [Core] // ------------------------- if (VM.EmulatorView.Emulator_DisableSpecRecomp_IsChecked == true) { Configure.ConigFile.cfg.Write("Core", "DisableSpecRecomp", "True"); } else if (VM.EmulatorView.Emulator_DisableSpecRecomp_IsChecked == false) { Configure.ConigFile.cfg.Write("Core", "DisableSpecRecomp", "False"); } }), }; MupenCfg.WriteMupen64PlusCfg(VM.PathsView.Config_Text, // Directory: %AppData%\Mupen64Plus\ "mupen64plus.cfg", // Filename actionsToWrite // Actions to write ); }
/// <summary> /// Resolution /// </summary> private void cboResolution_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Write to mupen64plus.cfg List <Action> actionsToWrite = new List <Action> { new Action(() => { // ------------------------- // [Video-General] // ------------------------- List <string> splitRes = new List <string>(); splitRes = VM.DisplayView.Display_Resolution_SelectedItem.Split('x').ToList(); string width = string.Empty; string height = string.Empty; if (splitRes.Count > 1) // null check { width = splitRes[0]; height = splitRes[1]; } Configure.ConigFile.cfg.Write("Video-General", "ScreenWidth", width); Configure.ConigFile.cfg.Write("Video-General", "ScreenHeight", height); }), }; MupenCfg.WriteMupen64PlusCfg(VM.PathsView.Config_Text, // Directory: %AppData%\Mupen64Plus\ "mupen64plus.cfg", // Filename actionsToWrite // Actions to write ); }
/// <summary> /// Display - View /// </summary> private void cboView_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Write to mupen64plus.cfg List <Action> actionsToWrite = new List <Action> { new Action(() => { // Fullscreen if (VM.DisplayView.Display_View_SelectedItem == "Fullscreen") { Configure.ConigFile.cfg.Write("Video-General", "Fullscreen", "True"); } // Windowed else if (VM.DisplayView.Display_View_SelectedItem == "Windowed") { Configure.ConigFile.cfg.Write("Video-General", "Fullscreen", "False"); } }), }; MupenCfg.WriteMupen64PlusCfg(VM.PathsView.Config_Text, // Directory: %AppData%\Mupen64Plus\ "mupen64plus.cfg", // Filename actionsToWrite // Actions to write ); }
/// <summary> /// Scan and Load Plugins Async /// </summary> public static async Task <int> ScanAndLoadPluginsAsync(MainWindow mainwindow) { int count = 0; await Task.Run(() => { ScanPlugins(mainwindow); mainwindow.Dispatcher.Invoke(() => // must use dispatcher to cross-thread { MupenCfg.LoadPlugins(mainwindow); }); }); return(count); }
/// <summary> /// Cycles /// </summary> private void cboEmulator_Cycles_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Write to mupen64plus.cfg List <Action> actionsToWrite = new List <Action> { new Action(() => { if (!string.IsNullOrEmpty(VM.EmulatorView.Emulator_Cycles_SelectedItem)) { Configure.ConigFile.cfg.Write("Core", "CountPerOp", VM.EmulatorView.Emulator_Cycles_SelectedItem); } }), }; MupenCfg.WriteMupen64PlusCfg(VM.PathsView.Config_Text, // Directory: %AppData%\Mupen64Plus\ "mupen64plus.cfg", // Filename actionsToWrite // Actions to write ); }
/// <summary> /// Pure Interpreter /// </summary> private void cboCPU_SelectionChanged(object sender, SelectionChangedEventArgs e) { string cpu = string.Empty; switch (VM.EmulatorView.CPU_SelectedItem) { case "Pure Interpreter": cpu = "0"; break; case "Cached Interpreter": cpu = "1"; break; case "Dynamic Recompiler": cpu = "2"; break; default: cpu = "2"; break; } // Write to mupen64plus.cfg List <Action> actionsToWrite = new List <Action> { new Action(() => { // ------------------------- // [Core] // ------------------------- Configure.ConigFile.cfg.Write("Core", "R4300Emulator", cpu); }), }; MupenCfg.WriteMupen64PlusCfg(VM.PathsView.Config_Text, // Directory: %AppData%\Mupen64Plus\ "mupen64plus.cfg", // Filename actionsToWrite // Actions to write ); }
/// <summary> /// RSP /// </summary> private void cboPlugin_RSP_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Write to mupen64plus.cfg List <Action> actionsToWrite = new List <Action> { new Action(() => { if (!string.IsNullOrEmpty(VM.PluginsView.RSP_SelectedItem)) { // ------------------------- // [UI-Console] // ------------------------- Configure.ConigFile.cfg.Write("UI-Console", "RspPlugin", "\"" + Path.Combine(VM.PathsView.Config_Text, VM.PluginsView.RSP_SelectedItem) + "\""); } }), }; MupenCfg.WriteMupen64PlusCfg(VM.PathsView.Config_Text, // Directory: %AppData%\Mupen64Plus\ "mupen64plus.cfg", // Filename actionsToWrite // Actions to write ); }