using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Contralto.CPU { public partial class AltoCPU { /// /// DisplayWordTask provides functionality for the DHT task /// 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; } } } } }