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 | |
---|
1 | unit UFormConsole;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
---|
9 | UMachine;
|
---|
10 |
|
---|
11 | type
|
---|
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 |
|
---|
26 | var
|
---|
27 | FormConsole: TFormConsole;
|
---|
28 |
|
---|
29 | implementation
|
---|
30 |
|
---|
31 | {$R *.lfm}
|
---|
32 |
|
---|
33 | { TFormConsole }
|
---|
34 |
|
---|
35 | procedure TFormConsole.Memo1KeyPress(Sender: TObject; var Key: char);
|
---|
36 | begin
|
---|
37 | Machine.LockInput.Acquire;
|
---|
38 | Machine.InputBuffer := Machine.InputBuffer + Key;
|
---|
39 | Machine.LockInput.Release;
|
---|
40 | end;
|
---|
41 |
|
---|
42 | procedure TFormConsole.Timer1Timer(Sender: TObject);
|
---|
43 | begin
|
---|
44 | Machine.LockOutput.Acquire;
|
---|
45 | Memo1.Lines.Text := Memo1.Lines.Text + Machine.OutputBuffer;
|
---|
46 | SetLength(Machine.OutputBuffer, 0);
|
---|
47 | Machine.LockOutput.Release;
|
---|
48 | end;
|
---|
49 |
|
---|
50 | end.
|
---|
51 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.