1
0
mirror of https://github.com/livingcomputermuseum/ContrAlto.git synced 2026-01-19 01:18:00 +00:00

Implemented the 3K control RAM configuration, fixed bug in SWMODE (should use modified NEXT, not the NEXT from the uinstruction to determine bank.)

This commit is contained in:
Josh Dersch 2016-03-03 16:28:05 -08:00
parent c48e530cbe
commit 41b6a76b2a
12 changed files with 60 additions and 33 deletions

View File

@ -143,18 +143,14 @@ namespace Contralto.CPU
_wrtRam = true;
break;
case EmulatorF1.LoadESRB:
// For now, this is always 0; we do not yet support the 3K RAM system with 8 banks of S registers.
case EmulatorF1.LoadESRB:
_rb = (ushort)((_busData & 0xe) >> 1);
if (_rb != 0)
if (_rb != 0 && Configuration.SystemType != SystemType.ThreeKRam)
{
_rb = 0;
Logging.Log.Write(Logging.LogType.Warning, Logging.LogComponent.EmulatorTask, "ESRB<- ({0}) not fully implemented.",
Conversion.ToOctal((_busData & 0xe) >> 1));
throw new NotImplementedException("ESRB<-");
}
// Force bank 0 for machines with only 1K RAM.
_rb = 0;
}
break;
default:

View File

@ -446,12 +446,13 @@ namespace Contralto.CPU
//
// Switch banks if the last instruction had an SWMODE F1;
// this depends on the value of the NEXT field in this instruction
// this depends on the value of the NEXT field in this instruction.
// (And apparently the modifier applied to NEXT in this instruction -- MADTEST expects this.)
//
if (swMode)
{
UCodeMemory.SwitchMode(instruction.NEXT, _taskType);
Logging.Log.Write(Logging.LogComponent.Microcode, "SWMODE: uPC {0}, next uPC {1}", Conversion.ToOctal(_mpc), Conversion.ToOctal(instruction.NEXT));
UCodeMemory.SwitchMode((ushort)(instruction.NEXT | nextModifier), _taskType);
Logging.Log.Write(Logging.LogComponent.Microcode, "SWMODE: uPC {0}, next uPC {1}", Conversion.ToOctal(_mpc), Conversion.ToOctal(instruction.NEXT | nextModifier));
}
//

View File

@ -109,11 +109,10 @@ namespace Contralto.CPU
case SystemType.TwoKRom:
_ramBank = 0;
break;
case SystemType.ThreeKRam:
if (_ramBank > 3)
case SystemType.ThreeKRam:
if (_ramBank > 2)
{
// TODO: clip or not.
throw new InvalidOperationException(String.Format("Unexpected RAM bank value of {0}.", _ramBank));
_ramBank = 2;
}
break;
}
@ -152,8 +151,49 @@ namespace Contralto.CPU
}
break;
case SystemType.ThreeKRam:
throw new NotImplementedException("3K uCode RAM not yet implemented.");
case SystemType.ThreeKRam:
if ((nextAddress & 0x100) == 0)
{
switch(_microcodeBank[(int)task])
{
case MicrocodeBank.ROM0:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.RAM0 : MicrocodeBank.RAM2;
break;
case MicrocodeBank.RAM0:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.ROM0 : MicrocodeBank.RAM2;
break;
case MicrocodeBank.RAM1:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.ROM0 : MicrocodeBank.RAM2;
break;
case MicrocodeBank.RAM2:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.ROM0 : MicrocodeBank.RAM1;
break;
}
}
else
{
switch (_microcodeBank[(int)task])
{
case MicrocodeBank.ROM0:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.RAM1 : MicrocodeBank.RAM0;
break;
case MicrocodeBank.RAM0:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.RAM1 : MicrocodeBank.RAM1;
break;
case MicrocodeBank.RAM1:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.RAM0 : MicrocodeBank.RAM0;
break;
case MicrocodeBank.RAM2:
_microcodeBank[(int)task] = (nextAddress & 0x80) == 0 ? MicrocodeBank.RAM0 : MicrocodeBank.RAM0;
break;
}
}
break;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -416,7 +416,7 @@ namespace Contralto.IO
_seeking = true;
// And figure out how long this will take.
_seekDuration = (ulong)(CalculateSeekTime() / (ulong)(Math.Abs(_destCylinder - SelectedDrive.Cylinder) + 1));
_seekDuration = 0; // (ulong)(CalculateSeekTime() / (ulong)(Math.Abs(_destCylinder - SelectedDrive.Cylinder) + 1));
_seekEvent.TimestampNsec = _seekDuration;
_system.Scheduler.Schedule(_seekEvent);

View File

@ -133,21 +133,12 @@ namespace Contralto.IO
packetBytes[i * 2 + 3] = (byte)(packet[i] >> 8);
}
//
// Grab the source and destination host addresses from the packet we're sending
// and build 10mbit versions.
//
byte destinationHost = packetBytes[3];
byte sourceHost = packetBytes[2];
Log.Write(LogComponent.HostNetworkInterface, "Sending packet; source {0} destination {1}, length {2} words.",
Conversion.ToOctal(sourceHost),
Conversion.ToOctal(destinationHost),
Log.Write(LogType.Verbose, LogComponent.HostNetworkInterface, "Sending packet via UDP; source {0} destination {1}, length {2} words.",
Conversion.ToOctal(packetBytes[2]),
Conversion.ToOctal(packetBytes[3]),
length);
_udpClient.Send(packetBytes, packetBytes.Length, _broadcastEndpoint);
Log.Write(LogComponent.HostNetworkInterface, "Encapsulated 3mbit packet sent via UDP.");
}
/// <summary>
@ -167,8 +158,7 @@ namespace Contralto.IO
// properly.)
Log.Write(LogComponent.HostNetworkInterface, "UDP Receiver thread started.");
IPEndPoint groupEndPoint = new IPEndPoint(IPAddress.Any, _udpPort);
//return;
IPEndPoint groupEndPoint = new IPEndPoint(IPAddress.Any, _udpPort);
while (true)
{