Changeset 238 for branches/CpuSingleSize/Core.pas
- Timestamp:
- Jul 15, 2023, 12:51:15 AM (16 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/CpuSingleSize/Core.pas
r237 r238 1 unit UCore;1 unit Core; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, ActnList, Controls, Forms, UMachine, UMemory, UMessages, 7 UDisassembler, UAssembler; 6 Classes, SysUtils, ActnList, Controls, Forms, Machine, Memory, Message, 7 Disassembler, Assembler, FormCpu, FormDevices, FormHelp, FormMessages, 8 FormMain, FormDisassembler; 8 9 9 10 type … … 38 39 procedure DataModuleDestroy(Sender: TObject); 39 40 private 40 41 FormCpu: TFormCpu; 42 FormDevices: TFormDevices; 43 FormHelp: TFormHelp; 44 FormMain: TFormMain; 45 FormDisassembler: TFormDisassembler; 41 46 public 42 47 Assembler: TAssembler; … … 55 60 56 61 uses 57 UFormScreen, UFormCpu, UFormAssembler, UFormConsole, UFormHelp, 58 UFormDisassembler, UFormMessages, UFormDevices; 62 FormScreen, FormAssembler, FormConsole; 59 63 60 64 { TCore } … … 67 71 procedure TCore.AHelpExecute(Sender: TObject); 68 72 begin 73 if not Assigned(FormHelp) then 74 FormHelp := TFormHelp.Create(nil); 69 75 FormHelp.Show; 70 76 end; … … 87 93 Assembler := TAssembler.Create; 88 94 Disassembler := TDisassembler.Create; 95 FormMain := TFormMain.Create(nil); 96 FormMain.Show; 89 97 end; 90 98 91 99 procedure TCore.DataModuleDestroy(Sender: TObject); 92 100 begin 101 if Assigned(FormCpu) then FreeAndNil(FormCpu); 102 if Assigned(FormDevices) then FreeAndNil(FormDevices); 103 if Assigned(FormHelp) then FreeAndNil(FormHelp); 104 if Assigned(FormDisassembler) then FreeAndNil(FormDisassembler); 105 FreeAndNil(FormMain); 93 106 FreeAndNil(Disassembler); 94 107 FreeAndNil(Assembler); … … 101 114 AStop.Execute; 102 115 with Assembler do begin 103 Compile(Form Assembler.SynEdit1.Lines.Text);116 Compile(FormMain.FormAssembler.SynEdit1.Lines.Text); 104 117 //Memory.SaveToFile('compiled.bin'); 105 118 CompiledProgram.Assign(Memory); … … 107 120 Machine.Memory.WriteMemory(CompiledProgram); 108 121 end; 109 if FormMessages.Visible then FormMessages.Reload; 122 if FormMain.FormMessages.Visible then 123 FormMain.FormMessages.Reload; 110 124 end; 111 125 112 126 procedure TCore.ACpuExecute(Sender: TObject); 113 127 begin 128 if not Assigned(FormCpu) then 129 FormCpu := TFormCpu.Create(nil); 114 130 FormCpu.Cpu := Machine.Cpu; 115 131 FormCpu.Show; … … 118 134 procedure TCore.ADevicesExecute(Sender: TObject); 119 135 begin 136 if not Assigned(FormDevices) then 137 FormDevices := TFormDevices.Create(nil); 120 138 FormDevices.Devices := Machine.Devices; 121 139 FormDevices.Show; … … 124 142 procedure TCore.ADisassemblerExecute(Sender: TObject); 125 143 begin 144 if not Assigned(FormDisassembler) then 145 FormDisassembler := TFormDisassembler.Create(nil); 126 146 with Disassembler do begin 127 147 Memory := CompiledProgram;
Note:
See TracChangeset
for help on using the changeset viewer.