Debugger - Disassembler - use the System Bus to assess the max value, instead of a hardcoded 0xFFFF

This commit is contained in:
adelikat 2014-12-20 18:11:42 +00:00
parent 6512dcbd62
commit 4bdbf9fa14
2 changed files with 14 additions and 4 deletions

View File

@ -20,7 +20,16 @@ namespace BizHawk.Client.EmuHawk
public string Mnemonic { get; private set; }
}
private const int ADDR_MAX = 0xFFFF; // TODO: this isn't a constant, calculate it off bus size
//private const int ADDR_MAX = 0xFFFF; // TODO: this isn't a constant, calculate it off bus size
private int BusMaxValue
{
get
{
return MemoryDomains.SystemBus.Size;
}
}
private const int DISASM_LINE_COUNT = 100;
private readonly List<DisasmOp> DisassemblyLines = new List<DisasmOp>();
@ -32,7 +41,7 @@ namespace BizHawk.Client.EmuHawk
{
DisassemblerView.BlazingFast = true;
Disassemble(DISASM_LINE_COUNT);
DisassemblerView.ensureVisible(0xFFFF);
DisassemblerView.ensureVisible(BusMaxValue);
DisassemblerView.ensureVisible(PC);
DisassemblerView.Refresh();
DisassemblerView.BlazingFast = false;
@ -49,7 +58,7 @@ namespace BizHawk.Client.EmuHawk
string line = Disassembler.Disassemble(MemoryDomains.SystemBus, (ushort)a, out advance);
DisassemblyLines.Add(new DisasmOp(advance, line));
a += advance;
if (a > ADDR_MAX)
if (a > BusMaxValue)
{
break;
}

View File

@ -28,11 +28,12 @@ namespace BizHawk.Client.EmuHawk
DisassemblerView.QueryItemText += DisassemblerView_QueryItemText;
DisassemblerView.QueryItemBkColor += DisassemblerView_QueryItemBkColor;
DisassemblerView.VirtualMode = true;
DisassemblerView.ItemCount = ADDR_MAX + 1;
}
private void GenericDebugger_Load(object sender, EventArgs e)
{
DisassemblerView.ItemCount = BusMaxValue + 1;
_defaultWidth = Size.Width;
_defaultHeight = Size.Height;