Debugger - convert to using OptionalServices for the Disassembler
This commit is contained in:
parent
1cd49d5b54
commit
29d6859167
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public IDictionary<Type, object> EmulatorServices { private get; set; }
|
public IDictionary<Type, object> EmulatorServices { private get; set; }
|
||||||
private IDebuggable Core { get { return (IDebuggable)EmulatorServices[typeof(IDebuggable)]; } }
|
private IDebuggable Core { get { return (IDebuggable)EmulatorServices[typeof(IDebuggable)]; } }
|
||||||
private IDisassemblable Disassembler;
|
private IDisassemblable Disassembler { get { return (IDisassemblable)EmulatorServices[typeof(IDisassemblable)]; } }
|
||||||
|
|
||||||
public void UpdateValues()
|
public void UpdateValues()
|
||||||
{
|
{
|
||||||
|
@ -29,8 +29,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Disassembler = Global.Emulator.AsDissassembler();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AskSaveChanges()
|
public bool AskSaveChanges()
|
||||||
|
|
|
@ -14,6 +14,7 @@ using BizHawk.Client.Common;
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
[RequiredServices(typeof(IDebuggable))]
|
[RequiredServices(typeof(IDebuggable))]
|
||||||
|
[OptionalServices(typeof(IDisassemblable))]
|
||||||
public partial class GenericDebugger : Form, IToolForm, IControlMainform
|
public partial class GenericDebugger : Form, IToolForm, IControlMainform
|
||||||
{
|
{
|
||||||
private int _defaultWidth;
|
private int _defaultWidth;
|
||||||
|
@ -45,8 +46,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Size = Global.Config.GenericDebuggerSettings.WindowSize;
|
Size = Global.Config.GenericDebuggerSettings.WindowSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
Disassembler = Global.Emulator.AsDissassembler();
|
|
||||||
|
|
||||||
EngageDebugger();
|
EngageDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +71,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void EngageDebugger()
|
private void EngageDebugger()
|
||||||
{
|
{
|
||||||
if (Core.CanDisassemble())
|
if (Disassembler != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue