Exemplo n.º 1
0
        protected override void OnCellValueNeeded(DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex > _cp.MicrocodeRam.Length)
            {
                // Past end of microcode, nothing to do.
                base.OnCellValueNeeded(e);
                return;
            }

            switch (e.ColumnIndex)
            {
            case 0:
            {
                ushort address = (ushort)e.RowIndex;

                e.Value = BreakpointManager.GetBreakpoint(BreakpointProcessor.CP, address) != BreakpointType.None;
            }
            break;

            case 1:
                e.Value = String.Format("{0:x3}", e.RowIndex);
                break;

            case 2:
                e.Value = new Microinstruction(_cp.MicrocodeRam[e.RowIndex]).Disassemble(-1);
                break;

            default:
                throw new InvalidOperationException("Unhandled column.");
            }

            base.OnCellValueNeeded(e);
        }
Exemplo n.º 2
0
        protected override void OnCellValueNeeded(DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex > _source.Count)
            {
                // Past end of source, nothing to do.
                return;
            }

            switch (e.ColumnIndex)
            {
            case 0:
            {
                ushort address          = 0;
                bool   addressAvailable = _sourceMap != null?_sourceMap.GetAddressForSource(new SourceEntry(_currentSourceFile, new string[] { }, 0, e.RowIndex), out address) : false;

                if (addressAvailable)
                {
                    e.Value = BreakpointManager.GetBreakpoint(_iopCode ? BreakpointProcessor.IOP : BreakpointProcessor.CP, address) != BreakpointType.None;
                }
                else
                {
                    e.Value = false;                // TODO: hook to breakpoint system
                }
            }
            break;

            case 1:
            {
                ushort address          = 0;
                bool   addressAvailable = _sourceMap != null?_sourceMap.GetAddressForSource(new SourceEntry(_currentSourceFile, new string[] { }, 0, e.RowIndex), out address) : false;

                e.Value = addressAvailable ? String.Format("${0:x4}", address) : String.Empty;
            }
            break;

            case 2:
                e.Value = _source[e.RowIndex];
                break;

            default:
                throw new InvalidOperationException("Unhandled column.");
            }

            base.OnCellValueNeeded(e);
        }