public N64VideoPluginConfig(
            IMainFormForConfig mainForm,
            Config config,
            IEmulator emulator)
        {
            _mainForm = mainForm;
            _config   = config;
            _emulator = emulator;

            // because mupen is a pile of garbage, this all needs to work even when N64 is not loaded
            if (_emulator is N64 n64)
            {
                _s  = n64.GetSettings();
                _ss = n64.GetSyncSettings();
            }
            else
            {
                _s = _config.GetCoreSettings <N64, N64Settings>()
                     ?? new N64Settings();
                _ss = _config.GetCoreSyncSettings <N64, N64SyncSettings>()
                      ?? new N64SyncSettings();
            }

            InitializeComponent();
            Icon = Properties.Resources.monitor_MultiSize;
        }
        private void NewN64PluginSettings_Load(object sender, EventArgs e)
        {
            s  = GetSettings();
            ss = GetSyncSettings();

            CoreTypeDropdown.PopulateFromEnum <N64SyncSettings.CoreType>(ss.Core);
            RspTypeDropdown.PopulateFromEnum <N64SyncSettings.RspType>(ss.Rsp);
            PluginComboBox.PopulateFromEnum <PluginType>(ss.VideoPlugin);

            VideoResolutionXTextBox.Text = s.VideoSizeX.ToString();
            VideoResolutionYTextBox.Text = s.VideoSizeY.ToString();

            var video_setting = s.VideoSizeX
                                + " x "
                                + s.VideoSizeY;

            var index = VideoResolutionComboBox.Items.IndexOf(video_setting);

            if (index >= 0)
            {
                VideoResolutionComboBox.SelectedIndex = index;
            }
            else if (PluginComboBox.SelectedIndex != 4)
            {
                VideoResolutionComboBox.SelectedIndex = 13;
                ShowCustomVideoResolutionControls();
            }

            RicePropertyGrid.SelectedObject     = ss.RicePlugin;
            Glidemk2PropertyGrid.SelectedObject = ss.Glide64mk2Plugin;
            GlidePropertyGrid.SelectedObject    = ss.GlidePlugin;
            JaboPropertyGrid.SelectedObject     = ss.JaboPlugin;
        }
        public N64VideoPluginConfig(ISettingsAdapter settable)
        {
            _settable = settable;

            _s  = (N64Settings)_settable.GetSettings();
            _ss = (N64SyncSettings)_settable.GetSyncSettings();

            InitializeComponent();
            Icon = Properties.Resources.MonitorIcon;
        }
 private static void PutSettings(N64Settings s)
 {
     if (Global.Emulator is N64)
     {
         GlobalWin.MainForm.PutCoreSettings(s);
     }
     else
     {
         Global.Config.PutCoreSettings <N64>(s);
     }
 }