public AmstradCpcNonSyncSettings(ISettingsAdapter settable)
 {
     _settable = settable;
     _settings = (AmstradCPC.AmstradCPCSettings)_settable.GetSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
 public SNESControllerSettings(ISettingsAdapter settable)
 {
     _settable     = settable;
     _syncSettings = (LibsnesCore.SnesSyncSettings)_settable.GetSyncSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
 public IntvControllerSettings(ISettingsAdapter settable)
 {
     _settable     = settable;
     _syncSettings = (Intellivision.IntvSyncSettings)_settable.GetSyncSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
Пример #4
0
        public static DialogResult DoGBLPrefsDialog(
            Config config,
            IDialogParent dialogParent,
            IGameInfo game,
            IMovieSession movieSession,
            ISettingsAdapter settable)
        {
            var s  = (GambatteLink.GambatteLinkSettings)settable.GetSettings();
            var ss = (GambatteLink.GambatteLinkSyncSettings)settable.GetSyncSettings();

            using var dlg = new GBLPrefs(dialogParent.DialogController, config, game, movieSession);
            dlg.PutSettings(s, ss);

            var result = dialogParent.ShowDialogAsChild(dlg);

            if (result == DialogResult.OK)
            {
                dlg.GetSettings(out s, out ss);
                settable.PutCoreSettings(s);
                if (dlg.SyncSettingsChanged)
                {
                    settable.PutCoreSyncSettings(ss);
                }
            }
            return(result);
        }
Пример #5
0
 public A7800ControllerSettings(ISettingsAdapter settable)
 {
     _settable     = settable;
     _syncSettings = (A7800Hawk.A7800SyncSettings)settable.GetSyncSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
Пример #6
0
 public PSXControllerConfig(ISettingsAdapter settable)
 {
     _settable     = settable;
     _syncSettings = (Octoshock.SyncSettings)_settable.GetSyncSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
 public ZxSpectrumCoreEmulationSettings(ISettingsAdapter settable)
 {
     _settable     = settable;
     _syncSettings = (ZXSpectrum.ZXSpectrumSyncSettings)_settable.GetSyncSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
 public ColecoControllerSettings(ISettingsAdapter settable)
 {
     _settable     = settable;
     _syncSettings = (ColecoVision.ColecoSyncSettings)_settable.GetSyncSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
Пример #9
0
 public N64ControllersSetup(ISettingsAdapter settable)
 {
     _settable     = settable;
     _syncSettings = (N64SyncSettings)_settable.GetSyncSettings();
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
Пример #10
0
 public TI83PaletteConfig(ISettingsAdapter settable)
 {
     _settable = settable;
     _settings = (TI83Common.TI83CommonSettings)_settable.GetSettings();
     InitializeComponent();
     Icon = Properties.Resources.CalculateIcon;
 }
Пример #11
0
 public ReadOnlyAdapter(ISettingsAdapter adaptee)
 {
     if (null == adaptee)
     {
         throw new ArgumentNullException(nameof(adaptee));
     }
     _adaptee = adaptee;
 }
Пример #12
0
        public ISettingsBuilder Add(ISettingsAdapter adapter, ISettingConverter converter)
        {
            converter = converter ?? new DefaultSettingConverter();
            var interceptor = new SettingsInterceptor(adapter, converter);

            _interceptors.Add(interceptor);
            return(this);
        }
 public ZxSpectrumJoystickSettings(IDialogController dialogController, ISettingsAdapter settable)
 {
     _settable        = settable;
     _syncSettings    = (ZXSpectrum.ZXSpectrumSyncSettings)_settable.GetSyncSettings();
     DialogController = dialogController;
     InitializeComponent();
     Icon = Properties.Resources.GameControllerIcon;
 }
Пример #14
0
 public QuickNesConfig(Config config, ISettingsAdapter settable)
 {
     _config   = config;
     _settable = settable;
     _settings = (QuickNES.QuickNESSettings)_settable.GetSettings();
     InitializeComponent();
     Icon = Properties.Resources.QuickNesIcon;
 }
Пример #15
0
 private static DialogResult DoMAMEDialog(
     IDialogParent owner,
     ISettingsAdapter settable,
     List <MAME.DriverSetting> settings,
     bool isMovieActive)
 {
     using TempTypeDescProviderScope scope = new(new MAMETypeDescriptorProvider(settings), typeof(MAME.MAMESyncSettings));
     return(DoDialogFor(owner, settable, "MAME Settings", isMovieActive: isMovieActive, ignoreSettings: true));
 }
        public N64VideoPluginConfig(ISettingsAdapter settable)
        {
            _settable = settable;

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

            InitializeComponent();
            Icon = Properties.Resources.MonitorIcon;
        }
Пример #17
0
 public NESGraphicsConfig(
     Config config,
     IDialogController dialogController,
     ISettingsAdapter settable)
 {
     _config          = config;
     _settable        = settable;
     _settings        = (NES.NESSettings)_settable.GetSettings();
     DialogController = dialogController;
     InitializeComponent();
 }
Пример #18
0
        public SettingsFacadeTests()
        {
            var settingsAdapterMock = new Mock <ISettingsAdapter>();

            settingsAdapterMock.Setup(x => x.GetValue(It.IsAny <string>(), It.IsAny <string>()))
            .Returns((string key, string defaultValue) => defaultValue);
            settingsAdapterMock.Setup(x => x.GetValue(It.IsAny <string>(), It.IsAny <int>()))
            .Returns((string key, int defaultValue) => defaultValue);
            settingsAdapterMock.Setup(x => x.GetValue(It.IsAny <string>(), It.IsAny <bool>()))
            .Returns((string key, bool defaultValue) => defaultValue);

            settingsAdapter = settingsAdapterMock.Object;
        }
Пример #19
0
        private PSXOptions(
            Config config,
            IDialogController dialogController,
            ISettingsAdapter settable,
            Octoshock.Settings settings,
            Octoshock.SyncSettings syncSettings,
            OctoshockDll.eVidStandard vidStandard,
            Size currentVideoSize)
        {
            InitializeComponent();
            _config               = config;
            _settable             = settable;
            _settings             = settings;
            _syncSettings         = syncSettings;
            _previewVideoStandard = vidStandard;
            _previewVideoSize     = currentVideoSize;
            DialogController      = dialogController;

            if (_previewVideoStandard == OctoshockDll.eVidStandard.NTSC)
            {
                lblNTSC.Font = new Font(lblNTSC.Font, FontStyle.Bold);
            }
            else
            {
                lblPAL.Font = new Font(lblPAL.Font, FontStyle.Bold);
            }

            _lblPixelProText        = lblPixelPro.Text;
            _lblMednafenText        = lblMednafen.Text;
            _lblTweakedMednafenText = lblTweakedMednafen.Text;

            rbPixelPro.Checked            = _settings.ResolutionMode == Octoshock.eResolutionMode.PixelPro;
            rbDebugMode.Checked           = _settings.ResolutionMode == Octoshock.eResolutionMode.Debug;
            rbMednafenMode.Checked        = _settings.ResolutionMode == Octoshock.eResolutionMode.Mednafen;
            rbTweakedMednafenMode.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.TweakedMednafen;
            rbClipNone.Checked            = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.None;
            rbClipBasic.Checked           = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.Basic;
            rbClipToFramebuffer.Checked   = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.Framebuffer;

            cbLEC.Checked    = _syncSettings.EnableLEC;
            cbGpuLag.Checked = _settings.GPULag;

            rbWeave.Checked     = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.Weave;
            rbBob.Checked       = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.Bob;
            rbBobOffset.Checked = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.BobOffset;

            NTSC_FirstLineNumeric.Value = _settings.ScanlineStart_NTSC;
            NTSC_LastLineNumeric.Value  = _settings.ScanlineEnd_NTSC;
            PAL_FirstLineNumeric.Value  = _settings.ScanlineStart_PAL;
            PAL_LastLineNumeric.Value   = _settings.ScanlineEnd_PAL;
        }
Пример #20
0
 public SameBoyColorChooserForm(
     Config config,
     IDialogController dialogController,
     IGameInfo game,
     ISettingsAdapter settable)
 {
     _game            = game;
     _config          = config;
     _settable        = settable;
     _settings        = (Sameboy.SameboySettings)_settable.GetSettings();
     DialogController = dialogController;
     InitializeComponent();
     SetAllColors(_settings.GetCustomPalette());
 }
        public NesControllerSettings(ISettingsAdapter settable)
        {
            _settable     = settable;
            _syncSettings = (NES.NESSyncSettings)_settable.GetSyncSettings();
            InitializeComponent();
            Icon = Properties.Resources.GameControllerIcon;

            // TODO: use combobox extension and add descriptions to enum values
            comboBoxFamicom.Items.AddRange(NESControlSettings.GetFamicomExpansionValues().Cast <object>().ToArray());
            comboBoxNESL.Items.AddRange(NESControlSettings.GetNesPortValues().Cast <object>().ToArray());
            comboBoxNESR.Items.AddRange(NESControlSettings.GetNesPortValues().Cast <object>().ToArray());

            comboBoxFamicom.SelectedItem = _syncSettings.Controls.FamicomExpPort;
            comboBoxNESL.SelectedItem    = _syncSettings.Controls.NesLeftPort;
            comboBoxNESR.SelectedItem    = _syncSettings.Controls.NesRightPort;
            checkBoxFamicom.Checked      = _syncSettings.Controls.Famicom;
        }
Пример #22
0
 public static DialogResult DoSettingsDialog(
     Config config,
     IDialogParent dialogParent,
     ISettingsAdapter settable,
     OctoshockDll.eVidStandard vidStandard,
     Size vidSize)
 {
     using PSXOptions dlg = new(
               config,
               dialogParent.DialogController,
               settable,
               (Octoshock.Settings)settable.GetSettings(),
               (Octoshock.SyncSettings)settable.GetSyncSettings(),
               vidStandard,
               vidSize);
     return(dialogParent.ShowDialogAsChild(dlg));
 }
Пример #23
0
        private GenericCoreConfig(
            ISettingsAdapter settable,
            bool isMovieActive,
            bool ignoreSettings     = false,
            bool ignoreSyncSettings = false)
        {
            InitializeComponent();

            _settable = settable;

            if (_settable.HasSettings && !ignoreSettings)
            {
                _s = _settable.GetSettings();
            }

            if (_settable.HasSyncSettings && !ignoreSyncSettings)
            {
                _ss = _settable.GetSyncSettings();
            }

            if (_s != null)
            {
                propertyGrid1.SelectedObject = _s;
                propertyGrid1.AdjustDescriptionHeightToFit();
            }
            else
            {
                tabControl1.TabPages.Remove(tabPage1);
            }

            if (_ss != null)
            {
                propertyGrid2.SelectedObject = _ss;
                propertyGrid2.AdjustDescriptionHeightToFit();
            }
            else
            {
                tabControl1.TabPages.Remove(tabPage2);
            }

            if (isMovieActive)
            {
                propertyGrid2.Enabled = false;                 // disable changes to sync setting when movie, so as not to confuse user
            }
        }
Пример #24
0
 public static DialogResult DoDialogFor(
     IDialogParent owner,
     ISettingsAdapter settable,
     string title,
     bool isMovieActive,
     bool ignoreSettings     = false,
     bool ignoreSyncSettings = false)
 {
     using GenericCoreConfig dlg = new(
               settable,
               isMovieActive : isMovieActive,
               ignoreSettings : ignoreSettings,
               ignoreSyncSettings : ignoreSyncSettings)
           {
               Text = title,
           };
     return(owner.ShowDialogAsChild(dlg));
 }
Пример #25
0
        public static DialogResult DoNymaDialogFor(
            IDialogParent owner,
            ISettingsAdapter settable,
            string title,
            NymaCore.NymaSettingsInfo settingsInfo,
            bool isMovieActive)
        {
            NymaTypeDescriptorProvider desc = new(settingsInfo);

            using TempTypeDescProviderScope scope = new(desc, typeof(NymaCore.NymaSettings)), scope1 = new(desc, typeof(NymaCore.NymaSyncSettings));
            return(DoDialogFor(
                       owner,
                       settable,
                       title,
                       isMovieActive: isMovieActive,
                       ignoreSettings: !settingsInfo.HasSettings,
                       ignoreSyncSettings: !settingsInfo.HasSyncSettings));
        }
Пример #26
0
        public static DialogResult DoSettingsDialog(IDialogParent dialogParent, ISettingsAdapter settable)
        {
            var s  = (LibsnesCore.SnesSettings)settable.GetSettings();
            var ss = (LibsnesCore.SnesSyncSettings)settable.GetSyncSettings();

            using var dlg = new SNESOptions
                  {
                      RandomizedInitialState = ss.RandomizedInitialState,
                      AlwaysDoubleSize       = s.AlwaysDoubleSize,
                      CropSGBFrame           = s.CropSGBFrame,
                      ShowObj1 = s.ShowOBJ_0,
                      ShowObj2 = s.ShowOBJ_1,
                      ShowObj3 = s.ShowOBJ_2,
                      ShowObj4 = s.ShowOBJ_3,
                      ShowBg1  = s.ShowBG1_0,
                      ShowBg2  = s.ShowBG2_0,
                      ShowBg3  = s.ShowBG3_0,
                      ShowBg4  = s.ShowBG4_0
                  };

            var result = dialogParent.ShowDialogAsChild(dlg);

            if (result == DialogResult.OK)
            {
                s.AlwaysDoubleSize        = dlg.AlwaysDoubleSize;
                s.CropSGBFrame            = dlg.CropSGBFrame;
                ss.RandomizedInitialState = dlg.RandomizedInitialState;
                s.ShowOBJ_0 = dlg.ShowObj1;
                s.ShowOBJ_1 = dlg.ShowObj2;
                s.ShowOBJ_2 = dlg.ShowObj3;
                s.ShowOBJ_3 = dlg.ShowObj4;
                s.ShowBG1_0 = s.ShowBG1_1 = dlg.ShowBg1;
                s.ShowBG2_0 = s.ShowBG2_1 = dlg.ShowBg2;
                s.ShowBG3_0 = s.ShowBG3_1 = dlg.ShowBg3;
                s.ShowBG4_0 = s.ShowBG4_1 = dlg.ShowBg4;

                settable.PutCoreSettings(s);
                settable.PutCoreSyncSettings(ss);
            }
            return(result);
        }
Пример #27
0
        public NESSyncSettingsForm(
            IDialogController dialogController,
            ISettingsAdapter settable,
            bool hasMapperProperties)
        {
            _settable        = settable;
            _syncSettings    = (NES.NESSyncSettings)_settable.GetSyncSettings();
            DialogController = dialogController;
            InitializeComponent();
            HelpBtn.Image = Properties.Resources.Help;

            if (hasMapperProperties)
            {
                _dataTableDictionary     = new DataTableDictionaryBind <string, string>(_syncSettings.BoardProperties);
                dataGridView1.DataSource = _dataTableDictionary.Table;
                InfoLabel.Visible        = false;
            }
            else
            {
                BoardPropertiesGroupBox.Enabled = false;
                dataGridView1.DataSource        = null;
                dataGridView1.Enabled           = false;
                InfoLabel.Visible = true;
            }

            RegionComboBox.Items.AddRange(Enum.GetNames(typeof(NES.NESSyncSettings.Region)).Cast <object>().ToArray());
            RegionComboBox.SelectedItem = Enum.GetName(typeof(NES.NESSyncSettings.Region), _syncSettings.RegionOverride);

            if (_syncSettings.InitialWRamStatePattern != null && _syncSettings.InitialWRamStatePattern.Any())
            {
                var sb = new StringBuilder();
                foreach (var b in _syncSettings.InitialWRamStatePattern)
                {
                    sb.Append($"{b:X2}");
                }

                RamPatternOverrideBox.Text = sb.ToString();
            }
        }
Пример #28
0
 public NesVsSettings(ISettingsAdapter settable)
 {
     _settable = settable;
     _settings = (NES.NESSyncSettings)_settable.GetSyncSettings();
     InitializeComponent();
 }
Пример #29
0
 public SettingsFacade(ISettingsAdapter settingsAdapter)
 {
     this.settingsAdapter = settingsAdapter;
 }
        // TODO: This doesn't really belong here, but not sure where to put it
        public static void PopulateWithDefaultHeaderValues(
            this IMovie movie,
            IEmulator emulator,
            ISettingsAdapter settable,
            IGameInfo game,
            FirmwareManager firmwareManager,
            string author)
        {
            movie.Author                  = author;
            movie.EmulatorVersion         = VersionInfo.GetEmuVersion();
            movie.OriginalEmulatorVersion = VersionInfo.GetEmuVersion();
            movie.SystemID                = emulator.SystemId;

            if (settable.HasSyncSettings)
            {
                movie.SyncSettingsJson = ConfigService.SaveWithType(settable.GetSyncSettings());
            }

            if (game.IsNullInstance())
            {
                movie.GameName = "NULL";
            }
            else
            {
                movie.GameName = game.FilesystemSafeName();
                movie.Hash     = game.Hash;
                if (game.FirmwareHash != null)
                {
                    movie.FirmwareHash = game.FirmwareHash;
                }
            }

            if (emulator.HasBoardInfo())
            {
                movie.BoardName = emulator.AsBoardInfo().BoardName;
            }

            if (emulator.HasRegions())
            {
                var region = emulator.AsRegionable().Region;
                if (region == DisplayType.PAL)
                {
                    movie.HeaderEntries.Add(HeaderKeys.Pal, "1");
                }
            }

            if (firmwareManager.RecentlyServed.Count != 0)
            {
                foreach (var firmware in firmwareManager.RecentlyServed)
                {
                    var key = firmware.ID.MovieHeaderKey;
                    if (!movie.HeaderEntries.ContainsKey(key))
                    {
                        movie.HeaderEntries.Add(key, firmware.Hash);
                    }
                }
            }

            if (emulator is NDS nds && nds.IsDSi)
            {
                movie.HeaderEntries.Add("IsDSi", "1");

                if (nds.IsDSiWare)
                {
                    movie.HeaderEntries.Add("IsDSiWare", "1");
                }
            }

            if ((emulator is NES nes && nes.IsVS) ||
                (emulator is SubNESHawk subnes && subnes.IsVs))
            {
                movie.HeaderEntries.Add("IsVS", "1");
            }

            if (emulator is IGameboyCommon gb)
            {
                if (gb.IsCGBMode())
                {
                    movie.HeaderEntries.Add(gb.IsCGBDMGMode() ? "IsCGBDMGMode" : "IsCGBMode", "1");
                }
            }

            if (emulator is SMS sms)
            {
                if (sms.IsSG1000)
                {
                    movie.HeaderEntries.Add("IsSGMode", "1");
                }

                if (sms.IsGameGear)
                {
                    movie.HeaderEntries.Add("IsGGMode", "1");
                }
            }

            if (emulator is GPGX gpgx && gpgx.IsMegaCD)
            {
                movie.HeaderEntries.Add("IsSegaCDMode", "1");
            }

            if (emulator is PicoDrive pico && pico.Is32XActive)
            {
                movie.HeaderEntries.Add("Is32X", "1");
            }

            if (emulator is ICycleTiming)
            {
                movie.HeaderEntries.Add(HeaderKeys.CycleCount, "0");
                movie.HeaderEntries.Add(HeaderKeys.ClockRate, "0");
            }

            movie.Core = emulator.Attributes().CoreName;
        }