EightBitNet/EightBit/Memory.cs
Adrian Conlon cf4e633034 Implement some suggestions from the code analysis.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
2019-02-14 23:51:32 +00:00

30 lines
844 B
C#

// <copyright file="Memory.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
using System;
using System.IO;
public abstract class Memory
{
public abstract int Size
{
get;
}
public abstract byte Peek(ushort address);
public virtual ref byte Reference(ushort address) => throw new NotImplementedException();
public abstract int Load(FileStream file, int writeOffset = 0, int readOffset = 0, int limit = -1);
public abstract int Load(string path, int writeOffset = 0, int readOffset = 0, int limit = -1);
public abstract int Load(byte[] from, int writeOffset = 0, int readOffset = 0, int limit = -1);
protected abstract void Poke(ushort address, byte value);
}
}