1
0
mirror of https://github.com/livingcomputermuseum/ContrAlto.git synced 2026-04-29 21:17:48 +00:00

Final v1.1 tweaks.

This commit is contained in:
Josh Dersch
2016-10-27 13:17:50 -07:00
parent ae0896b362
commit 364034f012
8 changed files with 55 additions and 66 deletions

View File

@@ -47,17 +47,11 @@ namespace Contralto
_cpu = new AltoCPU(this);
// Attach memory-mapped devices to the bus
_memBus.AddDevice(_mem);
_memBus.AddDevice(_keyboard);
_memBus.AddDevice(_mouse);
_memBus.AddDevice(_musicInterface);
// Register devices that need clocks
_clockableDevices = new List<IClockable>();
_clockableDevices.Add(_memBus);
_clockableDevices.Add(_cpu);
_memBus.AddDevice(_musicInterface);
Reset();
}
@@ -106,16 +100,12 @@ namespace Contralto
public void SingleStep()
{
// Run every device that needs attention for a single clock cycle.
int count = _clockableDevices.Count;
for (int i = 0; i < count; i++)
{
_clockableDevices[i].Clock();
}
_scheduler.Clock();
// Run every device that needs attention for a single clock cycle.
_memBus.Clock();
_cpu.Clock();
_clocks++;
// Clock the scheduler
_scheduler.Clock();
}
public void LoadDrive(int drive, string path)
@@ -252,8 +242,5 @@ namespace Contralto
private Music _musicInterface;
private Scheduler _scheduler;
private ulong _clocks;
private List<IClockable> _clockableDevices;
}
}

View File

@@ -41,8 +41,7 @@ namespace Contralto.IO
Reset();
_fifoTransmitWakeupEvent = new Event(_fifoTransmitDuration, null, OutputFifoCallback);
// Attach real Ethernet device if user has specified one, otherwise leave unattached; output data
// will go into a bit-bucket.
try
@@ -73,12 +72,12 @@ namespace Contralto.IO
_outputData = new ushort[4096];
_nextPackets = new Queue<MemoryStream>();
_inputPollEvent = new Event(_inputPollPeriod, null, InputHandler);
}
public void Reset()
{
_inputPollEvent = null;
ResetInterface();
}
@@ -165,14 +164,7 @@ namespace Contralto.IO
_system.CPU.BlockTask(TaskType.Ethernet);
}
Log.Write(LogComponent.EthernetController, "Interface reset.");
if (_inputPollEvent == null)
{
// Kick off the input poll event which will run forever.
_inputPollEvent = new Event(_inputPollPeriod, null, InputHandler);
_system.Scheduler.Schedule(_inputPollEvent);
}
Log.Write(LogComponent.EthernetController, "Interface reset.");
}
public ushort ReadInputFifo(bool lookOnly)
@@ -353,13 +345,21 @@ namespace Contralto.IO
Log.Write(LogComponent.EthernetController, "Receiver initializing, dropping current activity.");
_incomingPacket = null;
_incomingPacketLength = 0;
}
}
_inputState = InputState.ReceiverWaiting;
_iBusy = true;
_system.CPU.BlockTask(TaskType.Ethernet);
// Schedule the first input wakeup if the receiver is off or done.
if (!_inputPollActive)
{
_inputPollEvent.TimestampNsec = _inputPollPeriod;
_system.Scheduler.Schedule(_inputPollEvent);
_inputPollActive = true;
}
Log.Write(LogComponent.EthernetController, "Receiver initialized.");
}
@@ -409,7 +409,7 @@ namespace Contralto.IO
/// <param name="skewNsec"></param>
/// <param name="context"></param>
private void InputHandler(ulong timeNsec, ulong skewNsec, object context)
{
{
switch(_inputState)
{
case InputState.ReceiverOff:
@@ -425,6 +425,7 @@ namespace Contralto.IO
Log.Write(LogComponent.EthernetPacket, "Receiver is off, ignoring incoming packet from packet queue.");
}
_receiverLock.ExitReadLock();
_inputPollActive = false;
break;
case InputState.ReceiverWaiting:
@@ -462,7 +463,7 @@ namespace Contralto.IO
// Move to the Receiving state.
_inputState = InputState.Receiving;
}
}
_receiverLock.ExitReadLock();
break;
@@ -502,6 +503,8 @@ namespace Contralto.IO
_system.CPU.WakeupTask(TaskType.Ethernet);
Log.Write(LogComponent.EthernetController, "Receive complete.");
_inputPollActive = false;
}
// Wake up the Ethernet task to process data if we have
@@ -515,13 +518,17 @@ namespace Contralto.IO
case InputState.ReceiverDone:
// Nothing, we just wait in this state for the receiver to be reset by the microcode.
_inputPollActive = false;
break;
}
// Schedule the next wakeup.
_inputPollEvent.TimestampNsec = _inputPollPeriod - skewNsec;
_system.Scheduler.Schedule(_inputPollEvent);
// Schedule the next wakeup.
if (_inputPollActive)
{
_inputPollEvent.TimestampNsec = _inputPollPeriod - skewNsec;
_system.Scheduler.Schedule(_inputPollEvent);
}
}
private Queue<ushort> _fifo;
@@ -549,6 +556,7 @@ namespace Contralto.IO
// Receive:
private ulong _inputPollPeriod = 5400; // ~5400 nsec to receive 1 word at 3mbit
private Event _inputPollEvent;
private bool _inputPollActive;
// Input states
private enum InputState

View File

@@ -96,8 +96,8 @@ namespace Contralto
private static void PrintHerald()
{
Console.WriteLine("ContrAlto v1.1 (c) 2015, 2016 Living Computer Museum.");
Console.WriteLine("Bug reports to joshd@livingcomputermuseum.org");
Console.WriteLine("ContrAlto v1.1 (c) 2015, 2016 Living Computers: Museum+Labs.");
Console.WriteLine("Bug reports to joshd@livingcomputers.org");
Console.WriteLine();
}

View File

@@ -8,9 +8,9 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ContrAlto")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Living Computer Museum")]
[assembly: AssemblyCompany("Living Computers: Museum+Labs")]
[assembly: AssemblyProduct("ContrAlto")]
[assembly: AssemblyCopyright("Copyright © Living Computer Museum 2016")]
[assembly: AssemblyCopyright("Copyright © Living Computers: Museum+Labs 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@@ -52,12 +52,11 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(41, 59);
this.label2.Location = new System.Drawing.Point(20, 59);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(46, 13);
this.label2.TabIndex = 1;
this.label2.Text = "(c) 2016";
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// label3
//
@@ -70,7 +69,7 @@
//
// OkButton
//
this.OkButton.Location = new System.Drawing.Point(87, 363);
this.OkButton.Location = new System.Drawing.Point(78, 363);
this.OkButton.Name = "OkButton";
this.OkButton.Size = new System.Drawing.Size(75, 23);
this.OkButton.TabIndex = 3;
@@ -80,7 +79,7 @@
//
// label4
//
this.label4.Location = new System.Drawing.Point(12, 320);
this.label4.Location = new System.Drawing.Point(19, 320);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(224, 18);
this.label4.TabIndex = 4;
@@ -89,12 +88,12 @@
// emailLink
//
this.emailLink.AutoSize = true;
this.emailLink.Location = new System.Drawing.Point(41, 338);
this.emailLink.Location = new System.Drawing.Point(55, 338);
this.emailLink.Name = "emailLink";
this.emailLink.Size = new System.Drawing.Size(168, 13);
this.emailLink.Size = new System.Drawing.Size(134, 13);
this.emailLink.TabIndex = 5;
this.emailLink.TabStop = true;
this.emailLink.Text = "joshd@livingcomputermuseum.org";
this.emailLink.Text = "joshd@livingcomputers.org";
this.emailLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// pictureBox1
@@ -110,12 +109,12 @@
// websiteLink
//
this.websiteLink.AutoSize = true;
this.websiteLink.Location = new System.Drawing.Point(84, 60);
this.websiteLink.Location = new System.Drawing.Point(65, 59);
this.websiteLink.Name = "websiteLink";
this.websiteLink.Size = new System.Drawing.Size(126, 13);
this.websiteLink.Size = new System.Drawing.Size(163, 13);
this.websiteLink.TabIndex = 7;
this.websiteLink.TabStop = true;
this.websiteLink.Text = "Living Computer Museum";
this.websiteLink.Text = "Living Computers: Museum+Labs";
this.websiteLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnSiteLinkClicked);
//
// AboutBox

View File

@@ -34,20 +34,15 @@ namespace Contralto
{
this.Close();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("mailto:joshd@livingcomputermuseum.org");
System.Diagnostics.Process.Start("mailto:joshd@livingcomputers.org");
}
private void OnSiteLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://www.livingcomputermuseum.org");
System.Diagnostics.Process.Start("http://www.livingcomputers.org");
}
}
}

View File

@@ -1,4 +1,4 @@
Readme.txt for Contralto v0.1:
Readme.txt for Contralto v1.1:
1. Introduction and Overview
============================
@@ -439,14 +439,14 @@ Reserved Memory:
At the moment, the following issues are known and being worked on. If you find
an issue not listed here, see section 7.0 to report a new bug.
- BravoX does not run, trapping into SWAT with "DSt" as a diagnostic.
- Smalltalk-80 does not run.
7.0 Reporting Bugs
==================
If you believe you have found a new issue (or have a feature request) please
send an e-mail to joshd@livingcomputermuseum.org with a subject line starting
send an e-mail to joshd@livingcomputers.org with a subject line starting
with "ContrAlto Bug".
When you send a report, please be as specific and detailed as possible:
@@ -481,7 +481,7 @@ the Computer History Museum.
V1.1
----
- A few minor performance tweaks, adding to a 5% speed increase.
- A few minor performance tweaks, adding to a 10-15% speed increase.
- Switched back to targeting .NET 4.5.3 rather than 4.6; this works better under Mono
and avoids odd issues on Windows machines running pre-4.6 frameworks.
- Microcode disassembly improved slightly, annotated microcode source updated.