Ignore:
Timestamp:
Apr 21, 2026, 6:15:40 PM (5 days ago)
Author:
chronos
Message:
  • Modified: Faster instruction stepping.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormMemory.pas

    r13 r15  
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
    7   StdCtrls, MemoryTypes, Generics.Collections;
     7  StdCtrls, MemoryTypes, Generics.Collections, Math;
    88
    99type
     
    3131    procedure ReloadAreas;
    3232    procedure Reload;
     33    procedure ReloadList;
    3334  end;
    3435
     
    4647procedure TFormMemory.Reload;
    4748begin
    48   ListViewMemory.Items.Count := FSize div ItemsPerLine;
     49  FReloadPending := True;
     50end;
     51
     52procedure TFormMemory.ReloadList;
     53begin
     54  ListViewMemory.Items.Count := Ceil(FSize / ItemsPerLine);
    4955  ListViewMemory.Refresh;
    5056end;
     
    5662  Text: string;
    5763  One: Byte;
     64  Count: Byte;
     65  Address: Word;
    5866begin
    59   if Item.Index < FSize div ItemsPerLine then begin
     67  Address := Item.Index * ItemsPerLine;
     68  if Address < FSize then begin
     69    Count := ItemsPerLine;
     70    if (Address + Count) >= FSize then
     71      Count := FSize - Address;
    6072    Line := '';
    6173    Text := '';
    62     for I := 0 to ItemsPerLine - 1 do begin
    63       One := FMemory.Read(Item.Index * ItemsPerLine + I);
     74    for I := 0 to Count - 1 do begin
     75      One := FMemory.Read(Address + I);
    6476      Line := Line + IntToHex(One, 2) + ' ';
    6577      if One >= 32 then Text := Text + Char(One)
    6678        else Text := Text + ' ';
    6779    end;
    68     Item.Caption := IntToHex(Item.Index * ItemsPerLine, 8);
     80    Item.Caption := IntToHex(Address, 8);
    6981    Item.SubItems.Add(Line);
    7082    Item.SubItems.Add(Text);
     
    7688  ReloadAreas;
    7789  ComboBoxAreaSelect(nil);
    78   FReloadPending := True;
     90  Reload;
    7991end;
    8092
     
    105117  if FReloadPending then begin
    106118    FReloadPending := False;
    107     Reload;
     119    ReloadList;
    108120  end;
    109121end;
Note: See TracChangeset for help on using the changeset viewer.