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