Debugger - add breakpoint dialog - pop up in a reasonable place, and limit address size based on the core's bus size
This commit is contained in:
parent
925d6f5a50
commit
18e112536a
|
@ -125,6 +125,7 @@
|
|||
this.MinimizeBox = false;
|
||||
this.Name = "AddBreakpointDialog";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Add Breakpoint";
|
||||
this.Load += new System.EventHandler(this.AddBreakpointDialog_Load);
|
||||
this.BreakpointTypeGroupbox.ResumeLayout(false);
|
||||
|
|
|
@ -46,6 +46,19 @@ namespace BizHawk.Client.EmuHawk
|
|||
get { return (uint)AddressBox.ToRawInt().Value; }
|
||||
}
|
||||
|
||||
public int MaxAddressSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return AddressBox.MaxLength;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
AddressBox.MaxLength = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
|
|
|
@ -7,8 +7,10 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Common.NumberExtensions;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk.tools.Debugger
|
||||
{
|
||||
|
@ -96,7 +98,12 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
|||
|
||||
private void AddBreakpointButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var b = new AddBreakpointDialog();
|
||||
var b = new AddBreakpointDialog
|
||||
{
|
||||
// TODO: don't use Global.Emulator! Pass in an IMemoryDomains implementation from the parent tool
|
||||
MaxAddressSize = (Global.Emulator.AsMemoryDomains().MemoryDomains.SystemBus.Size - 1).NumHexDigits()
|
||||
};
|
||||
|
||||
if (b.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Breakpoints.Add(Core, b.Address, b.BreakType);
|
||||
|
|
Loading…
Reference in New Issue