Interfaces to emulators/machines is performed by inheriting the Debugger class.
This provides the following items to be overridden.
Return a new Meta containing capabilities.
Retrieve the registers from the emulator/machine, and update pRegisters.
Set the specified register to the value provided.
Update the memory page layout - the state is recorded by using pMemory.SetAddressBank:
pMemory.SetAddressBank(
(ushort)( 0x0000 ), // start of slot
(ushort)( 0x3FFF ), // end of slot
pMemory.Bank( BankID.ROM( 0 ) ) // memory bank in that slot
);
Additionally, whether paging is enabled or disabled is recorded using pMemory.PagingEnabled:
pMemory.PagingEnabled = true;
/// <summary>
/// The debugger can change the value of registers
/// </summary>
public bool CanSetRegisters;
/// <summary>
/// The debugger can evaluate an arbitrary string and return a result
/// </summary>
public bool CanEvaluate;
/// <summary>
/// The debugger supports stepping out
/// </summary>
public bool CanStepOut;
/// <summary>
/// The debugger will ignore step over for 'ret' and 'jp' and will instead do a normal step
/// </summary>
public bool CanStepOverSensibly;
/// <summary>
/// Maximum number of breakpoints enabled at any one time
/// </summary>
public int MaxBreakpoints;
public byte A;
public byte F;
public byte B;
public byte C;
public byte D;
public byte E;
public byte H;
public byte L;
public byte AltA;
public byte AltF;
public byte AltB;
public byte AltC;
public byte AltD;
public byte AltE;
public byte AltH;
public byte AltL;
public byte IXH;
public byte IXL;
public byte IYH;
public byte IYL;
public ushort PC;
public ushort SP;
public byte I;
public byte R;
public struct BankID
{
public readonly TypeEnum Type; // All, ROM, Bank, DIV
public readonly int Number;
}
Create a BankID by parsing the provided string into a bank type & number
Create a BankID from the textual bank type & number
Create a BankID for the specified ROM number
Create a BankID for the specified BANK number
Create a BankID for unpaged memory
public class Bank
{
public BankID ID;
public bool IsPagedIn;
public ushort LastAddress;
public string Name => ID.ToString();
}
n/a
Get the specified bank.
Set the memory slot from pMin to pMax to be associated with bank pBank.