mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-01-17 16:44:29 +00:00
40 lines
883 B
C#
40 lines
883 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Contralto.Memory
|
|
{
|
|
public class Memory : IMemoryMappedDevice
|
|
{
|
|
public Memory()
|
|
{
|
|
_mem = new ushort[0x10000];
|
|
}
|
|
|
|
public ushort Read(int address)
|
|
{
|
|
return _mem[address];
|
|
}
|
|
|
|
public void Load(int address, ushort data)
|
|
{
|
|
Console.WriteLine("wrote {0} to {1}", OctalHelpers.ToOctal(data), OctalHelpers.ToOctal(address));
|
|
_mem[address] = data;
|
|
}
|
|
|
|
public MemoryRange[] Addresses
|
|
{
|
|
get { return _addresses; }
|
|
}
|
|
|
|
private readonly MemoryRange[] _addresses =
|
|
{
|
|
new MemoryRange(0, 0xfdff), // to 176777; IO page above this.
|
|
};
|
|
|
|
private ushort[] _mem;
|
|
}
|
|
}
|