Files
SourMesen e391fd8f9a Code: Add auto-formatting rules for C++ (clang-format) and enforce in CI via "clang-format" and "dotnet format" (#78)
* Code: Add auto-formatting rules for C++ projects (clang-format) and enforce code style via "clang-format" and "dotnet format"

* fix ui format warnings
2026-04-30 06:03:55 -07:00

38 lines
793 B
C#

using Avalonia.Controls;
using Mesen.Debugger.Controls;
using Mesen.Interop;
namespace Mesen.Debugger.Disassembly
{
public class CodeDataProvider : ICodeDataProvider
{
private int _lineCount;
protected CpuType _type;
public CodeDataProvider(CpuType type)
{
_type = type;
if(Design.IsDesignMode) {
return;
}
_lineCount = DebugApi.GetMemorySize(type.ToMemoryType());
}
public CpuType CpuType => _type;
public int GetLineCount() => _lineCount;
public CodeLineData[] GetCodeLines(int startPosition, int rowCount)
{
return DebugApi.GetDisassemblyOutput(_type, (uint)startPosition, (uint)rowCount);
}
public int GetRowAddress(int address, int rowOffset)
{
return DebugApi.GetDisassemblyRowAddress(_type, (uint)address, rowOffset);
}
}
}