public MainForm() { synchronizationContext = SynchronizationContext.Current; speedUpdateStopwatch = Stopwatch.StartNew(); InitializeComponent(); ScaleStatusStrip(CurrentAutoScaleDimensions.Height / 96F); // In DPI scaling mode, CurrentAutoScaleDimensions is the current screen DPI. if (components == null) { components = new System.ComponentModel.Container(); } emulatedGameBoy = new EmulatedGameBoy(components); emulatedGameBoy.TryUsingBootRom = Settings.Default.UseBootstrapRom; emulatedGameBoy.EnableFramerateLimiter = Settings.Default.LimitSpeed; emulatedGameBoy.RomChanged += OnRomChanged; emulatedGameBoy.AfterReset += OnAfterReset; emulatedGameBoy.EmulationStatusChanged += OnEmulationStatusChanged; emulatedGameBoy.NewFrame += OnNewFrame; emulatedGameBoy.BorderChanged += OnBorderChanged; try { emulatedGameBoy.Reset(Settings.Default.HardwareType); } catch (ArgumentOutOfRangeException) { Settings.Default.HardwareType = emulatedGameBoy.HardwareType; } AdjustSize(Settings.Default.ContentSize); UpdateEmulationStatus(); UpdateSpeed(); SetStatusTextHandler(); CreateRendererMenuItems(); }
public MainForm() { InitializeComponent(); if (components == null) components = new System.ComponentModel.Container(); emulatedGameBoy = new EmulatedGameBoy(components); emulatedGameBoy.TryUsingBootRom = Settings.Default.UseBootstrapRom; emulatedGameBoy.EnableFramerateLimiter = Settings.Default.LimitSpeed; emulatedGameBoy.RomChanged += OnRomChanged; emulatedGameBoy.AfterReset += OnAfterReset; emulatedGameBoy.EmulationStatusChanged += OnEmulationStatusChanged; emulatedGameBoy.NewFrame += OnNewFrame; emulatedGameBoy.BorderChanged += OnBorderChanged; try { emulatedGameBoy.Reset(Settings.Default.HardwareType); } catch (ArgumentOutOfRangeException) { Settings.Default.HardwareType = emulatedGameBoy.HardwareType; } AdjustSize(Settings.Default.ContentSize); UpdateEmulationStatus(); UpdateFrameRate(); SetStatusTextHandler(); CreateRendererMenuItems(); }
private void resetToolStripMenuItem_Click(object sender, EventArgs e) { emulatedGameBoy.Reset(); }