source: branches/configured machine/FormMain.pas

Last change on this file was 239, checked in by chronos, 16 months ago
File size: 1.1 KB
Line 
1unit FormMain;
2
3interface
4
5uses
6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Machine;
7
8type
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
22var
23 FormMain: TFormMain;
24
25
26implementation
27
28uses
29 CpuBitWidth;
30
31{$R *.lfm}
32
33{ TFormMain }
34
35procedure TFormMain.FormCreate(Sender: TObject);
36begin
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;
52end;
53
54procedure TFormMain.FormDestroy(Sender: TObject);
55begin
56 FreeAndNil(Machine);
57end;
58
59procedure TFormMain.SerialPortWrite(Data: Byte);
60begin
61 Memo1.Lines.Text := Memo1.Lines.Text + Chr(Data);
62end;
63
64end.
65
Note: See TracBrowser for help on using the repository browser.