mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-01-24 11:21:26 +00:00
51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Contralto.CPU
|
|
{
|
|
public partial class AltoCPU
|
|
{
|
|
/// <summary>
|
|
/// DisplayWordTask provides functionality for the DHT task
|
|
/// </summary>
|
|
private sealed class DisplayHorizontalTask : Task
|
|
{
|
|
public DisplayHorizontalTask(AltoCPU cpu) : base(cpu)
|
|
{
|
|
_taskType = TaskType.DisplayHorizontal;
|
|
_wakeup = false;
|
|
}
|
|
|
|
protected override bool ExecuteInstruction(MicroInstruction instruction)
|
|
{
|
|
// We put ourselves back to sleep immediately once we've started running
|
|
_wakeup = false;
|
|
|
|
return base.ExecuteInstruction(instruction);
|
|
}
|
|
|
|
protected override void ExecuteSpecialFunction2(MicroInstruction instruction)
|
|
{
|
|
DisplayHorizontalF2 dh2 = (DisplayHorizontalF2)instruction.F2;
|
|
switch (dh2)
|
|
{
|
|
case DisplayHorizontalF2.EVENFIELD:
|
|
_nextModifier |= (ushort)(_cpu._system.DisplayController.EVENFIELD ? 1 : 0);
|
|
break;
|
|
|
|
case DisplayHorizontalF2.SETMODE:
|
|
// NO-op for now
|
|
break;
|
|
|
|
default:
|
|
throw new InvalidOperationException(String.Format("Unhandled display word F2 {0}.", dh2));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|