static public void ApplyConfig() { PreferenceInfo preferenceInfo = ConfigManager.Config.PreferenceInfo; if (Program.IsMono) { FileAssociationHelper.ConfigureLinuxMimeTypes(); } else { FileAssociationHelper.UpdateFileAssociation("nes", preferenceInfo.AssociateNesFiles); FileAssociationHelper.UpdateFileAssociation("fds", preferenceInfo.AssociateFdsFiles); FileAssociationHelper.UpdateFileAssociation("mmo", preferenceInfo.AssociateMmoFiles); FileAssociationHelper.UpdateFileAssociation("mst", preferenceInfo.AssociateMstFiles); FileAssociationHelper.UpdateFileAssociation("nsf", preferenceInfo.AssociateNsfFiles); FileAssociationHelper.UpdateFileAssociation("nsfe", preferenceInfo.AssociateNsfFiles); FileAssociationHelper.UpdateFileAssociation("unf", preferenceInfo.AssociateUnfFiles); } InteropEmu.SetFlag(EmulationFlags.AllowInvalidInput, preferenceInfo.AllowInvalidInput); InteropEmu.SetFlag(EmulationFlags.RemoveSpriteLimit, preferenceInfo.RemoveSpriteLimit); InteropEmu.SetFlag(EmulationFlags.FdsAutoLoadDisk, preferenceInfo.FdsAutoLoadDisk); InteropEmu.SetFlag(EmulationFlags.FdsFastForwardOnLoad, preferenceInfo.FdsFastForwardOnLoad); InteropEmu.SetFlag(EmulationFlags.FdsAutoInsertDisk, preferenceInfo.FdsAutoInsertDisk); InteropEmu.SetFlag(EmulationFlags.PauseOnMovieEnd, preferenceInfo.PauseOnMovieEnd); InteropEmu.SetFlag(EmulationFlags.AllowBackgroundInput, preferenceInfo.AllowBackgroundInput); InteropEmu.SetFlag(EmulationFlags.PauseWhenInBackground, preferenceInfo.PauseWhenInBackground || preferenceInfo.PauseWhenInMenusAndConfig || preferenceInfo.PauseWhenInDebuggingTools); InteropEmu.SetFlag(EmulationFlags.DisableGameDatabase, preferenceInfo.DisableGameDatabase); InteropEmu.SetFlag(EmulationFlags.DisableOsd, preferenceInfo.DisableOsd); InteropEmu.SetFlag(EmulationFlags.AllowMismatchingSaveStates, preferenceInfo.AllowMismatchingSaveStates); InteropEmu.SetFlag(EmulationFlags.ShowFrameCounter, preferenceInfo.ShowFrameCounter); InteropEmu.SetFlag(EmulationFlags.ShowGameTimer, preferenceInfo.ShowGameTimer); InteropEmu.SetFlag(EmulationFlags.HidePauseOverlay, preferenceInfo.HidePauseOverlay); InteropEmu.SetFlag(EmulationFlags.DisplayMovieIcons, preferenceInfo.DisplayMovieIcons); InteropEmu.SetFlag(EmulationFlags.DisableGameSelectionScreen, preferenceInfo.DisableGameSelectionScreen); InteropEmu.SetFlag(EmulationFlags.ConfirmExitResetPower, preferenceInfo.ConfirmExitResetPower); InteropEmu.NsfSetNsfConfig(preferenceInfo.NsfAutoDetectSilence ? preferenceInfo.NsfAutoDetectSilenceDelay : 0, preferenceInfo.NsfMoveToNextTrackAfterTime ? preferenceInfo.NsfMoveToNextTrackTime : -1, preferenceInfo.NsfDisableApuIrqs); InteropEmu.SetFlag(EmulationFlags.NsfRepeat, preferenceInfo.NsfRepeat); InteropEmu.SetFlag(EmulationFlags.NsfShuffle, preferenceInfo.NsfShuffle); InteropEmu.SetAutoSaveOptions(preferenceInfo.AutoSave ? (uint)preferenceInfo.AutoSaveDelay : 0, preferenceInfo.AutoSaveNotify); InteropEmu.ClearShortcutKeys(); foreach (ShortcutKeyInfo shortcutInfo in preferenceInfo.ShortcutKeys1) { InteropEmu.SetShortcutKey(shortcutInfo.Shortcut, shortcutInfo.KeyCombination, 0); } foreach (ShortcutKeyInfo shortcutInfo in preferenceInfo.ShortcutKeys2) { InteropEmu.SetShortcutKey(shortcutInfo.Shortcut, shortcutInfo.KeyCombination, 1); } InteropEmu.SetRewindBufferSize(preferenceInfo.RewindBufferSize); InteropEmu.SetFolderOverrides(ConfigManager.SaveFolder, ConfigManager.SaveStateFolder, ConfigManager.ScreenshotFolder); }
public static void ApplyPreferenceConfig() { InteropEmu.SetOsdState(false); InteropEmu.SetGameDatabaseState(true); InteropEmu.SetFlag(EmulationFlags.AllowInvalidInput, false); InteropEmu.SetFlag(EmulationFlags.RemoveSpriteLimit, false); InteropEmu.SetFlag(EmulationFlags.FdsAutoLoadDisk, true); InteropEmu.SetFlag(EmulationFlags.FdsFastForwardOnLoad, false); InteropEmu.SetFlag(EmulationFlags.FdsAutoInsertDisk, false); InteropEmu.SetFlag(EmulationFlags.PauseOnMovieEnd, true); InteropEmu.SetFlag(EmulationFlags.AllowBackgroundInput, false); InteropEmu.SetFlag(EmulationFlags.UseHighResolutionTimer, true); InteropEmu.SetFlag(EmulationFlags.AllowMismatchingSaveStates, false); InteropEmu.SetFlag(EmulationFlags.ShowFrameCounter, false); InteropEmu.SetFlag(EmulationFlags.ShowGameTimer, false); InteropEmu.SetFlag(EmulationFlags.HidePauseOverlay, false); InteropEmu.SetFlag(EmulationFlags.DisplayMovieIcons, false); InteropEmu.SetFlag(EmulationFlags.DisableGameSelectionScreen, false); InteropEmu.SetFlag(EmulationFlags.ConfirmExitResetPower, false); InteropEmu.NsfSetNsfConfig(3000, 120, true); InteropEmu.SetFlag(EmulationFlags.NsfRepeat, false); InteropEmu.SetFlag(EmulationFlags.NsfShuffle, false); InteropEmu.SetFlag(EmulationFlags.DisplayDebugInfo, false); InteropEmu.SetFlag(EmulationFlags.VsDualMuteMaster, false); InteropEmu.SetFlag(EmulationFlags.VsDualMuteSlave, false); InteropEmu.SetAutoSaveOptions(5, false); InteropEmu.ClearShortcutKeys(); InteropEmu.SetRewindBufferSize(300); InteropEmu.SetFolderOverrides(Path.Combine(Program.EmulatorDirectory, "Saves"), Path.Combine(Program.EmulatorDirectory, "SaveStates"), Path.Combine(Program.EmulatorDirectory, "Screenshots")); }