Exemplo n.º 1
0
        public void UpdateStatus(DebugState state)
        {
            _lastState = state;

            _binder.Entity = state.Ppu;
            _binder.UpdateUI();
        }
Exemplo n.º 2
0
        private void LoadConfig()
        {
            DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger;

            _entityBinder.Entity = cfg;
            _entityBinder.AddBinding(nameof(cfg.ShowByteCode), mnuShowByteCode);
            _entityBinder.AddBinding(nameof(cfg.ShowMemoryMappings), mnuShowMemoryMappings);
            _entityBinder.AddBinding(nameof(cfg.UseLowerCaseDisassembly), mnuUseLowerCaseDisassembly);
            _entityBinder.AddBinding(nameof(cfg.UseAltSpcOpNames), mnuUseAltSpcOpNames);

            mnuShowByteCode.CheckedChanged       += (s, e) => { ctrlDisassemblyView.CodeViewer.ShowContentNotes = mnuShowByteCode.Checked; };
            mnuShowMemoryMappings.CheckedChanged += (s, e) => {
                if (_cpuType == CpuType.Gameboy)
                {
                    ctrlMemoryMapping.Visible = mnuShowMemoryMappings.Checked;
                }
            };
            mnuUseLowerCaseDisassembly.CheckedChanged += this.UpdateFlags;
            mnuUseAltSpcOpNames.CheckedChanged        += this.UpdateFlags;

            _entityBinder.UpdateUI();

            Font font = new Font(cfg.FontFamily, cfg.FontSize, cfg.FontStyle);

            ctrlDisassemblyView.CodeViewer.BaseFont = font;
            ctrlDisassemblyView.CodeViewer.TextZoom = cfg.TextZoom;

            RestoreLocation(cfg.WindowLocation, cfg.WindowSize);

            if (cfg.SplitterDistance.HasValue)
            {
                ctrlSplitContainer.SplitterDistance = cfg.SplitterDistance.Value;
            }
        }
Exemplo n.º 3
0
        private void LoadConfig()
        {
            DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger;

            _entityBinder.Entity = cfg;
            _entityBinder.AddBinding(nameof(cfg.ShowByteCode), mnuShowByteCode);

            mnuShowByteCode.CheckedChanged += (s, e) => { ctrlDisassemblyView.CodeViewer.ShowContentNotes = mnuShowByteCode.Checked; };

            _entityBinder.UpdateUI();

            Font font = new Font(cfg.FontFamily, cfg.FontSize, cfg.FontStyle);

            ctrlDisassemblyView.CodeViewer.BaseFont = font;
            ctrlDisassemblyView.CodeViewer.TextZoom = cfg.TextZoom;

            if (!cfg.WindowSize.IsEmpty)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.Size          = cfg.WindowSize;
                this.Location      = cfg.WindowLocation;
            }

            if (cfg.SplitterDistance.HasValue)
            {
                ctrlSplitContainer.SplitterDistance = cfg.SplitterDistance.Value;
            }
        }
Exemplo n.º 4
0
        public frmTraceLogger()
        {
            InitializeComponent();

            DebugInfo debugInfo = ConfigManager.Config.DebugInfo;

            if (!debugInfo.TraceLoggerSize.IsEmpty)
            {
                this.Size = debugInfo.TraceLoggerSize;
            }

            mnuAutoRefresh.Checked = debugInfo.TraceAutoRefresh;
            _lineCount             = debugInfo.TraceLineCount;

            _entityBinder.Entity = debugInfo.TraceLoggerOptions;
            _entityBinder.AddBinding("ShowByteCode", chkShowByteCode);
            _entityBinder.AddBinding("ShowCpuCycles", chkShowCpuCycles);
            _entityBinder.AddBinding("ShowEffectiveAddresses", chkShowEffectiveAddresses);
            _entityBinder.AddBinding("ShowMemoryValues", chkShowMemoryValues);
            _entityBinder.AddBinding("ShowExtraInfo", chkShowExtraInfo);
            _entityBinder.AddBinding("ShowPpuFrames", chkShowFrameCount);
            _entityBinder.AddBinding("ShowPpuCycles", chkShowPpuCycles);
            _entityBinder.AddBinding("ShowPpuScanline", chkShowPpuScanline);
            _entityBinder.AddBinding("ShowRegisters", chkShowRegisters);
            _entityBinder.AddBinding("IndentCode", chkIndentCode);
            _entityBinder.AddBinding("UseLabels", chkUseLabels);
            _entityBinder.AddBinding("StatusFormat", cboStatusFlagFormat);
            _entityBinder.UpdateUI();

            this.toolTip.SetToolTip(this.picExpressionWarning, "Condition contains invalid syntax or symbols.");
            this.toolTip.SetToolTip(this.picHelp, "When a condition is given, instructions will only be logged by the trace logger if the condition returns a value not equal to 0 or false." + Environment.NewLine + Environment.NewLine + frmBreakpoint.GetConditionTooltip(false));
        }
Exemplo n.º 5
0
        public void UpdateStatus(DebugState state)
        {
            _lastState = state;

            _binder.Entity = state.Ppu;
            _binder.UpdateUI();

            txtHClocks.Text = (state.Ppu.Cycle * 4).ToString();
        }
Exemplo n.º 6
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            HexEditorInfo config = ConfigManager.Config.Debug.HexEditor;

            _entityBinder.Entity = config;
            _entityBinder.AddBinding(nameof(config.AutoRefresh), mnuAutoRefresh);
            _entityBinder.AddBinding(nameof(config.HighDensityTextMode), mnuHighDensityMode);
            _entityBinder.AddBinding(nameof(config.ByteEditingMode), mnuByteEditingMode);
            _entityBinder.AddBinding(nameof(config.EnablePerByteNavigation), mnuEnablePerByteNavigation);
            _entityBinder.AddBinding(nameof(config.IgnoreRedundantWrites), mnuIgnoreRedundantWrites);
            _entityBinder.AddBinding(nameof(config.HighlightCurrentRowColumn), mnuHighlightCurrentRowColumn);
            _entityBinder.AddBinding(nameof(config.ShowCharacters), mnuShowCharacters);
            _entityBinder.AddBinding(nameof(config.ShowLabelInfo), mnuShowLabelInfoOnMouseOver);

            _entityBinder.AddBinding(nameof(config.HighlightExecution), mnuHighlightExecution);
            _entityBinder.AddBinding(nameof(config.HighlightReads), mnuHightlightReads);
            _entityBinder.AddBinding(nameof(config.HighlightWrites), mnuHighlightWrites);
            _entityBinder.AddBinding(nameof(config.HideUnusedBytes), mnuHideUnusedBytes);
            _entityBinder.AddBinding(nameof(config.HideReadBytes), mnuHideReadBytes);
            _entityBinder.AddBinding(nameof(config.HideWrittenBytes), mnuHideWrittenBytes);
            _entityBinder.AddBinding(nameof(config.HideExecutedBytes), mnuHideExecutedBytes);

            _entityBinder.AddBinding(nameof(config.HighlightLabelledBytes), mnuHighlightLabelledBytes);
            _entityBinder.AddBinding(nameof(config.HighlightBreakpoints), mnuHighlightBreakpoints);
            _entityBinder.AddBinding(nameof(config.HighlightCodeBytes), mnuHighlightCodeBytes);
            _entityBinder.AddBinding(nameof(config.HighlightDataBytes), mnuHighlightDataBytes);

            _entityBinder.UpdateUI();

            UpdateRefreshSpeedMenu();
            UpdateFlags();

            this.ctrlHexViewer.HighlightCurrentRowColumn = config.HighlightCurrentRowColumn;
            this.ctrlHexViewer.TextZoom = config.TextZoom;
            this.ctrlHexViewer.BaseFont = new Font(config.FontFamily, config.FontSize, config.FontStyle);

            this.UpdateFadeOptions();

            this.InitTblMappings();

            this.ctrlHexViewer.StringViewVisible = mnuShowCharacters.Checked;

            UpdateImportButton();
            InitMemoryTypeDropdown(true);

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

            this.mnuShowCharacters.CheckedChanged        += this.mnuShowCharacters_CheckedChanged;
            this.mnuIgnoreRedundantWrites.CheckedChanged += mnuIgnoreRedundantWrites_CheckedChanged;

            RestoreLocation(config.WindowLocation, config.WindowSize);

            this.InitShortcuts();
        }
Exemplo n.º 7
0
        public void UpdateStatus(SpcState state)
        {
            _lastState = state;

            _binder.Entity = state;
            _binder.UpdateUI();

            UpdateCpuFlags();
            UpdateStack();
        }
Exemplo n.º 8
0
        private void UpdateCPUStatus(ref CPUState state)
        {
            _cpuBinder.Entity = state;
            _cpuBinder.UpdateUI();

            UpdateCpuFlags();

            chkExternal.Checked     = state.IRQFlag.HasFlag(IRQSource.External);
            chkFrameCounter.Checked = state.IRQFlag.HasFlag(IRQSource.FrameCounter);
            chkDMC.Checked          = state.IRQFlag.HasFlag(IRQSource.DMC);
        }
Exemplo n.º 9
0
        public void Init()
        {
            _entityBinder.Entity = ConfigManager.Config.Debug.EventViewer;
            _entityBinder.AddBinding(nameof(EventViewerConfig.ApuRegisterReadColor), picApuReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ApuRegisterWriteColor), picApuWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.CpuRegisterReadColor), picCpuReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.CpuRegisterWriteColor), picCpuWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.IrqColor), picIrq);
            _entityBinder.AddBinding(nameof(EventViewerConfig.BreakpointColor), picMarkedBreakpoints);
            _entityBinder.AddBinding(nameof(EventViewerConfig.NmiColor), picNmi);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterReadColor), picPpuReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteVramColor), picPpuVramWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteCgramColor), picPpuCgramWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteOamColor), picPpuOamWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteMode7Color), picPpuMode7Writes);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteBgOptionColor), picPpuBgOptionWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteBgScrollColor), picPpuBgScrollWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteWindowColor), picPpuWindowWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteOtherColor), picPpuOtherWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.WorkRamRegisterReadColor), picWramReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.WorkRamRegisterWriteColor), picWramWrites);

            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowApuRegisterReads), chkShowApuRegisterReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowApuRegisterWrites), chkShowApuRegisterWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowCpuRegisterReads), chkShowCpuRegisterReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowCpuRegisterWrites), chkShowCpuRegisterWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowIrq), chkShowIrq);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowMarkedBreakpoints), chkShowMarkedBreakpoints);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowNmi), chkShowNmi);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterReads), chkShowPpuRegisterReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterVramWrites), chkVramWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterCgramWrites), chkCgramWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterOamWrites), chkOamWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterMode7Writes), chkMode7Writes);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterBgOptionWrites), chkShowPpuBgOptionWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterBgScrollWrites), chkBgScroll);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterWindowWrites), chkWindowWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterOtherWrites), chkOtherWrites);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowWorkRamRegisterReads), chkShowWorkRamRegisterReads);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowWorkRamRegisterWrites), chkShowWorkRamRegisterWrites);

            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel0), chkDmaChannel0);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel1), chkDmaChannel1);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel2), chkDmaChannel2);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel3), chkDmaChannel3);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel4), chkDmaChannel4);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel5), chkDmaChannel5);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel6), chkDmaChannel6);
            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel7), chkDmaChannel7);

            _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPreviousFrameEvents), chkShowPreviousFrameEvents);

            _entityBinder.UpdateUI();
        }
Exemplo n.º 10
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!IsDesignMode)
            {
                tmrOverlay.Start();
                _overlayFont = new Font(BaseControl.MonospaceFontFamily, 10);

                _entityBinder.Entity = ConfigManager.Config.Debug.EventViewer;
                _entityBinder.AddBinding(nameof(EventViewerConfig.ApuRegisterReadColor), picApuReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ApuRegisterWriteColor), picApuWrites);
                _entityBinder.AddBinding(nameof(EventViewerConfig.CpuRegisterReadColor), picCpuReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.CpuRegisterWriteColor), picCpuWrites);
                _entityBinder.AddBinding(nameof(EventViewerConfig.IrqColor), picIrq);
                _entityBinder.AddBinding(nameof(EventViewerConfig.BreakpointColor), picMarkedBreakpoints);
                _entityBinder.AddBinding(nameof(EventViewerConfig.NmiColor), picNmi);
                _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterReadColor), picPpuReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.PpuRegisterWriteColor), picPpuWrites);
                _entityBinder.AddBinding(nameof(EventViewerConfig.WorkRamRegisterReadColor), picWramReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.WorkRamRegisterWriteColor), picWramWrites);

                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowApuRegisterReads), chkShowApuRegisterReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowApuRegisterWrites), chkShowApuRegisterWrites);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowCpuRegisterReads), chkShowCpuRegisterReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowCpuRegisterWrites), chkShowCpuRegisterWrites);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowIrq), chkShowIrq);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowMarkedBreakpoints), chkShowMarkedBreakpoints);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowNmi), chkShowNmi);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterReads), chkShowPpuRegisterReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPpuRegisterWrites), chkShowPpuRegisterWrites);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowWorkRamRegisterReads), chkShowWorkRamRegisterReads);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowWorkRamRegisterWrites), chkShowWorkRamRegisterWrites);

                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel0), chkDmaChannel0);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel1), chkDmaChannel1);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel2), chkDmaChannel2);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel3), chkDmaChannel3);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel4), chkDmaChannel4);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel5), chkDmaChannel5);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel6), chkDmaChannel6);
                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowDmaChannel7), chkDmaChannel7);

                _entityBinder.AddBinding(nameof(EventViewerConfig.ShowPreviousFrameEvents), chkShowPreviousFrameEvents);

                _entityBinder.UpdateUI();

                RefreshData();
                RefreshViewer();
            }
        }
Exemplo n.º 11
0
        public void UpdateStatus(DebugState state)
        {
            _lastState = state;

            _cpuBinder.Entity = state.Cpu;
            _cpuBinder.UpdateUI();

            txtPC.Text = ((state.Cpu.K << 16) | state.Cpu.PC).ToString("X6");

            UpdateCpuFlags();

            chkIrq.Checked = state.Cpu.IrqSource != 0;
            UpdateStack();
        }
Exemplo n.º 12
0
        public void UpdateStatus(GbState state)
        {
            _lastState = state;

            _cpuBinder.Entity = state.Cpu;
            _cpuBinder.UpdateUI();

            txtHL.Text = ((state.Cpu.H << 8) | state.Cpu.L).ToString("X4");

            _ppuBinder.Entity = state.Ppu;
            _ppuBinder.UpdateUI();

            UpdateCpuFlags();
            UpdateStack();
        }
Exemplo n.º 13
0
        private void UpdatePPUStatus(ref PPUDebugState state)
        {
            _ppuControlBinder.Entity = state.ControlFlags;
            _ppuStatusBinder.Entity  = state.StatusFlags;
            _ppuControlBinder.UpdateUI();
            _ppuStatusBinder.UpdateUI();

            txtCycle.Text    = state.Cycle.ToString();
            txtScanline.Text = state.Scanline.ToString();

            txtVRAMAddr.Text = state.State.VideoRamAddr.ToString("X4");
            txtNTAddr.Text   = (0x2000 | (state.State.VideoRamAddr & 0x0FFF)).ToString("X4");

            chkWriteToggle.Checked = state.State.WriteToggle;
            txtXScroll.Text        = state.State.XScroll.ToString();
        }
        public frmTraceLogger()
        {
            InitializeComponent();

            DebugInfo debugInfo = ConfigManager.Config.DebugInfo;

            if (!debugInfo.TraceLoggerSize.IsEmpty)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.Size          = debugInfo.TraceLoggerSize;
                this.Location      = debugInfo.TraceLoggerLocation;
            }

            _tooltipManager = new CodeTooltipManager(this, txtTraceLog);

            txtTraceLog.BaseFont = new Font(debugInfo.TraceFontFamily, debugInfo.TraceFontSize, debugInfo.TraceFontStyle);
            txtTraceLog.TextZoom = debugInfo.TraceTextZoom;

            mnuAutoRefresh.Checked = debugInfo.TraceAutoRefresh;
            _lineCount             = debugInfo.TraceLineCount;

            _entityBinder.Entity = debugInfo.TraceLoggerOptions;
            _entityBinder.AddBinding("ShowByteCode", chkShowByteCode);
            _entityBinder.AddBinding("ShowCpuCycles", chkShowCpuCycles);
            _entityBinder.AddBinding("ShowEffectiveAddresses", chkShowEffectiveAddresses);
            _entityBinder.AddBinding("ShowMemoryValues", chkShowMemoryValues);
            _entityBinder.AddBinding("ShowExtraInfo", chkShowExtraInfo);
            _entityBinder.AddBinding("ShowPpuFrames", chkShowFrameCount);
            _entityBinder.AddBinding("ShowPpuCycles", chkShowPpuCycles);
            _entityBinder.AddBinding("ShowPpuScanline", chkShowPpuScanline);
            _entityBinder.AddBinding("ShowRegisters", chkShowRegisters);
            _entityBinder.AddBinding("IndentCode", chkIndentCode);
            _entityBinder.AddBinding("UseLabels", chkUseLabels);
            _entityBinder.AddBinding("ExtendZeroPage", chkExtendZeroPage);
            _entityBinder.AddBinding("UseWindowsEol", chkUseWindowsEol);
            _entityBinder.AddBinding("StatusFormat", cboStatusFlagFormat);
            _entityBinder.AddBinding("OverrideFormat", chkOverrideFormat);
            _entityBinder.UpdateUI();

            this.toolTip.SetToolTip(this.picExpressionWarning, "Condition contains invalid syntax or symbols.");
            this.toolTip.SetToolTip(this.picHelp, "When a condition is given, instructions will only be logged by the trace logger if the condition returns a value not equal to 0 or false." + Environment.NewLine + Environment.NewLine + frmBreakpoint.GetConditionTooltip(false));
            this.toolTip.SetToolTip(this.picFormatHelp,
                                    "You can customize the trace logger's output by enabling the 'Override' option and altering the format." + Environment.NewLine + Environment.NewLine +
                                    "The following tags are available: " + Environment.NewLine +
                                    "[ByteCode]: The byte code for the instruction (1 to 3 bytes)." + Environment.NewLine +
                                    "[Disassembly]: The disassembly for the current instruction." + Environment.NewLine +
                                    "[EffectiveAddress]: The effective address used for indirect addressing modes." + Environment.NewLine +
                                    "[MemoryValue]: The value stored at the memory location referred to by the instruction." + Environment.NewLine +
                                    "[PC]: Program Counter" + Environment.NewLine +
                                    "[A]: A register" + Environment.NewLine +
                                    "[X]: X register" + Environment.NewLine +
                                    "[Y]: Y register" + Environment.NewLine +
                                    "[SP]: Stack Pointer" + Environment.NewLine +
                                    "[P]: Processor Flags" + Environment.NewLine +
                                    "[Cycle]: The current PPU cycle." + Environment.NewLine +
                                    "[Scanline]: The current PPU scanline." + Environment.NewLine +
                                    "[FrameCount]: The current PPU frame." + Environment.NewLine +
                                    "[CycleCount]: The current CPU cycle (32-bit signed value, resets to 0 at power on)" + Environment.NewLine + Environment.NewLine +
                                    "You can also specify some options by using a comma. e.g:" + Environment.NewLine +
                                    "[Cycle,3] will display the cycle and pad out the output to always be 3 characters wide." + Environment.NewLine +
                                    "[Scanline,h] will display the scanline in hexadecimal." + Environment.NewLine +
                                    "[Align,50]: Align is a special tag that is useful when trying to align some content. [Align,50] will make the next tag start on column 50."
                                    );

            this._initialized = true;
        }
Exemplo n.º 15
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();
            }
        }
Exemplo n.º 16
0
        public frmTraceLogger()
        {
            InitializeComponent();

            TraceLoggerInfo config = ConfigManager.Config.Debug.TraceLogger;

            RestoreLocation(config.WindowLocation, config.WindowSize);

            txtTraceLog.BaseFont = new Font(config.FontFamily, config.FontSize, config.FontStyle);
            txtTraceLog.TextZoom = config.TextZoom;

            mnuAutoRefresh.Checked = config.AutoRefresh;
            _lineCount             = config.LineCount;

            _entityBinder.Entity = config.LogOptions;

            _entityBinder.AddBinding(nameof(TraceLoggerOptions.LogCpu), chkLogCpu);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.LogSpc), chkLogSpc);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.LogNecDsp), chkLogNecDsp);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.LogSa1), chkLogSa1);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.LogGsu), chkLogGsu);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.LogCx4), chkLogCx4);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.LogGameboy), chkLogGameboy);

            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowByteCode), chkShowByteCode);
            //_entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowCpuCycles), chkShowCpuCycles);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowEffectiveAddresses), chkShowEffectiveAddresses);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowMemoryValues), chkShowMemoryValues);
            //_entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowExtraInfo), chkShowExtraInfo);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowPpuFrames), chkShowFrameCount);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowPpuCycles), chkShowPpuCycles);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowPpuScanline), chkShowPpuScanline);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ShowRegisters), chkShowRegisters);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.IndentCode), chkIndentCode);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.UseLabels), chkUseLabels);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.ExtendZeroPage), chkExtendZeroPage);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.UseWindowsEol), chkUseWindowsEol);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.StatusFormat), cboStatusFlagFormat);
            _entityBinder.AddBinding(nameof(TraceLoggerOptions.OverrideFormat), chkOverrideFormat);
            _entityBinder.UpdateUI();

            this.toolTip.SetToolTip(this.picExpressionWarning, "Condition contains invalid syntax or symbols.");
            //this.toolTip.SetToolTip(this.picHelp, "When a condition is given, instructions will only be logged by the trace logger if the condition returns a value not equal to 0 or false." + Environment.NewLine + Environment.NewLine + frmBreakpoint.GetConditionTooltip(false));
            this.toolTip.SetToolTip(this.picFormatHelp,
                                    "You can customize the trace logger's output by enabling the 'Override' option and altering the format." + Environment.NewLine + Environment.NewLine +
                                    "The following tags are available: " + Environment.NewLine +
                                    "[ByteCode]: The byte code for the instruction (1 to 3 bytes)." + Environment.NewLine +
                                    "[Disassembly]: The disassembly for the current instruction." + Environment.NewLine +
                                    "[EffectiveAddress]: The effective address used for indirect addressing modes." + Environment.NewLine +
                                    "[MemoryValue]: The value stored at the memory location referred to by the instruction." + Environment.NewLine +
                                    "[PC]: Program Counter" + Environment.NewLine +
                                    "[A]: A register" + Environment.NewLine +
                                    "[X]: X register" + Environment.NewLine +
                                    "[Y]: Y register" + Environment.NewLine +
                                    "[SP]: Stack Pointer" + Environment.NewLine +
                                    "[P]: Processor Flags" + Environment.NewLine +
                                    "[Cycle]: The current PPU cycle (H)" + Environment.NewLine +
                                    "[HClock]: The PPU's current H-clock position (H, in terms of master clocks)" + Environment.NewLine +
                                    "[Scanline]: The current PPU scanline (V)" + Environment.NewLine +
                                    "[FrameCount]: The current PPU frame." + Environment.NewLine +
                                    "[CycleCount]: The current CPU cycle (32-bit signed value, resets to 0 at power on)" + Environment.NewLine + Environment.NewLine +
                                    "You can also specify some options by using a comma. e.g:" + Environment.NewLine +
                                    "[Cycle,3] will display the cycle and pad out the output to always be 3 characters wide." + Environment.NewLine +
                                    "[Scanline,h] will display the scanline in hexadecimal." + Environment.NewLine +
                                    "[Align,50]: Align is a special tag that is useful when trying to align some content. [Align,50] will make the next tag start on column 50."
                                    );

            UpdateAvailableOptions();

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

            this._initialized = true;
        }