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; }
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); }
public A7800ControllerSettings(ISettingsAdapter settable) { _settable = settable; _syncSettings = (A7800Hawk.A7800SyncSettings)settable.GetSyncSettings(); InitializeComponent(); Icon = Properties.Resources.GameControllerIcon; }
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; }
public N64ControllersSetup(ISettingsAdapter settable) { _settable = settable; _syncSettings = (N64SyncSettings)_settable.GetSyncSettings(); InitializeComponent(); Icon = Properties.Resources.GameControllerIcon; }
public TI83PaletteConfig(ISettingsAdapter settable) { _settable = settable; _settings = (TI83Common.TI83CommonSettings)_settable.GetSettings(); InitializeComponent(); Icon = Properties.Resources.CalculateIcon; }
public ReadOnlyAdapter(ISettingsAdapter adaptee) { if (null == adaptee) { throw new ArgumentNullException(nameof(adaptee)); } _adaptee = adaptee; }
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; }
public QuickNesConfig(Config config, ISettingsAdapter settable) { _config = config; _settable = settable; _settings = (QuickNES.QuickNESSettings)_settable.GetSettings(); InitializeComponent(); Icon = Properties.Resources.QuickNesIcon; }
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; }
public NESGraphicsConfig( Config config, IDialogController dialogController, ISettingsAdapter settable) { _config = config; _settable = settable; _settings = (NES.NESSettings)_settable.GetSettings(); DialogController = dialogController; InitializeComponent(); }
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; }
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; }
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; }
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)); }
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 } }
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)); }
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)); }
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); }
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(); } }
public NesVsSettings(ISettingsAdapter settable) { _settable = settable; _settings = (NES.NESSyncSettings)_settable.GetSyncSettings(); InitializeComponent(); }
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; }