AsDebuggable()

This commit is contained in:
adelikat 2014-12-05 01:01:58 +00:00
parent f5cc38c9cd
commit 11a8a009c5
1 changed files with 13 additions and 7 deletions

View File

@ -65,11 +65,13 @@ namespace BizHawk.Client.Common
{
try
{
var debuggable = Global.Emulator as IDebuggable;
if (debuggable == null)
var debuggable = Global.Emulator.AsDebuggable();
if (!Global.Emulator.CanDebug())
{
throw new NotImplementedException();
}
var registers = debuggable.GetCpuFlagsAndRegisters();
var registers = debuggable.AsDebuggable().GetCpuFlagsAndRegisters();
return registers.ContainsKey(name)
? registers[name]
: 0;
@ -94,9 +96,11 @@ namespace BizHawk.Client.Common
try
{
var debuggable = Global.Emulator as IDebuggable;
if (debuggable == null)
var debuggable = Global.Emulator.AsDebuggable();
if (!Global.Emulator.CanDebug())
{
throw new NotImplementedException();
}
foreach (var kvp in debuggable.GetCpuFlagsAndRegisters())
{
@ -121,9 +125,11 @@ namespace BizHawk.Client.Common
{
try
{
var debuggable = Global.Emulator as IDebuggable;
if (debuggable == null)
var debuggable = Global.Emulator.AsDebuggable();
if (!Global.Emulator.CanDebug())
{
throw new NotImplementedException();
}
debuggable.SetCpuRegister(register, value);
}