IDebugable - add a CanStep() method, and implement it in all IDebuggable implementations

This commit is contained in:
adelikat 2014-12-20 13:29:57 +00:00
parent a8116297a0
commit ffdeb618f7
20 changed files with 57 additions and 4 deletions

View File

@ -21,11 +21,15 @@ namespace BizHawk.Emulation.Common
IMemoryCallbackSystem MemoryCallbacks { get; } IMemoryCallbackSystem MemoryCallbacks { get; }
// Advanced Navigation /// <summary>
//void StepInto(); /// Informs the calling code whether or not the given step type is implemented,
//void StepOut(); /// if false, a NotImplementedException will be thrown if Step is called with the given value
//void StepOver(); /// </summary>
bool CanStep(StepType type);
/// <summary>
/// Advances the core based on the given Step type
/// </summary>
void Step(StepType type); void Step(StepType type);
} }

View File

@ -130,5 +130,7 @@ namespace BizHawk.Emulation.Cores.Calculators
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }
public bool CanStep(StepType type) { return false; }
} }
} }

View File

@ -65,5 +65,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }
public bool CanStep(StepType type) { return false; }
} }
} }

View File

@ -60,6 +60,19 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
public IMemoryCallbackSystem MemoryCallbacks { get; private set; } public IMemoryCallbackSystem MemoryCallbacks { get; private set; }
public bool CanStep(StepType type)
{
switch (type)
{
case StepType.Into:
return true;
default:
case StepType.Out:
case StepType.Over:
return false;
}
}
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) public void Step(StepType type)
{ {

View File

@ -66,6 +66,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800
get { throw new NotImplementedException(); } get { throw new NotImplementedException(); }
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }
} }

View File

@ -133,6 +133,8 @@ namespace BizHawk.Emulation.Cores.ColecoVision
get { throw new NotImplementedException(); } get { throw new NotImplementedException(); }
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }
} }

View File

@ -27,6 +27,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
return ret; return ret;
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -421,6 +421,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
regs.SetRegister(register, value); regs.SetRegister(register, value);
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -289,6 +289,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
_inputCallbacks = ics; _inputCallbacks = ics;
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -448,6 +448,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
MemoryDomains = new MemoryDomainList(mm); MemoryDomains = new MemoryDomainList(mm);
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -71,6 +71,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
public IMemoryCallbackSystem MemoryCallbacks { get; private set; } public IMemoryCallbackSystem MemoryCallbacks { get; private set; }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -946,6 +946,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
} }
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -397,6 +397,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -254,6 +254,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
public ITracer Tracer { get; private set; } public ITracer Tracer { get; private set; }
public IMemoryCallbackSystem MemoryCallbacks { get; private set; } public IMemoryCallbackSystem MemoryCallbacks { get; private set; }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -566,6 +566,8 @@ namespace BizHawk.Emulation.Cores.PCEngine
}; };
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -292,6 +292,8 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
}; };
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -600,6 +600,8 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
} }
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -650,6 +650,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
return ret; return ret;
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -1007,6 +1007,8 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
[FeatureNotImplemented] [FeatureNotImplemented]
public IMemoryCallbackSystem MemoryCallbacks { get { throw new NotImplementedException(); } } public IMemoryCallbackSystem MemoryCallbacks { get { throw new NotImplementedException(); } }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }

View File

@ -351,6 +351,8 @@ namespace BizHawk.Emulation.Cores.WonderSwan
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool CanStep(StepType type) { return false; }
[FeatureNotImplemented] [FeatureNotImplemented]
public void Step(StepType type) { throw new NotImplementedException(); } public void Step(StepType type) { throw new NotImplementedException(); }