mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-07-24 21:24:47 +00:00
Rationalise use of "intermediate" Register16
This commit is contained in:
@@ -20,7 +20,7 @@ namespace EightBit
|
||||
|
||||
public byte Data { get => this.data; set => this.data = value; }
|
||||
|
||||
public Register16 Address { get; } = new Register16();
|
||||
public Register16 Address { get; } = new();
|
||||
|
||||
public abstract MemoryMapping Mapping(ushort absolute);
|
||||
|
||||
@@ -30,16 +30,12 @@ namespace EightBit
|
||||
|
||||
public byte Peek(Register16 absolute) => this.Peek(absolute.Word);
|
||||
|
||||
public byte Peek(byte low, byte high) => this.Reference(low, high);
|
||||
|
||||
public void Poke(byte value) => this.Reference() = value;
|
||||
|
||||
public void Poke(ushort absolute, byte value) => this.Reference(absolute) = value;
|
||||
|
||||
public void Poke(Register16 absolute, byte value) => this.Poke(absolute.Word, value);
|
||||
|
||||
public void Poke(byte low, byte high, byte value) => this.Reference(low, high) = value;
|
||||
|
||||
public byte Read()
|
||||
{
|
||||
this.OnReadingByte();
|
||||
@@ -127,8 +123,6 @@ namespace EightBit
|
||||
|
||||
protected ref byte Reference() => ref this.Reference(this.Address);
|
||||
|
||||
protected ref byte Reference(byte low, byte high) => ref this.Reference(new Register16(low, high).Word);
|
||||
|
||||
protected void LoadHexFile(string path)
|
||||
{
|
||||
using var file = new IntelHexFile(path);
|
||||
|
Reference in New Issue
Block a user