Exemple #1
0
        private void OkBtn_Click(object sender, EventArgs e)
        {
            switch (ProfileSelectComboBox.SelectedItem.ToString())
            {
            default:
            case "Custom Profile":                     // For now
            case "Casual Gaming":
                Global.Config.SelectedProfile = Config.ClientProfile.Casual;
                break;

            case "Longplays":
                Global.Config.SelectedProfile = Config.ClientProfile.Longplay;
                break;

            case "Tool-assisted Speedruns":
                Global.Config.SelectedProfile = Config.ClientProfile.Tas;
                break;

            case "N64 Tool-assisted Speedruns":
                Global.Config.SelectedProfile = Config.ClientProfile.N64Tas;
                break;
            }

            if (Global.Config.SelectedProfile == Config.ClientProfile.Casual)
            {
                DisplayProfileSettingBoxes(false);
                Global.Config.NoLowResLargeScreenshotWithStates = false;
                Global.Config.SaveScreenshotWithStates          = false;
                Global.Config.AllowUD_LR       = false;
                Global.Config.BackupSavestates = false;

                Global.Config.SaveStateCompressionLevelNormal = 0;
                Global.Config.RewindEnabledLarge  = false;
                Global.Config.RewindEnabledMedium = false;
                Global.Config.RewindEnabledSmall  = true;
                Global.Config.SkipLagFrame        = false;

                // N64
                var n64Settings = GetSyncSettings <N64, N64SyncSettings>();
                n64Settings.Rsp = N64SyncSettings.RspType.Rsp_Hle;
                //n64Settings.Core = N64SyncSettings.CoreType.Dynarec;
                n64Settings.Core = N64SyncSettings.CoreType.Interpret;
                Global.Config.N64UseCircularAnalogConstraint = true;
                PutSyncSettings <N64>(n64Settings);

                // SNES
                Global.Config.SNES_InSnes9x = true;

                // Genesis
                var genesisSettings = GetSyncSettings <GPGX, GPGX.GPGXSyncSettings>();
                genesisSettings.Region = LibGPGX.Region.Autodetect;
                PutSyncSettings <GPGX>(genesisSettings);

                // SMS
                var smsSettings = GetSyncSettings <SMS, SMS.SMSSyncSettings>();
                smsSettings.UseBIOS = true;
                PutSyncSettings <SMS>(smsSettings);

                // Coleco
                var colecoSettings = GetSyncSettings <ColecoVision, ColecoVision.ColecoSyncSettings>();
                colecoSettings.SkipBiosIntro = false;
                PutSyncSettings <ColecoVision>(colecoSettings);

                // A2600
                var a2600Settings = GetSyncSettings <Atari2600, Atari2600.A2600SyncSettings>();
                a2600Settings.FastScBios      = true;
                a2600Settings.LeftDifficulty  = false;
                a2600Settings.RightDifficulty = false;
                PutSyncSettings <Atari2600>(a2600Settings);

                // NES
                Global.Config.NES_InQuickNES = true;
            }
            else if (Global.Config.SelectedProfile == Config.ClientProfile.Longplay)
            {
                DisplayProfileSettingBoxes(false);
                Global.Config.NoLowResLargeScreenshotWithStates = false;
                Global.Config.SaveScreenshotWithStates          = false;
                Global.Config.AllowUD_LR       = false;
                Global.Config.BackupSavestates = false;
                Global.Config.SkipLagFrame     = false;
                Global.Config.SaveStateCompressionLevelNormal = 5;

                Global.Config.RewindEnabledLarge  = false;
                Global.Config.RewindEnabledMedium = false;
                Global.Config.RewindEnabledSmall  = true;

                // N64
                var n64Settings = GetSyncSettings <N64, N64SyncSettings>();
                n64Settings.Core = N64SyncSettings.CoreType.Pure_Interpret;
                Global.Config.N64UseCircularAnalogConstraint = true;
                PutSyncSettings <N64>(n64Settings);

                // SNES
                Global.Config.SNES_InSnes9x = false;

                // Genesis
                var genesisSettings = GetSyncSettings <GPGX, GPGX.GPGXSyncSettings>();
                genesisSettings.Region = LibGPGX.Region.Autodetect;
                PutSyncSettings <GPGX>(genesisSettings);

                // SMS
                var smsSettings = GetSyncSettings <SMS, SMS.SMSSyncSettings>();
                smsSettings.UseBIOS = true;
                PutSyncSettings <SMS>(smsSettings);

                // Coleco
                var colecoSettings = GetSyncSettings <ColecoVision, ColecoVision.ColecoSyncSettings>();
                colecoSettings.SkipBiosIntro = false;
                PutSyncSettings <ColecoVision>(colecoSettings);

                // A2600
                var a2600Settings = GetSyncSettings <Atari2600, Atari2600.A2600SyncSettings>();
                a2600Settings.FastScBios      = false;
                a2600Settings.LeftDifficulty  = true;
                a2600Settings.RightDifficulty = true;
                PutSyncSettings <Atari2600>(a2600Settings);

                // NES
                Global.Config.NES_InQuickNES = true;
            }
            else if (Global.Config.SelectedProfile == Config.ClientProfile.Tas)
            {
                DisplayProfileSettingBoxes(false);

                // General
                Global.Config.NoLowResLargeScreenshotWithStates = false;
                Global.Config.SaveScreenshotWithStates          = true;
                Global.Config.AllowUD_LR       = true;
                Global.Config.BackupSavestates = true;
                Global.Config.SkipLagFrame     = false;
                Global.Config.SaveStateCompressionLevelNormal = 5;

                // Rewind
                Global.Config.RewindEnabledLarge  = false;
                Global.Config.RewindEnabledMedium = false;
                Global.Config.RewindEnabledSmall  = false;

                // N64
                var n64Settings = GetSyncSettings <N64, N64SyncSettings>();
                n64Settings.Core = N64SyncSettings.CoreType.Pure_Interpret;
                Global.Config.N64UseCircularAnalogConstraint = false;
                PutSyncSettings <N64>(n64Settings);

                // SNES
                Global.Config.SNES_InSnes9x = false;

                // Genesis
                var genesisSettings = GetSyncSettings <GPGX, GPGX.GPGXSyncSettings>();
                genesisSettings.Region = LibGPGX.Region.Autodetect;
                PutSyncSettings <GPGX>(genesisSettings);

                // SMS
                var smsSettings = GetSyncSettings <SMS, SMS.SMSSyncSettings>();
                smsSettings.UseBIOS = true;
                PutSyncSettings <SMS>(smsSettings);

                // Coleco
                var colecoSettings = GetSyncSettings <ColecoVision, ColecoVision.ColecoSyncSettings>();
                colecoSettings.SkipBiosIntro = true;
                PutSyncSettings <ColecoVision>(colecoSettings);

                // A2600
                var a2600Settings = GetSyncSettings <Atari2600, Atari2600.A2600SyncSettings>();
                a2600Settings.FastScBios      = false;
                a2600Settings.LeftDifficulty  = true;
                a2600Settings.RightDifficulty = true;
                PutSyncSettings <Atari2600>(a2600Settings);

                // NES
                Global.Config.NES_InQuickNES = true;
            }
            else if (Global.Config.SelectedProfile == Config.ClientProfile.N64Tas)
            {
                DisplayProfileSettingBoxes(false);

                // General
                Global.Config.NoLowResLargeScreenshotWithStates = false;
                Global.Config.SaveScreenshotWithStates          = true;
                Global.Config.AllowUD_LR       = true;
                Global.Config.BackupSavestates = false;
                Global.Config.SkipLagFrame     = true;
                Global.Config.SaveStateCompressionLevelNormal = 0;

                // Rewind
                Global.Config.RewindEnabledLarge  = false;
                Global.Config.RewindEnabledMedium = false;
                Global.Config.RewindEnabledSmall  = false;

                // N64
                var n64Settings = GetSyncSettings <N64, N64SyncSettings>();
                n64Settings.Rsp  = N64SyncSettings.RspType.Rsp_Hle;
                n64Settings.Core = N64SyncSettings.CoreType.Pure_Interpret;
                Global.Config.N64UseCircularAnalogConstraint = false;
                PutSyncSettings <N64>(n64Settings);

                // SNES
                Global.Config.SNES_InSnes9x = false;

                // Genesis
                var genesisSettings = GetSyncSettings <GPGX, GPGX.GPGXSyncSettings>();
                genesisSettings.Region = LibGPGX.Region.Autodetect;
                PutSyncSettings <GPGX>(genesisSettings);

                // SMS
                var smsSettings = GetSyncSettings <SMS, SMS.SMSSyncSettings>();
                smsSettings.UseBIOS = true;
                PutSyncSettings <SMS>(smsSettings);

                // Coleco
                var colecoSettings = GetSyncSettings <ColecoVision, ColecoVision.ColecoSyncSettings>();
                colecoSettings.SkipBiosIntro = true;
                PutSyncSettings <ColecoVision>(colecoSettings);

                // A2600
                var a2600Settings = GetSyncSettings <Atari2600, Atari2600.A2600SyncSettings>();
                a2600Settings.FastScBios      = false;
                a2600Settings.LeftDifficulty  = true;
                a2600Settings.RightDifficulty = true;
                PutSyncSettings <Atari2600>(a2600Settings);

                // NES
                Global.Config.NES_InQuickNES = true;
            }
            else if (Global.Config.SelectedProfile == Config.ClientProfile.Custom)
            {
                // Disabled for now
                ////DisplayProfileSettingBoxes(true);
            }

            bool oldUpdateAutoCheckEnabled = Global.Config.Update_AutoCheckEnabled;

            Global.Config.Update_AutoCheckEnabled = AutoCheckForUpdates.Checked;
            if (Global.Config.Update_AutoCheckEnabled != oldUpdateAutoCheckEnabled)
            {
                if (!Global.Config.Update_AutoCheckEnabled)
                {
                    UpdateChecker.ResetHistory();
                }

                UpdateChecker.BeginCheck();                 // Call even if auto checking is disabled to trigger event (it won't actually check)
            }

            DialogResult = DialogResult.OK;
            Close();
        }