Ignore:
Timestamp:
Jul 12, 2022, 11:51:47 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Execute instructions as array of instruction handlers.
  • Modified: Optimized some methods call with inline directive.
Location:
branches/UltimatOS/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UltimatOS/Forms/UFormMain.lfm

    r32 r34  
    11object FormMain: TFormMain
    22  Left = 227
    3   Height = 707
     3  Height = 814
    44  Top = 205
    5   Width = 998
     5  Width = 1150
    66  Caption = 'UltimatOS'
    7   ClientHeight = 707
    8   ClientWidth = 998
    9   DesignTimePPI = 125
     7  ClientHeight = 814
     8  ClientWidth = 1150
     9  DesignTimePPI = 144
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
    1212  OnKeyUp = FormKeyUp
    1313  OnShow = FormShow
    14   LCLVersion = '2.2.0.4'
     14  LCLVersion = '2.2.2.0'
    1515  object PaintBox1: TPaintBox
    16     Left = 8
    17     Height = 480
    18     Top = 8
    19     Width = 640
     16    Left = 9
     17    Height = 553
     18    Top = 9
     19    Width = 737
    2020    OnMouseMove = PaintBox1MouseMove
    2121    OnPaint = PaintBox1Paint
    2222  end
    2323  object ButtonStart: TButton
    24     Left = 8
    25     Height = 33
    26     Top = 496
    27     Width = 98
     24    Left = 9
     25    Height = 38
     26    Top = 571
     27    Width = 113
    2828    Caption = 'Start'
    2929    OnClick = ButtonStartClick
     
    3131  end
    3232  object MemoCode: TMemo
    33     Left = 656
    34     Height = 477
    35     Top = 9
    36     Width = 328
     33    Left = 756
     34    Height = 550
     35    Top = 10
     36    Width = 378
    3737    ScrollBars = ssAutoBoth
    3838    TabOrder = 1
    3939  end
    4040  object Label1: TLabel
    41     Left = 662
    42     Height = 22
    43     Top = 500
    44     Width = 68
     41    Left = 763
     42    Height = 26
     43    Top = 576
     44    Width = 79
    4545    Caption = 'Instrukcí:'
     46    ParentColor = False
    4647  end
    4748  object ButtonMemory: TButton
    48     Left = 550
    49     Height = 33
    50     Top = 496
    51     Width = 98
     49    Left = 634
     50    Height = 38
     51    Top = 571
     52    Width = 113
    5253    Caption = 'Memory'
    5354    OnClick = ButtonMemoryClick
     
    5556  end
    5657  object ButtonStop: TButton
    57     Left = 112
    58     Height = 33
    59     Top = 496
    60     Width = 98
     58    Left = 129
     59    Height = 38
     60    Top = 571
     61    Width = 113
    6162    Caption = 'Stop'
    6263    OnClick = ButtonStopClick
     
    6465  end
    6566  object ButtonRestart: TButton
    66     Left = 216
    67     Height = 33
    68     Top = 496
    69     Width = 98
     67    Left = 249
     68    Height = 38
     69    Top = 571
     70    Width = 113
    7071    Caption = 'Restart'
    7172    OnClick = ButtonRestartClick
     
    7374  end
    7475  object ButtonCompile: TButton
    75     Left = 8
    76     Height = 33
    77     Top = 536
    78     Width = 98
     76    Left = 9
     77    Height = 38
     78    Top = 617
     79    Width = 113
    7980    Caption = 'Compile'
    8081    OnClick = ButtonCompileClick
    8182    TabOrder = 5
    8283  end
     84  object Label2: TLabel
     85    Left = 763
     86    Height = 26
     87    Top = 632
     88    Width = 55
     89    Caption = 'Label2'
     90    ParentColor = False
     91  end
    8392  object Timer1: TTimer
    8493    Interval = 20
    8594    OnTimer = Timer1Timer
    86     Left = 190
    87     Top = 542
     95    Left = 219
     96    Top = 624
     97  end
     98  object Timer2: TTimer
     99    OnTimer = Timer2Timer
     100    Left = 768
     101    Top = 664
    88102  end
    89103end
  • branches/UltimatOS/Forms/UFormMain.pas

    r32 r34  
    1818    ButtonRestart: TButton;
    1919    Label1: TLabel;
     20    Label2: TLabel;
    2021    MemoCode: TMemo;
    2122    PaintBox1: TPaintBox;
    2223    Timer1: TTimer;
     24    Timer2: TTimer;
    2325    procedure ButtonCompileClick(Sender: TObject);
    2426    procedure ButtonMemoryClick(Sender: TObject);
     
    3436    procedure PaintBox1Paint(Sender: TObject);
    3537    procedure Timer1Timer(Sender: TObject);
     38    procedure Timer2Timer(Sender: TObject);
    3639  private
     40    LastTicks: Integer;
    3741    procedure InitProgram;
    3842    procedure UpdateInterface;
     
    143147end;
    144148
     149procedure TFormMain.Timer2Timer(Sender: TObject);
     150begin
     151  Label2.Caption := 'Ticks/s: ' + IntToStr(Machine.Cpu.ExecutedCount - LastTicks);
     152  LastTicks := Machine.Cpu.ExecutedCount;
     153end;
     154
    145155procedure TFormMain.InitProgram;
    146156begin
Note: See TracChangeset for help on using the changeset viewer.