Ignore:
Timestamp:
Jul 15, 2023, 12:51:15 AM (16 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
  • Fixed: Memory leaks.
Location:
branches/CpuSingleSize/Forms
Files:
20 moved

Legend:

Unmodified
Added
Removed
  • branches/CpuSingleSize/Forms/FormAssembler.lfm

    r237 r238  
    88  ClientWidth = 1106
    99  DesignTimePPI = 144
    10   OnShow = FormShow
    11   LCLVersion = '2.2.2.0'
     10  LCLVersion = '2.2.6.0'
    1211  inline SynEdit1: TSynEdit
    1312    Left = 16
  • branches/CpuSingleSize/Forms/FormAssembler.pas

    r237 r238  
    1 unit UFormAssembler;
     1unit FormAssembler;
    22
    33interface
     
    1414    SynAnySyn1: TSynAnySyn;
    1515    SynEdit1: TSynEdit;
    16     procedure FormShow(Sender: TObject);
    17   private
    18 
    1916  public
     17    procedure Select(Position: TPoint);
    2018  end;
    2119
    22 var
    23   FormAssembler: TFormAssembler;
    2420
    2521implementation
     
    2925{ TFormAssembler }
    3026
    31 procedure TFormAssembler.FormShow(Sender: TObject);
     27procedure TFormAssembler.Select(Position: TPoint);
    3228begin
     29  SynEdit1.CaretXY := Position;
     30  SynEdit1.SetFocus;
     31  Show;
    3332end;
    3433
  • branches/CpuSingleSize/Forms/FormConsole.pas

    r237 r238  
    1 unit UFormConsole;
     1unit FormConsole;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
    7   UMachine, UCpu;
     7  Machine, Cpu;
    88
    99type
     
    2525  end;
    2626
    27 var
    28   FormConsole: TFormConsole;
    2927
    3028implementation
  • branches/CpuSingleSize/Forms/FormCpu.pas

    r237 r238  
    1 unit UFormCpu;
     1unit FormCpu;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
    7   ExtCtrls, UCpu;
     7  ExtCtrls, Cpu;
    88
    99type
     
    2323    procedure ListViewMemoryData(Sender: TObject; Item: TListItem);
    2424    procedure ListViewRegsData(Sender: TObject; Item: TListItem);
    25   private
    26 
    2725  public
    2826    Cpu: TCpu;
    2927  end;
    30 
    31 var
    32   FormCpu: TFormCpu;
    3328
    3429const
  • branches/CpuSingleSize/Forms/FormDevices.lfm

    r237 r238  
    99  DesignTimePPI = 144
    1010  OnShow = FormShow
    11   LCLVersion = '2.2.2.0'
     11  LCLVersion = '2.2.6.0'
    1212  object TreeView1: TTreeView
    1313    Left = 16
  • branches/CpuSingleSize/Forms/FormDevices.pas

    r237 r238  
    1 unit UFormDevices;
     1unit FormDevices;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
    7   UMachine;
     7  Machine;
    88
    99type
     
    2222  end;
    2323
    24 var
    25   FormDevices: TFormDevices;
    2624
    2725implementation
     
    3028
    3129uses
    32   UFormConsole, UFormScreen, UFormStorage;
     30  FormConsole, FormScreen, FormStorage;
    3331
    3432const
  • branches/CpuSingleSize/Forms/FormDisassembler.pas

    r237 r238  
    1 unit UFormDisassembler;
     1unit FormDisassembler;
    22
    33interface
     
    2121  FormDisassembler: TFormDisassembler;
    2222
     23
    2324implementation
    2425
  • branches/CpuSingleSize/Forms/FormHelp.pas

    r237 r238  
    1 unit UFormHelp;
     1unit FormHelp;
    22
    33interface
     
    2020  end;
    2121
    22 var
    23   FormHelp: TFormHelp;
    24 
    2522
    2623implementation
     
    2926
    3027uses
    31   UInstructions;
     28  Instructions;
    3229
    3330{ TFormHelp }
  • branches/CpuSingleSize/Forms/FormMain.lfm

    r237 r238  
    99  DesignTimePPI = 144
    1010  Menu = MainMenu1
     11  OnClose = FormClose
    1112  OnCreate = FormCreate
    1213  OnDestroy = FormDestroy
    1314  OnShow = FormShow
    14   LCLVersion = '2.2.2.0'
     15  LCLVersion = '2.2.6.0'
    1516  object ButtonLoad: TButton
    1617    Left = 24
     
    1920    Width = 113
    2021    Caption = 'Load'
    21     OnClick = ButtonLoadClick
    2222    TabOrder = 0
    2323  end
     
    2828    Width = 113
    2929    Caption = 'Start'
    30     OnClick = ButtonStartClick
    3130    TabOrder = 1
    3231  end
     
    3736    Width = 113
    3837    Caption = 'Stop'
    39     OnClick = ButtonStopClick
    4038    TabOrder = 2
    4139  end
  • branches/CpuSingleSize/Forms/FormMain.pas

    r237 r238  
    1 unit UFormMain;
     1unit FormMain;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
    7   ExtCtrls, Menus, UCpu, UMachine, UAssembler;
     7  ExtCtrls, Menus, Cpu, Machine, Assembler, FormMessages, FormAssembler;
    88
    99type
     
    3636    PanelBottom: TPanel;
    3737    Splitter1: TSplitter;
    38     procedure ButtonConsoleClick(Sender: TObject);
    39     procedure ButtonCpuClick(Sender: TObject);
    40     procedure ButtonLoadClick(Sender: TObject);
    41     procedure ButtonScreenClick(Sender: TObject);
    42     procedure ButtonStartClick(Sender: TObject);
    43     procedure ButtonStopClick(Sender: TObject);
     38    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4439    procedure FormCreate(Sender: TObject);
    4540    procedure FormDestroy(Sender: TObject);
     
    4742  private
    4843  public
     44    FormMessages: TFormMessages;
     45    FormAssembler: TFormAssembler;
    4946    procedure DockForm(Form: TForm; DockSite: TWinControl);
    5047    procedure DockInit;
    5148  end;
    52 
    53 var
    54   FormMain: TFormMain;
    5549
    5650
     
    5953{$R *.lfm}
    6054
    61 uses
    62   UFormScreen, UFormCpu, UFormConsole, UFormAssembler, UFormMessages;
    63 
    6455{ TFormMain }
    6556
    6657procedure TFormMain.FormCreate(Sender: TObject);
    6758begin
     59  FormMessages := TFormMessages.Create(nil);
     60  FormAssembler := TFormAssembler.Create(nil);
     61  FormMessages.OnSelect := FormAssembler.Select;
    6862end;
    6963
    70 procedure TFormMain.ButtonConsoleClick(Sender: TObject);
     64procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    7165begin
    72 end;
    73 
    74 procedure TFormMain.ButtonCpuClick(Sender: TObject);
    75 begin
    76 
    77 end;
    78 
    79 procedure TFormMain.ButtonLoadClick(Sender: TObject);
    80 begin
    81 
    82 end;
    83 
    84 procedure TFormMain.ButtonScreenClick(Sender: TObject);
    85 begin
    86 
    87 end;
    88 
    89 procedure TFormMain.ButtonStartClick(Sender: TObject);
    90 begin
    91 end;
    92 
    93 procedure TFormMain.ButtonStopClick(Sender: TObject);
    94 begin
     66  Application.Terminate;
    9567end;
    9668
    9769procedure TFormMain.FormDestroy(Sender: TObject);
    9870begin
     71  FreeAndNil(FormAssembler);
     72  FreeAndNil(FormMessages);
    9973end;
    10074
  • branches/CpuSingleSize/Forms/FormMessages.lfm

    r237 r238  
    88  ClientWidth = 1113
    99  DesignTimePPI = 144
    10   LCLVersion = '2.2.2.0'
     10  LCLVersion = '2.2.6.0'
    1111  object ListView1: TListView
    1212    Left = 0
  • branches/CpuSingleSize/Forms/FormMessages.pas

    r237 r238  
    1 unit UFormMessages;
     1unit FormMessages;
    22
    33interface
     
    77
    88type
     9  TSelectEvent = procedure (Position: TPoint) of object;
    910
    1011  { TFormMessages }
     
    1516    procedure ListView1DblClick(Sender: TObject);
    1617  private
     18    FOnSelect: TSelectEvent;
    1719  public
    1820    procedure Reload;
     21    property OnSelect: TSelectEvent read FOnSelect write FOnSelect;
    1922  end;
    20 
    21 var
    22   FormMessages: TFormMessages;
    2323
    2424
     
    2828
    2929uses
    30   UCore, UMessages, UFormAssembler;
     30  Core, Message, FormAssembler;
    3131
    3232{ TFormMessages }
     
    3434procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem);
    3535begin
    36   with Core.Assembler do
    37   if (Item.Index >= 0) and (Item.Index < Messages.Count) then
    38   with TMessage(Messages[Item.Index]) do begin
     36  with Core.Core.Assembler do
     37  if (Item.Index >= 0) and (Item.Index < Message.Count) then
     38  with TMessage(Message[Item.Index]) do begin
    3939    Item.Caption := IntToStr(Position.X) + ', ' + IntToStr(Position.Y);
    40     Item.Data := Messages[Item.Index];
     40    Item.Data := Message[Item.Index];
    4141    Item.SubItems.Add(Text);
    4242  end;
     
    4646begin
    4747  if Assigned(ListView1.Selected) then begin
    48     FormAssembler.SynEdit1.CaretXY := TMessage(ListView1.Selected.Data).Position;
    49     FormAssembler.SynEdit1.SetFocus;
    50     FormAssembler.Show;
     48    if Assigned(FOnSelect) then
     49      FOnSelect(TMessage(ListView1.Selected.Data).Position);
    5150  end;
    5251end;
     
    5453procedure TFormMessages.Reload;
    5554begin
    56   ListView1.Items.Count := Core.Assembler.Messages.Count;
     55  ListView1.Items.Count := Core.Core.Assembler.Message.Count;
    5756  ListView1.Refresh;
    5857end;
    5958
    60 
    6159end.
    6260
  • branches/CpuSingleSize/Forms/FormScreen.lfm

    r237 r238  
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
    12   LCLVersion = '2.2.2.0'
     12  LCLVersion = '2.2.6.0'
    1313  object PaintBox1: TPaintBox
    1414    Left = 8
  • branches/CpuSingleSize/Forms/FormScreen.pas

    r237 r238  
    1 unit UFormScreen;
     1unit FormScreen;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, UMachine;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Machine;
    77
    88type
     
    2626  end;
    2727
    28 var
    29   FormScreen: TFormScreen;
    3028
    3129implementation
     
    7977procedure TFormScreen.FormDestroy(Sender: TObject);
    8078begin
    81   TempBitmap.Free;
     79  FreeAndNil(TempBitmap);
    8280end;
    8381
  • branches/CpuSingleSize/Forms/FormStorage.lfm

    r237 r238  
    88  ClientWidth = 1153
    99  DesignTimePPI = 144
    10   LCLVersion = '2.2.2.0'
     10  LCLVersion = '2.2.6.0'
    1111  object ListView1: TListView
    1212    Left = 17
  • branches/CpuSingleSize/Forms/FormStorage.pas

    r237 r238  
    1 unit UFormStorage;
     1unit FormStorage;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, UMachine;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, Machine;
    77
    88type
     
    1919  end;
    2020
    21 var
    22   FormStorage: TFormStorage;
    2321
    2422implementation
Note: See TracChangeset for help on using the changeset viewer.