mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-04-26 12:08:41 +00:00
Work begun on Disk controller, stubs for keyboard and a few bugfixes and tweaks.
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Contralto.CPU;
|
||||
using Contralto.IO;
|
||||
using Contralto.Memory;
|
||||
|
||||
namespace Contralto
|
||||
@@ -18,19 +19,28 @@ namespace Contralto
|
||||
public AltoSystem()
|
||||
{
|
||||
_cpu = new AltoCPU(this);
|
||||
_mem = new MemoryBus();
|
||||
_memBus = new MemoryBus();
|
||||
_mem = new Memory.Memory();
|
||||
_keyboard = new Keyboard();
|
||||
_diskController = new DiskController(this);
|
||||
|
||||
// Attach memory-mapped devices to the bus
|
||||
_memBus.AddDevice(_mem);
|
||||
_memBus.AddDevice(_keyboard);
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_cpu.Reset();
|
||||
_mem.Reset();
|
||||
_memBus.Reset();
|
||||
}
|
||||
|
||||
public void SingleStep()
|
||||
{
|
||||
_mem.Clock();
|
||||
{
|
||||
_memBus.Clock();
|
||||
_diskController.Clock();
|
||||
_cpu.ExecuteNext();
|
||||
}
|
||||
|
||||
@@ -41,10 +51,26 @@ namespace Contralto
|
||||
|
||||
public MemoryBus MemoryBus
|
||||
{
|
||||
get { return _mem; }
|
||||
get { return _memBus; }
|
||||
}
|
||||
|
||||
public DiskController DiskController
|
||||
{
|
||||
get { return _diskController; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Time (in msec) for one system clock
|
||||
/// </summary>
|
||||
public static double ClockInterval
|
||||
{
|
||||
get { return 0.00017; } // appx 170nsec, TODO: more accurate value?
|
||||
}
|
||||
|
||||
private AltoCPU _cpu;
|
||||
private MemoryBus _mem;
|
||||
private MemoryBus _memBus;
|
||||
private Contralto.Memory.Memory _mem;
|
||||
private Keyboard _keyboard;
|
||||
private DiskController _diskController;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user