Line | |
---|
1 | unit FormMain;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Machine;
|
---|
7 |
|
---|
8 | type
|
---|
9 |
|
---|
10 | { TFormMain }
|
---|
11 |
|
---|
12 | TFormMain = class(TForm)
|
---|
13 | Memo1: TMemo;
|
---|
14 | procedure FormCreate(Sender: TObject);
|
---|
15 | procedure FormDestroy(Sender: TObject);
|
---|
16 | private
|
---|
17 | procedure SerialPortWrite(Data: Byte);
|
---|
18 | public
|
---|
19 | Machine: TMachine2;
|
---|
20 | end;
|
---|
21 |
|
---|
22 | var
|
---|
23 | FormMain: TFormMain;
|
---|
24 |
|
---|
25 |
|
---|
26 | implementation
|
---|
27 |
|
---|
28 | uses
|
---|
29 | CpuBitWidth;
|
---|
30 |
|
---|
31 | {$R *.lfm}
|
---|
32 |
|
---|
33 | { TFormMain }
|
---|
34 |
|
---|
35 | procedure TFormMain.FormCreate(Sender: TObject);
|
---|
36 | begin
|
---|
37 | Machine := TMachine2.Create;
|
---|
38 | with Machine do begin
|
---|
39 | Memory.Size := $10000;
|
---|
40 | VideoMemory.Size := $4000;
|
---|
41 | SystemMemory.Size := $1000;
|
---|
42 | SerialPort.OnWrite := SerialPortWrite;
|
---|
43 | with Cpu do begin
|
---|
44 | Write1(Integer(inLoad1));
|
---|
45 | Write1(Ord('A'));
|
---|
46 | Write1(Integer(inOutput1));
|
---|
47 | Write2($1);
|
---|
48 | Write1(Integer(inHalt));
|
---|
49 | Run;
|
---|
50 | end;
|
---|
51 | end;
|
---|
52 | end;
|
---|
53 |
|
---|
54 | procedure TFormMain.FormDestroy(Sender: TObject);
|
---|
55 | begin
|
---|
56 | FreeAndNil(Machine);
|
---|
57 | end;
|
---|
58 |
|
---|
59 | procedure TFormMain.SerialPortWrite(Data: Byte);
|
---|
60 | begin
|
---|
61 | Memo1.Lines.Text := Memo1.Lines.Text + Chr(Data);
|
---|
62 | end;
|
---|
63 |
|
---|
64 | end.
|
---|
65 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.