public override void Replay(AltoSystem system, ExecutionController controller) { // // Press all requested keys simultaneously, then release them. // foreach (AltoKey key in _keys) { if (_keyDown) { system.Keyboard.KeyDown(key); } else { system.Keyboard.KeyUp(key); } } if (_keyDown) { // Delay 50ms, then repeat for keyup _keyDown = false; _completed = false; _timestamp = 50 * Conversion.MsecToNsec; } else { _completed = true; } }
public SdlConsole(AltoSystem system) { _system = system; _controller = new ExecutionController(_system); _controller.ErrorCallback += OnExecutionError; }
public DoverROS(AltoSystem system) { _system = system; _printEngineEvent = new Event(0, null, PrintEngineCallback); Reset(); }
public TridentDrive(AltoSystem system) { _system = system; _seekEvent = new Event(0, null, SeekCallback); Reset(); }
public ScriptRecorder(AltoSystem system, string scriptFile) { _script = new ScriptWriter(scriptFile); _system = system; _lastTimestamp = 0; _firstTime = true; }
public OrbitController(AltoSystem system) { _system = system; _ros = new DoverROS(system); _refreshEvent = new Event(_refreshInterval, null, RefreshCallback); Reset(); }
public ScriptPlayback(string scriptFile, AltoSystem system, ExecutionController controller) { _scriptReader = new ScriptReader(scriptFile); _system = system; _controller = controller; _currentAction = null; _stopPlayback = false; }
public DiskController(AltoSystem system) { _system = system; // Load the drives _drives = new DiabloDrive[2]; _drives[0] = new DiabloDrive(_system); _drives[1] = new DiabloDrive(_system); Reset(); }
public SdlConsole(AltoSystem system) { _system = system; _controller = new ExecutionController(_system); _controller.ErrorCallback += OnExecutionError; _controller.ShutdownCallback += OnShutdown; _commitDisksAtShutdown = true; ScriptManager.PlaybackCompleted += OnScriptPlaybackCompleted; }
public override void Replay(AltoSystem system, ExecutionController controller) { if (_keyDown) { system.Keyboard.KeyDown(_key); } else { system.Keyboard.KeyUp(_key); } _completed = true; }
public override void Replay(AltoSystem system, ExecutionController controller) { if (_mouseDown) { system.MouseAndKeyset.MouseDown(_buttons); } else { system.MouseAndKeyset.MouseUp(_buttons); } _completed = true; }
public static void StartPlayback(AltoSystem system, ExecutionController controller, string scriptPath) { // Stop any pending actions StopRecording(); StopPlayback(); _scheduler.Reset(); _scriptPlayback = new ScriptPlayback(scriptPath, system, controller); _scriptPlayback.PlaybackCompleted += OnPlaybackCompleted; _scriptPlayback.Start(); Log.Write(LogComponent.Scripting, "Starting playback of {0}", scriptPath); }
public override void Replay(AltoSystem system, ExecutionController controller) { if (_absolute) { // // We stuff the x/y coordinates into the well-defined memory locations for the mouse coordinates. // system.Memory.Load(0x114, (ushort)_dx, CPU.TaskType.Emulator, false); system.Memory.Load(0x115, (ushort)_dy, CPU.TaskType.Emulator, false); } else { system.MouseAndKeyset.MouseMove(_dx, _dy); } _completed = true; }
public AltoCPU(AltoSystem system) { _system = system; _tasks[(int)TaskType.Emulator] = new EmulatorTask(this); _tasks[(int)TaskType.DiskSector] = new DiskTask(this, true); _tasks[(int)TaskType.DiskWord] = new DiskTask(this, false); _tasks[(int)TaskType.DisplayWord] = new DisplayWordTask(this); _tasks[(int)TaskType.DisplayHorizontal] = new DisplayHorizontalTask(this); _tasks[(int)TaskType.DisplayVertical] = new DisplayVerticalTask(this); _tasks[(int)TaskType.Cursor] = new CursorTask(this); _tasks[(int)TaskType.MemoryRefresh] = new MemoryRefreshTask(this); _tasks[(int)TaskType.Ethernet] = new EthernetTask(this); _tasks[(int)TaskType.Parity] = new ParityTask(this); Reset(); }
public EthernetController(AltoSystem system) { _system = system; _receiverLock = new System.Threading.ReaderWriterLockSlim(); _fifo = new Queue <ushort>(); _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 { switch (Configuration.HostPacketInterfaceType) { case PacketInterfaceType.UDPEncapsulation: _hostInterface = new UDPEncapsulation(Configuration.HostPacketInterfaceName); _hostInterface.RegisterReceiveCallback(OnHostPacketReceived); break; case PacketInterfaceType.EthernetEncapsulation: _hostInterface = new HostEthernetEncapsulation(Configuration.HostPacketInterfaceName); _hostInterface.RegisterReceiveCallback(OnHostPacketReceived); break; default: _hostInterface = null; break; } } catch (Exception e) { _hostInterface = null; Log.Write(LogComponent.HostNetworkInterface, "Unable to configure network interface. Error {0}", e.Message); } // More words than the Alto will ever send. _outputData = new ushort[4096]; _nextPackets = new Queue <MemoryStream>(); _inputPollEvent = new Event(_inputPollPeriod, null, InputHandler); Reset(); }
public TridentController(AltoSystem system) { _system = system; // // We initialize 16 drives even though the // controller only technically supports 8. // TODO: detail // _drives = new TridentDrive[16]; for (int i = 0; i < _drives.Length; i++) { _drives[i] = new TridentDrive(system); } Reset(); }
public static void StartRecording(AltoSystem system, string scriptPath) { // Stop any pending actions StopRecording(); StopPlayback(); _scriptRecorder = new ScriptRecorder(system, scriptPath); Log.Write(LogComponent.Scripting, "Starting recording to {0}", scriptPath); // // Record the absolute position of the mouse (as held in MOUSELOC in system memory). // All other mouse movements in the script will be recorded relative to this point. // int x = system.Memory.Read(0x114, CPU.TaskType.Ethernet, false); int y = system.Memory.Read(0x115, CPU.TaskType.Ethernet, false); _scriptRecorder.MouseMoveAbsolute(x, y); }
public override void Replay(AltoSystem system, ExecutionController controller) { if (_currentStroke >= _strokes.Count) { _completed = true; } else { Keystroke stroke = _strokes[_currentStroke++]; if (stroke.Type == StrokeType.KeyDown) { system.Keyboard.KeyDown(stroke.Key); } else { system.Keyboard.KeyUp(stroke.Key); } // Delay 50ms before the next key _timestamp = 50 * Conversion.MsecToNsec; } }
public override void Replay(AltoSystem system, ExecutionController controller) { // // Execute the command. // // TODO: recreating these objects each time through is uncool. // ControlCommands controlCommands = new ControlCommands(system, controller); CommandExecutor executor = new CommandExecutor(controlCommands); CommandResult res = executor.ExecuteCommand(_commandString); if (res == CommandResult.Quit || res == CommandResult.QuitNoSave) { // // Force an exit, commit disks if result was Quit. // throw new ShutdownException(res == CommandResult.Quit); } _completed = true; }
public MouseAndKeyset(AltoSystem system) { _system = system; _lock = new ReaderWriterLockSlim(); Reset(); }
public AudioDAC(AltoSystem system) { _system = system; _dacOutput = new Queue <ushort>(16384); }
public Music(AltoSystem system) { //_musicIo = new FileStream("c:\\alto\\mus.snd", FileMode.Create, FileAccess.ReadWrite); _system = system; Reset(); }
public override void Replay(AltoSystem system, ExecutionController controller) { // This is a no-op. _completed = true; }
/// <summary> /// Replays a single step of the action. If the action is completed, /// Completed will be true afterwards. /// </summary> /// <param name="system"></param> /// <param name="controller"></param> public abstract void Replay(AltoSystem system, ExecutionController controller);
public void AttachSystem(AltoSystem system) { _system = system; _system.AttachDisplay(this); }
public DisplayController(AltoSystem system) { _system = system; Reset(); }
public DiabloDrive(AltoSystem system) { _system = system; Reset(); }
public ControlCommands(AltoSystem system, ExecutionController controller) { _system = system; _controller = controller; }
public OrganKeyboard(AltoSystem system) { _system = system; Reset(); }