source: branches/configured machine/Machine.pas

Last change on this file was 239, checked in by chronos, 16 months ago
File size: 1.5 KB
Line 
1unit Machine;
2
3interface
4
5uses
6 Classes, SysUtils, CpuBitWidth, Memory, SerialPort;
7
8type
9
10 { TMachine }
11
12 TMachine1 = class
13 public
14 Cpu: TCpuBitWidth1;
15 Memory: TMemory1;
16 VideoMemory: TMemory1;
17 SystemMemory: TMemory1;
18 SerialPort: TSerialPort1;
19 constructor Create;
20 destructor Destroy; override;
21 end;
22
23 { TMachine2 }
24
25 TMachine2 = class
26 public
27 Cpu: TCpuBitWidth2;
28 Memory: TMemory2;
29 VideoMemory: TMemory2;
30 SystemMemory: TMemory2;
31 SerialPort: TSerialPort2;
32 constructor Create;
33 destructor Destroy; override;
34 end;
35
36implementation
37
38{ TMachine2 }
39
40constructor TMachine2.Create;
41begin
42 Memory := TMemory2.Create;
43 VideoMemory := TMemory2.Create;
44 SystemMemory := TMemory2.Create;
45 SerialPort := TSerialPort2.Create;
46 Cpu := TCpuBitWidth2.Create;
47 Cpu.IO := SerialPort;
48 Cpu.Memory := Memory;
49end;
50
51destructor TMachine2.Destroy;
52begin
53 FreeAndNil(SerialPort);
54 FreeAndNil(Cpu);
55 FreeAndNil(SystemMemory);
56 FreeAndNil(VideoMemory);
57 FreeAndNil(Memory);
58 inherited;
59end;
60
61{ TMachine }
62
63constructor TMachine1.Create;
64begin
65 Memory := TMemory1.Create;
66 VideoMemory := TMemory1.Create;
67 SystemMemory := TMemory1.Create;
68 SerialPort := TSerialPort1.Create;
69 Cpu := TCpuBitWidth1.Create;
70 Cpu.IO := SerialPort;
71 Cpu.Memory := Memory;
72end;
73
74destructor TMachine1.Destroy;
75begin
76 FreeAndNil(SerialPort);
77 FreeAndNil(Cpu);
78 FreeAndNil(SystemMemory);
79 FreeAndNil(VideoMemory);
80 FreeAndNil(Memory);
81 inherited;
82end;
83
84end.
85
Note: See TracBrowser for help on using the repository browser.