예제 #1
0
 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();
 }
예제 #2
0
 public RomInformationForm(EmulatedGameBoy emulatedGameBoy)
     : base(emulatedGameBoy)
 {
     InitializeComponent();
     backgroundColorPaletteTableLayoutPanel.Tag = _backgroundColors;
     object0ColorPaletteTableLayoutPanel.Tag    = _object0Colors;
     object1ColorPaletteTableLayoutPanel.Tag    = _object1Colors;
 }
예제 #3
0
 public TileViewerForm(EmulatedGameBoy emulatedGameBoy)
     : base(emulatedGameBoy)
 {
     InitializeComponent();
     tileSet0Bitmap       = new Bitmap(128, 192);
     tileSet1Bitmap       = new Bitmap(128, 192);
     tileSet0Panel.Bitmap = tileSet0Bitmap;
     tileSet1Panel.Bitmap = tileSet1Bitmap;
 }
예제 #4
0
		public TileViewerForm(EmulatedGameBoy emulatedGameBoy)
			: base(emulatedGameBoy)
		{
			InitializeComponent();
			tileSet0Bitmap = new Bitmap(128, 192);
			tileSet1Bitmap = new Bitmap(128, 192);
			tileSet0Panel.Bitmap = tileSet0Bitmap;
			tileSet1Panel.Bitmap = tileSet1Bitmap;
		}
예제 #5
0
 public EmulatorForm(EmulatedGameBoy emulatedGameBoy)
 {
     EmulatedGameBoy                         = emulatedGameBoy ?? throw new ArgumentNullException(nameof(emulatedGameBoy));
     EmulatedGameBoy.AfterReset             += OnAfterResetInternal;
     EmulatedGameBoy.RomChanged             += OnRomChangedInternal;
     EmulatedGameBoy.Paused                 += OnPausedInternal;
     EmulatedGameBoy.Break                  += OnBreakInternal;
     EmulatedGameBoy.EmulationStatusChanged += OnEmulationStatusChangedInternal;
     EmulatedGameBoy.NewFrame               += OnNewFrameInternal;
 }
예제 #6
0
		public EmulatorForm(EmulatedGameBoy emulatedGameBoy)
		{
			if (emulatedGameBoy == null)
				throw new ArgumentNullException("emulatedGameBoy");
			this.emulatedGameBoy = emulatedGameBoy;
			this.emulatedGameBoy.AfterReset += OnAfterResetInternal;
			this.emulatedGameBoy.RomChanged += OnRomChangedInternal;
			this.emulatedGameBoy.Paused += OnPausedInternal;
			this.emulatedGameBoy.Break += OnBreakInternal;
			this.emulatedGameBoy.EmulationStatusChanged += OnEmulationStatusChangedInternal;
			this.emulatedGameBoy.NewFrame += OnNewFrameInternal;
		}
예제 #7
0
        public DebuggerForm(EmulatedGameBoy EmulatedGameBoy)
            : base(EmulatedGameBoy)
        {
            InitializeComponent();
            OnRomChanged(EventArgs.Empty);
#if !WITH_DEBUGGING || !DEBUG_CYCLE_COUNTER
            cycleCounterGroupBox.Visible = false;
#endif
#if !WITH_DEBUGGING
            breakpointsGroupBox.Visible = false;
#endif
        }
예제 #8
0
		public DebuggerForm(EmulatedGameBoy EmulatedGameBoy)
			: base(EmulatedGameBoy)
		{
			InitializeComponent();
			OnRomChanged(EventArgs.Empty);
#if !WITH_DEBUGGING || !DEBUG_CYCLE_COUNTER
			cycleCounterGroupBox.Visible = false;
#endif
#if !WITH_DEBUGGING
			breakpointsGroupBox.Visible = false;
#endif
		}
예제 #9
0
		public MapViewerForm(EmulatedGameBoy emulatedGameBoy)
			: base(emulatedGameBoy)
		{
			InitializeComponent();
			backgroundMapBitmap = new Bitmap(256, 256);
			windowMapBitmap = new Bitmap(256, 256);
			customMapBitmap = new Bitmap(256, 256);

			backgroundMapPanel.Bitmap = backgroundMapBitmap;
			windowMapPanel.Bitmap = windowMapBitmap;
			customMapPanel.Bitmap = customMapBitmap;

			colors = new uint[32]; // 8 palettes of 4 colors each
		}
예제 #10
0
        public MapViewerForm(EmulatedGameBoy emulatedGameBoy)
            : base(emulatedGameBoy)
        {
            InitializeComponent();
            _backgroundMapBitmap = new Bitmap(256, 256);
            _windowMapBitmap     = new Bitmap(256, 256);
            _customMapBitmap     = new Bitmap(256, 256);

            backgroundMapPanel.Bitmap = _backgroundMapBitmap;
            windowMapPanel.Bitmap     = _windowMapBitmap;
            customMapPanel.Bitmap     = _customMapBitmap;

            _colors = new uint[32];             // 8 palettes of 4 colors each
        }
예제 #11
0
 public EmulatorForm(EmulatedGameBoy emulatedGameBoy)
 {
     if (emulatedGameBoy == null)
     {
         throw new ArgumentNullException("emulatedGameBoy");
     }
     this.emulatedGameBoy                         = emulatedGameBoy;
     this.emulatedGameBoy.AfterReset             += OnAfterResetInternal;
     this.emulatedGameBoy.RomChanged             += OnRomChangedInternal;
     this.emulatedGameBoy.Paused                 += OnPausedInternal;
     this.emulatedGameBoy.Break                  += OnBreakInternal;
     this.emulatedGameBoy.EmulationStatusChanged += OnEmulationStatusChangedInternal;
     this.emulatedGameBoy.NewFrame               += OnNewFrameInternal;
 }
예제 #12
0
		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();
		}
예제 #13
0
		public RomInformationForm(EmulatedGameBoy emulatedGameBoy)
			: base(emulatedGameBoy)
		{
			InitializeComponent();
		}
예제 #14
0
 private void runButton_Click(object sender, EventArgs e)
 {
     EmulatedGameBoy.Run();
 }
예제 #15
0
 private void stepButton_Click(object sender, EventArgs e)
 {
     EmulatedGameBoy.Step();
 }