source: branches/virtualcpu4/Forms/UFormConsole.pas

Last change on this file was 180, checked in by chronos, 6 years ago
  • Modified: Memory dump, CPU state, screen, console moved to separate forms.
  • Added: Dissasembler form.
File size: 896 bytes
Line 
1unit UFormConsole;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
9 UMachine;
10
11type
12
13 { TFormConsole }
14
15 TFormConsole = class(TForm)
16 Memo1: TMemo;
17 Timer1: TTimer;
18 procedure Memo1KeyPress(Sender: TObject; var Key: char);
19 procedure Timer1Timer(Sender: TObject);
20 private
21
22 public
23 Machine: TMachine;
24 end;
25
26var
27 FormConsole: TFormConsole;
28
29implementation
30
31{$R *.lfm}
32
33{ TFormConsole }
34
35procedure TFormConsole.Memo1KeyPress(Sender: TObject; var Key: char);
36begin
37 Machine.LockInput.Acquire;
38 Machine.InputBuffer := Machine.InputBuffer + Key;
39 Machine.LockInput.Release;
40end;
41
42procedure TFormConsole.Timer1Timer(Sender: TObject);
43begin
44 Machine.LockOutput.Acquire;
45 Memo1.Lines.Text := Memo1.Lines.Text + Machine.OutputBuffer;
46 SetLength(Machine.OutputBuffer, 0);
47 Machine.LockOutput.Release;
48end;
49
50end.
51
Note: See TracBrowser for help on using the repository browser.