2014-12-13 23:15:39 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
using BizHawk.Emulation.Common;
|
|
|
|
|
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
|
|
|
|
using BizHawk.Client.Common;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.Client.EmuHawk
|
2014-12-06 00:03:36 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class GenericDebugger : IToolForm
|
|
|
|
|
{
|
2014-12-15 03:19:23 +00:00
|
|
|
|
[RequiredService]
|
|
|
|
|
private IDebuggable Core { get; set; }
|
|
|
|
|
[OptionalService]
|
|
|
|
|
private IDisassemblable Disassembler { get; set; }
|
|
|
|
|
[OptionalService]
|
|
|
|
|
private IMemoryDomains MemoryDomainSource { get; set; }
|
2014-12-15 22:25:06 +00:00
|
|
|
|
[OptionalService]
|
|
|
|
|
private IMemoryCallbackSystem MCS { get; set; }
|
|
|
|
|
|
2014-12-15 03:19:23 +00:00
|
|
|
|
private MemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
2014-12-14 14:30:46 +00:00
|
|
|
|
|
2014-12-14 17:44:45 +00:00
|
|
|
|
private int PC
|
2014-12-14 14:30:46 +00:00
|
|
|
|
{
|
2014-12-20 03:19:33 +00:00
|
|
|
|
// TODO: is this okay for N64?
|
|
|
|
|
get { return (int)Core.GetCpuFlagsAndRegisters()[Disassembler.PCRegisterName].Value; }
|
2014-12-14 14:30:46 +00:00
|
|
|
|
}
|
2014-12-13 23:15:39 +00:00
|
|
|
|
|
2014-12-18 02:42:53 +00:00
|
|
|
|
#region Implementation checking
|
|
|
|
|
|
|
|
|
|
private bool CanDisassemble
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (Disassembler == null)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var pc = PC;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
catch (NotImplementedException)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2014-12-06 00:03:36 +00:00
|
|
|
|
public void UpdateValues()
|
|
|
|
|
{
|
2014-12-06 13:42:59 +00:00
|
|
|
|
RegisterPanel.UpdateValues();
|
2014-12-14 14:30:46 +00:00
|
|
|
|
UpdateDisassembler();
|
2014-12-06 00:03:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void FastUpdate()
|
|
|
|
|
{
|
|
|
|
|
// TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Restart()
|
|
|
|
|
{
|
2014-12-17 03:48:08 +00:00
|
|
|
|
// TODO
|
2014-12-06 00:03:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool AskSaveChanges()
|
|
|
|
|
{
|
|
|
|
|
// TODO
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool UpdateBefore
|
|
|
|
|
{
|
|
|
|
|
get { return false; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|