public void Prepare(long firstByteIndex, long lastByteIndex) { _readStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType, MemoryOperationType.Read); _writeStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType, MemoryOperationType.Write); _execStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType, MemoryOperationType.Exec); if (_memoryType == DebugMemoryType.CpuMemory) { _freezeState = InteropEmu.DebugGetFreezeState((UInt16)firstByteIndex, (UInt16)(lastByteIndex - firstByteIndex + 1)); } _readCounts = InteropEmu.DebugGetMemoryAccessCountsEx((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType, MemoryOperationType.Read); _writeCounts = InteropEmu.DebugGetMemoryAccessCountsEx((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType, MemoryOperationType.Write); _execCounts = InteropEmu.DebugGetMemoryAccessCountsEx((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType, MemoryOperationType.Exec); _cdlData = null; if (_highlightDmcDataBytes || _highlightDataBytes || _highlightCodeBytes || _highlightLabelledBytes) { switch (_memoryType) { case DebugMemoryType.ChrRom: case DebugMemoryType.PpuMemory: case DebugMemoryType.CpuMemory: case DebugMemoryType.PrgRom: _cdlData = InteropEmu.DebugGetCdlData((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType); break; } } InteropEmu.DebugGetState(ref _state); }
public void Prepare(long firstByteIndex, long lastByteIndex) { if (_highlightDrawnBytes || _highlightReadBytes) { _cdlData = InteropEmu.DebugGetCdlData((UInt32)firstByteIndex, (UInt32)(lastByteIndex - firstByteIndex + 1), _memoryType); } else { _cdlData = null; } }
public void Prepare(long firstByteIndex, long lastByteIndex) { int visibleByteCount = (int)(lastByteIndex - firstByteIndex + 1); if (_highlightBreakpoints) { Breakpoint[] breakpoints = BreakpointManager.Breakpoints.ToArray(); _breakpointTypes = new BreakpointType[visibleByteCount]; for (int i = 0; i < visibleByteCount; i++) { int byteIndex = i + (int)firstByteIndex; foreach (Breakpoint bp in breakpoints) { if (bp.Enabled && !bp.IsCpuBreakpoint && bp.Matches(byteIndex, _memoryType)) { _breakpointTypes[i] = bp.BreakOnWrite ? BreakpointType.WriteVram : BreakpointType.ReadVram; break; } } } } else { _breakpointTypes = null; } InteropEmu.DebugGetState(ref _state); _readStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Read); _writeStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Write); _readCounts = InteropEmu.DebugGetMemoryAccessCounts((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Read); _writeCounts = InteropEmu.DebugGetMemoryAccessCounts((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Write); if (_memoryType == DebugMemoryType.ChrRom && (_highlightDrawnBytes || _highlightReadBytes)) { _cdlData = InteropEmu.DebugGetCdlData((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType); } else { _cdlData = null; } }
public void Prepare(long firstByteIndex, long lastByteIndex) { int visibleByteCount = (int)(lastByteIndex - firstByteIndex + 1); if (_highlightBreakpoints) { Breakpoint[] breakpoints = BreakpointManager.Breakpoints.ToArray(); _breakpointTypes = new BreakpointType[visibleByteCount]; for (int i = 0; i < visibleByteCount; i++) { int byteIndex = i + (int)firstByteIndex; foreach (Breakpoint bp in breakpoints) { if (bp.Enabled && bp.IsCpuBreakpoint && bp.Matches(byteIndex, _memoryType)) { _breakpointTypes[i] = bp.BreakOnExec ? BreakpointType.Execute : (bp.BreakOnWrite ? BreakpointType.WriteRam : BreakpointType.ReadRam); break; } } } } else { _breakpointTypes = null; } _readStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Read); _writeStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Write); _execStamps = InteropEmu.DebugGetMemoryAccessStamps((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Exec); if (_memoryType == DebugMemoryType.CpuMemory) { _freezeState = InteropEmu.DebugGetFreezeState((UInt16)firstByteIndex, (UInt16)visibleByteCount); } _readCounts = InteropEmu.DebugGetMemoryAccessCounts((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Read); _writeCounts = InteropEmu.DebugGetMemoryAccessCounts((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Write); _execCounts = InteropEmu.DebugGetMemoryAccessCounts((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType, MemoryOperationType.Exec); _cdlData = null; if (_highlightDmcDataBytes || _highlightDataBytes || _highlightCodeBytes) { switch (_memoryType) { case DebugMemoryType.ChrRom: case DebugMemoryType.PpuMemory: case DebugMemoryType.CpuMemory: case DebugMemoryType.PrgRom: _cdlData = InteropEmu.DebugGetCdlData((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType); break; } } _hasLabel = new bool[visibleByteCount]; if (_highlightLabelledBytes) { if (_memoryType == DebugMemoryType.CpuMemory) { for (long i = 0; i < _hasLabel.Length; i++) { _hasLabel[i] = ( !string.IsNullOrWhiteSpace(LabelManager.GetLabel((UInt16)(i + firstByteIndex))?.Label) || !string.IsNullOrWhiteSpace(LabelManager.GetLabel((uint)(i + firstByteIndex), AddressType.Register)?.Label) ); } } else if (_memoryType == DebugMemoryType.PrgRom || _memoryType == DebugMemoryType.WorkRam || _memoryType == DebugMemoryType.SaveRam) { for (long i = 0; i < _hasLabel.Length; i++) { _hasLabel[i] = !string.IsNullOrWhiteSpace(LabelManager.GetLabel((uint)(firstByteIndex + i), _memoryType.ToAddressType())?.Label); } } } InteropEmu.DebugGetState(ref _state); }
public void Prepare(long firstByteIndex, long lastByteIndex) { int visibleByteCount = (int)(lastByteIndex - firstByteIndex + 1); if (_highlightBreakpoints) { Breakpoint[] breakpoints = BreakpointManager.Breakpoints.ToArray(); _breakpointTypes = new BreakpointType[visibleByteCount]; for (int i = 0; i < visibleByteCount; i++) { int byteIndex = i + (int)firstByteIndex; foreach (Breakpoint bp in breakpoints) { if (bp.Enabled && bp.IsCpuBreakpoint && bp.Matches(byteIndex, _memoryType)) { _breakpointTypes[i] = bp.BreakOnExec ? BreakpointType.Execute : (bp.BreakOnWrite ? BreakpointType.WriteRam : BreakpointType.ReadRam); break; } } } } else { _breakpointTypes = null; } _counts = InteropEmu.DebugGetMemoryAccessCounts((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType); if (_memoryType == DebugMemoryType.CpuMemory) { _freezeState = InteropEmu.DebugGetFreezeState((UInt16)firstByteIndex, (UInt16)visibleByteCount); } _cdlData = null; if (_highlightDmcDataBytes || _highlightDataBytes || _highlightCodeBytes) { switch (_memoryType) { case DebugMemoryType.ChrRom: case DebugMemoryType.PpuMemory: case DebugMemoryType.CpuMemory: case DebugMemoryType.PrgRom: _cdlData = InteropEmu.DebugGetCdlData((UInt32)firstByteIndex, (UInt32)visibleByteCount, _memoryType); break; } } _hasLabel = new ByteLabelState[visibleByteCount]; if (_highlightLabelledBytes) { if (_memoryType == DebugMemoryType.CpuMemory) { for (long i = 0; i < _hasLabel.Length; i++) { UInt16 addr = (UInt16)(i + firstByteIndex); CodeLabel label = LabelManager.GetLabel(addr); if (label == null) { label = LabelManager.GetLabel(addr, AddressType.Register); } if (label != null && !string.IsNullOrWhiteSpace(label.Label)) { if (label.Length > 1) { int relAddress = label.GetRelativeAddress(); _hasLabel[i] = relAddress == addr ? ByteLabelState.LabelFirstByte : ByteLabelState.LabelExtraByte; } else { _hasLabel[i] = ByteLabelState.LabelFirstByte; } } } } else if (_memoryType == DebugMemoryType.PrgRom || _memoryType == DebugMemoryType.WorkRam || _memoryType == DebugMemoryType.SaveRam) { for (long i = 0; i < _hasLabel.Length; i++) { UInt32 addr = (UInt32)(i + firstByteIndex); CodeLabel label = LabelManager.GetLabel(addr, _memoryType.ToAddressType()); if (label != null && !string.IsNullOrWhiteSpace(label.Label)) { _hasLabel[i] = label.Length == 1 || label.Address == addr ? ByteLabelState.LabelFirstByte : ByteLabelState.LabelExtraByte; } } } } InteropEmu.DebugGetState(ref _state); }