mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-07-18 15:24:06 +00:00
Clarifications of EightBit library
This commit is contained in:
@@ -61,8 +61,7 @@ namespace EightBit
|
|||||||
public void Write()
|
public void Write()
|
||||||
{
|
{
|
||||||
this.OnWritingByte();
|
this.OnWritingByte();
|
||||||
var value = this.Data; // N.B. Don't join these two lines together: the
|
this.Reference() = this.Data;
|
||||||
this.Reference() = value; // data bus integrity is lost, due to evaluation order!
|
|
||||||
this.OnWrittenByte();
|
this.OnWrittenByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,10 +6,6 @@ namespace EightBit
|
|||||||
{
|
{
|
||||||
public class Chip : Device
|
public class Chip : Device
|
||||||
{
|
{
|
||||||
protected Chip()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte Bit(int which) => (byte)(1 << which);
|
public static byte Bit(int which) => (byte)(1 << which);
|
||||||
|
|
||||||
public static byte Bit(byte which) => Bit((int)which);
|
public static byte Bit(byte which) => Bit((int)which);
|
||||||
|
@@ -10,10 +10,6 @@ namespace EightBit
|
|||||||
{
|
{
|
||||||
private PinLevel powerLine;
|
private PinLevel powerLine;
|
||||||
|
|
||||||
protected Device()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public event EventHandler<EventArgs>? RaisingPOWER;
|
public event EventHandler<EventArgs>? RaisingPOWER;
|
||||||
|
|
||||||
public event EventHandler<EventArgs>? RaisedPOWER;
|
public event EventHandler<EventArgs>? RaisedPOWER;
|
||||||
|
@@ -11,10 +11,6 @@ namespace EightBit
|
|||||||
private readonly byte[] input = new byte[0x100];
|
private readonly byte[] input = new byte[0x100];
|
||||||
private readonly byte[] output = new byte[0x100];
|
private readonly byte[] output = new byte[0x100];
|
||||||
|
|
||||||
public InputOutput()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public event EventHandler<PortEventArgs>? ReadingPort;
|
public event EventHandler<PortEventArgs>? ReadingPort;
|
||||||
|
|
||||||
public event EventHandler<PortEventArgs>? ReadPort;
|
public event EventHandler<PortEventArgs>? ReadPort;
|
||||||
|
@@ -4,12 +4,8 @@
|
|||||||
|
|
||||||
namespace EightBit
|
namespace EightBit
|
||||||
{
|
{
|
||||||
public class IntelOpCodeDecoded
|
public sealed class IntelOpCodeDecoded
|
||||||
{
|
{
|
||||||
public IntelOpCodeDecoded()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntelOpCodeDecoded(byte opCode)
|
public IntelOpCodeDecoded(byte opCode)
|
||||||
{
|
{
|
||||||
this.X = (opCode & 0b11000000) >> 6; // 0 - 3
|
this.X = (opCode & 0b11000000) >> 6; // 0 - 3
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace EightBit
|
namespace EightBit
|
||||||
{
|
{
|
||||||
public class MemoryMapping(Memory memory, ushort begin, ushort mask, AccessLevel access)
|
public sealed class MemoryMapping(Memory memory, ushort begin, ushort mask, AccessLevel access)
|
||||||
{
|
{
|
||||||
public MemoryMapping(Memory memory, ushort begin, Mask mask, AccessLevel access)
|
public MemoryMapping(Memory memory, ushort begin, Mask mask, AccessLevel access)
|
||||||
: this(memory, begin, (ushort)mask, access)
|
: this(memory, begin, (ushort)mask, access)
|
||||||
|
@@ -7,7 +7,7 @@ namespace EightBit
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
[DebuggerDisplay("Word = {Word}")]
|
[DebuggerDisplay("Word = {Word}")]
|
||||||
public class Register16
|
public sealed class Register16
|
||||||
{
|
{
|
||||||
private byte low;
|
private byte low;
|
||||||
private byte high;
|
private byte high;
|
||||||
|
@@ -7,15 +7,10 @@ namespace EightBit
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
public class Rom(int size) : Memory
|
public class Rom(int size = 0) : Memory
|
||||||
{
|
{
|
||||||
private byte[] bytes = new byte[size];
|
private byte[] bytes = new byte[size];
|
||||||
|
|
||||||
public Rom()
|
|
||||||
: this(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Size => this.bytes.Length;
|
public override int Size => this.bytes.Length;
|
||||||
|
|
||||||
public static int Load(Stream file, ref byte[] output, int writeOffset = 0, int readOffset = 0, int limit = -1, int maximumSize = -1)
|
public static int Load(Stream file, ref byte[] output, int writeOffset = 0, int readOffset = 0, int limit = -1, int maximumSize = -1)
|
||||||
|
Reference in New Issue
Block a user