mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-01-22 16:16:17 +00:00
Library fixes
This commit is contained in:
@@ -83,6 +83,11 @@ namespace EightBit
|
||||
}
|
||||
}
|
||||
|
||||
protected void ResetWorkingRegisters()
|
||||
{
|
||||
this.AF.Word = this.BC.Word = this.DE.Word = this.HL.Word = (ushort)Mask.Sixteen;
|
||||
}
|
||||
|
||||
protected static int BuildHalfCarryIndex(byte before, byte value, int calculation) => ((before & 0x88) >> 1) | ((value & 0x88) >> 2) | ((calculation & 0x88) >> 3);
|
||||
|
||||
protected static int CalculateHalfCarryAdd(byte before, byte value, int calculation)
|
||||
|
||||
@@ -15,6 +15,53 @@ namespace EightBit
|
||||
|
||||
#endregion
|
||||
|
||||
#region Bus events
|
||||
|
||||
#region Memory events
|
||||
|
||||
#region Memory read events
|
||||
|
||||
public event EventHandler<EventArgs>? ReadingMemory;
|
||||
public event EventHandler<EventArgs>? ReadMemory;
|
||||
protected virtual void OnReadingMemory() => ReadingMemory?.Invoke(this, EventArgs.Empty);
|
||||
protected virtual void OnReadMemory() => ReadMemory?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Memory write events
|
||||
|
||||
public event EventHandler<EventArgs>? WritingMemory;
|
||||
public event EventHandler<EventArgs>? WrittenMemory;
|
||||
protected virtual void OnWritingMemory() => WritingMemory?.Invoke(this, EventArgs.Empty);
|
||||
protected virtual void OnWrittenMemory() => WrittenMemory?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region IO events
|
||||
|
||||
#region IO read events
|
||||
|
||||
public event EventHandler<EventArgs>? ReadingIO;
|
||||
public event EventHandler<EventArgs>? ReadIO;
|
||||
protected virtual void OnReadingIO() => ReadingIO?.Invoke(this, EventArgs.Empty);
|
||||
protected virtual void OnReadIO() => ReadIO?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
#endregion
|
||||
|
||||
#region IO write events
|
||||
|
||||
public event EventHandler<EventArgs>? WritingIO;
|
||||
public event EventHandler<EventArgs>? WrittenIO;
|
||||
protected virtual void OnWritingIO() => WritingIO?.Invoke(this, EventArgs.Empty);
|
||||
protected virtual void OnWrittenIO() => WrittenIO?.Invoke(this, EventArgs.Empty);
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
private PinLevel _resetLine;
|
||||
private PinLevel _intLine;
|
||||
|
||||
@@ -217,7 +264,10 @@ namespace EightBit
|
||||
return this.MemoryRead(address.Low, address.High);
|
||||
}
|
||||
|
||||
protected virtual byte MemoryRead() => this.BusRead();
|
||||
protected virtual byte MemoryRead()
|
||||
{
|
||||
return this.BusRead();
|
||||
}
|
||||
|
||||
protected virtual byte BusRead() => this.Bus.Read(); // N.B. Should be the only real call into the "Bus.Read" code.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user