示例#1
0
        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);
        }
示例#2
0
        public void ApplyConfig()
        {
            if (Program.IsMono)
            {
                FileAssociationHelper.ConfigureLinuxMimeTypes();
            }
            else
            {
                FileAssociationHelper.UpdateFileAssociation("sfc", this.AssociateRomFiles);
                FileAssociationHelper.UpdateFileAssociation("smc", this.AssociateRomFiles);
                FileAssociationHelper.UpdateFileAssociation("swc", this.AssociateRomFiles);
                FileAssociationHelper.UpdateFileAssociation("fig", this.AssociateRomFiles);
                FileAssociationHelper.UpdateFileAssociation("msm", this.AssociateMsmFiles);
                FileAssociationHelper.UpdateFileAssociation("mss", this.AssociateMssFiles);
                FileAssociationHelper.UpdateFileAssociation("spc", this.AssociateSpcFiles);
                FileAssociationHelper.UpdateFileAssociation("bs", this.AssociateBsFiles);
            }

            frmMain.Instance.TopMost = AlwaysOnTop;

            ShortcutKeyInfo[] shortcutKeys = new ShortcutKeyInfo[ShortcutKeys1.Count + ShortcutKeys2.Count];
            int i = 0;

            foreach (ShortcutKeyInfo shortcutInfo in ShortcutKeys1)
            {
                shortcutKeys[i++] = shortcutInfo;
            }
            foreach (ShortcutKeyInfo shortcutInfo in ShortcutKeys2)
            {
                shortcutKeys[i++] = shortcutInfo;
            }
            ConfigApi.SetShortcutKeys(shortcutKeys, (UInt32)shortcutKeys.Length);

            ConfigApi.SetPreferences(new InteropPreferencesConfig()
            {
                ShowFps                    = ShowFps,
                ShowFrameCounter           = ShowFrameCounter,
                ShowGameTimer              = ShowGameTimer,
                ShowDebugInfo              = ShowDebugInfo,
                DisableOsd                 = DisableOsd,
                AllowBackgroundInput       = AllowBackgroundInput,
                PauseOnMovieEnd            = PauseOnMovieEnd,
                DisableGameSelectionScreen = DisableGameSelectionScreen,
                SaveFolderOverride         = OverrideSaveDataFolder ? SaveDataFolder : "",
                SaveStateFolderOverride    = OverrideSaveStateFolder ? SaveStateFolder : "",
                ScreenshotFolderOverride   = OverrideScreenshotFolder ? ScreenshotFolder : "",
                RewindBufferSize           = RewindBufferSize
            });
        }