Debugger - Disassembler - highlight the current PC, and some more reorg

This commit is contained in:
adelikat 2014-12-20 16:01:11 +00:00
parent 7d3a7005cb
commit 8e3c494204
3 changed files with 35 additions and 26 deletions

View File

@ -286,7 +286,7 @@
// Instruction
//
this.Instruction.Text = "Instruction";
this.Instruction.Width = 143;
this.Instruction.Width = 291;
//
// StepOutBtn
//

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
@ -54,5 +55,38 @@ namespace BizHawk.Client.EmuHawk
}
}
}
private void DisassemblerView_QueryItemText(int index, int column, out string text)
{
text = "";
if (column == 0)
{
if (PC <= index && index < PC + DisassemblyLines.Count)
{
int a = PC;
for (int i = 0; i < index - PC; ++i)
{
a += DisassemblyLines[i].Size;
}
text = string.Format("{0:X4}", a);
}
}
else if (column == 1)
{
if (PC <= index && index < PC + DisassemblyLines.Count)
{
text = DisassemblyLines[index - PC].Mnemonic;
}
}
}
private void DisassemblerView_QueryItemBkColor(int index, int column, ref Color color)
{
if (index == PC)
{
color = Color.LightCyan;
}
}
}
}

View File

@ -49,31 +49,6 @@ namespace BizHawk.Client.EmuHawk
EngageDebugger();
}
private void DisassemblerView_QueryItemText(int index, int column, out string text)
{
text = "";
if (column == 0)
{
if (PC <= index && index < PC + DisassemblyLines.Count)
{
int a = PC;
for (int i = 0; i < index - PC; ++i)
a += DisassemblyLines[i].Size;
text = string.Format("{0:X4}", a);
}
}
else if (column == 1)
{
if (PC <= index && index < PC + DisassemblyLines.Count)
text = DisassemblyLines[index - PC].Mnemonic;
}
}
private void DisassemblerView_QueryItemBkColor(int index, int column, ref Color color)
{
}
public void DisableRegisterBox()
{
RegistersGroupBox.Enabled = false;