예제 #1
0
        protected override void OnLoad(EventArgs evt)
        {
            base.OnLoad(evt);
            if (DesignMode)
            {
                return;
            }

            _notifListener = new NotificationListener();
            _notifListener.OnNotification += OnNotificationReceived;

            InitShortcuts();

            RegisterViewerConfig config = ConfigManager.Config.Debug.RegisterViewer;

            RestoreLocation(config.WindowLocation, config.WindowSize);

            mnuAutoRefresh.Checked = config.AutoRefresh;
            ctrlScanlineCycleSelect.Initialize(config.RefreshScanline, config.RefreshCycle, EmuApi.GetRomInfo().CoprocessorType == CoprocessorType.Gameboy ? CpuType.Gameboy : CpuType.Cpu);

            _refreshManager                  = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh      = config.AutoRefresh;
            _refreshManager.AutoRefreshSpeed = RefreshSpeed.High;

            UpdateTabs();

            RefreshData();
            RefreshViewer();

            mnuAutoRefresh.CheckedChanged += mnuAutoRefresh_CheckedChanged;
        }
예제 #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!this.DesignMode)
            {
                InitShortcuts();

                EventViewerConfig config = ConfigManager.Config.Debug.EventViewer;
                RestoreLocation(config.WindowLocation, config.WindowSize);

                mnuRefreshOnBreakPause.Checked = ConfigManager.Config.Debug.EventViewer.RefreshOnBreakPause;
                ctrlPpuView.ImageScale         = config.ImageScale;

                _notifListener = new NotificationListener();
                _notifListener.OnNotification += OnNotificationReceived;

                _refreshManager                      = new WindowRefreshManager(this);
                _refreshManager.AutoRefresh          = config.AutoRefresh;
                _refreshManager.AutoRefreshSpeed     = config.AutoRefreshSpeed;
                mnuAutoRefresh.Checked               = config.AutoRefresh;
                mnuAutoRefreshLow.Click             += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Low;
                mnuAutoRefreshNormal.Click          += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Normal;
                mnuAutoRefreshHigh.Click            += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.High;
                mnuAutoRefreshSpeed.DropDownOpening += (s, evt) => UpdateRefreshSpeedMenu();

                ctrlFilters.Init();

                RefreshData();
                RefreshViewer();
            }
        }
예제 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (DesignMode)
            {
                return;
            }

            InitShortcuts();

            SpriteViewerConfig config = ConfigManager.Config.Debug.SpriteViewer;

            RestoreLocation(config.WindowLocation, config.WindowSize);

            _refreshManager                      = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh          = config.AutoRefresh;
            _refreshManager.AutoRefreshSpeed     = config.AutoRefreshSpeed;
            mnuAutoRefreshLow.Click             += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Low;
            mnuAutoRefreshNormal.Click          += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Normal;
            mnuAutoRefreshHigh.Click            += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.High;
            mnuAutoRefreshSpeed.DropDownOpening += (s, evt) => UpdateRefreshSpeedMenu();

            mnuAutoRefresh.Checked              = config.AutoRefresh;
            ctrlImagePanel.ImageScale           = config.ImageScale;
            ctrlSplitContainer.SplitterDistance = config.SplitterDistance;
            ctrlScanlineCycleSelect.Initialize(config.RefreshScanline, config.RefreshCycle);
            ctrlSpriteList.HideOffscreenSprites = config.HideOffscreenSprites;

            RefreshData();
            RefreshViewer();
        }
예제 #4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (DesignMode)
            {
                return;
            }

            _refreshManager             = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh = true;
            ctrlScanlineCycleSelect.Initialize(241, 0);

            ctrlPaletteViewer.RefreshData();
            ctrlPaletteViewer.RefreshViewer();
            UpdateFields();
        }
예제 #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            ctrlProfiler.CpuType    = CpuType.Cpu;
            ctrlProfilerSpc.CpuType = CpuType.Spc;

            _selectedTab = tpgCpu;
            UpdateAvailableTabs();
            RefreshData();
            RefreshViewer();

            _refreshManager                  = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh      = true;
            _refreshManager.AutoRefreshSpeed = RefreshSpeed.Low;

            _notifListener = new NotificationListener();
            _notifListener.OnNotification += OnNotificationReceived;
        }
예제 #6
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (DesignMode)
            {
                return;
            }

            _refreshManager             = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh = true;
            ctrlScanlineCycleSelect.Initialize(241, 0, this.CpuType);

            double scale = (double)ctrlPaletteViewer.Width / 256;

            ctrlPaletteViewer.PaletteScale = (int)(16 * scale);

            ctrlPaletteViewer.RefreshData();
            ctrlPaletteViewer.RefreshViewer();
            UpdateFields();
        }
예제 #7
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (DesignMode)
            {
                return;
            }

            _tilemapData         = new byte[1024 * 1024 * 4];
            _tilemapImage        = new Bitmap(1024, 1024, PixelFormat.Format32bppPArgb);
            ctrlImagePanel.Image = _tilemapImage;

            InitShortcuts();

            TilemapViewerConfig config = ConfigManager.Config.Debug.TilemapViewer;

            RestoreLocation(config.WindowLocation, config.WindowSize);

            mnuAutoRefresh.Checked       = config.AutoRefresh;
            chkShowTileGrid.Checked      = config.ShowTileGrid;
            chkShowScrollOverlay.Checked = config.ShowScrollOverlay;
            ctrlImagePanel.ImageScale    = config.ImageScale;
            ctrlScanlineCycleSelect.Initialize(config.RefreshScanline, config.RefreshCycle);

            _refreshManager                  = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh      = config.AutoRefresh;
            _refreshManager.AutoRefreshSpeed = config.AutoRefreshSpeed;

            mnuAutoRefreshLow.Click             += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Low;
            mnuAutoRefreshNormal.Click          += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Normal;
            mnuAutoRefreshHigh.Click            += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.High;
            mnuAutoRefreshSpeed.DropDownOpening += (s, evt) => UpdateRefreshSpeedMenu();

            RefreshData();
            RefreshViewer();
        }
예제 #8
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!this.DesignMode)
            {
                _binder.Entity = _config;

                mnuRefreshOnBreak.Checked = _config.EventViewerRefreshOnBreak;

                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuWrite2000), chkWrite2000);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuWrite2001), chkWrite2001);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuWrite2003), chkWrite2003);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuWrite2004), chkWrite2004);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuWrite2005), chkWrite2005);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuWrite2006), chkWrite2006);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuWrite2007), chkWrite2007);

                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuRead2002), chkRead2002);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuRead2004), chkRead2004);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPpuRead2007), chkRead2007);

                _binder.AddBinding(nameof(DebugInfo.EventViewerShowIrq), chkShowIrq);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowNmi), chkShowNmi);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowSpriteZeroHit), chkShowSpriteZero);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowMapperRegisterWrites), chkShowMapperRegisterWrites);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowMapperRegisterReads), chkShowMapperRegisterReads);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowDmcDmaReads), chkShowDmcDmaRead);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowMarkedBreakpoints), chkBreakpoints);

                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterWrite2000Color), picWrite2000);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterWrite2001Color), picWrite2001);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterWrite2003Color), picWrite2003);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterWrite2004Color), picWrite2004);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterWrite2005Color), picWrite2005);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterWrite2006Color), picWrite2006);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterWrite2007Color), picWrite2007);

                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterRead2002Color), picRead2002);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterRead2004Color), picRead2004);
                _binder.AddBinding(nameof(DebugInfo.EventViewerPpuRegisterRead2007Color), picRead2007);

                _binder.AddBinding(nameof(DebugInfo.EventViewerMapperRegisterWriteColor), picMapperWrite);
                _binder.AddBinding(nameof(DebugInfo.EventViewerMapperRegisterReadColor), picMapperRead);
                _binder.AddBinding(nameof(DebugInfo.EventViewerNmiColor), picNmi);
                _binder.AddBinding(nameof(DebugInfo.EventViewerIrqColor), picIrq);
                _binder.AddBinding(nameof(DebugInfo.EventViewerSpriteZeroHitColor), picSpriteZeroHit);
                _binder.AddBinding(nameof(DebugInfo.EventViewerBreakpointColor), picBreakpoint);
                _binder.AddBinding(nameof(DebugInfo.EventViewerDmcDmaReadColor), picDmcDmaRead);

                _binder.AddBinding(nameof(DebugInfo.EventViewerShowPreviousFrameEvents), chkShowPreviousFrameEvents);
                _binder.AddBinding(nameof(DebugInfo.EventViewerShowNtscBorders), chkShowNtscBorders);

                DebugWorkspaceManager.GetWorkspace();

                RestoreLocation(_config.EventViewerLocation, _config.EventViewerSize);

                mnuAutoRefresh.Checked               = _config.EventViewerAutoRefresh;
                mnuAutoRefreshLow.Click             += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Low;
                mnuAutoRefreshNormal.Click          += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Normal;
                mnuAutoRefreshHigh.Click            += (s, evt) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.High;
                mnuAutoRefreshSpeed.DropDownOpening += (s, evt) => UpdateRefreshSpeedMenu();

                this.RefreshData();
                _binder.UpdateUI();
                this.RefreshViewer();

                _refreshManager                  = new WindowRefreshManager(this);
                _refreshManager.AutoRefresh      = _config.EventViewerAutoRefresh;
                _refreshManager.AutoRefreshSpeed = _config.EventViewerAutoRefreshSpeed;

                this._notifListener = new InteropEmu.NotificationListener(_config.DebugConsoleId);
                this._notifListener.OnNotification += this._notifListener_OnNotification;

                InitShortcuts();
            }
        }
예제 #9
0
        protected override void OnLoad(EventArgs evt)
        {
            base.OnLoad(evt);
            if (DesignMode)
            {
                return;
            }

            _tileData            = new byte[0x400000];
            _tileImage           = new Bitmap(512, 512, PixelFormat.Format32bppPArgb);
            ctrlImagePanel.Image = _tileImage;

            BaseConfigForm.InitializeComboBox(cboFormat, typeof(TileFormat));
            BaseConfigForm.InitializeComboBox(cboLayout, typeof(TileLayout));
            InitMemoryTypeDropdown();

            InitShortcuts();

            TileViewerConfig config = ConfigManager.Config.Debug.TileViewer;

            RestoreLocation(config.WindowLocation, config.WindowSize);

            cboMemoryType.SetEnumValue(config.Source);
            cboFormat.SetEnumValue(config.Format);
            cboLayout.SetEnumValue(config.Layout);
            nudColumns.Value = config.ColumnCount;

            int memSize = DebugApi.GetMemorySize(_memoryType);

            config.Address = Math.Min(memSize - config.PageSize, config.Address);

            UpdateMemoryType(config.Source);
            nudAddress.Value          = config.Address;
            nudSize.Value             = config.PageSize;
            mnuAutoRefresh.Checked    = config.AutoRefresh;
            chkShowTileGrid.Checked   = config.ShowTileGrid;
            ctrlImagePanel.ImageScale = config.ImageScale;
            ctrlScanlineCycleSelect.Initialize(config.RefreshScanline, config.RefreshCycle);
            ctrlPaletteViewer.SelectedPalette = config.SelectedPalette;

            nudSize.Increment    = 0x1000;
            nudSize.Minimum      = 0x1000;
            nudSize.Maximum      = Math.Min(memSize, 0x40000);
            nudAddress.Increment = nudSize.Value;
            nudAddress.Maximum   = memSize - nudSize.Value;

            _address                 = config.Address;
            _options.Format          = config.Format;
            _options.Layout          = config.Layout;
            _options.Palette         = config.SelectedPalette;
            _options.Width           = config.ColumnCount;
            _options.PageSize        = config.PageSize;
            ctrlImagePanel.GridSizeX = config.ShowTileGrid ? 8 : 0;
            ctrlImagePanel.GridSizeY = config.ShowTileGrid ? 8 : 0;

            _refreshManager                      = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh          = config.AutoRefresh;
            _refreshManager.AutoRefreshSpeed     = config.AutoRefreshSpeed;
            mnuAutoRefreshLow.Click             += (s, e) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Low;
            mnuAutoRefreshNormal.Click          += (s, e) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Normal;
            mnuAutoRefreshHigh.Click            += (s, e) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.High;
            mnuAutoRefreshSpeed.DropDownOpening += (s, e) => UpdateRefreshSpeedMenu();

            RefreshData();
            RefreshViewer();

            cboMemoryType.SelectedIndexChanged += cboMemoryType_SelectedIndexChanged;
            nudAddress.ValueChanged            += nudAddress_ValueChanged;
            chkShowTileGrid.Click              += chkShowTileGrid_Click;
            cboFormat.SelectedIndexChanged     += cboFormat_SelectedIndexChanged;
            cboLayout.SelectedIndexChanged     += cboLayout_SelectedIndexChanged;
            nudColumns.ValueChanged            += nudColumns_ValueChanged;
            nudSize.ValueChanged               += nudSize_ValueChanged;
            ctrlPaletteViewer.SelectionChanged += ctrlPaletteViewer_SelectionChanged;
            mnuAutoRefresh.CheckedChanged      += mnuAutoRefresh_CheckedChanged;

            UpdatePaletteControl();

            btnPresetBg1.Click  += (s, e) => GoToBgLayer(0);
            btnPresetBg2.Click  += (s, e) => GoToBgLayer(1);
            btnPresetBg3.Click  += (s, e) => GoToBgLayer(2);
            btnPresetBg4.Click  += (s, e) => GoToBgLayer(3);
            btnPresetOam1.Click += (s, e) => GoToOamPreset(0);
            btnPresetOam2.Click += (s, e) => GoToOamPreset(1);
        }